pdf.worker.mjs 2.1 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987549885498954990549915499254993549945499554996549975499854999550005500155002550035500455005550065500755008550095501055011550125501355014550155501655017550185501955020550215502255023550245502555026550275502855029550305503155032550335503455035550365503755038550395504055041550425504355044550455504655047550485504955050550515505255053550545505555056550575505855059550605506155062550635506455065550665506755068550695507055071550725507355074550755507655077550785507955080550815508255083550845508555086550875508855089550905509155092550935509455095550965509755098550995510055101551025510355104551055510655107551085510955110551115511255113551145511555116551175511855119551205512155122551235512455125551265512755128551295513055131551325513355134551355513655137551385513955140551415514255143551445514555146551475514855149551505515155152551535515455155551565515755158551595516055161551625516355164551655516655167551685516955170551715517255173551745517555176551775517855179551805518155182551835518455185551865518755188551895519055191551925519355194551955519655197551985519955200552015520255203552045520555206552075520855209552105521155212552135521455215552165521755218552195522055221552225522355224552255522655227552285522955230552315523255233552345523555236552375523855239552405524155242552435524455245552465524755248552495525055251552525525355254552555525655257552585525955260552615526255263552645526555266552675526855269552705527155272552735527455275552765527755278552795528055281552825528355284552855528655287552885528955290552915529255293552945529555296552975529855299553005530155302553035530455305553065530755308553095531055311553125531355314553155531655317553185531955320553215532255323553245532555326553275532855329553305533155332553335533455335553365533755338553395534055341553425534355344553455534655347553485534955350553515535255353553545535555356553575535855359553605536155362553635536455365553665536755368553695537055371553725537355374553755537655377553785537955380553815538255383553845538555386553875538855389553905539155392553935539455395553965539755398553995540055401554025540355404554055540655407554085540955410554115541255413554145541555416554175541855419554205542155422554235542455425554265542755428554295543055431554325543355434554355543655437554385543955440554415544255443554445544555446554475544855449554505545155452554535545455455554565545755458554595546055461554625546355464554655546655467554685546955470554715547255473554745547555476554775547855479554805548155482554835548455485554865548755488554895549055491554925549355494554955549655497554985549955500555015550255503555045550555506555075550855509555105551155512555135551455515555165551755518555195552055521555225552355524555255552655527555285552955530555315553255533555345553555536555375553855539555405554155542555435554455545555465554755548555495555055551555525555355554555555555655557555585555955560555615556255563555645556555566555675556855569555705557155572555735557455575555765557755578555795558055581555825558355584555855558655587555885558955590555915559255593555945559555596555975559855599556005560155602556035560455605556065560755608556095561055611556125561355614556155561655617556185561955620556215562255623556245562555626556275562855629556305563155632556335563455635556365563755638556395564055641556425564355644556455564655647556485564955650556515565255653556545565555656556575565855659556605566155662556635566455665556665566755668556695567055671556725567355674556755567655677556785567955680556815568255683556845568555686556875568855689556905569155692556935569455695556965569755698556995570055701557025570355704557055570655707557085570955710557115571255713557145571555716557175571855719557205572155722557235572455725557265572755728557295573055731557325573355734557355573655737557385573955740557415574255743557445574555746557475574855749557505575155752557535575455755557565575755758557595576055761557625576355764557655576655767557685576955770557715577255773557745577555776557775577855779557805578155782557835578455785557865578755788557895579055791557925579355794557955579655797557985579955800558015580255803558045580555806558075580855809558105581155812558135581455815558165581755818558195582055821558225582355824558255582655827558285582955830558315583255833558345583555836558375583855839558405584155842558435584455845558465584755848558495585055851558525585355854558555585655857558585585955860558615586255863558645586555866558675586855869558705587155872558735587455875558765587755878558795588055881558825588355884558855588655887558885588955890558915589255893558945589555896558975589855899559005590155902559035590455905559065590755908559095591055911559125591355914559155591655917559185591955920559215592255923559245592555926559275592855929559305593155932559335593455935559365593755938559395594055941559425594355944559455594655947559485594955950559515595255953559545595555956559575595855959559605596155962559635596455965559665596755968559695597055971559725597355974559755597655977559785597955980559815598255983559845598555986559875598855989559905599155992559935599455995559965599755998559995600056001560025600356004560055600656007560085600956010560115601256013560145601556016560175601856019560205602156022560235602456025560265602756028560295603056031560325603356034560355603656037560385603956040560415604256043560445604556046560475604856049560505605156052560535605456055560565605756058560595606056061560625606356064560655606656067560685606956070560715607256073560745607556076560775607856079560805608156082560835608456085560865608756088560895609056091560925609356094560955609656097560985609956100561015610256103561045610556106561075610856109561105611156112561135611456115561165611756118561195612056121561225612356124561255612656127561285612956130561315613256133561345613556136561375613856139561405614156142561435614456145561465614756148561495615056151561525615356154561555615656157561585615956160561615616256163561645616556166561675616856169561705617156172561735617456175561765617756178561795618056181561825618356184561855618656187561885618956190561915619256193561945619556196561975619856199562005620156202562035620456205562065620756208562095621056211562125621356214562155621656217562185621956220562215622256223562245622556226562275622856229562305623156232562335623456235562365623756238562395624056241562425624356244562455624656247562485624956250562515625256253562545625556256562575625856259562605626156262562635626456265562665626756268562695627056271562725627356274562755627656277562785627956280562815628256283562845628556286562875628856289562905629156292562935629456295562965629756298562995630056301563025630356304563055630656307563085630956310563115631256313563145631556316563175631856319563205632156322563235632456325563265632756328563295633056331563325633356334563355633656337563385633956340563415634256343563445634556346563475634856349563505635156352563535635456355563565635756358563595636056361563625636356364563655636656367563685636956370563715637256373563745637556376563775637856379563805638156382563835638456385563865638756388563895639056391563925639356394563955639656397563985639956400564015640256403564045640556406564075640856409564105641156412564135641456415564165641756418564195642056421564225642356424
  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. /******/ // The require scope
  23. /******/ var __webpack_require__ = {};
  24. /******/
  25. /************************************************************************/
  26. /******/ /* webpack/runtime/define property getters */
  27. /******/ (() => {
  28. /******/ // define getter functions for harmony exports
  29. /******/ __webpack_require__.d = (exports, definition) => {
  30. /******/ for(var key in definition) {
  31. /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  32. /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
  33. /******/ }
  34. /******/ }
  35. /******/ };
  36. /******/ })();
  37. /******/
  38. /******/ /* webpack/runtime/hasOwnProperty shorthand */
  39. /******/ (() => {
  40. /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
  41. /******/ })();
  42. /******/
  43. /************************************************************************/
  44. var __webpack_exports__ = globalThis.pdfjsWorker = {};
  45. // EXPORTS
  46. __webpack_require__.d(__webpack_exports__, {
  47. WorkerMessageHandler: () => (/* reexport */ WorkerMessageHandler)
  48. });
  49. ;// CONCATENATED MODULE: ./src/shared/util.js
  50. const isNodeJS = typeof process === "object" && process + "" === "[object process]" && !process.versions.nw && !(process.versions.electron && process.type && process.type !== "browser");
  51. const IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0];
  52. const FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0];
  53. const MAX_IMAGE_SIZE_TO_CACHE = 10e6;
  54. const LINE_FACTOR = 1.35;
  55. const LINE_DESCENT_FACTOR = 0.35;
  56. const BASELINE_FACTOR = LINE_DESCENT_FACTOR / LINE_FACTOR;
  57. const RenderingIntentFlag = {
  58. ANY: 0x01,
  59. DISPLAY: 0x02,
  60. PRINT: 0x04,
  61. SAVE: 0x08,
  62. ANNOTATIONS_FORMS: 0x10,
  63. ANNOTATIONS_STORAGE: 0x20,
  64. ANNOTATIONS_DISABLE: 0x40,
  65. IS_EDITING: 0x80,
  66. OPLIST: 0x100
  67. };
  68. const AnnotationMode = {
  69. DISABLE: 0,
  70. ENABLE: 1,
  71. ENABLE_FORMS: 2,
  72. ENABLE_STORAGE: 3
  73. };
  74. const AnnotationEditorPrefix = "pdfjs_internal_editor_";
  75. const AnnotationEditorType = {
  76. DISABLE: -1,
  77. NONE: 0,
  78. FREETEXT: 3,
  79. HIGHLIGHT: 9,
  80. STAMP: 13,
  81. INK: 15
  82. };
  83. const AnnotationEditorParamsType = {
  84. RESIZE: 1,
  85. CREATE: 2,
  86. FREETEXT_SIZE: 11,
  87. FREETEXT_COLOR: 12,
  88. FREETEXT_OPACITY: 13,
  89. INK_COLOR: 21,
  90. INK_THICKNESS: 22,
  91. INK_OPACITY: 23,
  92. HIGHLIGHT_COLOR: 31,
  93. HIGHLIGHT_DEFAULT_COLOR: 32,
  94. HIGHLIGHT_THICKNESS: 33,
  95. HIGHLIGHT_FREE: 34,
  96. HIGHLIGHT_SHOW_ALL: 35
  97. };
  98. const PermissionFlag = {
  99. PRINT: 0x04,
  100. MODIFY_CONTENTS: 0x08,
  101. COPY: 0x10,
  102. MODIFY_ANNOTATIONS: 0x20,
  103. FILL_INTERACTIVE_FORMS: 0x100,
  104. COPY_FOR_ACCESSIBILITY: 0x200,
  105. ASSEMBLE: 0x400,
  106. PRINT_HIGH_QUALITY: 0x800
  107. };
  108. const TextRenderingMode = {
  109. FILL: 0,
  110. STROKE: 1,
  111. FILL_STROKE: 2,
  112. INVISIBLE: 3,
  113. FILL_ADD_TO_PATH: 4,
  114. STROKE_ADD_TO_PATH: 5,
  115. FILL_STROKE_ADD_TO_PATH: 6,
  116. ADD_TO_PATH: 7,
  117. FILL_STROKE_MASK: 3,
  118. ADD_TO_PATH_FLAG: 4
  119. };
  120. const ImageKind = {
  121. GRAYSCALE_1BPP: 1,
  122. RGB_24BPP: 2,
  123. RGBA_32BPP: 3
  124. };
  125. const AnnotationType = {
  126. TEXT: 1,
  127. LINK: 2,
  128. FREETEXT: 3,
  129. LINE: 4,
  130. SQUARE: 5,
  131. CIRCLE: 6,
  132. POLYGON: 7,
  133. POLYLINE: 8,
  134. HIGHLIGHT: 9,
  135. UNDERLINE: 10,
  136. SQUIGGLY: 11,
  137. STRIKEOUT: 12,
  138. STAMP: 13,
  139. CARET: 14,
  140. INK: 15,
  141. POPUP: 16,
  142. FILEATTACHMENT: 17,
  143. SOUND: 18,
  144. MOVIE: 19,
  145. WIDGET: 20,
  146. SCREEN: 21,
  147. PRINTERMARK: 22,
  148. TRAPNET: 23,
  149. WATERMARK: 24,
  150. THREED: 25,
  151. REDACT: 26
  152. };
  153. const AnnotationReplyType = {
  154. GROUP: "Group",
  155. REPLY: "R"
  156. };
  157. const AnnotationFlag = {
  158. INVISIBLE: 0x01,
  159. HIDDEN: 0x02,
  160. PRINT: 0x04,
  161. NOZOOM: 0x08,
  162. NOROTATE: 0x10,
  163. NOVIEW: 0x20,
  164. READONLY: 0x40,
  165. LOCKED: 0x80,
  166. TOGGLENOVIEW: 0x100,
  167. LOCKEDCONTENTS: 0x200
  168. };
  169. const AnnotationFieldFlag = {
  170. READONLY: 0x0000001,
  171. REQUIRED: 0x0000002,
  172. NOEXPORT: 0x0000004,
  173. MULTILINE: 0x0001000,
  174. PASSWORD: 0x0002000,
  175. NOTOGGLETOOFF: 0x0004000,
  176. RADIO: 0x0008000,
  177. PUSHBUTTON: 0x0010000,
  178. COMBO: 0x0020000,
  179. EDIT: 0x0040000,
  180. SORT: 0x0080000,
  181. FILESELECT: 0x0100000,
  182. MULTISELECT: 0x0200000,
  183. DONOTSPELLCHECK: 0x0400000,
  184. DONOTSCROLL: 0x0800000,
  185. COMB: 0x1000000,
  186. RICHTEXT: 0x2000000,
  187. RADIOSINUNISON: 0x2000000,
  188. COMMITONSELCHANGE: 0x4000000
  189. };
  190. const AnnotationBorderStyleType = {
  191. SOLID: 1,
  192. DASHED: 2,
  193. BEVELED: 3,
  194. INSET: 4,
  195. UNDERLINE: 5
  196. };
  197. const AnnotationActionEventType = {
  198. E: "Mouse Enter",
  199. X: "Mouse Exit",
  200. D: "Mouse Down",
  201. U: "Mouse Up",
  202. Fo: "Focus",
  203. Bl: "Blur",
  204. PO: "PageOpen",
  205. PC: "PageClose",
  206. PV: "PageVisible",
  207. PI: "PageInvisible",
  208. K: "Keystroke",
  209. F: "Format",
  210. V: "Validate",
  211. C: "Calculate"
  212. };
  213. const DocumentActionEventType = {
  214. WC: "WillClose",
  215. WS: "WillSave",
  216. DS: "DidSave",
  217. WP: "WillPrint",
  218. DP: "DidPrint"
  219. };
  220. const PageActionEventType = {
  221. O: "PageOpen",
  222. C: "PageClose"
  223. };
  224. const VerbosityLevel = {
  225. ERRORS: 0,
  226. WARNINGS: 1,
  227. INFOS: 5
  228. };
  229. const CMapCompressionType = {
  230. NONE: 0,
  231. BINARY: 1
  232. };
  233. const OPS = {
  234. dependency: 1,
  235. setLineWidth: 2,
  236. setLineCap: 3,
  237. setLineJoin: 4,
  238. setMiterLimit: 5,
  239. setDash: 6,
  240. setRenderingIntent: 7,
  241. setFlatness: 8,
  242. setGState: 9,
  243. save: 10,
  244. restore: 11,
  245. transform: 12,
  246. moveTo: 13,
  247. lineTo: 14,
  248. curveTo: 15,
  249. curveTo2: 16,
  250. curveTo3: 17,
  251. closePath: 18,
  252. rectangle: 19,
  253. stroke: 20,
  254. closeStroke: 21,
  255. fill: 22,
  256. eoFill: 23,
  257. fillStroke: 24,
  258. eoFillStroke: 25,
  259. closeFillStroke: 26,
  260. closeEOFillStroke: 27,
  261. endPath: 28,
  262. clip: 29,
  263. eoClip: 30,
  264. beginText: 31,
  265. endText: 32,
  266. setCharSpacing: 33,
  267. setWordSpacing: 34,
  268. setHScale: 35,
  269. setLeading: 36,
  270. setFont: 37,
  271. setTextRenderingMode: 38,
  272. setTextRise: 39,
  273. moveText: 40,
  274. setLeadingMoveText: 41,
  275. setTextMatrix: 42,
  276. nextLine: 43,
  277. showText: 44,
  278. showSpacedText: 45,
  279. nextLineShowText: 46,
  280. nextLineSetSpacingShowText: 47,
  281. setCharWidth: 48,
  282. setCharWidthAndBounds: 49,
  283. setStrokeColorSpace: 50,
  284. setFillColorSpace: 51,
  285. setStrokeColor: 52,
  286. setStrokeColorN: 53,
  287. setFillColor: 54,
  288. setFillColorN: 55,
  289. setStrokeGray: 56,
  290. setFillGray: 57,
  291. setStrokeRGBColor: 58,
  292. setFillRGBColor: 59,
  293. setStrokeCMYKColor: 60,
  294. setFillCMYKColor: 61,
  295. shadingFill: 62,
  296. beginInlineImage: 63,
  297. beginImageData: 64,
  298. endInlineImage: 65,
  299. paintXObject: 66,
  300. markPoint: 67,
  301. markPointProps: 68,
  302. beginMarkedContent: 69,
  303. beginMarkedContentProps: 70,
  304. endMarkedContent: 71,
  305. beginCompat: 72,
  306. endCompat: 73,
  307. paintFormXObjectBegin: 74,
  308. paintFormXObjectEnd: 75,
  309. beginGroup: 76,
  310. endGroup: 77,
  311. beginAnnotation: 80,
  312. endAnnotation: 81,
  313. paintImageMaskXObject: 83,
  314. paintImageMaskXObjectGroup: 84,
  315. paintImageXObject: 85,
  316. paintInlineImageXObject: 86,
  317. paintInlineImageXObjectGroup: 87,
  318. paintImageXObjectRepeat: 88,
  319. paintImageMaskXObjectRepeat: 89,
  320. paintSolidColorImageMask: 90,
  321. constructPath: 91,
  322. setStrokeTransparent: 92,
  323. setFillTransparent: 93
  324. };
  325. const PasswordResponses = {
  326. NEED_PASSWORD: 1,
  327. INCORRECT_PASSWORD: 2
  328. };
  329. let verbosity = VerbosityLevel.WARNINGS;
  330. function setVerbosityLevel(level) {
  331. if (Number.isInteger(level)) {
  332. verbosity = level;
  333. }
  334. }
  335. function getVerbosityLevel() {
  336. return verbosity;
  337. }
  338. function info(msg) {
  339. if (verbosity >= VerbosityLevel.INFOS) {
  340. console.log(`Info: ${msg}`);
  341. }
  342. }
  343. function warn(msg) {
  344. if (verbosity >= VerbosityLevel.WARNINGS) {
  345. console.log(`Warning: ${msg}`);
  346. }
  347. }
  348. function unreachable(msg) {
  349. throw new Error(msg);
  350. }
  351. function assert(cond, msg) {
  352. if (!cond) {
  353. unreachable(msg);
  354. }
  355. }
  356. function _isValidProtocol(url) {
  357. switch (url?.protocol) {
  358. case "http:":
  359. case "https:":
  360. case "ftp:":
  361. case "mailto:":
  362. case "tel:":
  363. return true;
  364. default:
  365. return false;
  366. }
  367. }
  368. function createValidAbsoluteUrl(url, baseUrl = null, options = null) {
  369. if (!url) {
  370. return null;
  371. }
  372. try {
  373. if (options && typeof url === "string") {
  374. if (options.addDefaultProtocol && url.startsWith("www.")) {
  375. const dots = url.match(/\./g);
  376. if (dots?.length >= 2) {
  377. url = `http://${url}`;
  378. }
  379. }
  380. if (options.tryConvertEncoding) {
  381. try {
  382. url = stringToUTF8String(url);
  383. } catch {}
  384. }
  385. }
  386. const absoluteUrl = baseUrl ? new URL(url, baseUrl) : new URL(url);
  387. if (_isValidProtocol(absoluteUrl)) {
  388. return absoluteUrl;
  389. }
  390. } catch {}
  391. return null;
  392. }
  393. function shadow(obj, prop, value, nonSerializable = false) {
  394. Object.defineProperty(obj, prop, {
  395. value,
  396. enumerable: !nonSerializable,
  397. configurable: true,
  398. writable: false
  399. });
  400. return value;
  401. }
  402. const BaseException = function BaseExceptionClosure() {
  403. function BaseException(message, name) {
  404. if (this.constructor === BaseException) {
  405. unreachable("Cannot initialize BaseException.");
  406. }
  407. this.message = message;
  408. this.name = name;
  409. }
  410. BaseException.prototype = new Error();
  411. BaseException.constructor = BaseException;
  412. return BaseException;
  413. }();
  414. class PasswordException extends BaseException {
  415. constructor(msg, code) {
  416. super(msg, "PasswordException");
  417. this.code = code;
  418. }
  419. }
  420. class UnknownErrorException extends BaseException {
  421. constructor(msg, details) {
  422. super(msg, "UnknownErrorException");
  423. this.details = details;
  424. }
  425. }
  426. class InvalidPDFException extends BaseException {
  427. constructor(msg) {
  428. super(msg, "InvalidPDFException");
  429. }
  430. }
  431. class MissingPDFException extends BaseException {
  432. constructor(msg) {
  433. super(msg, "MissingPDFException");
  434. }
  435. }
  436. class UnexpectedResponseException extends BaseException {
  437. constructor(msg, status) {
  438. super(msg, "UnexpectedResponseException");
  439. this.status = status;
  440. }
  441. }
  442. class FormatError extends BaseException {
  443. constructor(msg) {
  444. super(msg, "FormatError");
  445. }
  446. }
  447. class AbortException extends BaseException {
  448. constructor(msg) {
  449. super(msg, "AbortException");
  450. }
  451. }
  452. function bytesToString(bytes) {
  453. if (typeof bytes !== "object" || bytes?.length === undefined) {
  454. unreachable("Invalid argument for bytesToString");
  455. }
  456. const length = bytes.length;
  457. const MAX_ARGUMENT_COUNT = 8192;
  458. if (length < MAX_ARGUMENT_COUNT) {
  459. return String.fromCharCode.apply(null, bytes);
  460. }
  461. const strBuf = [];
  462. for (let i = 0; i < length; i += MAX_ARGUMENT_COUNT) {
  463. const chunkEnd = Math.min(i + MAX_ARGUMENT_COUNT, length);
  464. const chunk = bytes.subarray(i, chunkEnd);
  465. strBuf.push(String.fromCharCode.apply(null, chunk));
  466. }
  467. return strBuf.join("");
  468. }
  469. function stringToBytes(str) {
  470. if (typeof str !== "string") {
  471. unreachable("Invalid argument for stringToBytes");
  472. }
  473. const length = str.length;
  474. const bytes = new Uint8Array(length);
  475. for (let i = 0; i < length; ++i) {
  476. bytes[i] = str.charCodeAt(i) & 0xff;
  477. }
  478. return bytes;
  479. }
  480. function string32(value) {
  481. return String.fromCharCode(value >> 24 & 0xff, value >> 16 & 0xff, value >> 8 & 0xff, value & 0xff);
  482. }
  483. function objectSize(obj) {
  484. return Object.keys(obj).length;
  485. }
  486. function objectFromMap(map) {
  487. const obj = Object.create(null);
  488. for (const [key, value] of map) {
  489. obj[key] = value;
  490. }
  491. return obj;
  492. }
  493. function isLittleEndian() {
  494. const buffer8 = new Uint8Array(4);
  495. buffer8[0] = 1;
  496. const view32 = new Uint32Array(buffer8.buffer, 0, 1);
  497. return view32[0] === 1;
  498. }
  499. function isEvalSupported() {
  500. try {
  501. new Function("");
  502. return true;
  503. } catch {
  504. return false;
  505. }
  506. }
  507. class FeatureTest {
  508. static get isLittleEndian() {
  509. return shadow(this, "isLittleEndian", isLittleEndian());
  510. }
  511. static get isEvalSupported() {
  512. return shadow(this, "isEvalSupported", isEvalSupported());
  513. }
  514. static get isOffscreenCanvasSupported() {
  515. return shadow(this, "isOffscreenCanvasSupported", typeof OffscreenCanvas !== "undefined");
  516. }
  517. static get platform() {
  518. if (typeof navigator !== "undefined" && typeof navigator?.platform === "string") {
  519. return shadow(this, "platform", {
  520. isMac: navigator.platform.includes("Mac")
  521. });
  522. }
  523. return shadow(this, "platform", {
  524. isMac: false
  525. });
  526. }
  527. static get isCSSRoundSupported() {
  528. return shadow(this, "isCSSRoundSupported", globalThis.CSS?.supports?.("width: round(1.5px, 1px)"));
  529. }
  530. }
  531. const hexNumbers = Array.from(Array(256).keys(), n => n.toString(16).padStart(2, "0"));
  532. class Util {
  533. static makeHexColor(r, g, b) {
  534. return `#${hexNumbers[r]}${hexNumbers[g]}${hexNumbers[b]}`;
  535. }
  536. static scaleMinMax(transform, minMax) {
  537. let temp;
  538. if (transform[0]) {
  539. if (transform[0] < 0) {
  540. temp = minMax[0];
  541. minMax[0] = minMax[2];
  542. minMax[2] = temp;
  543. }
  544. minMax[0] *= transform[0];
  545. minMax[2] *= transform[0];
  546. if (transform[3] < 0) {
  547. temp = minMax[1];
  548. minMax[1] = minMax[3];
  549. minMax[3] = temp;
  550. }
  551. minMax[1] *= transform[3];
  552. minMax[3] *= transform[3];
  553. } else {
  554. temp = minMax[0];
  555. minMax[0] = minMax[1];
  556. minMax[1] = temp;
  557. temp = minMax[2];
  558. minMax[2] = minMax[3];
  559. minMax[3] = temp;
  560. if (transform[1] < 0) {
  561. temp = minMax[1];
  562. minMax[1] = minMax[3];
  563. minMax[3] = temp;
  564. }
  565. minMax[1] *= transform[1];
  566. minMax[3] *= transform[1];
  567. if (transform[2] < 0) {
  568. temp = minMax[0];
  569. minMax[0] = minMax[2];
  570. minMax[2] = temp;
  571. }
  572. minMax[0] *= transform[2];
  573. minMax[2] *= transform[2];
  574. }
  575. minMax[0] += transform[4];
  576. minMax[1] += transform[5];
  577. minMax[2] += transform[4];
  578. minMax[3] += transform[5];
  579. }
  580. static transform(m1, m2) {
  581. 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]];
  582. }
  583. static applyTransform(p, m) {
  584. const xt = p[0] * m[0] + p[1] * m[2] + m[4];
  585. const yt = p[0] * m[1] + p[1] * m[3] + m[5];
  586. return [xt, yt];
  587. }
  588. static applyInverseTransform(p, m) {
  589. const d = m[0] * m[3] - m[1] * m[2];
  590. const xt = (p[0] * m[3] - p[1] * m[2] + m[2] * m[5] - m[4] * m[3]) / d;
  591. const yt = (-p[0] * m[1] + p[1] * m[0] + m[4] * m[1] - m[5] * m[0]) / d;
  592. return [xt, yt];
  593. }
  594. static getAxialAlignedBoundingBox(r, m) {
  595. const p1 = this.applyTransform(r, m);
  596. const p2 = this.applyTransform(r.slice(2, 4), m);
  597. const p3 = this.applyTransform([r[0], r[3]], m);
  598. const p4 = this.applyTransform([r[2], r[1]], m);
  599. 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])];
  600. }
  601. static inverseTransform(m) {
  602. const d = m[0] * m[3] - m[1] * m[2];
  603. 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];
  604. }
  605. static singularValueDecompose2dScale(m) {
  606. const transpose = [m[0], m[2], m[1], m[3]];
  607. const a = m[0] * transpose[0] + m[1] * transpose[2];
  608. const b = m[0] * transpose[1] + m[1] * transpose[3];
  609. const c = m[2] * transpose[0] + m[3] * transpose[2];
  610. const d = m[2] * transpose[1] + m[3] * transpose[3];
  611. const first = (a + d) / 2;
  612. const second = Math.sqrt((a + d) ** 2 - 4 * (a * d - c * b)) / 2;
  613. const sx = first + second || 1;
  614. const sy = first - second || 1;
  615. return [Math.sqrt(sx), Math.sqrt(sy)];
  616. }
  617. static normalizeRect(rect) {
  618. const r = rect.slice(0);
  619. if (rect[0] > rect[2]) {
  620. r[0] = rect[2];
  621. r[2] = rect[0];
  622. }
  623. if (rect[1] > rect[3]) {
  624. r[1] = rect[3];
  625. r[3] = rect[1];
  626. }
  627. return r;
  628. }
  629. static intersect(rect1, rect2) {
  630. const xLow = Math.max(Math.min(rect1[0], rect1[2]), Math.min(rect2[0], rect2[2]));
  631. const xHigh = Math.min(Math.max(rect1[0], rect1[2]), Math.max(rect2[0], rect2[2]));
  632. if (xLow > xHigh) {
  633. return null;
  634. }
  635. const yLow = Math.max(Math.min(rect1[1], rect1[3]), Math.min(rect2[1], rect2[3]));
  636. const yHigh = Math.min(Math.max(rect1[1], rect1[3]), Math.max(rect2[1], rect2[3]));
  637. if (yLow > yHigh) {
  638. return null;
  639. }
  640. return [xLow, yLow, xHigh, yHigh];
  641. }
  642. static #getExtremumOnCurve(x0, x1, x2, x3, y0, y1, y2, y3, t, minMax) {
  643. if (t <= 0 || t >= 1) {
  644. return;
  645. }
  646. const mt = 1 - t;
  647. const tt = t * t;
  648. const ttt = tt * t;
  649. const x = mt * (mt * (mt * x0 + 3 * t * x1) + 3 * tt * x2) + ttt * x3;
  650. const y = mt * (mt * (mt * y0 + 3 * t * y1) + 3 * tt * y2) + ttt * y3;
  651. minMax[0] = Math.min(minMax[0], x);
  652. minMax[1] = Math.min(minMax[1], y);
  653. minMax[2] = Math.max(minMax[2], x);
  654. minMax[3] = Math.max(minMax[3], y);
  655. }
  656. static #getExtremum(x0, x1, x2, x3, y0, y1, y2, y3, a, b, c, minMax) {
  657. if (Math.abs(a) < 1e-12) {
  658. if (Math.abs(b) >= 1e-12) {
  659. this.#getExtremumOnCurve(x0, x1, x2, x3, y0, y1, y2, y3, -c / b, minMax);
  660. }
  661. return;
  662. }
  663. const delta = b ** 2 - 4 * c * a;
  664. if (delta < 0) {
  665. return;
  666. }
  667. const sqrtDelta = Math.sqrt(delta);
  668. const a2 = 2 * a;
  669. this.#getExtremumOnCurve(x0, x1, x2, x3, y0, y1, y2, y3, (-b + sqrtDelta) / a2, minMax);
  670. this.#getExtremumOnCurve(x0, x1, x2, x3, y0, y1, y2, y3, (-b - sqrtDelta) / a2, minMax);
  671. }
  672. static bezierBoundingBox(x0, y0, x1, y1, x2, y2, x3, y3, minMax) {
  673. if (minMax) {
  674. minMax[0] = Math.min(minMax[0], x0, x3);
  675. minMax[1] = Math.min(minMax[1], y0, y3);
  676. minMax[2] = Math.max(minMax[2], x0, x3);
  677. minMax[3] = Math.max(minMax[3], y0, y3);
  678. } else {
  679. minMax = [Math.min(x0, x3), Math.min(y0, y3), Math.max(x0, x3), Math.max(y0, y3)];
  680. }
  681. 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);
  682. 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);
  683. return minMax;
  684. }
  685. }
  686. 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];
  687. function stringToPDFString(str) {
  688. if (str[0] >= "\xEF") {
  689. let encoding;
  690. if (str[0] === "\xFE" && str[1] === "\xFF") {
  691. encoding = "utf-16be";
  692. if (str.length % 2 === 1) {
  693. str = str.slice(0, -1);
  694. }
  695. } else if (str[0] === "\xFF" && str[1] === "\xFE") {
  696. encoding = "utf-16le";
  697. if (str.length % 2 === 1) {
  698. str = str.slice(0, -1);
  699. }
  700. } else if (str[0] === "\xEF" && str[1] === "\xBB" && str[2] === "\xBF") {
  701. encoding = "utf-8";
  702. }
  703. if (encoding) {
  704. try {
  705. const decoder = new TextDecoder(encoding, {
  706. fatal: true
  707. });
  708. const buffer = stringToBytes(str);
  709. const decoded = decoder.decode(buffer);
  710. if (!decoded.includes("\x1b")) {
  711. return decoded;
  712. }
  713. return decoded.replaceAll(/\x1b[^\x1b]*(?:\x1b|$)/g, "");
  714. } catch (ex) {
  715. warn(`stringToPDFString: "${ex}".`);
  716. }
  717. }
  718. }
  719. const strBuf = [];
  720. for (let i = 0, ii = str.length; i < ii; i++) {
  721. const charCode = str.charCodeAt(i);
  722. if (charCode === 0x1b) {
  723. while (++i < ii && str.charCodeAt(i) !== 0x1b) {}
  724. continue;
  725. }
  726. const code = PDFStringTranslateTable[charCode];
  727. strBuf.push(code ? String.fromCharCode(code) : str.charAt(i));
  728. }
  729. return strBuf.join("");
  730. }
  731. function stringToUTF8String(str) {
  732. return decodeURIComponent(escape(str));
  733. }
  734. function utf8StringToString(str) {
  735. return unescape(encodeURIComponent(str));
  736. }
  737. function isArrayEqual(arr1, arr2) {
  738. if (arr1.length !== arr2.length) {
  739. return false;
  740. }
  741. for (let i = 0, ii = arr1.length; i < ii; i++) {
  742. if (arr1[i] !== arr2[i]) {
  743. return false;
  744. }
  745. }
  746. return true;
  747. }
  748. function getModificationDate(date = new Date()) {
  749. 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")];
  750. return buffer.join("");
  751. }
  752. let NormalizeRegex = null;
  753. let NormalizationMap = null;
  754. function normalizeUnicode(str) {
  755. if (!NormalizeRegex) {
  756. 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;
  757. NormalizationMap = new Map([["ſt", "ſt"]]);
  758. }
  759. return str.replaceAll(NormalizeRegex, (_, p1, p2) => p1 ? p1.normalize("NFKC") : NormalizationMap.get(p2));
  760. }
  761. function getUuid() {
  762. if (typeof crypto !== "undefined" && typeof crypto?.randomUUID === "function") {
  763. return crypto.randomUUID();
  764. }
  765. const buf = new Uint8Array(32);
  766. if (typeof crypto !== "undefined" && typeof crypto?.getRandomValues === "function") {
  767. crypto.getRandomValues(buf);
  768. } else {
  769. for (let i = 0; i < 32; i++) {
  770. buf[i] = Math.floor(Math.random() * 255);
  771. }
  772. }
  773. return bytesToString(buf);
  774. }
  775. const AnnotationPrefix = "pdfjs_internal_id_";
  776. const FontRenderOps = {
  777. BEZIER_CURVE_TO: 0,
  778. MOVE_TO: 1,
  779. LINE_TO: 2,
  780. QUADRATIC_CURVE_TO: 3,
  781. RESTORE: 4,
  782. SAVE: 5,
  783. SCALE: 6,
  784. TRANSFORM: 7,
  785. TRANSLATE: 8
  786. };
  787. ;// CONCATENATED MODULE: ./src/core/primitives.js
  788. const CIRCULAR_REF = Symbol("CIRCULAR_REF");
  789. const EOF = Symbol("EOF");
  790. let CmdCache = Object.create(null);
  791. let NameCache = Object.create(null);
  792. let RefCache = Object.create(null);
  793. function clearPrimitiveCaches() {
  794. CmdCache = Object.create(null);
  795. NameCache = Object.create(null);
  796. RefCache = Object.create(null);
  797. }
  798. class Name {
  799. constructor(name) {
  800. this.name = name;
  801. }
  802. static get(name) {
  803. return NameCache[name] ||= new Name(name);
  804. }
  805. }
  806. class Cmd {
  807. constructor(cmd) {
  808. this.cmd = cmd;
  809. }
  810. static get(cmd) {
  811. return CmdCache[cmd] ||= new Cmd(cmd);
  812. }
  813. }
  814. const nonSerializable = function nonSerializableClosure() {
  815. return nonSerializable;
  816. };
  817. class Dict {
  818. constructor(xref = null) {
  819. this._map = Object.create(null);
  820. this.xref = xref;
  821. this.objId = null;
  822. this.suppressEncryption = false;
  823. this.__nonSerializable__ = nonSerializable;
  824. }
  825. assignXref(newXref) {
  826. this.xref = newXref;
  827. }
  828. get size() {
  829. return Object.keys(this._map).length;
  830. }
  831. get(key1, key2, key3) {
  832. let value = this._map[key1];
  833. if (value === undefined && key2 !== undefined) {
  834. value = this._map[key2];
  835. if (value === undefined && key3 !== undefined) {
  836. value = this._map[key3];
  837. }
  838. }
  839. if (value instanceof Ref && this.xref) {
  840. return this.xref.fetch(value, this.suppressEncryption);
  841. }
  842. return value;
  843. }
  844. async getAsync(key1, key2, key3) {
  845. let value = this._map[key1];
  846. if (value === undefined && key2 !== undefined) {
  847. value = this._map[key2];
  848. if (value === undefined && key3 !== undefined) {
  849. value = this._map[key3];
  850. }
  851. }
  852. if (value instanceof Ref && this.xref) {
  853. return this.xref.fetchAsync(value, this.suppressEncryption);
  854. }
  855. return value;
  856. }
  857. getArray(key1, key2, key3) {
  858. let value = this._map[key1];
  859. if (value === undefined && key2 !== undefined) {
  860. value = this._map[key2];
  861. if (value === undefined && key3 !== undefined) {
  862. value = this._map[key3];
  863. }
  864. }
  865. if (value instanceof Ref && this.xref) {
  866. value = this.xref.fetch(value, this.suppressEncryption);
  867. }
  868. if (Array.isArray(value)) {
  869. value = value.slice();
  870. for (let i = 0, ii = value.length; i < ii; i++) {
  871. if (value[i] instanceof Ref && this.xref) {
  872. value[i] = this.xref.fetch(value[i], this.suppressEncryption);
  873. }
  874. }
  875. }
  876. return value;
  877. }
  878. getRaw(key) {
  879. return this._map[key];
  880. }
  881. getKeys() {
  882. return Object.keys(this._map);
  883. }
  884. getRawValues() {
  885. return Object.values(this._map);
  886. }
  887. set(key, value) {
  888. this._map[key] = value;
  889. }
  890. has(key) {
  891. return this._map[key] !== undefined;
  892. }
  893. forEach(callback) {
  894. for (const key in this._map) {
  895. callback(key, this.get(key));
  896. }
  897. }
  898. static get empty() {
  899. const emptyDict = new Dict(null);
  900. emptyDict.set = (key, value) => {
  901. unreachable("Should not call `set` on the empty dictionary.");
  902. };
  903. return shadow(this, "empty", emptyDict);
  904. }
  905. static merge({
  906. xref,
  907. dictArray,
  908. mergeSubDicts = false
  909. }) {
  910. const mergedDict = new Dict(xref),
  911. properties = new Map();
  912. for (const dict of dictArray) {
  913. if (!(dict instanceof Dict)) {
  914. continue;
  915. }
  916. for (const [key, value] of Object.entries(dict._map)) {
  917. let property = properties.get(key);
  918. if (property === undefined) {
  919. property = [];
  920. properties.set(key, property);
  921. } else if (!mergeSubDicts || !(value instanceof Dict)) {
  922. continue;
  923. }
  924. property.push(value);
  925. }
  926. }
  927. for (const [name, values] of properties) {
  928. if (values.length === 1 || !(values[0] instanceof Dict)) {
  929. mergedDict._map[name] = values[0];
  930. continue;
  931. }
  932. const subDict = new Dict(xref);
  933. for (const dict of values) {
  934. for (const [key, value] of Object.entries(dict._map)) {
  935. if (subDict._map[key] === undefined) {
  936. subDict._map[key] = value;
  937. }
  938. }
  939. }
  940. if (subDict.size > 0) {
  941. mergedDict._map[name] = subDict;
  942. }
  943. }
  944. properties.clear();
  945. return mergedDict.size > 0 ? mergedDict : Dict.empty;
  946. }
  947. clone() {
  948. const dict = new Dict(this.xref);
  949. for (const key of this.getKeys()) {
  950. dict.set(key, this.getRaw(key));
  951. }
  952. return dict;
  953. }
  954. delete(key) {
  955. delete this._map[key];
  956. }
  957. }
  958. class Ref {
  959. constructor(num, gen) {
  960. this.num = num;
  961. this.gen = gen;
  962. }
  963. toString() {
  964. if (this.gen === 0) {
  965. return `${this.num}R`;
  966. }
  967. return `${this.num}R${this.gen}`;
  968. }
  969. static fromString(str) {
  970. const ref = RefCache[str];
  971. if (ref) {
  972. return ref;
  973. }
  974. const m = /^(\d+)R(\d*)$/.exec(str);
  975. if (!m || m[1] === "0") {
  976. return null;
  977. }
  978. return RefCache[str] = new Ref(parseInt(m[1]), !m[2] ? 0 : parseInt(m[2]));
  979. }
  980. static get(num, gen) {
  981. const key = gen === 0 ? `${num}R` : `${num}R${gen}`;
  982. return RefCache[key] ||= new Ref(num, gen);
  983. }
  984. }
  985. class RefSet {
  986. constructor(parent = null) {
  987. this._set = new Set(parent?._set);
  988. }
  989. has(ref) {
  990. return this._set.has(ref.toString());
  991. }
  992. put(ref) {
  993. this._set.add(ref.toString());
  994. }
  995. remove(ref) {
  996. this._set.delete(ref.toString());
  997. }
  998. [Symbol.iterator]() {
  999. return this._set.values();
  1000. }
  1001. clear() {
  1002. this._set.clear();
  1003. }
  1004. }
  1005. class RefSetCache {
  1006. constructor() {
  1007. this._map = new Map();
  1008. }
  1009. get size() {
  1010. return this._map.size;
  1011. }
  1012. get(ref) {
  1013. return this._map.get(ref.toString());
  1014. }
  1015. has(ref) {
  1016. return this._map.has(ref.toString());
  1017. }
  1018. put(ref, obj) {
  1019. this._map.set(ref.toString(), obj);
  1020. }
  1021. putAlias(ref, aliasRef) {
  1022. this._map.set(ref.toString(), this.get(aliasRef));
  1023. }
  1024. [Symbol.iterator]() {
  1025. return this._map.values();
  1026. }
  1027. clear() {
  1028. this._map.clear();
  1029. }
  1030. *items() {
  1031. for (const [ref, value] of this._map) {
  1032. yield [Ref.fromString(ref), value];
  1033. }
  1034. }
  1035. }
  1036. function isName(v, name) {
  1037. return v instanceof Name && (name === undefined || v.name === name);
  1038. }
  1039. function isCmd(v, cmd) {
  1040. return v instanceof Cmd && (cmd === undefined || v.cmd === cmd);
  1041. }
  1042. function isDict(v, type) {
  1043. return v instanceof Dict && (type === undefined || isName(v.get("Type"), type));
  1044. }
  1045. function isRefsEqual(v1, v2) {
  1046. return v1.num === v2.num && v1.gen === v2.gen;
  1047. }
  1048. ;// CONCATENATED MODULE: ./src/core/base_stream.js
  1049. class BaseStream {
  1050. constructor() {
  1051. if (this.constructor === BaseStream) {
  1052. unreachable("Cannot initialize BaseStream.");
  1053. }
  1054. }
  1055. get length() {
  1056. unreachable("Abstract getter `length` accessed");
  1057. }
  1058. get isEmpty() {
  1059. unreachable("Abstract getter `isEmpty` accessed");
  1060. }
  1061. get isDataLoaded() {
  1062. return shadow(this, "isDataLoaded", true);
  1063. }
  1064. getByte() {
  1065. unreachable("Abstract method `getByte` called");
  1066. }
  1067. getBytes(length) {
  1068. unreachable("Abstract method `getBytes` called");
  1069. }
  1070. async getImageData(length, decoderOptions) {
  1071. return this.getBytes(length, decoderOptions);
  1072. }
  1073. async asyncGetBytes() {
  1074. unreachable("Abstract method `asyncGetBytes` called");
  1075. }
  1076. get isAsync() {
  1077. return false;
  1078. }
  1079. get canAsyncDecodeImageFromBuffer() {
  1080. return false;
  1081. }
  1082. peekByte() {
  1083. const peekedByte = this.getByte();
  1084. if (peekedByte !== -1) {
  1085. this.pos--;
  1086. }
  1087. return peekedByte;
  1088. }
  1089. peekBytes(length) {
  1090. const bytes = this.getBytes(length);
  1091. this.pos -= bytes.length;
  1092. return bytes;
  1093. }
  1094. getUint16() {
  1095. const b0 = this.getByte();
  1096. const b1 = this.getByte();
  1097. if (b0 === -1 || b1 === -1) {
  1098. return -1;
  1099. }
  1100. return (b0 << 8) + b1;
  1101. }
  1102. getInt32() {
  1103. const b0 = this.getByte();
  1104. const b1 = this.getByte();
  1105. const b2 = this.getByte();
  1106. const b3 = this.getByte();
  1107. return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3;
  1108. }
  1109. getByteRange(begin, end) {
  1110. unreachable("Abstract method `getByteRange` called");
  1111. }
  1112. getString(length) {
  1113. return bytesToString(this.getBytes(length));
  1114. }
  1115. skip(n) {
  1116. this.pos += n || 1;
  1117. }
  1118. reset() {
  1119. unreachable("Abstract method `reset` called");
  1120. }
  1121. moveStart() {
  1122. unreachable("Abstract method `moveStart` called");
  1123. }
  1124. makeSubStream(start, length, dict = null) {
  1125. unreachable("Abstract method `makeSubStream` called");
  1126. }
  1127. getBaseStreams() {
  1128. return null;
  1129. }
  1130. }
  1131. ;// CONCATENATED MODULE: ./src/core/core_utils.js
  1132. const PDF_VERSION_REGEXP = /^[1-9]\.\d$/;
  1133. function getLookupTableFactory(initializer) {
  1134. let lookup;
  1135. return function () {
  1136. if (initializer) {
  1137. lookup = Object.create(null);
  1138. initializer(lookup);
  1139. initializer = null;
  1140. }
  1141. return lookup;
  1142. };
  1143. }
  1144. class MissingDataException extends BaseException {
  1145. constructor(begin, end) {
  1146. super(`Missing data [${begin}, ${end})`, "MissingDataException");
  1147. this.begin = begin;
  1148. this.end = end;
  1149. }
  1150. }
  1151. class ParserEOFException extends BaseException {
  1152. constructor(msg) {
  1153. super(msg, "ParserEOFException");
  1154. }
  1155. }
  1156. class XRefEntryException extends BaseException {
  1157. constructor(msg) {
  1158. super(msg, "XRefEntryException");
  1159. }
  1160. }
  1161. class XRefParseException extends BaseException {
  1162. constructor(msg) {
  1163. super(msg, "XRefParseException");
  1164. }
  1165. }
  1166. function arrayBuffersToBytes(arr) {
  1167. const length = arr.length;
  1168. if (length === 0) {
  1169. return new Uint8Array(0);
  1170. }
  1171. if (length === 1) {
  1172. return new Uint8Array(arr[0]);
  1173. }
  1174. let dataLength = 0;
  1175. for (let i = 0; i < length; i++) {
  1176. dataLength += arr[i].byteLength;
  1177. }
  1178. const data = new Uint8Array(dataLength);
  1179. let pos = 0;
  1180. for (let i = 0; i < length; i++) {
  1181. const item = new Uint8Array(arr[i]);
  1182. data.set(item, pos);
  1183. pos += item.byteLength;
  1184. }
  1185. return data;
  1186. }
  1187. function getInheritableProperty({
  1188. dict,
  1189. key,
  1190. getArray = false,
  1191. stopWhenFound = true
  1192. }) {
  1193. let values;
  1194. const visited = new RefSet();
  1195. while (dict instanceof Dict && !(dict.objId && visited.has(dict.objId))) {
  1196. if (dict.objId) {
  1197. visited.put(dict.objId);
  1198. }
  1199. const value = getArray ? dict.getArray(key) : dict.get(key);
  1200. if (value !== undefined) {
  1201. if (stopWhenFound) {
  1202. return value;
  1203. }
  1204. (values ||= []).push(value);
  1205. }
  1206. dict = dict.get("Parent");
  1207. }
  1208. return values;
  1209. }
  1210. 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"];
  1211. function toRomanNumerals(number, lowerCase = false) {
  1212. assert(Number.isInteger(number) && number > 0, "The number should be a positive integer.");
  1213. const romanBuf = [];
  1214. let pos;
  1215. while (number >= 1000) {
  1216. number -= 1000;
  1217. romanBuf.push("M");
  1218. }
  1219. pos = number / 100 | 0;
  1220. number %= 100;
  1221. romanBuf.push(ROMAN_NUMBER_MAP[pos]);
  1222. pos = number / 10 | 0;
  1223. number %= 10;
  1224. romanBuf.push(ROMAN_NUMBER_MAP[10 + pos]);
  1225. romanBuf.push(ROMAN_NUMBER_MAP[20 + number]);
  1226. const romanStr = romanBuf.join("");
  1227. return lowerCase ? romanStr.toLowerCase() : romanStr;
  1228. }
  1229. function log2(x) {
  1230. if (x <= 0) {
  1231. return 0;
  1232. }
  1233. return Math.ceil(Math.log2(x));
  1234. }
  1235. function readInt8(data, offset) {
  1236. return data[offset] << 24 >> 24;
  1237. }
  1238. function readUint16(data, offset) {
  1239. return data[offset] << 8 | data[offset + 1];
  1240. }
  1241. function readUint32(data, offset) {
  1242. return (data[offset] << 24 | data[offset + 1] << 16 | data[offset + 2] << 8 | data[offset + 3]) >>> 0;
  1243. }
  1244. function isWhiteSpace(ch) {
  1245. return ch === 0x20 || ch === 0x09 || ch === 0x0d || ch === 0x0a;
  1246. }
  1247. function isBooleanArray(arr, len) {
  1248. return Array.isArray(arr) && (len === null || arr.length === len) && arr.every(x => typeof x === "boolean");
  1249. }
  1250. function isNumberArray(arr, len) {
  1251. return Array.isArray(arr) && (len === null || arr.length === len) && arr.every(x => typeof x === "number");
  1252. }
  1253. function lookupMatrix(arr, fallback) {
  1254. return isNumberArray(arr, 6) ? arr : fallback;
  1255. }
  1256. function lookupRect(arr, fallback) {
  1257. return isNumberArray(arr, 4) ? arr : fallback;
  1258. }
  1259. function lookupNormalRect(arr, fallback) {
  1260. return isNumberArray(arr, 4) ? Util.normalizeRect(arr) : fallback;
  1261. }
  1262. function parseXFAPath(path) {
  1263. const positionPattern = /(.+)\[(\d+)\]$/;
  1264. return path.split(".").map(component => {
  1265. const m = component.match(positionPattern);
  1266. if (m) {
  1267. return {
  1268. name: m[1],
  1269. pos: parseInt(m[2], 10)
  1270. };
  1271. }
  1272. return {
  1273. name: component,
  1274. pos: 0
  1275. };
  1276. });
  1277. }
  1278. function escapePDFName(str) {
  1279. const buffer = [];
  1280. let start = 0;
  1281. for (let i = 0, ii = str.length; i < ii; i++) {
  1282. const char = str.charCodeAt(i);
  1283. 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) {
  1284. if (start < i) {
  1285. buffer.push(str.substring(start, i));
  1286. }
  1287. buffer.push(`#${char.toString(16)}`);
  1288. start = i + 1;
  1289. }
  1290. }
  1291. if (buffer.length === 0) {
  1292. return str;
  1293. }
  1294. if (start < str.length) {
  1295. buffer.push(str.substring(start, str.length));
  1296. }
  1297. return buffer.join("");
  1298. }
  1299. function escapeString(str) {
  1300. return str.replaceAll(/([()\\\n\r])/g, match => {
  1301. if (match === "\n") {
  1302. return "\\n";
  1303. } else if (match === "\r") {
  1304. return "\\r";
  1305. }
  1306. return `\\${match}`;
  1307. });
  1308. }
  1309. function _collectJS(entry, xref, list, parents) {
  1310. if (!entry) {
  1311. return;
  1312. }
  1313. let parent = null;
  1314. if (entry instanceof Ref) {
  1315. if (parents.has(entry)) {
  1316. return;
  1317. }
  1318. parent = entry;
  1319. parents.put(parent);
  1320. entry = xref.fetch(entry);
  1321. }
  1322. if (Array.isArray(entry)) {
  1323. for (const element of entry) {
  1324. _collectJS(element, xref, list, parents);
  1325. }
  1326. } else if (entry instanceof Dict) {
  1327. if (isName(entry.get("S"), "JavaScript")) {
  1328. const js = entry.get("JS");
  1329. let code;
  1330. if (js instanceof BaseStream) {
  1331. code = js.getString();
  1332. } else if (typeof js === "string") {
  1333. code = js;
  1334. }
  1335. code &&= stringToPDFString(code).replaceAll("\x00", "");
  1336. if (code) {
  1337. list.push(code);
  1338. }
  1339. }
  1340. _collectJS(entry.getRaw("Next"), xref, list, parents);
  1341. }
  1342. if (parent) {
  1343. parents.remove(parent);
  1344. }
  1345. }
  1346. function collectActions(xref, dict, eventType) {
  1347. const actions = Object.create(null);
  1348. const additionalActionsDicts = getInheritableProperty({
  1349. dict,
  1350. key: "AA",
  1351. stopWhenFound: false
  1352. });
  1353. if (additionalActionsDicts) {
  1354. for (let i = additionalActionsDicts.length - 1; i >= 0; i--) {
  1355. const additionalActions = additionalActionsDicts[i];
  1356. if (!(additionalActions instanceof Dict)) {
  1357. continue;
  1358. }
  1359. for (const key of additionalActions.getKeys()) {
  1360. const action = eventType[key];
  1361. if (!action) {
  1362. continue;
  1363. }
  1364. const actionDict = additionalActions.getRaw(key);
  1365. const parents = new RefSet();
  1366. const list = [];
  1367. _collectJS(actionDict, xref, list, parents);
  1368. if (list.length > 0) {
  1369. actions[action] = list;
  1370. }
  1371. }
  1372. }
  1373. }
  1374. if (dict.has("A")) {
  1375. const actionDict = dict.get("A");
  1376. const parents = new RefSet();
  1377. const list = [];
  1378. _collectJS(actionDict, xref, list, parents);
  1379. if (list.length > 0) {
  1380. actions.Action = list;
  1381. }
  1382. }
  1383. return objectSize(actions) > 0 ? actions : null;
  1384. }
  1385. const XMLEntities = {
  1386. 0x3c: "&lt;",
  1387. 0x3e: "&gt;",
  1388. 0x26: "&amp;",
  1389. 0x22: "&quot;",
  1390. 0x27: "&apos;"
  1391. };
  1392. function* codePointIter(str) {
  1393. for (let i = 0, ii = str.length; i < ii; i++) {
  1394. const char = str.codePointAt(i);
  1395. if (char > 0xd7ff && (char < 0xe000 || char > 0xfffd)) {
  1396. i++;
  1397. }
  1398. yield char;
  1399. }
  1400. }
  1401. function encodeToXmlString(str) {
  1402. const buffer = [];
  1403. let start = 0;
  1404. for (let i = 0, ii = str.length; i < ii; i++) {
  1405. const char = str.codePointAt(i);
  1406. if (0x20 <= char && char <= 0x7e) {
  1407. const entity = XMLEntities[char];
  1408. if (entity) {
  1409. if (start < i) {
  1410. buffer.push(str.substring(start, i));
  1411. }
  1412. buffer.push(entity);
  1413. start = i + 1;
  1414. }
  1415. } else {
  1416. if (start < i) {
  1417. buffer.push(str.substring(start, i));
  1418. }
  1419. buffer.push(`&#x${char.toString(16).toUpperCase()};`);
  1420. if (char > 0xd7ff && (char < 0xe000 || char > 0xfffd)) {
  1421. i++;
  1422. }
  1423. start = i + 1;
  1424. }
  1425. }
  1426. if (buffer.length === 0) {
  1427. return str;
  1428. }
  1429. if (start < str.length) {
  1430. buffer.push(str.substring(start, str.length));
  1431. }
  1432. return buffer.join("");
  1433. }
  1434. function validateFontName(fontFamily, mustWarn = false) {
  1435. const m = /^("|').*("|')$/.exec(fontFamily);
  1436. if (m && m[1] === m[2]) {
  1437. const re = new RegExp(`[^\\\\]${m[1]}`);
  1438. if (re.test(fontFamily.slice(1, -1))) {
  1439. if (mustWarn) {
  1440. warn(`FontFamily contains unescaped ${m[1]}: ${fontFamily}.`);
  1441. }
  1442. return false;
  1443. }
  1444. } else {
  1445. for (const ident of fontFamily.split(/[ \t]+/)) {
  1446. if (/^(\d|(-(\d|-)))/.test(ident) || !/^[\w-\\]+$/.test(ident)) {
  1447. if (mustWarn) {
  1448. warn(`FontFamily contains invalid <custom-ident>: ${fontFamily}.`);
  1449. }
  1450. return false;
  1451. }
  1452. }
  1453. }
  1454. return true;
  1455. }
  1456. function validateCSSFont(cssFontInfo) {
  1457. const DEFAULT_CSS_FONT_OBLIQUE = "14";
  1458. const DEFAULT_CSS_FONT_WEIGHT = "400";
  1459. const CSS_FONT_WEIGHT_VALUES = new Set(["100", "200", "300", "400", "500", "600", "700", "800", "900", "1000", "normal", "bold", "bolder", "lighter"]);
  1460. const {
  1461. fontFamily,
  1462. fontWeight,
  1463. italicAngle
  1464. } = cssFontInfo;
  1465. if (!validateFontName(fontFamily, true)) {
  1466. return false;
  1467. }
  1468. const weight = fontWeight ? fontWeight.toString() : "";
  1469. cssFontInfo.fontWeight = CSS_FONT_WEIGHT_VALUES.has(weight) ? weight : DEFAULT_CSS_FONT_WEIGHT;
  1470. const angle = parseFloat(italicAngle);
  1471. cssFontInfo.italicAngle = isNaN(angle) || angle < -90 || angle > 90 ? DEFAULT_CSS_FONT_OBLIQUE : italicAngle.toString();
  1472. return true;
  1473. }
  1474. function recoverJsURL(str) {
  1475. const URL_OPEN_METHODS = ["app.launchURL", "window.open", "xfa.host.gotoURL"];
  1476. const regex = new RegExp("^\\s*(" + URL_OPEN_METHODS.join("|").replaceAll(".", "\\.") + ")\\((?:'|\")([^'\"]*)(?:'|\")(?:,\\s*(\\w+)\\)|\\))", "i");
  1477. const jsUrl = regex.exec(str);
  1478. if (jsUrl?.[2]) {
  1479. const url = jsUrl[2];
  1480. let newWindow = false;
  1481. if (jsUrl[3] === "true" && jsUrl[1] === "app.launchURL") {
  1482. newWindow = true;
  1483. }
  1484. return {
  1485. url,
  1486. newWindow
  1487. };
  1488. }
  1489. return null;
  1490. }
  1491. function numberToString(value) {
  1492. if (Number.isInteger(value)) {
  1493. return value.toString();
  1494. }
  1495. const roundedValue = Math.round(value * 100);
  1496. if (roundedValue % 100 === 0) {
  1497. return (roundedValue / 100).toString();
  1498. }
  1499. if (roundedValue % 10 === 0) {
  1500. return value.toFixed(1);
  1501. }
  1502. return value.toFixed(2);
  1503. }
  1504. function getNewAnnotationsMap(annotationStorage) {
  1505. if (!annotationStorage) {
  1506. return null;
  1507. }
  1508. const newAnnotationsByPage = new Map();
  1509. for (const [key, value] of annotationStorage) {
  1510. if (!key.startsWith(AnnotationEditorPrefix)) {
  1511. continue;
  1512. }
  1513. let annotations = newAnnotationsByPage.get(value.pageIndex);
  1514. if (!annotations) {
  1515. annotations = [];
  1516. newAnnotationsByPage.set(value.pageIndex, annotations);
  1517. }
  1518. annotations.push(value);
  1519. }
  1520. return newAnnotationsByPage.size > 0 ? newAnnotationsByPage : null;
  1521. }
  1522. function stringToAsciiOrUTF16BE(str) {
  1523. return isAscii(str) ? str : stringToUTF16String(str, true);
  1524. }
  1525. function isAscii(str) {
  1526. return /^[\x00-\x7F]*$/.test(str);
  1527. }
  1528. function stringToUTF16HexString(str) {
  1529. const buf = [];
  1530. for (let i = 0, ii = str.length; i < ii; i++) {
  1531. const char = str.charCodeAt(i);
  1532. buf.push((char >> 8 & 0xff).toString(16).padStart(2, "0"), (char & 0xff).toString(16).padStart(2, "0"));
  1533. }
  1534. return buf.join("");
  1535. }
  1536. function stringToUTF16String(str, bigEndian = false) {
  1537. const buf = [];
  1538. if (bigEndian) {
  1539. buf.push("\xFE\xFF");
  1540. }
  1541. for (let i = 0, ii = str.length; i < ii; i++) {
  1542. const char = str.charCodeAt(i);
  1543. buf.push(String.fromCharCode(char >> 8 & 0xff), String.fromCharCode(char & 0xff));
  1544. }
  1545. return buf.join("");
  1546. }
  1547. function getRotationMatrix(rotation, width, height) {
  1548. switch (rotation) {
  1549. case 90:
  1550. return [0, 1, -1, 0, width, 0];
  1551. case 180:
  1552. return [-1, 0, 0, -1, width, height];
  1553. case 270:
  1554. return [0, -1, 1, 0, 0, height];
  1555. default:
  1556. throw new Error("Invalid rotation");
  1557. }
  1558. }
  1559. function getSizeInBytes(x) {
  1560. return Math.ceil(Math.ceil(Math.log2(1 + x)) / 8);
  1561. }
  1562. ;// CONCATENATED MODULE: ./src/core/stream.js
  1563. class Stream extends BaseStream {
  1564. constructor(arrayBuffer, start, length, dict) {
  1565. super();
  1566. this.bytes = arrayBuffer instanceof Uint8Array ? arrayBuffer : new Uint8Array(arrayBuffer);
  1567. this.start = start || 0;
  1568. this.pos = this.start;
  1569. this.end = start + length || this.bytes.length;
  1570. this.dict = dict;
  1571. }
  1572. get length() {
  1573. return this.end - this.start;
  1574. }
  1575. get isEmpty() {
  1576. return this.length === 0;
  1577. }
  1578. getByte() {
  1579. if (this.pos >= this.end) {
  1580. return -1;
  1581. }
  1582. return this.bytes[this.pos++];
  1583. }
  1584. getBytes(length) {
  1585. const bytes = this.bytes;
  1586. const pos = this.pos;
  1587. const strEnd = this.end;
  1588. if (!length) {
  1589. return bytes.subarray(pos, strEnd);
  1590. }
  1591. let end = pos + length;
  1592. if (end > strEnd) {
  1593. end = strEnd;
  1594. }
  1595. this.pos = end;
  1596. return bytes.subarray(pos, end);
  1597. }
  1598. getByteRange(begin, end) {
  1599. if (begin < 0) {
  1600. begin = 0;
  1601. }
  1602. if (end > this.end) {
  1603. end = this.end;
  1604. }
  1605. return this.bytes.subarray(begin, end);
  1606. }
  1607. reset() {
  1608. this.pos = this.start;
  1609. }
  1610. moveStart() {
  1611. this.start = this.pos;
  1612. }
  1613. makeSubStream(start, length, dict = null) {
  1614. return new Stream(this.bytes.buffer, start, length, dict);
  1615. }
  1616. }
  1617. class StringStream extends Stream {
  1618. constructor(str) {
  1619. super(stringToBytes(str));
  1620. }
  1621. }
  1622. class NullStream extends Stream {
  1623. constructor() {
  1624. super(new Uint8Array(0));
  1625. }
  1626. }
  1627. ;// CONCATENATED MODULE: ./src/core/chunked_stream.js
  1628. class ChunkedStream extends Stream {
  1629. constructor(length, chunkSize, manager) {
  1630. super(new Uint8Array(length), 0, length, null);
  1631. this.chunkSize = chunkSize;
  1632. this._loadedChunks = new Set();
  1633. this.numChunks = Math.ceil(length / chunkSize);
  1634. this.manager = manager;
  1635. this.progressiveDataLength = 0;
  1636. this.lastSuccessfulEnsureByteChunk = -1;
  1637. }
  1638. getMissingChunks() {
  1639. const chunks = [];
  1640. for (let chunk = 0, n = this.numChunks; chunk < n; ++chunk) {
  1641. if (!this._loadedChunks.has(chunk)) {
  1642. chunks.push(chunk);
  1643. }
  1644. }
  1645. return chunks;
  1646. }
  1647. get numChunksLoaded() {
  1648. return this._loadedChunks.size;
  1649. }
  1650. get isDataLoaded() {
  1651. return this.numChunksLoaded === this.numChunks;
  1652. }
  1653. onReceiveData(begin, chunk) {
  1654. const chunkSize = this.chunkSize;
  1655. if (begin % chunkSize !== 0) {
  1656. throw new Error(`Bad begin offset: ${begin}`);
  1657. }
  1658. const end = begin + chunk.byteLength;
  1659. if (end % chunkSize !== 0 && end !== this.bytes.length) {
  1660. throw new Error(`Bad end offset: ${end}`);
  1661. }
  1662. this.bytes.set(new Uint8Array(chunk), begin);
  1663. const beginChunk = Math.floor(begin / chunkSize);
  1664. const endChunk = Math.floor((end - 1) / chunkSize) + 1;
  1665. for (let curChunk = beginChunk; curChunk < endChunk; ++curChunk) {
  1666. this._loadedChunks.add(curChunk);
  1667. }
  1668. }
  1669. onReceiveProgressiveData(data) {
  1670. let position = this.progressiveDataLength;
  1671. const beginChunk = Math.floor(position / this.chunkSize);
  1672. this.bytes.set(new Uint8Array(data), position);
  1673. position += data.byteLength;
  1674. this.progressiveDataLength = position;
  1675. const endChunk = position >= this.end ? this.numChunks : Math.floor(position / this.chunkSize);
  1676. for (let curChunk = beginChunk; curChunk < endChunk; ++curChunk) {
  1677. this._loadedChunks.add(curChunk);
  1678. }
  1679. }
  1680. ensureByte(pos) {
  1681. if (pos < this.progressiveDataLength) {
  1682. return;
  1683. }
  1684. const chunk = Math.floor(pos / this.chunkSize);
  1685. if (chunk > this.numChunks) {
  1686. return;
  1687. }
  1688. if (chunk === this.lastSuccessfulEnsureByteChunk) {
  1689. return;
  1690. }
  1691. if (!this._loadedChunks.has(chunk)) {
  1692. throw new MissingDataException(pos, pos + 1);
  1693. }
  1694. this.lastSuccessfulEnsureByteChunk = chunk;
  1695. }
  1696. ensureRange(begin, end) {
  1697. if (begin >= end) {
  1698. return;
  1699. }
  1700. if (end <= this.progressiveDataLength) {
  1701. return;
  1702. }
  1703. const beginChunk = Math.floor(begin / this.chunkSize);
  1704. if (beginChunk > this.numChunks) {
  1705. return;
  1706. }
  1707. const endChunk = Math.min(Math.floor((end - 1) / this.chunkSize) + 1, this.numChunks);
  1708. for (let chunk = beginChunk; chunk < endChunk; ++chunk) {
  1709. if (!this._loadedChunks.has(chunk)) {
  1710. throw new MissingDataException(begin, end);
  1711. }
  1712. }
  1713. }
  1714. nextEmptyChunk(beginChunk) {
  1715. const numChunks = this.numChunks;
  1716. for (let i = 0; i < numChunks; ++i) {
  1717. const chunk = (beginChunk + i) % numChunks;
  1718. if (!this._loadedChunks.has(chunk)) {
  1719. return chunk;
  1720. }
  1721. }
  1722. return null;
  1723. }
  1724. hasChunk(chunk) {
  1725. return this._loadedChunks.has(chunk);
  1726. }
  1727. getByte() {
  1728. const pos = this.pos;
  1729. if (pos >= this.end) {
  1730. return -1;
  1731. }
  1732. if (pos >= this.progressiveDataLength) {
  1733. this.ensureByte(pos);
  1734. }
  1735. return this.bytes[this.pos++];
  1736. }
  1737. getBytes(length) {
  1738. const bytes = this.bytes;
  1739. const pos = this.pos;
  1740. const strEnd = this.end;
  1741. if (!length) {
  1742. if (strEnd > this.progressiveDataLength) {
  1743. this.ensureRange(pos, strEnd);
  1744. }
  1745. return bytes.subarray(pos, strEnd);
  1746. }
  1747. let end = pos + length;
  1748. if (end > strEnd) {
  1749. end = strEnd;
  1750. }
  1751. if (end > this.progressiveDataLength) {
  1752. this.ensureRange(pos, end);
  1753. }
  1754. this.pos = end;
  1755. return bytes.subarray(pos, end);
  1756. }
  1757. getByteRange(begin, end) {
  1758. if (begin < 0) {
  1759. begin = 0;
  1760. }
  1761. if (end > this.end) {
  1762. end = this.end;
  1763. }
  1764. if (end > this.progressiveDataLength) {
  1765. this.ensureRange(begin, end);
  1766. }
  1767. return this.bytes.subarray(begin, end);
  1768. }
  1769. makeSubStream(start, length, dict = null) {
  1770. if (length) {
  1771. if (start + length > this.progressiveDataLength) {
  1772. this.ensureRange(start, start + length);
  1773. }
  1774. } else if (start >= this.progressiveDataLength) {
  1775. this.ensureByte(start);
  1776. }
  1777. function ChunkedStreamSubstream() {}
  1778. ChunkedStreamSubstream.prototype = Object.create(this);
  1779. ChunkedStreamSubstream.prototype.getMissingChunks = function () {
  1780. const chunkSize = this.chunkSize;
  1781. const beginChunk = Math.floor(this.start / chunkSize);
  1782. const endChunk = Math.floor((this.end - 1) / chunkSize) + 1;
  1783. const missingChunks = [];
  1784. for (let chunk = beginChunk; chunk < endChunk; ++chunk) {
  1785. if (!this._loadedChunks.has(chunk)) {
  1786. missingChunks.push(chunk);
  1787. }
  1788. }
  1789. return missingChunks;
  1790. };
  1791. Object.defineProperty(ChunkedStreamSubstream.prototype, "isDataLoaded", {
  1792. get() {
  1793. if (this.numChunksLoaded === this.numChunks) {
  1794. return true;
  1795. }
  1796. return this.getMissingChunks().length === 0;
  1797. },
  1798. configurable: true
  1799. });
  1800. const subStream = new ChunkedStreamSubstream();
  1801. subStream.pos = subStream.start = start;
  1802. subStream.end = start + length || this.end;
  1803. subStream.dict = dict;
  1804. return subStream;
  1805. }
  1806. getBaseStreams() {
  1807. return [this];
  1808. }
  1809. }
  1810. class ChunkedStreamManager {
  1811. constructor(pdfNetworkStream, args) {
  1812. this.length = args.length;
  1813. this.chunkSize = args.rangeChunkSize;
  1814. this.stream = new ChunkedStream(this.length, this.chunkSize, this);
  1815. this.pdfNetworkStream = pdfNetworkStream;
  1816. this.disableAutoFetch = args.disableAutoFetch;
  1817. this.msgHandler = args.msgHandler;
  1818. this.currRequestId = 0;
  1819. this._chunksNeededByRequest = new Map();
  1820. this._requestsByChunk = new Map();
  1821. this._promisesByRequest = new Map();
  1822. this.progressiveDataLength = 0;
  1823. this.aborted = false;
  1824. this._loadedStreamCapability = Promise.withResolvers();
  1825. }
  1826. sendRequest(begin, end) {
  1827. const rangeReader = this.pdfNetworkStream.getRangeReader(begin, end);
  1828. if (!rangeReader.isStreamingSupported) {
  1829. rangeReader.onProgress = this.onProgress.bind(this);
  1830. }
  1831. let chunks = [],
  1832. loaded = 0;
  1833. return new Promise((resolve, reject) => {
  1834. const readChunk = ({
  1835. value,
  1836. done
  1837. }) => {
  1838. try {
  1839. if (done) {
  1840. const chunkData = arrayBuffersToBytes(chunks);
  1841. chunks = null;
  1842. resolve(chunkData);
  1843. return;
  1844. }
  1845. loaded += value.byteLength;
  1846. if (rangeReader.isStreamingSupported) {
  1847. this.onProgress({
  1848. loaded
  1849. });
  1850. }
  1851. chunks.push(value);
  1852. rangeReader.read().then(readChunk, reject);
  1853. } catch (e) {
  1854. reject(e);
  1855. }
  1856. };
  1857. rangeReader.read().then(readChunk, reject);
  1858. }).then(data => {
  1859. if (this.aborted) {
  1860. return;
  1861. }
  1862. this.onReceiveData({
  1863. chunk: data,
  1864. begin
  1865. });
  1866. });
  1867. }
  1868. requestAllChunks(noFetch = false) {
  1869. if (!noFetch) {
  1870. const missingChunks = this.stream.getMissingChunks();
  1871. this._requestChunks(missingChunks);
  1872. }
  1873. return this._loadedStreamCapability.promise;
  1874. }
  1875. _requestChunks(chunks) {
  1876. const requestId = this.currRequestId++;
  1877. const chunksNeeded = new Set();
  1878. this._chunksNeededByRequest.set(requestId, chunksNeeded);
  1879. for (const chunk of chunks) {
  1880. if (!this.stream.hasChunk(chunk)) {
  1881. chunksNeeded.add(chunk);
  1882. }
  1883. }
  1884. if (chunksNeeded.size === 0) {
  1885. return Promise.resolve();
  1886. }
  1887. const capability = Promise.withResolvers();
  1888. this._promisesByRequest.set(requestId, capability);
  1889. const chunksToRequest = [];
  1890. for (const chunk of chunksNeeded) {
  1891. let requestIds = this._requestsByChunk.get(chunk);
  1892. if (!requestIds) {
  1893. requestIds = [];
  1894. this._requestsByChunk.set(chunk, requestIds);
  1895. chunksToRequest.push(chunk);
  1896. }
  1897. requestIds.push(requestId);
  1898. }
  1899. if (chunksToRequest.length > 0) {
  1900. const groupedChunksToRequest = this.groupChunks(chunksToRequest);
  1901. for (const groupedChunk of groupedChunksToRequest) {
  1902. const begin = groupedChunk.beginChunk * this.chunkSize;
  1903. const end = Math.min(groupedChunk.endChunk * this.chunkSize, this.length);
  1904. this.sendRequest(begin, end).catch(capability.reject);
  1905. }
  1906. }
  1907. return capability.promise.catch(reason => {
  1908. if (this.aborted) {
  1909. return;
  1910. }
  1911. throw reason;
  1912. });
  1913. }
  1914. getStream() {
  1915. return this.stream;
  1916. }
  1917. requestRange(begin, end) {
  1918. end = Math.min(end, this.length);
  1919. const beginChunk = this.getBeginChunk(begin);
  1920. const endChunk = this.getEndChunk(end);
  1921. const chunks = [];
  1922. for (let chunk = beginChunk; chunk < endChunk; ++chunk) {
  1923. chunks.push(chunk);
  1924. }
  1925. return this._requestChunks(chunks);
  1926. }
  1927. requestRanges(ranges = []) {
  1928. const chunksToRequest = [];
  1929. for (const range of ranges) {
  1930. const beginChunk = this.getBeginChunk(range.begin);
  1931. const endChunk = this.getEndChunk(range.end);
  1932. for (let chunk = beginChunk; chunk < endChunk; ++chunk) {
  1933. if (!chunksToRequest.includes(chunk)) {
  1934. chunksToRequest.push(chunk);
  1935. }
  1936. }
  1937. }
  1938. chunksToRequest.sort(function (a, b) {
  1939. return a - b;
  1940. });
  1941. return this._requestChunks(chunksToRequest);
  1942. }
  1943. groupChunks(chunks) {
  1944. const groupedChunks = [];
  1945. let beginChunk = -1;
  1946. let prevChunk = -1;
  1947. for (let i = 0, ii = chunks.length; i < ii; ++i) {
  1948. const chunk = chunks[i];
  1949. if (beginChunk < 0) {
  1950. beginChunk = chunk;
  1951. }
  1952. if (prevChunk >= 0 && prevChunk + 1 !== chunk) {
  1953. groupedChunks.push({
  1954. beginChunk,
  1955. endChunk: prevChunk + 1
  1956. });
  1957. beginChunk = chunk;
  1958. }
  1959. if (i + 1 === chunks.length) {
  1960. groupedChunks.push({
  1961. beginChunk,
  1962. endChunk: chunk + 1
  1963. });
  1964. }
  1965. prevChunk = chunk;
  1966. }
  1967. return groupedChunks;
  1968. }
  1969. onProgress(args) {
  1970. this.msgHandler.send("DocProgress", {
  1971. loaded: this.stream.numChunksLoaded * this.chunkSize + args.loaded,
  1972. total: this.length
  1973. });
  1974. }
  1975. onReceiveData(args) {
  1976. const chunk = args.chunk;
  1977. const isProgressive = args.begin === undefined;
  1978. const begin = isProgressive ? this.progressiveDataLength : args.begin;
  1979. const end = begin + chunk.byteLength;
  1980. const beginChunk = Math.floor(begin / this.chunkSize);
  1981. const endChunk = end < this.length ? Math.floor(end / this.chunkSize) : Math.ceil(end / this.chunkSize);
  1982. if (isProgressive) {
  1983. this.stream.onReceiveProgressiveData(chunk);
  1984. this.progressiveDataLength = end;
  1985. } else {
  1986. this.stream.onReceiveData(begin, chunk);
  1987. }
  1988. if (this.stream.isDataLoaded) {
  1989. this._loadedStreamCapability.resolve(this.stream);
  1990. }
  1991. const loadedRequests = [];
  1992. for (let curChunk = beginChunk; curChunk < endChunk; ++curChunk) {
  1993. const requestIds = this._requestsByChunk.get(curChunk);
  1994. if (!requestIds) {
  1995. continue;
  1996. }
  1997. this._requestsByChunk.delete(curChunk);
  1998. for (const requestId of requestIds) {
  1999. const chunksNeeded = this._chunksNeededByRequest.get(requestId);
  2000. if (chunksNeeded.has(curChunk)) {
  2001. chunksNeeded.delete(curChunk);
  2002. }
  2003. if (chunksNeeded.size > 0) {
  2004. continue;
  2005. }
  2006. loadedRequests.push(requestId);
  2007. }
  2008. }
  2009. if (!this.disableAutoFetch && this._requestsByChunk.size === 0) {
  2010. let nextEmptyChunk;
  2011. if (this.stream.numChunksLoaded === 1) {
  2012. const lastChunk = this.stream.numChunks - 1;
  2013. if (!this.stream.hasChunk(lastChunk)) {
  2014. nextEmptyChunk = lastChunk;
  2015. }
  2016. } else {
  2017. nextEmptyChunk = this.stream.nextEmptyChunk(endChunk);
  2018. }
  2019. if (Number.isInteger(nextEmptyChunk)) {
  2020. this._requestChunks([nextEmptyChunk]);
  2021. }
  2022. }
  2023. for (const requestId of loadedRequests) {
  2024. const capability = this._promisesByRequest.get(requestId);
  2025. this._promisesByRequest.delete(requestId);
  2026. capability.resolve();
  2027. }
  2028. this.msgHandler.send("DocProgress", {
  2029. loaded: this.stream.numChunksLoaded * this.chunkSize,
  2030. total: this.length
  2031. });
  2032. }
  2033. onError(err) {
  2034. this._loadedStreamCapability.reject(err);
  2035. }
  2036. getBeginChunk(begin) {
  2037. return Math.floor(begin / this.chunkSize);
  2038. }
  2039. getEndChunk(end) {
  2040. return Math.floor((end - 1) / this.chunkSize) + 1;
  2041. }
  2042. abort(reason) {
  2043. this.aborted = true;
  2044. this.pdfNetworkStream?.cancelAllRequests(reason);
  2045. for (const capability of this._promisesByRequest.values()) {
  2046. capability.reject(reason);
  2047. }
  2048. }
  2049. }
  2050. ;// CONCATENATED MODULE: ./src/core/colorspace.js
  2051. function resizeRgbImage(src, dest, w1, h1, w2, h2, alpha01) {
  2052. const COMPONENTS = 3;
  2053. alpha01 = alpha01 !== 1 ? 0 : alpha01;
  2054. const xRatio = w1 / w2;
  2055. const yRatio = h1 / h2;
  2056. let newIndex = 0,
  2057. oldIndex;
  2058. const xScaled = new Uint16Array(w2);
  2059. const w1Scanline = w1 * COMPONENTS;
  2060. for (let i = 0; i < w2; i++) {
  2061. xScaled[i] = Math.floor(i * xRatio) * COMPONENTS;
  2062. }
  2063. for (let i = 0; i < h2; i++) {
  2064. const py = Math.floor(i * yRatio) * w1Scanline;
  2065. for (let j = 0; j < w2; j++) {
  2066. oldIndex = py + xScaled[j];
  2067. dest[newIndex++] = src[oldIndex++];
  2068. dest[newIndex++] = src[oldIndex++];
  2069. dest[newIndex++] = src[oldIndex++];
  2070. newIndex += alpha01;
  2071. }
  2072. }
  2073. }
  2074. class ColorSpace {
  2075. constructor(name, numComps) {
  2076. if (this.constructor === ColorSpace) {
  2077. unreachable("Cannot initialize ColorSpace.");
  2078. }
  2079. this.name = name;
  2080. this.numComps = numComps;
  2081. }
  2082. getRgb(src, srcOffset) {
  2083. const rgb = new Uint8ClampedArray(3);
  2084. this.getRgbItem(src, srcOffset, rgb, 0);
  2085. return rgb;
  2086. }
  2087. getRgbItem(src, srcOffset, dest, destOffset) {
  2088. unreachable("Should not call ColorSpace.getRgbItem");
  2089. }
  2090. getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) {
  2091. unreachable("Should not call ColorSpace.getRgbBuffer");
  2092. }
  2093. getOutputLength(inputLength, alpha01) {
  2094. unreachable("Should not call ColorSpace.getOutputLength");
  2095. }
  2096. isPassthrough(bits) {
  2097. return false;
  2098. }
  2099. isDefaultDecode(decodeMap, bpc) {
  2100. return ColorSpace.isDefaultDecode(decodeMap, this.numComps);
  2101. }
  2102. fillRgb(dest, originalWidth, originalHeight, width, height, actualHeight, bpc, comps, alpha01) {
  2103. const count = originalWidth * originalHeight;
  2104. let rgbBuf = null;
  2105. const numComponentColors = 1 << bpc;
  2106. const needsResizing = originalHeight !== height || originalWidth !== width;
  2107. if (this.isPassthrough(bpc)) {
  2108. rgbBuf = comps;
  2109. } else if (this.numComps === 1 && count > numComponentColors && this.name !== "DeviceGray" && this.name !== "DeviceRGB") {
  2110. const allColors = bpc <= 8 ? new Uint8Array(numComponentColors) : new Uint16Array(numComponentColors);
  2111. for (let i = 0; i < numComponentColors; i++) {
  2112. allColors[i] = i;
  2113. }
  2114. const colorMap = new Uint8ClampedArray(numComponentColors * 3);
  2115. this.getRgbBuffer(allColors, 0, numComponentColors, colorMap, 0, bpc, 0);
  2116. if (!needsResizing) {
  2117. let destPos = 0;
  2118. for (let i = 0; i < count; ++i) {
  2119. const key = comps[i] * 3;
  2120. dest[destPos++] = colorMap[key];
  2121. dest[destPos++] = colorMap[key + 1];
  2122. dest[destPos++] = colorMap[key + 2];
  2123. destPos += alpha01;
  2124. }
  2125. } else {
  2126. rgbBuf = new Uint8Array(count * 3);
  2127. let rgbPos = 0;
  2128. for (let i = 0; i < count; ++i) {
  2129. const key = comps[i] * 3;
  2130. rgbBuf[rgbPos++] = colorMap[key];
  2131. rgbBuf[rgbPos++] = colorMap[key + 1];
  2132. rgbBuf[rgbPos++] = colorMap[key + 2];
  2133. }
  2134. }
  2135. } else if (!needsResizing) {
  2136. this.getRgbBuffer(comps, 0, width * actualHeight, dest, 0, bpc, alpha01);
  2137. } else {
  2138. rgbBuf = new Uint8ClampedArray(count * 3);
  2139. this.getRgbBuffer(comps, 0, count, rgbBuf, 0, bpc, 0);
  2140. }
  2141. if (rgbBuf) {
  2142. if (needsResizing) {
  2143. resizeRgbImage(rgbBuf, dest, originalWidth, originalHeight, width, height, alpha01);
  2144. } else {
  2145. let destPos = 0,
  2146. rgbPos = 0;
  2147. for (let i = 0, ii = width * actualHeight; i < ii; i++) {
  2148. dest[destPos++] = rgbBuf[rgbPos++];
  2149. dest[destPos++] = rgbBuf[rgbPos++];
  2150. dest[destPos++] = rgbBuf[rgbPos++];
  2151. destPos += alpha01;
  2152. }
  2153. }
  2154. }
  2155. }
  2156. get usesZeroToOneRange() {
  2157. return shadow(this, "usesZeroToOneRange", true);
  2158. }
  2159. static _cache(cacheKey, xref, localColorSpaceCache, parsedColorSpace) {
  2160. if (!localColorSpaceCache) {
  2161. throw new Error('ColorSpace._cache - expected "localColorSpaceCache" argument.');
  2162. }
  2163. if (!parsedColorSpace) {
  2164. throw new Error('ColorSpace._cache - expected "parsedColorSpace" argument.');
  2165. }
  2166. let csName, csRef;
  2167. if (cacheKey instanceof Ref) {
  2168. csRef = cacheKey;
  2169. cacheKey = xref.fetch(cacheKey);
  2170. }
  2171. if (cacheKey instanceof Name) {
  2172. csName = cacheKey.name;
  2173. }
  2174. if (csName || csRef) {
  2175. localColorSpaceCache.set(csName, csRef, parsedColorSpace);
  2176. }
  2177. }
  2178. static getCached(cacheKey, xref, localColorSpaceCache) {
  2179. if (!localColorSpaceCache) {
  2180. throw new Error('ColorSpace.getCached - expected "localColorSpaceCache" argument.');
  2181. }
  2182. if (cacheKey instanceof Ref) {
  2183. const localColorSpace = localColorSpaceCache.getByRef(cacheKey);
  2184. if (localColorSpace) {
  2185. return localColorSpace;
  2186. }
  2187. try {
  2188. cacheKey = xref.fetch(cacheKey);
  2189. } catch (ex) {
  2190. if (ex instanceof MissingDataException) {
  2191. throw ex;
  2192. }
  2193. }
  2194. }
  2195. if (cacheKey instanceof Name) {
  2196. const localColorSpace = localColorSpaceCache.getByName(cacheKey.name);
  2197. if (localColorSpace) {
  2198. return localColorSpace;
  2199. }
  2200. }
  2201. return null;
  2202. }
  2203. static async parseAsync({
  2204. cs,
  2205. xref,
  2206. resources = null,
  2207. pdfFunctionFactory,
  2208. localColorSpaceCache
  2209. }) {
  2210. const parsedColorSpace = this._parse(cs, xref, resources, pdfFunctionFactory);
  2211. this._cache(cs, xref, localColorSpaceCache, parsedColorSpace);
  2212. return parsedColorSpace;
  2213. }
  2214. static parse({
  2215. cs,
  2216. xref,
  2217. resources = null,
  2218. pdfFunctionFactory,
  2219. localColorSpaceCache
  2220. }) {
  2221. const cachedColorSpace = this.getCached(cs, xref, localColorSpaceCache);
  2222. if (cachedColorSpace) {
  2223. return cachedColorSpace;
  2224. }
  2225. const parsedColorSpace = this._parse(cs, xref, resources, pdfFunctionFactory);
  2226. this._cache(cs, xref, localColorSpaceCache, parsedColorSpace);
  2227. return parsedColorSpace;
  2228. }
  2229. static _parse(cs, xref, resources = null, pdfFunctionFactory) {
  2230. cs = xref.fetchIfRef(cs);
  2231. if (cs instanceof Name) {
  2232. switch (cs.name) {
  2233. case "G":
  2234. case "DeviceGray":
  2235. return this.singletons.gray;
  2236. case "RGB":
  2237. case "DeviceRGB":
  2238. return this.singletons.rgb;
  2239. case "DeviceRGBA":
  2240. return this.singletons.rgba;
  2241. case "CMYK":
  2242. case "DeviceCMYK":
  2243. return this.singletons.cmyk;
  2244. case "Pattern":
  2245. return new PatternCS(null);
  2246. default:
  2247. if (resources instanceof Dict) {
  2248. const colorSpaces = resources.get("ColorSpace");
  2249. if (colorSpaces instanceof Dict) {
  2250. const resourcesCS = colorSpaces.get(cs.name);
  2251. if (resourcesCS) {
  2252. if (resourcesCS instanceof Name) {
  2253. return this._parse(resourcesCS, xref, resources, pdfFunctionFactory);
  2254. }
  2255. cs = resourcesCS;
  2256. break;
  2257. }
  2258. }
  2259. }
  2260. warn(`Unrecognized ColorSpace: ${cs.name}`);
  2261. return this.singletons.gray;
  2262. }
  2263. }
  2264. if (Array.isArray(cs)) {
  2265. const mode = xref.fetchIfRef(cs[0]).name;
  2266. let params, numComps, baseCS, whitePoint, blackPoint, gamma;
  2267. switch (mode) {
  2268. case "G":
  2269. case "DeviceGray":
  2270. return this.singletons.gray;
  2271. case "RGB":
  2272. case "DeviceRGB":
  2273. return this.singletons.rgb;
  2274. case "CMYK":
  2275. case "DeviceCMYK":
  2276. return this.singletons.cmyk;
  2277. case "CalGray":
  2278. params = xref.fetchIfRef(cs[1]);
  2279. whitePoint = params.getArray("WhitePoint");
  2280. blackPoint = params.getArray("BlackPoint");
  2281. gamma = params.get("Gamma");
  2282. return new CalGrayCS(whitePoint, blackPoint, gamma);
  2283. case "CalRGB":
  2284. params = xref.fetchIfRef(cs[1]);
  2285. whitePoint = params.getArray("WhitePoint");
  2286. blackPoint = params.getArray("BlackPoint");
  2287. gamma = params.getArray("Gamma");
  2288. const matrix = params.getArray("Matrix");
  2289. return new CalRGBCS(whitePoint, blackPoint, gamma, matrix);
  2290. case "ICCBased":
  2291. const stream = xref.fetchIfRef(cs[1]);
  2292. const dict = stream.dict;
  2293. numComps = dict.get("N");
  2294. const alt = dict.get("Alternate");
  2295. if (alt) {
  2296. const altCS = this._parse(alt, xref, resources, pdfFunctionFactory);
  2297. if (altCS.numComps === numComps) {
  2298. return altCS;
  2299. }
  2300. warn("ICCBased color space: Ignoring incorrect /Alternate entry.");
  2301. }
  2302. if (numComps === 1) {
  2303. return this.singletons.gray;
  2304. } else if (numComps === 3) {
  2305. return this.singletons.rgb;
  2306. } else if (numComps === 4) {
  2307. return this.singletons.cmyk;
  2308. }
  2309. break;
  2310. case "Pattern":
  2311. baseCS = cs[1] || null;
  2312. if (baseCS) {
  2313. baseCS = this._parse(baseCS, xref, resources, pdfFunctionFactory);
  2314. }
  2315. return new PatternCS(baseCS);
  2316. case "I":
  2317. case "Indexed":
  2318. baseCS = this._parse(cs[1], xref, resources, pdfFunctionFactory);
  2319. const hiVal = xref.fetchIfRef(cs[2]) + 1;
  2320. const lookup = xref.fetchIfRef(cs[3]);
  2321. return new IndexedCS(baseCS, hiVal, lookup);
  2322. case "Separation":
  2323. case "DeviceN":
  2324. const name = xref.fetchIfRef(cs[1]);
  2325. numComps = Array.isArray(name) ? name.length : 1;
  2326. baseCS = this._parse(cs[2], xref, resources, pdfFunctionFactory);
  2327. const tintFn = pdfFunctionFactory.create(cs[3]);
  2328. return new AlternateCS(numComps, baseCS, tintFn);
  2329. case "Lab":
  2330. params = xref.fetchIfRef(cs[1]);
  2331. whitePoint = params.getArray("WhitePoint");
  2332. blackPoint = params.getArray("BlackPoint");
  2333. const range = params.getArray("Range");
  2334. return new LabCS(whitePoint, blackPoint, range);
  2335. default:
  2336. warn(`Unimplemented ColorSpace object: ${mode}`);
  2337. return this.singletons.gray;
  2338. }
  2339. }
  2340. warn(`Unrecognized ColorSpace object: ${cs}`);
  2341. return this.singletons.gray;
  2342. }
  2343. static isDefaultDecode(decode, numComps) {
  2344. if (!Array.isArray(decode)) {
  2345. return true;
  2346. }
  2347. if (numComps * 2 !== decode.length) {
  2348. warn("The decode map is not the correct length");
  2349. return true;
  2350. }
  2351. for (let i = 0, ii = decode.length; i < ii; i += 2) {
  2352. if (decode[i] !== 0 || decode[i + 1] !== 1) {
  2353. return false;
  2354. }
  2355. }
  2356. return true;
  2357. }
  2358. static get singletons() {
  2359. return shadow(this, "singletons", {
  2360. get gray() {
  2361. return shadow(this, "gray", new DeviceGrayCS());
  2362. },
  2363. get rgb() {
  2364. return shadow(this, "rgb", new DeviceRgbCS());
  2365. },
  2366. get rgba() {
  2367. return shadow(this, "rgba", new DeviceRgbaCS());
  2368. },
  2369. get cmyk() {
  2370. return shadow(this, "cmyk", new DeviceCmykCS());
  2371. }
  2372. });
  2373. }
  2374. }
  2375. class AlternateCS extends ColorSpace {
  2376. constructor(numComps, base, tintFn) {
  2377. super("Alternate", numComps);
  2378. this.base = base;
  2379. this.tintFn = tintFn;
  2380. this.tmpBuf = new Float32Array(base.numComps);
  2381. }
  2382. getRgbItem(src, srcOffset, dest, destOffset) {
  2383. const tmpBuf = this.tmpBuf;
  2384. this.tintFn(src, srcOffset, tmpBuf, 0);
  2385. this.base.getRgbItem(tmpBuf, 0, dest, destOffset);
  2386. }
  2387. getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) {
  2388. const tintFn = this.tintFn;
  2389. const base = this.base;
  2390. const scale = 1 / ((1 << bits) - 1);
  2391. const baseNumComps = base.numComps;
  2392. const usesZeroToOneRange = base.usesZeroToOneRange;
  2393. const isPassthrough = (base.isPassthrough(8) || !usesZeroToOneRange) && alpha01 === 0;
  2394. let pos = isPassthrough ? destOffset : 0;
  2395. const baseBuf = isPassthrough ? dest : new Uint8ClampedArray(baseNumComps * count);
  2396. const numComps = this.numComps;
  2397. const scaled = new Float32Array(numComps);
  2398. const tinted = new Float32Array(baseNumComps);
  2399. let i, j;
  2400. for (i = 0; i < count; i++) {
  2401. for (j = 0; j < numComps; j++) {
  2402. scaled[j] = src[srcOffset++] * scale;
  2403. }
  2404. tintFn(scaled, 0, tinted, 0);
  2405. if (usesZeroToOneRange) {
  2406. for (j = 0; j < baseNumComps; j++) {
  2407. baseBuf[pos++] = tinted[j] * 255;
  2408. }
  2409. } else {
  2410. base.getRgbItem(tinted, 0, baseBuf, pos);
  2411. pos += baseNumComps;
  2412. }
  2413. }
  2414. if (!isPassthrough) {
  2415. base.getRgbBuffer(baseBuf, 0, count, dest, destOffset, 8, alpha01);
  2416. }
  2417. }
  2418. getOutputLength(inputLength, alpha01) {
  2419. return this.base.getOutputLength(inputLength * this.base.numComps / this.numComps, alpha01);
  2420. }
  2421. }
  2422. class PatternCS extends ColorSpace {
  2423. constructor(baseCS) {
  2424. super("Pattern", null);
  2425. this.base = baseCS;
  2426. }
  2427. isDefaultDecode(decodeMap, bpc) {
  2428. unreachable("Should not call PatternCS.isDefaultDecode");
  2429. }
  2430. }
  2431. class IndexedCS extends ColorSpace {
  2432. constructor(base, highVal, lookup) {
  2433. super("Indexed", 1);
  2434. this.base = base;
  2435. this.highVal = highVal;
  2436. const length = base.numComps * highVal;
  2437. this.lookup = new Uint8Array(length);
  2438. if (lookup instanceof BaseStream) {
  2439. const bytes = lookup.getBytes(length);
  2440. this.lookup.set(bytes);
  2441. } else if (typeof lookup === "string") {
  2442. for (let i = 0; i < length; ++i) {
  2443. this.lookup[i] = lookup.charCodeAt(i) & 0xff;
  2444. }
  2445. } else {
  2446. throw new FormatError(`IndexedCS - unrecognized lookup table: ${lookup}`);
  2447. }
  2448. }
  2449. getRgbItem(src, srcOffset, dest, destOffset) {
  2450. const numComps = this.base.numComps;
  2451. const start = src[srcOffset] * numComps;
  2452. this.base.getRgbBuffer(this.lookup, start, 1, dest, destOffset, 8, 0);
  2453. }
  2454. getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) {
  2455. const base = this.base;
  2456. const numComps = base.numComps;
  2457. const outputDelta = base.getOutputLength(numComps, alpha01);
  2458. const lookup = this.lookup;
  2459. for (let i = 0; i < count; ++i) {
  2460. const lookupPos = src[srcOffset++] * numComps;
  2461. base.getRgbBuffer(lookup, lookupPos, 1, dest, destOffset, 8, alpha01);
  2462. destOffset += outputDelta;
  2463. }
  2464. }
  2465. getOutputLength(inputLength, alpha01) {
  2466. return this.base.getOutputLength(inputLength * this.base.numComps, alpha01);
  2467. }
  2468. isDefaultDecode(decodeMap, bpc) {
  2469. if (!Array.isArray(decodeMap)) {
  2470. return true;
  2471. }
  2472. if (decodeMap.length !== 2) {
  2473. warn("Decode map length is not correct");
  2474. return true;
  2475. }
  2476. if (!Number.isInteger(bpc) || bpc < 1) {
  2477. warn("Bits per component is not correct");
  2478. return true;
  2479. }
  2480. return decodeMap[0] === 0 && decodeMap[1] === (1 << bpc) - 1;
  2481. }
  2482. }
  2483. class DeviceGrayCS extends ColorSpace {
  2484. constructor() {
  2485. super("DeviceGray", 1);
  2486. }
  2487. getRgbItem(src, srcOffset, dest, destOffset) {
  2488. const c = src[srcOffset] * 255;
  2489. dest[destOffset] = dest[destOffset + 1] = dest[destOffset + 2] = c;
  2490. }
  2491. getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) {
  2492. const scale = 255 / ((1 << bits) - 1);
  2493. let j = srcOffset,
  2494. q = destOffset;
  2495. for (let i = 0; i < count; ++i) {
  2496. const c = scale * src[j++];
  2497. dest[q++] = c;
  2498. dest[q++] = c;
  2499. dest[q++] = c;
  2500. q += alpha01;
  2501. }
  2502. }
  2503. getOutputLength(inputLength, alpha01) {
  2504. return inputLength * (3 + alpha01);
  2505. }
  2506. }
  2507. class DeviceRgbCS extends ColorSpace {
  2508. constructor() {
  2509. super("DeviceRGB", 3);
  2510. }
  2511. getRgbItem(src, srcOffset, dest, destOffset) {
  2512. dest[destOffset] = src[srcOffset] * 255;
  2513. dest[destOffset + 1] = src[srcOffset + 1] * 255;
  2514. dest[destOffset + 2] = src[srcOffset + 2] * 255;
  2515. }
  2516. getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) {
  2517. if (bits === 8 && alpha01 === 0) {
  2518. dest.set(src.subarray(srcOffset, srcOffset + count * 3), destOffset);
  2519. return;
  2520. }
  2521. const scale = 255 / ((1 << bits) - 1);
  2522. let j = srcOffset,
  2523. q = destOffset;
  2524. for (let i = 0; i < count; ++i) {
  2525. dest[q++] = scale * src[j++];
  2526. dest[q++] = scale * src[j++];
  2527. dest[q++] = scale * src[j++];
  2528. q += alpha01;
  2529. }
  2530. }
  2531. getOutputLength(inputLength, alpha01) {
  2532. return inputLength * (3 + alpha01) / 3 | 0;
  2533. }
  2534. isPassthrough(bits) {
  2535. return bits === 8;
  2536. }
  2537. }
  2538. class DeviceRgbaCS extends ColorSpace {
  2539. constructor() {
  2540. super("DeviceRGBA", 4);
  2541. }
  2542. getOutputLength(inputLength, _alpha01) {
  2543. return inputLength * 4;
  2544. }
  2545. isPassthrough(bits) {
  2546. return bits === 8;
  2547. }
  2548. }
  2549. class DeviceCmykCS extends ColorSpace {
  2550. constructor() {
  2551. super("DeviceCMYK", 4);
  2552. }
  2553. #toRgb(src, srcOffset, srcScale, dest, destOffset) {
  2554. const c = src[srcOffset] * srcScale;
  2555. const m = src[srcOffset + 1] * srcScale;
  2556. const y = src[srcOffset + 2] * srcScale;
  2557. const k = src[srcOffset + 3] * srcScale;
  2558. 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);
  2559. 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);
  2560. 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);
  2561. }
  2562. getRgbItem(src, srcOffset, dest, destOffset) {
  2563. this.#toRgb(src, srcOffset, 1, dest, destOffset);
  2564. }
  2565. getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) {
  2566. const scale = 1 / ((1 << bits) - 1);
  2567. for (let i = 0; i < count; i++) {
  2568. this.#toRgb(src, srcOffset, scale, dest, destOffset);
  2569. srcOffset += 4;
  2570. destOffset += 3 + alpha01;
  2571. }
  2572. }
  2573. getOutputLength(inputLength, alpha01) {
  2574. return inputLength / 4 * (3 + alpha01) | 0;
  2575. }
  2576. }
  2577. class CalGrayCS extends ColorSpace {
  2578. constructor(whitePoint, blackPoint, gamma) {
  2579. super("CalGray", 1);
  2580. if (!whitePoint) {
  2581. throw new FormatError("WhitePoint missing - required for color space CalGray");
  2582. }
  2583. [this.XW, this.YW, this.ZW] = whitePoint;
  2584. [this.XB, this.YB, this.ZB] = blackPoint || [0, 0, 0];
  2585. this.G = gamma || 1;
  2586. if (this.XW < 0 || this.ZW < 0 || this.YW !== 1) {
  2587. throw new FormatError(`Invalid WhitePoint components for ${this.name}, no fallback available`);
  2588. }
  2589. if (this.XB < 0 || this.YB < 0 || this.ZB < 0) {
  2590. info(`Invalid BlackPoint for ${this.name}, falling back to default.`);
  2591. this.XB = this.YB = this.ZB = 0;
  2592. }
  2593. if (this.XB !== 0 || this.YB !== 0 || this.ZB !== 0) {
  2594. warn(`${this.name}, BlackPoint: XB: ${this.XB}, YB: ${this.YB}, ` + `ZB: ${this.ZB}, only default values are supported.`);
  2595. }
  2596. if (this.G < 1) {
  2597. info(`Invalid Gamma: ${this.G} for ${this.name}, falling back to default.`);
  2598. this.G = 1;
  2599. }
  2600. }
  2601. #toRgb(src, srcOffset, dest, destOffset, scale) {
  2602. const A = src[srcOffset] * scale;
  2603. const AG = A ** this.G;
  2604. const L = this.YW * AG;
  2605. const val = Math.max(295.8 * L ** 0.3333333333333333 - 40.8, 0);
  2606. dest[destOffset] = val;
  2607. dest[destOffset + 1] = val;
  2608. dest[destOffset + 2] = val;
  2609. }
  2610. getRgbItem(src, srcOffset, dest, destOffset) {
  2611. this.#toRgb(src, srcOffset, dest, destOffset, 1);
  2612. }
  2613. getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) {
  2614. const scale = 1 / ((1 << bits) - 1);
  2615. for (let i = 0; i < count; ++i) {
  2616. this.#toRgb(src, srcOffset, dest, destOffset, scale);
  2617. srcOffset += 1;
  2618. destOffset += 3 + alpha01;
  2619. }
  2620. }
  2621. getOutputLength(inputLength, alpha01) {
  2622. return inputLength * (3 + alpha01);
  2623. }
  2624. }
  2625. class CalRGBCS extends ColorSpace {
  2626. static #BRADFORD_SCALE_MATRIX = new Float32Array([0.8951, 0.2664, -0.1614, -0.7502, 1.7135, 0.0367, 0.0389, -0.0685, 1.0296]);
  2627. 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]);
  2628. 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]);
  2629. static #FLAT_WHITEPOINT_MATRIX = new Float32Array([1, 1, 1]);
  2630. static #tempNormalizeMatrix = new Float32Array(3);
  2631. static #tempConvertMatrix1 = new Float32Array(3);
  2632. static #tempConvertMatrix2 = new Float32Array(3);
  2633. static #DECODE_L_CONSTANT = ((8 + 16) / 116) ** 3 / 8.0;
  2634. constructor(whitePoint, blackPoint, gamma, matrix) {
  2635. super("CalRGB", 3);
  2636. if (!whitePoint) {
  2637. throw new FormatError("WhitePoint missing - required for color space CalRGB");
  2638. }
  2639. const [XW, YW, ZW] = this.whitePoint = whitePoint;
  2640. const [XB, YB, ZB] = this.blackPoint = blackPoint || new Float32Array(3);
  2641. [this.GR, this.GG, this.GB] = gamma || new Float32Array([1, 1, 1]);
  2642. [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]);
  2643. if (XW < 0 || ZW < 0 || YW !== 1) {
  2644. throw new FormatError(`Invalid WhitePoint components for ${this.name}, no fallback available`);
  2645. }
  2646. if (XB < 0 || YB < 0 || ZB < 0) {
  2647. info(`Invalid BlackPoint for ${this.name} [${XB}, ${YB}, ${ZB}], ` + "falling back to default.");
  2648. this.blackPoint = new Float32Array(3);
  2649. }
  2650. if (this.GR < 0 || this.GG < 0 || this.GB < 0) {
  2651. info(`Invalid Gamma [${this.GR}, ${this.GG}, ${this.GB}] for ` + `${this.name}, falling back to default.`);
  2652. this.GR = this.GG = this.GB = 1;
  2653. }
  2654. }
  2655. #matrixProduct(a, b, result) {
  2656. result[0] = a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
  2657. result[1] = a[3] * b[0] + a[4] * b[1] + a[5] * b[2];
  2658. result[2] = a[6] * b[0] + a[7] * b[1] + a[8] * b[2];
  2659. }
  2660. #toFlat(sourceWhitePoint, LMS, result) {
  2661. result[0] = LMS[0] * 1 / sourceWhitePoint[0];
  2662. result[1] = LMS[1] * 1 / sourceWhitePoint[1];
  2663. result[2] = LMS[2] * 1 / sourceWhitePoint[2];
  2664. }
  2665. #toD65(sourceWhitePoint, LMS, result) {
  2666. const D65X = 0.95047;
  2667. const D65Y = 1;
  2668. const D65Z = 1.08883;
  2669. result[0] = LMS[0] * D65X / sourceWhitePoint[0];
  2670. result[1] = LMS[1] * D65Y / sourceWhitePoint[1];
  2671. result[2] = LMS[2] * D65Z / sourceWhitePoint[2];
  2672. }
  2673. #sRGBTransferFunction(color) {
  2674. if (color <= 0.0031308) {
  2675. return this.#adjustToRange(0, 1, 12.92 * color);
  2676. }
  2677. if (color >= 0.99554525) {
  2678. return 1;
  2679. }
  2680. return this.#adjustToRange(0, 1, (1 + 0.055) * color ** (1 / 2.4) - 0.055);
  2681. }
  2682. #adjustToRange(min, max, value) {
  2683. return Math.max(min, Math.min(max, value));
  2684. }
  2685. #decodeL(L) {
  2686. if (L < 0) {
  2687. return -this.#decodeL(-L);
  2688. }
  2689. if (L > 8.0) {
  2690. return ((L + 16) / 116) ** 3;
  2691. }
  2692. return L * CalRGBCS.#DECODE_L_CONSTANT;
  2693. }
  2694. #compensateBlackPoint(sourceBlackPoint, XYZ_Flat, result) {
  2695. if (sourceBlackPoint[0] === 0 && sourceBlackPoint[1] === 0 && sourceBlackPoint[2] === 0) {
  2696. result[0] = XYZ_Flat[0];
  2697. result[1] = XYZ_Flat[1];
  2698. result[2] = XYZ_Flat[2];
  2699. return;
  2700. }
  2701. const zeroDecodeL = this.#decodeL(0);
  2702. const X_DST = zeroDecodeL;
  2703. const X_SRC = this.#decodeL(sourceBlackPoint[0]);
  2704. const Y_DST = zeroDecodeL;
  2705. const Y_SRC = this.#decodeL(sourceBlackPoint[1]);
  2706. const Z_DST = zeroDecodeL;
  2707. const Z_SRC = this.#decodeL(sourceBlackPoint[2]);
  2708. const X_Scale = (1 - X_DST) / (1 - X_SRC);
  2709. const X_Offset = 1 - X_Scale;
  2710. const Y_Scale = (1 - Y_DST) / (1 - Y_SRC);
  2711. const Y_Offset = 1 - Y_Scale;
  2712. const Z_Scale = (1 - Z_DST) / (1 - Z_SRC);
  2713. const Z_Offset = 1 - Z_Scale;
  2714. result[0] = XYZ_Flat[0] * X_Scale + X_Offset;
  2715. result[1] = XYZ_Flat[1] * Y_Scale + Y_Offset;
  2716. result[2] = XYZ_Flat[2] * Z_Scale + Z_Offset;
  2717. }
  2718. #normalizeWhitePointToFlat(sourceWhitePoint, XYZ_In, result) {
  2719. if (sourceWhitePoint[0] === 1 && sourceWhitePoint[2] === 1) {
  2720. result[0] = XYZ_In[0];
  2721. result[1] = XYZ_In[1];
  2722. result[2] = XYZ_In[2];
  2723. return;
  2724. }
  2725. const LMS = result;
  2726. this.#matrixProduct(CalRGBCS.#BRADFORD_SCALE_MATRIX, XYZ_In, LMS);
  2727. const LMS_Flat = CalRGBCS.#tempNormalizeMatrix;
  2728. this.#toFlat(sourceWhitePoint, LMS, LMS_Flat);
  2729. this.#matrixProduct(CalRGBCS.#BRADFORD_SCALE_INVERSE_MATRIX, LMS_Flat, result);
  2730. }
  2731. #normalizeWhitePointToD65(sourceWhitePoint, XYZ_In, result) {
  2732. const LMS = result;
  2733. this.#matrixProduct(CalRGBCS.#BRADFORD_SCALE_MATRIX, XYZ_In, LMS);
  2734. const LMS_D65 = CalRGBCS.#tempNormalizeMatrix;
  2735. this.#toD65(sourceWhitePoint, LMS, LMS_D65);
  2736. this.#matrixProduct(CalRGBCS.#BRADFORD_SCALE_INVERSE_MATRIX, LMS_D65, result);
  2737. }
  2738. #toRgb(src, srcOffset, dest, destOffset, scale) {
  2739. const A = this.#adjustToRange(0, 1, src[srcOffset] * scale);
  2740. const B = this.#adjustToRange(0, 1, src[srcOffset + 1] * scale);
  2741. const C = this.#adjustToRange(0, 1, src[srcOffset + 2] * scale);
  2742. const AGR = A === 1 ? 1 : A ** this.GR;
  2743. const BGG = B === 1 ? 1 : B ** this.GG;
  2744. const CGB = C === 1 ? 1 : C ** this.GB;
  2745. const X = this.MXA * AGR + this.MXB * BGG + this.MXC * CGB;
  2746. const Y = this.MYA * AGR + this.MYB * BGG + this.MYC * CGB;
  2747. const Z = this.MZA * AGR + this.MZB * BGG + this.MZC * CGB;
  2748. const XYZ = CalRGBCS.#tempConvertMatrix1;
  2749. XYZ[0] = X;
  2750. XYZ[1] = Y;
  2751. XYZ[2] = Z;
  2752. const XYZ_Flat = CalRGBCS.#tempConvertMatrix2;
  2753. this.#normalizeWhitePointToFlat(this.whitePoint, XYZ, XYZ_Flat);
  2754. const XYZ_Black = CalRGBCS.#tempConvertMatrix1;
  2755. this.#compensateBlackPoint(this.blackPoint, XYZ_Flat, XYZ_Black);
  2756. const XYZ_D65 = CalRGBCS.#tempConvertMatrix2;
  2757. this.#normalizeWhitePointToD65(CalRGBCS.#FLAT_WHITEPOINT_MATRIX, XYZ_Black, XYZ_D65);
  2758. const SRGB = CalRGBCS.#tempConvertMatrix1;
  2759. this.#matrixProduct(CalRGBCS.#SRGB_D65_XYZ_TO_RGB_MATRIX, XYZ_D65, SRGB);
  2760. dest[destOffset] = this.#sRGBTransferFunction(SRGB[0]) * 255;
  2761. dest[destOffset + 1] = this.#sRGBTransferFunction(SRGB[1]) * 255;
  2762. dest[destOffset + 2] = this.#sRGBTransferFunction(SRGB[2]) * 255;
  2763. }
  2764. getRgbItem(src, srcOffset, dest, destOffset) {
  2765. this.#toRgb(src, srcOffset, dest, destOffset, 1);
  2766. }
  2767. getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) {
  2768. const scale = 1 / ((1 << bits) - 1);
  2769. for (let i = 0; i < count; ++i) {
  2770. this.#toRgb(src, srcOffset, dest, destOffset, scale);
  2771. srcOffset += 3;
  2772. destOffset += 3 + alpha01;
  2773. }
  2774. }
  2775. getOutputLength(inputLength, alpha01) {
  2776. return inputLength * (3 + alpha01) / 3 | 0;
  2777. }
  2778. }
  2779. class LabCS extends ColorSpace {
  2780. constructor(whitePoint, blackPoint, range) {
  2781. super("Lab", 3);
  2782. if (!whitePoint) {
  2783. throw new FormatError("WhitePoint missing - required for color space Lab");
  2784. }
  2785. [this.XW, this.YW, this.ZW] = whitePoint;
  2786. [this.amin, this.amax, this.bmin, this.bmax] = range || [-100, 100, -100, 100];
  2787. [this.XB, this.YB, this.ZB] = blackPoint || [0, 0, 0];
  2788. if (this.XW < 0 || this.ZW < 0 || this.YW !== 1) {
  2789. throw new FormatError("Invalid WhitePoint components, no fallback available");
  2790. }
  2791. if (this.XB < 0 || this.YB < 0 || this.ZB < 0) {
  2792. info("Invalid BlackPoint, falling back to default");
  2793. this.XB = this.YB = this.ZB = 0;
  2794. }
  2795. if (this.amin > this.amax || this.bmin > this.bmax) {
  2796. info("Invalid Range, falling back to defaults");
  2797. this.amin = -100;
  2798. this.amax = 100;
  2799. this.bmin = -100;
  2800. this.bmax = 100;
  2801. }
  2802. }
  2803. #fn_g(x) {
  2804. return x >= 6 / 29 ? x ** 3 : 108 / 841 * (x - 4 / 29);
  2805. }
  2806. #decode(value, high1, low2, high2) {
  2807. return low2 + value * (high2 - low2) / high1;
  2808. }
  2809. #toRgb(src, srcOffset, maxVal, dest, destOffset) {
  2810. let Ls = src[srcOffset];
  2811. let as = src[srcOffset + 1];
  2812. let bs = src[srcOffset + 2];
  2813. if (maxVal !== false) {
  2814. Ls = this.#decode(Ls, maxVal, 0, 100);
  2815. as = this.#decode(as, maxVal, this.amin, this.amax);
  2816. bs = this.#decode(bs, maxVal, this.bmin, this.bmax);
  2817. }
  2818. if (as > this.amax) {
  2819. as = this.amax;
  2820. } else if (as < this.amin) {
  2821. as = this.amin;
  2822. }
  2823. if (bs > this.bmax) {
  2824. bs = this.bmax;
  2825. } else if (bs < this.bmin) {
  2826. bs = this.bmin;
  2827. }
  2828. const M = (Ls + 16) / 116;
  2829. const L = M + as / 500;
  2830. const N = M - bs / 200;
  2831. const X = this.XW * this.#fn_g(L);
  2832. const Y = this.YW * this.#fn_g(M);
  2833. const Z = this.ZW * this.#fn_g(N);
  2834. let r, g, b;
  2835. if (this.ZW < 1) {
  2836. r = X * 3.1339 + Y * -1.617 + Z * -0.4906;
  2837. g = X * -0.9785 + Y * 1.916 + Z * 0.0333;
  2838. b = X * 0.072 + Y * -0.229 + Z * 1.4057;
  2839. } else {
  2840. r = X * 3.2406 + Y * -1.5372 + Z * -0.4986;
  2841. g = X * -0.9689 + Y * 1.8758 + Z * 0.0415;
  2842. b = X * 0.0557 + Y * -0.204 + Z * 1.057;
  2843. }
  2844. dest[destOffset] = Math.sqrt(r) * 255;
  2845. dest[destOffset + 1] = Math.sqrt(g) * 255;
  2846. dest[destOffset + 2] = Math.sqrt(b) * 255;
  2847. }
  2848. getRgbItem(src, srcOffset, dest, destOffset) {
  2849. this.#toRgb(src, srcOffset, false, dest, destOffset);
  2850. }
  2851. getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) {
  2852. const maxVal = (1 << bits) - 1;
  2853. for (let i = 0; i < count; i++) {
  2854. this.#toRgb(src, srcOffset, maxVal, dest, destOffset);
  2855. srcOffset += 3;
  2856. destOffset += 3 + alpha01;
  2857. }
  2858. }
  2859. getOutputLength(inputLength, alpha01) {
  2860. return inputLength * (3 + alpha01) / 3 | 0;
  2861. }
  2862. isDefaultDecode(decodeMap, bpc) {
  2863. return true;
  2864. }
  2865. get usesZeroToOneRange() {
  2866. return shadow(this, "usesZeroToOneRange", false);
  2867. }
  2868. }
  2869. ;// CONCATENATED MODULE: ./src/core/binary_cmap.js
  2870. function hexToInt(a, size) {
  2871. let n = 0;
  2872. for (let i = 0; i <= size; i++) {
  2873. n = n << 8 | a[i];
  2874. }
  2875. return n >>> 0;
  2876. }
  2877. function hexToStr(a, size) {
  2878. if (size === 1) {
  2879. return String.fromCharCode(a[0], a[1]);
  2880. }
  2881. if (size === 3) {
  2882. return String.fromCharCode(a[0], a[1], a[2], a[3]);
  2883. }
  2884. return String.fromCharCode(...a.subarray(0, size + 1));
  2885. }
  2886. function addHex(a, b, size) {
  2887. let c = 0;
  2888. for (let i = size; i >= 0; i--) {
  2889. c += a[i] + b[i];
  2890. a[i] = c & 255;
  2891. c >>= 8;
  2892. }
  2893. }
  2894. function incHex(a, size) {
  2895. let c = 1;
  2896. for (let i = size; i >= 0 && c > 0; i--) {
  2897. c += a[i];
  2898. a[i] = c & 255;
  2899. c >>= 8;
  2900. }
  2901. }
  2902. const MAX_NUM_SIZE = 16;
  2903. const MAX_ENCODED_NUM_SIZE = 19;
  2904. class BinaryCMapStream {
  2905. constructor(data) {
  2906. this.buffer = data;
  2907. this.pos = 0;
  2908. this.end = data.length;
  2909. this.tmpBuf = new Uint8Array(MAX_ENCODED_NUM_SIZE);
  2910. }
  2911. readByte() {
  2912. if (this.pos >= this.end) {
  2913. return -1;
  2914. }
  2915. return this.buffer[this.pos++];
  2916. }
  2917. readNumber() {
  2918. let n = 0;
  2919. let last;
  2920. do {
  2921. const b = this.readByte();
  2922. if (b < 0) {
  2923. throw new FormatError("unexpected EOF in bcmap");
  2924. }
  2925. last = !(b & 0x80);
  2926. n = n << 7 | b & 0x7f;
  2927. } while (!last);
  2928. return n;
  2929. }
  2930. readSigned() {
  2931. const n = this.readNumber();
  2932. return n & 1 ? ~(n >>> 1) : n >>> 1;
  2933. }
  2934. readHex(num, size) {
  2935. num.set(this.buffer.subarray(this.pos, this.pos + size + 1));
  2936. this.pos += size + 1;
  2937. }
  2938. readHexNumber(num, size) {
  2939. let last;
  2940. const stack = this.tmpBuf;
  2941. let sp = 0;
  2942. do {
  2943. const b = this.readByte();
  2944. if (b < 0) {
  2945. throw new FormatError("unexpected EOF in bcmap");
  2946. }
  2947. last = !(b & 0x80);
  2948. stack[sp++] = b & 0x7f;
  2949. } while (!last);
  2950. let i = size,
  2951. buffer = 0,
  2952. bufferSize = 0;
  2953. while (i >= 0) {
  2954. while (bufferSize < 8 && stack.length > 0) {
  2955. buffer |= stack[--sp] << bufferSize;
  2956. bufferSize += 7;
  2957. }
  2958. num[i] = buffer & 255;
  2959. i--;
  2960. buffer >>= 8;
  2961. bufferSize -= 8;
  2962. }
  2963. }
  2964. readHexSigned(num, size) {
  2965. this.readHexNumber(num, size);
  2966. const sign = num[size] & 1 ? 255 : 0;
  2967. let c = 0;
  2968. for (let i = 0; i <= size; i++) {
  2969. c = (c & 1) << 8 | num[i];
  2970. num[i] = c >> 1 ^ sign;
  2971. }
  2972. }
  2973. readString() {
  2974. const len = this.readNumber(),
  2975. buf = new Array(len);
  2976. for (let i = 0; i < len; i++) {
  2977. buf[i] = this.readNumber();
  2978. }
  2979. return String.fromCharCode(...buf);
  2980. }
  2981. }
  2982. class BinaryCMapReader {
  2983. async process(data, cMap, extend) {
  2984. const stream = new BinaryCMapStream(data);
  2985. const header = stream.readByte();
  2986. cMap.vertical = !!(header & 1);
  2987. let useCMap = null;
  2988. const start = new Uint8Array(MAX_NUM_SIZE);
  2989. const end = new Uint8Array(MAX_NUM_SIZE);
  2990. const char = new Uint8Array(MAX_NUM_SIZE);
  2991. const charCode = new Uint8Array(MAX_NUM_SIZE);
  2992. const tmp = new Uint8Array(MAX_NUM_SIZE);
  2993. let code;
  2994. let b;
  2995. while ((b = stream.readByte()) >= 0) {
  2996. const type = b >> 5;
  2997. if (type === 7) {
  2998. switch (b & 0x1f) {
  2999. case 0:
  3000. stream.readString();
  3001. break;
  3002. case 1:
  3003. useCMap = stream.readString();
  3004. break;
  3005. }
  3006. continue;
  3007. }
  3008. const sequence = !!(b & 0x10);
  3009. const dataSize = b & 15;
  3010. if (dataSize + 1 > MAX_NUM_SIZE) {
  3011. throw new Error("BinaryCMapReader.process: Invalid dataSize.");
  3012. }
  3013. const ucs2DataSize = 1;
  3014. const subitemsCount = stream.readNumber();
  3015. switch (type) {
  3016. case 0:
  3017. stream.readHex(start, dataSize);
  3018. stream.readHexNumber(end, dataSize);
  3019. addHex(end, start, dataSize);
  3020. cMap.addCodespaceRange(dataSize + 1, hexToInt(start, dataSize), hexToInt(end, dataSize));
  3021. for (let i = 1; i < subitemsCount; i++) {
  3022. incHex(end, dataSize);
  3023. stream.readHexNumber(start, dataSize);
  3024. addHex(start, end, dataSize);
  3025. stream.readHexNumber(end, dataSize);
  3026. addHex(end, start, dataSize);
  3027. cMap.addCodespaceRange(dataSize + 1, hexToInt(start, dataSize), hexToInt(end, dataSize));
  3028. }
  3029. break;
  3030. case 1:
  3031. stream.readHex(start, dataSize);
  3032. stream.readHexNumber(end, dataSize);
  3033. addHex(end, start, dataSize);
  3034. stream.readNumber();
  3035. for (let i = 1; i < subitemsCount; i++) {
  3036. incHex(end, dataSize);
  3037. stream.readHexNumber(start, dataSize);
  3038. addHex(start, end, dataSize);
  3039. stream.readHexNumber(end, dataSize);
  3040. addHex(end, start, dataSize);
  3041. stream.readNumber();
  3042. }
  3043. break;
  3044. case 2:
  3045. stream.readHex(char, dataSize);
  3046. code = stream.readNumber();
  3047. cMap.mapOne(hexToInt(char, dataSize), code);
  3048. for (let i = 1; i < subitemsCount; i++) {
  3049. incHex(char, dataSize);
  3050. if (!sequence) {
  3051. stream.readHexNumber(tmp, dataSize);
  3052. addHex(char, tmp, dataSize);
  3053. }
  3054. code = stream.readSigned() + (code + 1);
  3055. cMap.mapOne(hexToInt(char, dataSize), code);
  3056. }
  3057. break;
  3058. case 3:
  3059. stream.readHex(start, dataSize);
  3060. stream.readHexNumber(end, dataSize);
  3061. addHex(end, start, dataSize);
  3062. code = stream.readNumber();
  3063. cMap.mapCidRange(hexToInt(start, dataSize), hexToInt(end, dataSize), code);
  3064. for (let i = 1; i < subitemsCount; i++) {
  3065. incHex(end, dataSize);
  3066. if (!sequence) {
  3067. stream.readHexNumber(start, dataSize);
  3068. addHex(start, end, dataSize);
  3069. } else {
  3070. start.set(end);
  3071. }
  3072. stream.readHexNumber(end, dataSize);
  3073. addHex(end, start, dataSize);
  3074. code = stream.readNumber();
  3075. cMap.mapCidRange(hexToInt(start, dataSize), hexToInt(end, dataSize), code);
  3076. }
  3077. break;
  3078. case 4:
  3079. stream.readHex(char, ucs2DataSize);
  3080. stream.readHex(charCode, dataSize);
  3081. cMap.mapOne(hexToInt(char, ucs2DataSize), hexToStr(charCode, dataSize));
  3082. for (let i = 1; i < subitemsCount; i++) {
  3083. incHex(char, ucs2DataSize);
  3084. if (!sequence) {
  3085. stream.readHexNumber(tmp, ucs2DataSize);
  3086. addHex(char, tmp, ucs2DataSize);
  3087. }
  3088. incHex(charCode, dataSize);
  3089. stream.readHexSigned(tmp, dataSize);
  3090. addHex(charCode, tmp, dataSize);
  3091. cMap.mapOne(hexToInt(char, ucs2DataSize), hexToStr(charCode, dataSize));
  3092. }
  3093. break;
  3094. case 5:
  3095. stream.readHex(start, ucs2DataSize);
  3096. stream.readHexNumber(end, ucs2DataSize);
  3097. addHex(end, start, ucs2DataSize);
  3098. stream.readHex(charCode, dataSize);
  3099. cMap.mapBfRange(hexToInt(start, ucs2DataSize), hexToInt(end, ucs2DataSize), hexToStr(charCode, dataSize));
  3100. for (let i = 1; i < subitemsCount; i++) {
  3101. incHex(end, ucs2DataSize);
  3102. if (!sequence) {
  3103. stream.readHexNumber(start, ucs2DataSize);
  3104. addHex(start, end, ucs2DataSize);
  3105. } else {
  3106. start.set(end);
  3107. }
  3108. stream.readHexNumber(end, ucs2DataSize);
  3109. addHex(end, start, ucs2DataSize);
  3110. stream.readHex(charCode, dataSize);
  3111. cMap.mapBfRange(hexToInt(start, ucs2DataSize), hexToInt(end, ucs2DataSize), hexToStr(charCode, dataSize));
  3112. }
  3113. break;
  3114. default:
  3115. throw new Error(`BinaryCMapReader.process - unknown type: ${type}`);
  3116. }
  3117. }
  3118. if (useCMap) {
  3119. return extend(useCMap);
  3120. }
  3121. return cMap;
  3122. }
  3123. }
  3124. ;// CONCATENATED MODULE: ./src/core/decode_stream.js
  3125. const emptyBuffer = new Uint8Array(0);
  3126. class DecodeStream extends BaseStream {
  3127. constructor(maybeMinBufferLength) {
  3128. super();
  3129. this._rawMinBufferLength = maybeMinBufferLength || 0;
  3130. this.pos = 0;
  3131. this.bufferLength = 0;
  3132. this.eof = false;
  3133. this.buffer = emptyBuffer;
  3134. this.minBufferLength = 512;
  3135. if (maybeMinBufferLength) {
  3136. while (this.minBufferLength < maybeMinBufferLength) {
  3137. this.minBufferLength *= 2;
  3138. }
  3139. }
  3140. }
  3141. get isEmpty() {
  3142. while (!this.eof && this.bufferLength === 0) {
  3143. this.readBlock();
  3144. }
  3145. return this.bufferLength === 0;
  3146. }
  3147. ensureBuffer(requested) {
  3148. const buffer = this.buffer;
  3149. if (requested <= buffer.byteLength) {
  3150. return buffer;
  3151. }
  3152. let size = this.minBufferLength;
  3153. while (size < requested) {
  3154. size *= 2;
  3155. }
  3156. const buffer2 = new Uint8Array(size);
  3157. buffer2.set(buffer);
  3158. return this.buffer = buffer2;
  3159. }
  3160. getByte() {
  3161. const pos = this.pos;
  3162. while (this.bufferLength <= pos) {
  3163. if (this.eof) {
  3164. return -1;
  3165. }
  3166. this.readBlock();
  3167. }
  3168. return this.buffer[this.pos++];
  3169. }
  3170. getBytes(length, decoderOptions = null) {
  3171. const pos = this.pos;
  3172. let end;
  3173. if (length) {
  3174. this.ensureBuffer(pos + length);
  3175. end = pos + length;
  3176. while (!this.eof && this.bufferLength < end) {
  3177. this.readBlock(decoderOptions);
  3178. }
  3179. const bufEnd = this.bufferLength;
  3180. if (end > bufEnd) {
  3181. end = bufEnd;
  3182. }
  3183. } else {
  3184. while (!this.eof) {
  3185. this.readBlock(decoderOptions);
  3186. }
  3187. end = this.bufferLength;
  3188. }
  3189. this.pos = end;
  3190. return this.buffer.subarray(pos, end);
  3191. }
  3192. async getImageData(length, decoderOptions = null) {
  3193. if (!this.canAsyncDecodeImageFromBuffer) {
  3194. return this.getBytes(length, decoderOptions);
  3195. }
  3196. const data = await this.stream.asyncGetBytes();
  3197. return this.decodeImage(data, decoderOptions);
  3198. }
  3199. reset() {
  3200. this.pos = 0;
  3201. }
  3202. makeSubStream(start, length, dict = null) {
  3203. if (length === undefined) {
  3204. while (!this.eof) {
  3205. this.readBlock();
  3206. }
  3207. } else {
  3208. const end = start + length;
  3209. while (this.bufferLength <= end && !this.eof) {
  3210. this.readBlock();
  3211. }
  3212. }
  3213. return new Stream(this.buffer, start, length, dict);
  3214. }
  3215. getBaseStreams() {
  3216. return this.str ? this.str.getBaseStreams() : null;
  3217. }
  3218. }
  3219. class StreamsSequenceStream extends DecodeStream {
  3220. constructor(streams, onError = null) {
  3221. let maybeLength = 0;
  3222. for (const stream of streams) {
  3223. maybeLength += stream instanceof DecodeStream ? stream._rawMinBufferLength : stream.length;
  3224. }
  3225. super(maybeLength);
  3226. this.streams = streams;
  3227. this._onError = onError;
  3228. }
  3229. readBlock() {
  3230. const streams = this.streams;
  3231. if (streams.length === 0) {
  3232. this.eof = true;
  3233. return;
  3234. }
  3235. const stream = streams.shift();
  3236. let chunk;
  3237. try {
  3238. chunk = stream.getBytes();
  3239. } catch (reason) {
  3240. if (this._onError) {
  3241. this._onError(reason, stream.dict?.objId);
  3242. return;
  3243. }
  3244. throw reason;
  3245. }
  3246. const bufferLength = this.bufferLength;
  3247. const newLength = bufferLength + chunk.length;
  3248. const buffer = this.ensureBuffer(newLength);
  3249. buffer.set(chunk, bufferLength);
  3250. this.bufferLength = newLength;
  3251. }
  3252. getBaseStreams() {
  3253. const baseStreamsBuf = [];
  3254. for (const stream of this.streams) {
  3255. const baseStreams = stream.getBaseStreams();
  3256. if (baseStreams) {
  3257. baseStreamsBuf.push(...baseStreams);
  3258. }
  3259. }
  3260. return baseStreamsBuf.length > 0 ? baseStreamsBuf : null;
  3261. }
  3262. }
  3263. ;// CONCATENATED MODULE: ./src/core/ascii_85_stream.js
  3264. class Ascii85Stream extends DecodeStream {
  3265. constructor(str, maybeLength) {
  3266. if (maybeLength) {
  3267. maybeLength *= 0.8;
  3268. }
  3269. super(maybeLength);
  3270. this.str = str;
  3271. this.dict = str.dict;
  3272. this.input = new Uint8Array(5);
  3273. }
  3274. readBlock() {
  3275. const TILDA_CHAR = 0x7e;
  3276. const Z_LOWER_CHAR = 0x7a;
  3277. const EOF = -1;
  3278. const str = this.str;
  3279. let c = str.getByte();
  3280. while (isWhiteSpace(c)) {
  3281. c = str.getByte();
  3282. }
  3283. if (c === EOF || c === TILDA_CHAR) {
  3284. this.eof = true;
  3285. return;
  3286. }
  3287. const bufferLength = this.bufferLength;
  3288. let buffer, i;
  3289. if (c === Z_LOWER_CHAR) {
  3290. buffer = this.ensureBuffer(bufferLength + 4);
  3291. for (i = 0; i < 4; ++i) {
  3292. buffer[bufferLength + i] = 0;
  3293. }
  3294. this.bufferLength += 4;
  3295. } else {
  3296. const input = this.input;
  3297. input[0] = c;
  3298. for (i = 1; i < 5; ++i) {
  3299. c = str.getByte();
  3300. while (isWhiteSpace(c)) {
  3301. c = str.getByte();
  3302. }
  3303. input[i] = c;
  3304. if (c === EOF || c === TILDA_CHAR) {
  3305. break;
  3306. }
  3307. }
  3308. buffer = this.ensureBuffer(bufferLength + i - 1);
  3309. this.bufferLength += i - 1;
  3310. if (i < 5) {
  3311. for (; i < 5; ++i) {
  3312. input[i] = 0x21 + 84;
  3313. }
  3314. this.eof = true;
  3315. }
  3316. let t = 0;
  3317. for (i = 0; i < 5; ++i) {
  3318. t = t * 85 + (input[i] - 0x21);
  3319. }
  3320. for (i = 3; i >= 0; --i) {
  3321. buffer[bufferLength + i] = t & 0xff;
  3322. t >>= 8;
  3323. }
  3324. }
  3325. }
  3326. }
  3327. ;// CONCATENATED MODULE: ./src/core/ascii_hex_stream.js
  3328. class AsciiHexStream extends DecodeStream {
  3329. constructor(str, maybeLength) {
  3330. if (maybeLength) {
  3331. maybeLength *= 0.5;
  3332. }
  3333. super(maybeLength);
  3334. this.str = str;
  3335. this.dict = str.dict;
  3336. this.firstDigit = -1;
  3337. }
  3338. readBlock() {
  3339. const UPSTREAM_BLOCK_SIZE = 8000;
  3340. const bytes = this.str.getBytes(UPSTREAM_BLOCK_SIZE);
  3341. if (!bytes.length) {
  3342. this.eof = true;
  3343. return;
  3344. }
  3345. const maxDecodeLength = bytes.length + 1 >> 1;
  3346. const buffer = this.ensureBuffer(this.bufferLength + maxDecodeLength);
  3347. let bufferLength = this.bufferLength;
  3348. let firstDigit = this.firstDigit;
  3349. for (const ch of bytes) {
  3350. let digit;
  3351. if (ch >= 0x30 && ch <= 0x39) {
  3352. digit = ch & 0x0f;
  3353. } else if (ch >= 0x41 && ch <= 0x46 || ch >= 0x61 && ch <= 0x66) {
  3354. digit = (ch & 0x0f) + 9;
  3355. } else if (ch === 0x3e) {
  3356. this.eof = true;
  3357. break;
  3358. } else {
  3359. continue;
  3360. }
  3361. if (firstDigit < 0) {
  3362. firstDigit = digit;
  3363. } else {
  3364. buffer[bufferLength++] = firstDigit << 4 | digit;
  3365. firstDigit = -1;
  3366. }
  3367. }
  3368. if (firstDigit >= 0 && this.eof) {
  3369. buffer[bufferLength++] = firstDigit << 4;
  3370. firstDigit = -1;
  3371. }
  3372. this.firstDigit = firstDigit;
  3373. this.bufferLength = bufferLength;
  3374. }
  3375. }
  3376. ;// CONCATENATED MODULE: ./src/core/ccitt.js
  3377. const ccittEOL = -2;
  3378. const ccittEOF = -1;
  3379. const twoDimPass = 0;
  3380. const twoDimHoriz = 1;
  3381. const twoDimVert0 = 2;
  3382. const twoDimVertR1 = 3;
  3383. const twoDimVertL1 = 4;
  3384. const twoDimVertR2 = 5;
  3385. const twoDimVertL2 = 6;
  3386. const twoDimVertR3 = 7;
  3387. const twoDimVertL3 = 8;
  3388. 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]];
  3389. 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]];
  3390. 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]];
  3391. 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]];
  3392. 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]];
  3393. 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]];
  3394. class CCITTFaxDecoder {
  3395. constructor(source, options = {}) {
  3396. if (!source || typeof source.next !== "function") {
  3397. throw new Error('CCITTFaxDecoder - invalid "source" parameter.');
  3398. }
  3399. this.source = source;
  3400. this.eof = false;
  3401. this.encoding = options.K || 0;
  3402. this.eoline = options.EndOfLine || false;
  3403. this.byteAlign = options.EncodedByteAlign || false;
  3404. this.columns = options.Columns || 1728;
  3405. this.rows = options.Rows || 0;
  3406. this.eoblock = options.EndOfBlock ?? true;
  3407. this.black = options.BlackIs1 || false;
  3408. this.codingLine = new Uint32Array(this.columns + 1);
  3409. this.refLine = new Uint32Array(this.columns + 2);
  3410. this.codingLine[0] = this.columns;
  3411. this.codingPos = 0;
  3412. this.row = 0;
  3413. this.nextLine2D = this.encoding < 0;
  3414. this.inputBits = 0;
  3415. this.inputBuf = 0;
  3416. this.outputBits = 0;
  3417. this.rowsDone = false;
  3418. let code1;
  3419. while ((code1 = this._lookBits(12)) === 0) {
  3420. this._eatBits(1);
  3421. }
  3422. if (code1 === 1) {
  3423. this._eatBits(12);
  3424. }
  3425. if (this.encoding > 0) {
  3426. this.nextLine2D = !this._lookBits(1);
  3427. this._eatBits(1);
  3428. }
  3429. }
  3430. readNextChar() {
  3431. if (this.eof) {
  3432. return -1;
  3433. }
  3434. const refLine = this.refLine;
  3435. const codingLine = this.codingLine;
  3436. const columns = this.columns;
  3437. let refPos, blackPixels, bits, i;
  3438. if (this.outputBits === 0) {
  3439. if (this.rowsDone) {
  3440. this.eof = true;
  3441. }
  3442. if (this.eof) {
  3443. return -1;
  3444. }
  3445. this.err = false;
  3446. let code1, code2, code3;
  3447. if (this.nextLine2D) {
  3448. for (i = 0; codingLine[i] < columns; ++i) {
  3449. refLine[i] = codingLine[i];
  3450. }
  3451. refLine[i++] = columns;
  3452. refLine[i] = columns;
  3453. codingLine[0] = 0;
  3454. this.codingPos = 0;
  3455. refPos = 0;
  3456. blackPixels = 0;
  3457. while (codingLine[this.codingPos] < columns) {
  3458. code1 = this._getTwoDimCode();
  3459. switch (code1) {
  3460. case twoDimPass:
  3461. this._addPixels(refLine[refPos + 1], blackPixels);
  3462. if (refLine[refPos + 1] < columns) {
  3463. refPos += 2;
  3464. }
  3465. break;
  3466. case twoDimHoriz:
  3467. code1 = code2 = 0;
  3468. if (blackPixels) {
  3469. do {
  3470. code1 += code3 = this._getBlackCode();
  3471. } while (code3 >= 64);
  3472. do {
  3473. code2 += code3 = this._getWhiteCode();
  3474. } while (code3 >= 64);
  3475. } else {
  3476. do {
  3477. code1 += code3 = this._getWhiteCode();
  3478. } while (code3 >= 64);
  3479. do {
  3480. code2 += code3 = this._getBlackCode();
  3481. } while (code3 >= 64);
  3482. }
  3483. this._addPixels(codingLine[this.codingPos] + code1, blackPixels);
  3484. if (codingLine[this.codingPos] < columns) {
  3485. this._addPixels(codingLine[this.codingPos] + code2, blackPixels ^ 1);
  3486. }
  3487. while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) {
  3488. refPos += 2;
  3489. }
  3490. break;
  3491. case twoDimVertR3:
  3492. this._addPixels(refLine[refPos] + 3, blackPixels);
  3493. blackPixels ^= 1;
  3494. if (codingLine[this.codingPos] < columns) {
  3495. ++refPos;
  3496. while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) {
  3497. refPos += 2;
  3498. }
  3499. }
  3500. break;
  3501. case twoDimVertR2:
  3502. this._addPixels(refLine[refPos] + 2, blackPixels);
  3503. blackPixels ^= 1;
  3504. if (codingLine[this.codingPos] < columns) {
  3505. ++refPos;
  3506. while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) {
  3507. refPos += 2;
  3508. }
  3509. }
  3510. break;
  3511. case twoDimVertR1:
  3512. this._addPixels(refLine[refPos] + 1, blackPixels);
  3513. blackPixels ^= 1;
  3514. if (codingLine[this.codingPos] < columns) {
  3515. ++refPos;
  3516. while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) {
  3517. refPos += 2;
  3518. }
  3519. }
  3520. break;
  3521. case twoDimVert0:
  3522. this._addPixels(refLine[refPos], blackPixels);
  3523. blackPixels ^= 1;
  3524. if (codingLine[this.codingPos] < columns) {
  3525. ++refPos;
  3526. while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) {
  3527. refPos += 2;
  3528. }
  3529. }
  3530. break;
  3531. case twoDimVertL3:
  3532. this._addPixelsNeg(refLine[refPos] - 3, blackPixels);
  3533. blackPixels ^= 1;
  3534. if (codingLine[this.codingPos] < columns) {
  3535. if (refPos > 0) {
  3536. --refPos;
  3537. } else {
  3538. ++refPos;
  3539. }
  3540. while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) {
  3541. refPos += 2;
  3542. }
  3543. }
  3544. break;
  3545. case twoDimVertL2:
  3546. this._addPixelsNeg(refLine[refPos] - 2, blackPixels);
  3547. blackPixels ^= 1;
  3548. if (codingLine[this.codingPos] < columns) {
  3549. if (refPos > 0) {
  3550. --refPos;
  3551. } else {
  3552. ++refPos;
  3553. }
  3554. while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) {
  3555. refPos += 2;
  3556. }
  3557. }
  3558. break;
  3559. case twoDimVertL1:
  3560. this._addPixelsNeg(refLine[refPos] - 1, blackPixels);
  3561. blackPixels ^= 1;
  3562. if (codingLine[this.codingPos] < columns) {
  3563. if (refPos > 0) {
  3564. --refPos;
  3565. } else {
  3566. ++refPos;
  3567. }
  3568. while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) {
  3569. refPos += 2;
  3570. }
  3571. }
  3572. break;
  3573. case ccittEOF:
  3574. this._addPixels(columns, 0);
  3575. this.eof = true;
  3576. break;
  3577. default:
  3578. info("bad 2d code");
  3579. this._addPixels(columns, 0);
  3580. this.err = true;
  3581. }
  3582. }
  3583. } else {
  3584. codingLine[0] = 0;
  3585. this.codingPos = 0;
  3586. blackPixels = 0;
  3587. while (codingLine[this.codingPos] < columns) {
  3588. code1 = 0;
  3589. if (blackPixels) {
  3590. do {
  3591. code1 += code3 = this._getBlackCode();
  3592. } while (code3 >= 64);
  3593. } else {
  3594. do {
  3595. code1 += code3 = this._getWhiteCode();
  3596. } while (code3 >= 64);
  3597. }
  3598. this._addPixels(codingLine[this.codingPos] + code1, blackPixels);
  3599. blackPixels ^= 1;
  3600. }
  3601. }
  3602. let gotEOL = false;
  3603. if (this.byteAlign) {
  3604. this.inputBits &= ~7;
  3605. }
  3606. if (!this.eoblock && this.row === this.rows - 1) {
  3607. this.rowsDone = true;
  3608. } else {
  3609. code1 = this._lookBits(12);
  3610. if (this.eoline) {
  3611. while (code1 !== ccittEOF && code1 !== 1) {
  3612. this._eatBits(1);
  3613. code1 = this._lookBits(12);
  3614. }
  3615. } else {
  3616. while (code1 === 0) {
  3617. this._eatBits(1);
  3618. code1 = this._lookBits(12);
  3619. }
  3620. }
  3621. if (code1 === 1) {
  3622. this._eatBits(12);
  3623. gotEOL = true;
  3624. } else if (code1 === ccittEOF) {
  3625. this.eof = true;
  3626. }
  3627. }
  3628. if (!this.eof && this.encoding > 0 && !this.rowsDone) {
  3629. this.nextLine2D = !this._lookBits(1);
  3630. this._eatBits(1);
  3631. }
  3632. if (this.eoblock && gotEOL && this.byteAlign) {
  3633. code1 = this._lookBits(12);
  3634. if (code1 === 1) {
  3635. this._eatBits(12);
  3636. if (this.encoding > 0) {
  3637. this._lookBits(1);
  3638. this._eatBits(1);
  3639. }
  3640. if (this.encoding >= 0) {
  3641. for (i = 0; i < 4; ++i) {
  3642. code1 = this._lookBits(12);
  3643. if (code1 !== 1) {
  3644. info("bad rtc code: " + code1);
  3645. }
  3646. this._eatBits(12);
  3647. if (this.encoding > 0) {
  3648. this._lookBits(1);
  3649. this._eatBits(1);
  3650. }
  3651. }
  3652. }
  3653. this.eof = true;
  3654. }
  3655. } else if (this.err && this.eoline) {
  3656. while (true) {
  3657. code1 = this._lookBits(13);
  3658. if (code1 === ccittEOF) {
  3659. this.eof = true;
  3660. return -1;
  3661. }
  3662. if (code1 >> 1 === 1) {
  3663. break;
  3664. }
  3665. this._eatBits(1);
  3666. }
  3667. this._eatBits(12);
  3668. if (this.encoding > 0) {
  3669. this._eatBits(1);
  3670. this.nextLine2D = !(code1 & 1);
  3671. }
  3672. }
  3673. this.outputBits = codingLine[0] > 0 ? codingLine[this.codingPos = 0] : codingLine[this.codingPos = 1];
  3674. this.row++;
  3675. }
  3676. let c;
  3677. if (this.outputBits >= 8) {
  3678. c = this.codingPos & 1 ? 0 : 0xff;
  3679. this.outputBits -= 8;
  3680. if (this.outputBits === 0 && codingLine[this.codingPos] < columns) {
  3681. this.codingPos++;
  3682. this.outputBits = codingLine[this.codingPos] - codingLine[this.codingPos - 1];
  3683. }
  3684. } else {
  3685. bits = 8;
  3686. c = 0;
  3687. do {
  3688. if (typeof this.outputBits !== "number") {
  3689. throw new FormatError('Invalid /CCITTFaxDecode data, "outputBits" must be a number.');
  3690. }
  3691. if (this.outputBits > bits) {
  3692. c <<= bits;
  3693. if (!(this.codingPos & 1)) {
  3694. c |= 0xff >> 8 - bits;
  3695. }
  3696. this.outputBits -= bits;
  3697. bits = 0;
  3698. } else {
  3699. c <<= this.outputBits;
  3700. if (!(this.codingPos & 1)) {
  3701. c |= 0xff >> 8 - this.outputBits;
  3702. }
  3703. bits -= this.outputBits;
  3704. this.outputBits = 0;
  3705. if (codingLine[this.codingPos] < columns) {
  3706. this.codingPos++;
  3707. this.outputBits = codingLine[this.codingPos] - codingLine[this.codingPos - 1];
  3708. } else if (bits > 0) {
  3709. c <<= bits;
  3710. bits = 0;
  3711. }
  3712. }
  3713. } while (bits);
  3714. }
  3715. if (this.black) {
  3716. c ^= 0xff;
  3717. }
  3718. return c;
  3719. }
  3720. _addPixels(a1, blackPixels) {
  3721. const codingLine = this.codingLine;
  3722. let codingPos = this.codingPos;
  3723. if (a1 > codingLine[codingPos]) {
  3724. if (a1 > this.columns) {
  3725. info("row is wrong length");
  3726. this.err = true;
  3727. a1 = this.columns;
  3728. }
  3729. if (codingPos & 1 ^ blackPixels) {
  3730. ++codingPos;
  3731. }
  3732. codingLine[codingPos] = a1;
  3733. }
  3734. this.codingPos = codingPos;
  3735. }
  3736. _addPixelsNeg(a1, blackPixels) {
  3737. const codingLine = this.codingLine;
  3738. let codingPos = this.codingPos;
  3739. if (a1 > codingLine[codingPos]) {
  3740. if (a1 > this.columns) {
  3741. info("row is wrong length");
  3742. this.err = true;
  3743. a1 = this.columns;
  3744. }
  3745. if (codingPos & 1 ^ blackPixels) {
  3746. ++codingPos;
  3747. }
  3748. codingLine[codingPos] = a1;
  3749. } else if (a1 < codingLine[codingPos]) {
  3750. if (a1 < 0) {
  3751. info("invalid code");
  3752. this.err = true;
  3753. a1 = 0;
  3754. }
  3755. while (codingPos > 0 && a1 < codingLine[codingPos - 1]) {
  3756. --codingPos;
  3757. }
  3758. codingLine[codingPos] = a1;
  3759. }
  3760. this.codingPos = codingPos;
  3761. }
  3762. _findTableCode(start, end, table, limit) {
  3763. const limitValue = limit || 0;
  3764. for (let i = start; i <= end; ++i) {
  3765. let code = this._lookBits(i);
  3766. if (code === ccittEOF) {
  3767. return [true, 1, false];
  3768. }
  3769. if (i < end) {
  3770. code <<= end - i;
  3771. }
  3772. if (!limitValue || code >= limitValue) {
  3773. const p = table[code - limitValue];
  3774. if (p[0] === i) {
  3775. this._eatBits(i);
  3776. return [true, p[1], true];
  3777. }
  3778. }
  3779. }
  3780. return [false, 0, false];
  3781. }
  3782. _getTwoDimCode() {
  3783. let code = 0;
  3784. let p;
  3785. if (this.eoblock) {
  3786. code = this._lookBits(7);
  3787. p = twoDimTable[code];
  3788. if (p?.[0] > 0) {
  3789. this._eatBits(p[0]);
  3790. return p[1];
  3791. }
  3792. } else {
  3793. const result = this._findTableCode(1, 7, twoDimTable);
  3794. if (result[0] && result[2]) {
  3795. return result[1];
  3796. }
  3797. }
  3798. info("Bad two dim code");
  3799. return ccittEOF;
  3800. }
  3801. _getWhiteCode() {
  3802. let code = 0;
  3803. let p;
  3804. if (this.eoblock) {
  3805. code = this._lookBits(12);
  3806. if (code === ccittEOF) {
  3807. return 1;
  3808. }
  3809. p = code >> 5 === 0 ? whiteTable1[code] : whiteTable2[code >> 3];
  3810. if (p[0] > 0) {
  3811. this._eatBits(p[0]);
  3812. return p[1];
  3813. }
  3814. } else {
  3815. let result = this._findTableCode(1, 9, whiteTable2);
  3816. if (result[0]) {
  3817. return result[1];
  3818. }
  3819. result = this._findTableCode(11, 12, whiteTable1);
  3820. if (result[0]) {
  3821. return result[1];
  3822. }
  3823. }
  3824. info("bad white code");
  3825. this._eatBits(1);
  3826. return 1;
  3827. }
  3828. _getBlackCode() {
  3829. let code, p;
  3830. if (this.eoblock) {
  3831. code = this._lookBits(13);
  3832. if (code === ccittEOF) {
  3833. return 1;
  3834. }
  3835. if (code >> 7 === 0) {
  3836. p = blackTable1[code];
  3837. } else if (code >> 9 === 0 && code >> 7 !== 0) {
  3838. p = blackTable2[(code >> 1) - 64];
  3839. } else {
  3840. p = blackTable3[code >> 7];
  3841. }
  3842. if (p[0] > 0) {
  3843. this._eatBits(p[0]);
  3844. return p[1];
  3845. }
  3846. } else {
  3847. let result = this._findTableCode(2, 6, blackTable3);
  3848. if (result[0]) {
  3849. return result[1];
  3850. }
  3851. result = this._findTableCode(7, 12, blackTable2, 64);
  3852. if (result[0]) {
  3853. return result[1];
  3854. }
  3855. result = this._findTableCode(10, 13, blackTable1);
  3856. if (result[0]) {
  3857. return result[1];
  3858. }
  3859. }
  3860. info("bad black code");
  3861. this._eatBits(1);
  3862. return 1;
  3863. }
  3864. _lookBits(n) {
  3865. let c;
  3866. while (this.inputBits < n) {
  3867. if ((c = this.source.next()) === -1) {
  3868. if (this.inputBits === 0) {
  3869. return ccittEOF;
  3870. }
  3871. return this.inputBuf << n - this.inputBits & 0xffff >> 16 - n;
  3872. }
  3873. this.inputBuf = this.inputBuf << 8 | c;
  3874. this.inputBits += 8;
  3875. }
  3876. return this.inputBuf >> this.inputBits - n & 0xffff >> 16 - n;
  3877. }
  3878. _eatBits(n) {
  3879. if ((this.inputBits -= n) < 0) {
  3880. this.inputBits = 0;
  3881. }
  3882. }
  3883. }
  3884. ;// CONCATENATED MODULE: ./src/core/ccitt_stream.js
  3885. class CCITTFaxStream extends DecodeStream {
  3886. constructor(str, maybeLength, params) {
  3887. super(maybeLength);
  3888. this.str = str;
  3889. this.dict = str.dict;
  3890. if (!(params instanceof Dict)) {
  3891. params = Dict.empty;
  3892. }
  3893. const source = {
  3894. next() {
  3895. return str.getByte();
  3896. }
  3897. };
  3898. this.ccittFaxDecoder = new CCITTFaxDecoder(source, {
  3899. K: params.get("K"),
  3900. EndOfLine: params.get("EndOfLine"),
  3901. EncodedByteAlign: params.get("EncodedByteAlign"),
  3902. Columns: params.get("Columns"),
  3903. Rows: params.get("Rows"),
  3904. EndOfBlock: params.get("EndOfBlock"),
  3905. BlackIs1: params.get("BlackIs1")
  3906. });
  3907. }
  3908. readBlock() {
  3909. while (!this.eof) {
  3910. const c = this.ccittFaxDecoder.readNextChar();
  3911. if (c === -1) {
  3912. this.eof = true;
  3913. return;
  3914. }
  3915. this.ensureBuffer(this.bufferLength + 1);
  3916. this.buffer[this.bufferLength++] = c;
  3917. }
  3918. }
  3919. }
  3920. ;// CONCATENATED MODULE: ./src/core/flate_stream.js
  3921. const codeLenCodeMap = new Int32Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);
  3922. 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]);
  3923. 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]);
  3924. 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];
  3925. 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];
  3926. class FlateStream extends DecodeStream {
  3927. constructor(str, maybeLength) {
  3928. super(maybeLength);
  3929. this.str = str;
  3930. this.dict = str.dict;
  3931. const cmf = str.getByte();
  3932. const flg = str.getByte();
  3933. if (cmf === -1 || flg === -1) {
  3934. throw new FormatError(`Invalid header in flate stream: ${cmf}, ${flg}`);
  3935. }
  3936. if ((cmf & 0x0f) !== 0x08) {
  3937. throw new FormatError(`Unknown compression method in flate stream: ${cmf}, ${flg}`);
  3938. }
  3939. if (((cmf << 8) + flg) % 31 !== 0) {
  3940. throw new FormatError(`Bad FCHECK in flate stream: ${cmf}, ${flg}`);
  3941. }
  3942. if (flg & 0x20) {
  3943. throw new FormatError(`FDICT bit set in flate stream: ${cmf}, ${flg}`);
  3944. }
  3945. this.codeSize = 0;
  3946. this.codeBuf = 0;
  3947. }
  3948. async getImageData(length, _decoderOptions) {
  3949. const data = await this.asyncGetBytes();
  3950. return data?.subarray(0, length) || this.getBytes(length);
  3951. }
  3952. async asyncGetBytes() {
  3953. this.str.reset();
  3954. const bytes = this.str.getBytes();
  3955. try {
  3956. const {
  3957. readable,
  3958. writable
  3959. } = new DecompressionStream("deflate");
  3960. const writer = writable.getWriter();
  3961. writer.write(bytes);
  3962. writer.close();
  3963. const chunks = [];
  3964. let totalLength = 0;
  3965. for await (const chunk of readable) {
  3966. chunks.push(chunk);
  3967. totalLength += chunk.byteLength;
  3968. }
  3969. const data = new Uint8Array(totalLength);
  3970. let offset = 0;
  3971. for (const chunk of chunks) {
  3972. data.set(chunk, offset);
  3973. offset += chunk.byteLength;
  3974. }
  3975. return data;
  3976. } catch {
  3977. this.str = new Stream(bytes, 2, bytes.length, this.str.dict);
  3978. this.reset();
  3979. return null;
  3980. }
  3981. }
  3982. get isAsync() {
  3983. return true;
  3984. }
  3985. getBits(bits) {
  3986. const str = this.str;
  3987. let codeSize = this.codeSize;
  3988. let codeBuf = this.codeBuf;
  3989. let b;
  3990. while (codeSize < bits) {
  3991. if ((b = str.getByte()) === -1) {
  3992. throw new FormatError("Bad encoding in flate stream");
  3993. }
  3994. codeBuf |= b << codeSize;
  3995. codeSize += 8;
  3996. }
  3997. b = codeBuf & (1 << bits) - 1;
  3998. this.codeBuf = codeBuf >> bits;
  3999. this.codeSize = codeSize -= bits;
  4000. return b;
  4001. }
  4002. getCode(table) {
  4003. const str = this.str;
  4004. const codes = table[0];
  4005. const maxLen = table[1];
  4006. let codeSize = this.codeSize;
  4007. let codeBuf = this.codeBuf;
  4008. let b;
  4009. while (codeSize < maxLen) {
  4010. if ((b = str.getByte()) === -1) {
  4011. break;
  4012. }
  4013. codeBuf |= b << codeSize;
  4014. codeSize += 8;
  4015. }
  4016. const code = codes[codeBuf & (1 << maxLen) - 1];
  4017. const codeLen = code >> 16;
  4018. const codeVal = code & 0xffff;
  4019. if (codeLen < 1 || codeSize < codeLen) {
  4020. throw new FormatError("Bad encoding in flate stream");
  4021. }
  4022. this.codeBuf = codeBuf >> codeLen;
  4023. this.codeSize = codeSize - codeLen;
  4024. return codeVal;
  4025. }
  4026. generateHuffmanTable(lengths) {
  4027. const n = lengths.length;
  4028. let maxLen = 0;
  4029. let i;
  4030. for (i = 0; i < n; ++i) {
  4031. if (lengths[i] > maxLen) {
  4032. maxLen = lengths[i];
  4033. }
  4034. }
  4035. const size = 1 << maxLen;
  4036. const codes = new Int32Array(size);
  4037. for (let len = 1, code = 0, skip = 2; len <= maxLen; ++len, code <<= 1, skip <<= 1) {
  4038. for (let val = 0; val < n; ++val) {
  4039. if (lengths[val] === len) {
  4040. let code2 = 0;
  4041. let t = code;
  4042. for (i = 0; i < len; ++i) {
  4043. code2 = code2 << 1 | t & 1;
  4044. t >>= 1;
  4045. }
  4046. for (i = code2; i < size; i += skip) {
  4047. codes[i] = len << 16 | val;
  4048. }
  4049. ++code;
  4050. }
  4051. }
  4052. }
  4053. return [codes, maxLen];
  4054. }
  4055. #endsStreamOnError(err) {
  4056. info(err);
  4057. this.eof = true;
  4058. }
  4059. readBlock() {
  4060. let buffer, hdr, len;
  4061. const str = this.str;
  4062. try {
  4063. hdr = this.getBits(3);
  4064. } catch (ex) {
  4065. this.#endsStreamOnError(ex.message);
  4066. return;
  4067. }
  4068. if (hdr & 1) {
  4069. this.eof = true;
  4070. }
  4071. hdr >>= 1;
  4072. if (hdr === 0) {
  4073. let b;
  4074. if ((b = str.getByte()) === -1) {
  4075. this.#endsStreamOnError("Bad block header in flate stream");
  4076. return;
  4077. }
  4078. let blockLen = b;
  4079. if ((b = str.getByte()) === -1) {
  4080. this.#endsStreamOnError("Bad block header in flate stream");
  4081. return;
  4082. }
  4083. blockLen |= b << 8;
  4084. if ((b = str.getByte()) === -1) {
  4085. this.#endsStreamOnError("Bad block header in flate stream");
  4086. return;
  4087. }
  4088. let check = b;
  4089. if ((b = str.getByte()) === -1) {
  4090. this.#endsStreamOnError("Bad block header in flate stream");
  4091. return;
  4092. }
  4093. check |= b << 8;
  4094. if (check !== (~blockLen & 0xffff) && (blockLen !== 0 || check !== 0)) {
  4095. throw new FormatError("Bad uncompressed block length in flate stream");
  4096. }
  4097. this.codeBuf = 0;
  4098. this.codeSize = 0;
  4099. const bufferLength = this.bufferLength,
  4100. end = bufferLength + blockLen;
  4101. buffer = this.ensureBuffer(end);
  4102. this.bufferLength = end;
  4103. if (blockLen === 0) {
  4104. if (str.peekByte() === -1) {
  4105. this.eof = true;
  4106. }
  4107. } else {
  4108. const block = str.getBytes(blockLen);
  4109. buffer.set(block, bufferLength);
  4110. if (block.length < blockLen) {
  4111. this.eof = true;
  4112. }
  4113. }
  4114. return;
  4115. }
  4116. let litCodeTable;
  4117. let distCodeTable;
  4118. if (hdr === 1) {
  4119. litCodeTable = fixedLitCodeTab;
  4120. distCodeTable = fixedDistCodeTab;
  4121. } else if (hdr === 2) {
  4122. const numLitCodes = this.getBits(5) + 257;
  4123. const numDistCodes = this.getBits(5) + 1;
  4124. const numCodeLenCodes = this.getBits(4) + 4;
  4125. const codeLenCodeLengths = new Uint8Array(codeLenCodeMap.length);
  4126. let i;
  4127. for (i = 0; i < numCodeLenCodes; ++i) {
  4128. codeLenCodeLengths[codeLenCodeMap[i]] = this.getBits(3);
  4129. }
  4130. const codeLenCodeTab = this.generateHuffmanTable(codeLenCodeLengths);
  4131. len = 0;
  4132. i = 0;
  4133. const codes = numLitCodes + numDistCodes;
  4134. const codeLengths = new Uint8Array(codes);
  4135. let bitsLength, bitsOffset, what;
  4136. while (i < codes) {
  4137. const code = this.getCode(codeLenCodeTab);
  4138. if (code === 16) {
  4139. bitsLength = 2;
  4140. bitsOffset = 3;
  4141. what = len;
  4142. } else if (code === 17) {
  4143. bitsLength = 3;
  4144. bitsOffset = 3;
  4145. what = len = 0;
  4146. } else if (code === 18) {
  4147. bitsLength = 7;
  4148. bitsOffset = 11;
  4149. what = len = 0;
  4150. } else {
  4151. codeLengths[i++] = len = code;
  4152. continue;
  4153. }
  4154. let repeatLength = this.getBits(bitsLength) + bitsOffset;
  4155. while (repeatLength-- > 0) {
  4156. codeLengths[i++] = what;
  4157. }
  4158. }
  4159. litCodeTable = this.generateHuffmanTable(codeLengths.subarray(0, numLitCodes));
  4160. distCodeTable = this.generateHuffmanTable(codeLengths.subarray(numLitCodes, codes));
  4161. } else {
  4162. throw new FormatError("Unknown block type in flate stream");
  4163. }
  4164. buffer = this.buffer;
  4165. let limit = buffer ? buffer.length : 0;
  4166. let pos = this.bufferLength;
  4167. while (true) {
  4168. let code1 = this.getCode(litCodeTable);
  4169. if (code1 < 256) {
  4170. if (pos + 1 >= limit) {
  4171. buffer = this.ensureBuffer(pos + 1);
  4172. limit = buffer.length;
  4173. }
  4174. buffer[pos++] = code1;
  4175. continue;
  4176. }
  4177. if (code1 === 256) {
  4178. this.bufferLength = pos;
  4179. return;
  4180. }
  4181. code1 -= 257;
  4182. code1 = lengthDecode[code1];
  4183. let code2 = code1 >> 16;
  4184. if (code2 > 0) {
  4185. code2 = this.getBits(code2);
  4186. }
  4187. len = (code1 & 0xffff) + code2;
  4188. code1 = this.getCode(distCodeTable);
  4189. code1 = distDecode[code1];
  4190. code2 = code1 >> 16;
  4191. if (code2 > 0) {
  4192. code2 = this.getBits(code2);
  4193. }
  4194. const dist = (code1 & 0xffff) + code2;
  4195. if (pos + len >= limit) {
  4196. buffer = this.ensureBuffer(pos + len);
  4197. limit = buffer.length;
  4198. }
  4199. for (let k = 0; k < len; ++k, ++pos) {
  4200. buffer[pos] = buffer[pos - dist];
  4201. }
  4202. }
  4203. }
  4204. }
  4205. ;// CONCATENATED MODULE: ./src/core/arithmetic_decoder.js
  4206. const QeTable = [{
  4207. qe: 0x5601,
  4208. nmps: 1,
  4209. nlps: 1,
  4210. switchFlag: 1
  4211. }, {
  4212. qe: 0x3401,
  4213. nmps: 2,
  4214. nlps: 6,
  4215. switchFlag: 0
  4216. }, {
  4217. qe: 0x1801,
  4218. nmps: 3,
  4219. nlps: 9,
  4220. switchFlag: 0
  4221. }, {
  4222. qe: 0x0ac1,
  4223. nmps: 4,
  4224. nlps: 12,
  4225. switchFlag: 0
  4226. }, {
  4227. qe: 0x0521,
  4228. nmps: 5,
  4229. nlps: 29,
  4230. switchFlag: 0
  4231. }, {
  4232. qe: 0x0221,
  4233. nmps: 38,
  4234. nlps: 33,
  4235. switchFlag: 0
  4236. }, {
  4237. qe: 0x5601,
  4238. nmps: 7,
  4239. nlps: 6,
  4240. switchFlag: 1
  4241. }, {
  4242. qe: 0x5401,
  4243. nmps: 8,
  4244. nlps: 14,
  4245. switchFlag: 0
  4246. }, {
  4247. qe: 0x4801,
  4248. nmps: 9,
  4249. nlps: 14,
  4250. switchFlag: 0
  4251. }, {
  4252. qe: 0x3801,
  4253. nmps: 10,
  4254. nlps: 14,
  4255. switchFlag: 0
  4256. }, {
  4257. qe: 0x3001,
  4258. nmps: 11,
  4259. nlps: 17,
  4260. switchFlag: 0
  4261. }, {
  4262. qe: 0x2401,
  4263. nmps: 12,
  4264. nlps: 18,
  4265. switchFlag: 0
  4266. }, {
  4267. qe: 0x1c01,
  4268. nmps: 13,
  4269. nlps: 20,
  4270. switchFlag: 0
  4271. }, {
  4272. qe: 0x1601,
  4273. nmps: 29,
  4274. nlps: 21,
  4275. switchFlag: 0
  4276. }, {
  4277. qe: 0x5601,
  4278. nmps: 15,
  4279. nlps: 14,
  4280. switchFlag: 1
  4281. }, {
  4282. qe: 0x5401,
  4283. nmps: 16,
  4284. nlps: 14,
  4285. switchFlag: 0
  4286. }, {
  4287. qe: 0x5101,
  4288. nmps: 17,
  4289. nlps: 15,
  4290. switchFlag: 0
  4291. }, {
  4292. qe: 0x4801,
  4293. nmps: 18,
  4294. nlps: 16,
  4295. switchFlag: 0
  4296. }, {
  4297. qe: 0x3801,
  4298. nmps: 19,
  4299. nlps: 17,
  4300. switchFlag: 0
  4301. }, {
  4302. qe: 0x3401,
  4303. nmps: 20,
  4304. nlps: 18,
  4305. switchFlag: 0
  4306. }, {
  4307. qe: 0x3001,
  4308. nmps: 21,
  4309. nlps: 19,
  4310. switchFlag: 0
  4311. }, {
  4312. qe: 0x2801,
  4313. nmps: 22,
  4314. nlps: 19,
  4315. switchFlag: 0
  4316. }, {
  4317. qe: 0x2401,
  4318. nmps: 23,
  4319. nlps: 20,
  4320. switchFlag: 0
  4321. }, {
  4322. qe: 0x2201,
  4323. nmps: 24,
  4324. nlps: 21,
  4325. switchFlag: 0
  4326. }, {
  4327. qe: 0x1c01,
  4328. nmps: 25,
  4329. nlps: 22,
  4330. switchFlag: 0
  4331. }, {
  4332. qe: 0x1801,
  4333. nmps: 26,
  4334. nlps: 23,
  4335. switchFlag: 0
  4336. }, {
  4337. qe: 0x1601,
  4338. nmps: 27,
  4339. nlps: 24,
  4340. switchFlag: 0
  4341. }, {
  4342. qe: 0x1401,
  4343. nmps: 28,
  4344. nlps: 25,
  4345. switchFlag: 0
  4346. }, {
  4347. qe: 0x1201,
  4348. nmps: 29,
  4349. nlps: 26,
  4350. switchFlag: 0
  4351. }, {
  4352. qe: 0x1101,
  4353. nmps: 30,
  4354. nlps: 27,
  4355. switchFlag: 0
  4356. }, {
  4357. qe: 0x0ac1,
  4358. nmps: 31,
  4359. nlps: 28,
  4360. switchFlag: 0
  4361. }, {
  4362. qe: 0x09c1,
  4363. nmps: 32,
  4364. nlps: 29,
  4365. switchFlag: 0
  4366. }, {
  4367. qe: 0x08a1,
  4368. nmps: 33,
  4369. nlps: 30,
  4370. switchFlag: 0
  4371. }, {
  4372. qe: 0x0521,
  4373. nmps: 34,
  4374. nlps: 31,
  4375. switchFlag: 0
  4376. }, {
  4377. qe: 0x0441,
  4378. nmps: 35,
  4379. nlps: 32,
  4380. switchFlag: 0
  4381. }, {
  4382. qe: 0x02a1,
  4383. nmps: 36,
  4384. nlps: 33,
  4385. switchFlag: 0
  4386. }, {
  4387. qe: 0x0221,
  4388. nmps: 37,
  4389. nlps: 34,
  4390. switchFlag: 0
  4391. }, {
  4392. qe: 0x0141,
  4393. nmps: 38,
  4394. nlps: 35,
  4395. switchFlag: 0
  4396. }, {
  4397. qe: 0x0111,
  4398. nmps: 39,
  4399. nlps: 36,
  4400. switchFlag: 0
  4401. }, {
  4402. qe: 0x0085,
  4403. nmps: 40,
  4404. nlps: 37,
  4405. switchFlag: 0
  4406. }, {
  4407. qe: 0x0049,
  4408. nmps: 41,
  4409. nlps: 38,
  4410. switchFlag: 0
  4411. }, {
  4412. qe: 0x0025,
  4413. nmps: 42,
  4414. nlps: 39,
  4415. switchFlag: 0
  4416. }, {
  4417. qe: 0x0015,
  4418. nmps: 43,
  4419. nlps: 40,
  4420. switchFlag: 0
  4421. }, {
  4422. qe: 0x0009,
  4423. nmps: 44,
  4424. nlps: 41,
  4425. switchFlag: 0
  4426. }, {
  4427. qe: 0x0005,
  4428. nmps: 45,
  4429. nlps: 42,
  4430. switchFlag: 0
  4431. }, {
  4432. qe: 0x0001,
  4433. nmps: 45,
  4434. nlps: 43,
  4435. switchFlag: 0
  4436. }, {
  4437. qe: 0x5601,
  4438. nmps: 46,
  4439. nlps: 46,
  4440. switchFlag: 0
  4441. }];
  4442. class ArithmeticDecoder {
  4443. constructor(data, start, end) {
  4444. this.data = data;
  4445. this.bp = start;
  4446. this.dataEnd = end;
  4447. this.chigh = data[start];
  4448. this.clow = 0;
  4449. this.byteIn();
  4450. this.chigh = this.chigh << 7 & 0xffff | this.clow >> 9 & 0x7f;
  4451. this.clow = this.clow << 7 & 0xffff;
  4452. this.ct -= 7;
  4453. this.a = 0x8000;
  4454. }
  4455. byteIn() {
  4456. const data = this.data;
  4457. let bp = this.bp;
  4458. if (data[bp] === 0xff) {
  4459. if (data[bp + 1] > 0x8f) {
  4460. this.clow += 0xff00;
  4461. this.ct = 8;
  4462. } else {
  4463. bp++;
  4464. this.clow += data[bp] << 9;
  4465. this.ct = 7;
  4466. this.bp = bp;
  4467. }
  4468. } else {
  4469. bp++;
  4470. this.clow += bp < this.dataEnd ? data[bp] << 8 : 0xff00;
  4471. this.ct = 8;
  4472. this.bp = bp;
  4473. }
  4474. if (this.clow > 0xffff) {
  4475. this.chigh += this.clow >> 16;
  4476. this.clow &= 0xffff;
  4477. }
  4478. }
  4479. readBit(contexts, pos) {
  4480. let cx_index = contexts[pos] >> 1,
  4481. cx_mps = contexts[pos] & 1;
  4482. const qeTableIcx = QeTable[cx_index];
  4483. const qeIcx = qeTableIcx.qe;
  4484. let d;
  4485. let a = this.a - qeIcx;
  4486. if (this.chigh < qeIcx) {
  4487. if (a < qeIcx) {
  4488. a = qeIcx;
  4489. d = cx_mps;
  4490. cx_index = qeTableIcx.nmps;
  4491. } else {
  4492. a = qeIcx;
  4493. d = 1 ^ cx_mps;
  4494. if (qeTableIcx.switchFlag === 1) {
  4495. cx_mps = d;
  4496. }
  4497. cx_index = qeTableIcx.nlps;
  4498. }
  4499. } else {
  4500. this.chigh -= qeIcx;
  4501. if ((a & 0x8000) !== 0) {
  4502. this.a = a;
  4503. return cx_mps;
  4504. }
  4505. if (a < qeIcx) {
  4506. d = 1 ^ cx_mps;
  4507. if (qeTableIcx.switchFlag === 1) {
  4508. cx_mps = d;
  4509. }
  4510. cx_index = qeTableIcx.nlps;
  4511. } else {
  4512. d = cx_mps;
  4513. cx_index = qeTableIcx.nmps;
  4514. }
  4515. }
  4516. do {
  4517. if (this.ct === 0) {
  4518. this.byteIn();
  4519. }
  4520. a <<= 1;
  4521. this.chigh = this.chigh << 1 & 0xffff | this.clow >> 15 & 1;
  4522. this.clow = this.clow << 1 & 0xffff;
  4523. this.ct--;
  4524. } while ((a & 0x8000) === 0);
  4525. this.a = a;
  4526. contexts[pos] = cx_index << 1 | cx_mps;
  4527. return d;
  4528. }
  4529. }
  4530. ;// CONCATENATED MODULE: ./src/core/jbig2.js
  4531. class Jbig2Error extends BaseException {
  4532. constructor(msg) {
  4533. super(msg, "Jbig2Error");
  4534. }
  4535. }
  4536. class ContextCache {
  4537. getContexts(id) {
  4538. if (id in this) {
  4539. return this[id];
  4540. }
  4541. return this[id] = new Int8Array(1 << 16);
  4542. }
  4543. }
  4544. class DecodingContext {
  4545. constructor(data, start, end) {
  4546. this.data = data;
  4547. this.start = start;
  4548. this.end = end;
  4549. }
  4550. get decoder() {
  4551. const decoder = new ArithmeticDecoder(this.data, this.start, this.end);
  4552. return shadow(this, "decoder", decoder);
  4553. }
  4554. get contextCache() {
  4555. const cache = new ContextCache();
  4556. return shadow(this, "contextCache", cache);
  4557. }
  4558. }
  4559. const MAX_INT_32 = 2 ** 31 - 1;
  4560. const MIN_INT_32 = -(2 ** 31);
  4561. function decodeInteger(contextCache, procedure, decoder) {
  4562. const contexts = contextCache.getContexts(procedure);
  4563. let prev = 1;
  4564. function readBits(length) {
  4565. let v = 0;
  4566. for (let i = 0; i < length; i++) {
  4567. const bit = decoder.readBit(contexts, prev);
  4568. prev = prev < 256 ? prev << 1 | bit : (prev << 1 | bit) & 511 | 256;
  4569. v = v << 1 | bit;
  4570. }
  4571. return v >>> 0;
  4572. }
  4573. const sign = readBits(1);
  4574. 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);
  4575. let signedValue;
  4576. if (sign === 0) {
  4577. signedValue = value;
  4578. } else if (value > 0) {
  4579. signedValue = -value;
  4580. }
  4581. if (signedValue >= MIN_INT_32 && signedValue <= MAX_INT_32) {
  4582. return signedValue;
  4583. }
  4584. return null;
  4585. }
  4586. function decodeIAID(contextCache, decoder, codeLength) {
  4587. const contexts = contextCache.getContexts("IAID");
  4588. let prev = 1;
  4589. for (let i = 0; i < codeLength; i++) {
  4590. const bit = decoder.readBit(contexts, prev);
  4591. prev = prev << 1 | bit;
  4592. }
  4593. if (codeLength < 31) {
  4594. return prev & (1 << codeLength) - 1;
  4595. }
  4596. return prev & 0x7fffffff;
  4597. }
  4598. 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"];
  4599. const CodingTemplates = [[{
  4600. x: -1,
  4601. y: -2
  4602. }, {
  4603. x: 0,
  4604. y: -2
  4605. }, {
  4606. x: 1,
  4607. y: -2
  4608. }, {
  4609. x: -2,
  4610. y: -1
  4611. }, {
  4612. x: -1,
  4613. y: -1
  4614. }, {
  4615. x: 0,
  4616. y: -1
  4617. }, {
  4618. x: 1,
  4619. y: -1
  4620. }, {
  4621. x: 2,
  4622. y: -1
  4623. }, {
  4624. x: -4,
  4625. y: 0
  4626. }, {
  4627. x: -3,
  4628. y: 0
  4629. }, {
  4630. x: -2,
  4631. y: 0
  4632. }, {
  4633. x: -1,
  4634. y: 0
  4635. }], [{
  4636. x: -1,
  4637. y: -2
  4638. }, {
  4639. x: 0,
  4640. y: -2
  4641. }, {
  4642. x: 1,
  4643. y: -2
  4644. }, {
  4645. x: 2,
  4646. y: -2
  4647. }, {
  4648. x: -2,
  4649. y: -1
  4650. }, {
  4651. x: -1,
  4652. y: -1
  4653. }, {
  4654. x: 0,
  4655. y: -1
  4656. }, {
  4657. x: 1,
  4658. y: -1
  4659. }, {
  4660. x: 2,
  4661. y: -1
  4662. }, {
  4663. x: -3,
  4664. y: 0
  4665. }, {
  4666. x: -2,
  4667. y: 0
  4668. }, {
  4669. x: -1,
  4670. y: 0
  4671. }], [{
  4672. x: -1,
  4673. y: -2
  4674. }, {
  4675. x: 0,
  4676. y: -2
  4677. }, {
  4678. x: 1,
  4679. y: -2
  4680. }, {
  4681. x: -2,
  4682. y: -1
  4683. }, {
  4684. x: -1,
  4685. y: -1
  4686. }, {
  4687. x: 0,
  4688. y: -1
  4689. }, {
  4690. x: 1,
  4691. y: -1
  4692. }, {
  4693. x: -2,
  4694. y: 0
  4695. }, {
  4696. x: -1,
  4697. y: 0
  4698. }], [{
  4699. x: -3,
  4700. y: -1
  4701. }, {
  4702. x: -2,
  4703. y: -1
  4704. }, {
  4705. x: -1,
  4706. y: -1
  4707. }, {
  4708. x: 0,
  4709. y: -1
  4710. }, {
  4711. x: 1,
  4712. y: -1
  4713. }, {
  4714. x: -4,
  4715. y: 0
  4716. }, {
  4717. x: -3,
  4718. y: 0
  4719. }, {
  4720. x: -2,
  4721. y: 0
  4722. }, {
  4723. x: -1,
  4724. y: 0
  4725. }]];
  4726. const RefinementTemplates = [{
  4727. coding: [{
  4728. x: 0,
  4729. y: -1
  4730. }, {
  4731. x: 1,
  4732. y: -1
  4733. }, {
  4734. x: -1,
  4735. y: 0
  4736. }],
  4737. reference: [{
  4738. x: 0,
  4739. y: -1
  4740. }, {
  4741. x: 1,
  4742. y: -1
  4743. }, {
  4744. x: -1,
  4745. y: 0
  4746. }, {
  4747. x: 0,
  4748. y: 0
  4749. }, {
  4750. x: 1,
  4751. y: 0
  4752. }, {
  4753. x: -1,
  4754. y: 1
  4755. }, {
  4756. x: 0,
  4757. y: 1
  4758. }, {
  4759. x: 1,
  4760. y: 1
  4761. }]
  4762. }, {
  4763. coding: [{
  4764. x: -1,
  4765. y: -1
  4766. }, {
  4767. x: 0,
  4768. y: -1
  4769. }, {
  4770. x: 1,
  4771. y: -1
  4772. }, {
  4773. x: -1,
  4774. y: 0
  4775. }],
  4776. reference: [{
  4777. x: 0,
  4778. y: -1
  4779. }, {
  4780. x: -1,
  4781. y: 0
  4782. }, {
  4783. x: 0,
  4784. y: 0
  4785. }, {
  4786. x: 1,
  4787. y: 0
  4788. }, {
  4789. x: 0,
  4790. y: 1
  4791. }, {
  4792. x: 1,
  4793. y: 1
  4794. }]
  4795. }];
  4796. const ReusedContexts = [0x9b25, 0x0795, 0x00e5, 0x0195];
  4797. const RefinementReusedContexts = [0x0020, 0x0008];
  4798. function decodeBitmapTemplate0(width, height, decodingContext) {
  4799. const decoder = decodingContext.decoder;
  4800. const contexts = decodingContext.contextCache.getContexts("GB");
  4801. const bitmap = [];
  4802. let contextLabel, i, j, pixel, row, row1, row2;
  4803. const OLD_PIXEL_MASK = 0x7bf7;
  4804. for (i = 0; i < height; i++) {
  4805. row = bitmap[i] = new Uint8Array(width);
  4806. row1 = i < 1 ? row : bitmap[i - 1];
  4807. row2 = i < 2 ? row : bitmap[i - 2];
  4808. contextLabel = row2[0] << 13 | row2[1] << 12 | row2[2] << 11 | row1[0] << 7 | row1[1] << 6 | row1[2] << 5 | row1[3] << 4;
  4809. for (j = 0; j < width; j++) {
  4810. row[j] = pixel = decoder.readBit(contexts, contextLabel);
  4811. contextLabel = (contextLabel & OLD_PIXEL_MASK) << 1 | (j + 3 < width ? row2[j + 3] << 11 : 0) | (j + 4 < width ? row1[j + 4] << 4 : 0) | pixel;
  4812. }
  4813. }
  4814. return bitmap;
  4815. }
  4816. function decodeBitmap(mmr, width, height, templateIndex, prediction, skip, at, decodingContext) {
  4817. if (mmr) {
  4818. const input = new Reader(decodingContext.data, decodingContext.start, decodingContext.end);
  4819. return decodeMMRBitmap(input, width, height, false);
  4820. }
  4821. 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) {
  4822. return decodeBitmapTemplate0(width, height, decodingContext);
  4823. }
  4824. const useskip = !!skip;
  4825. const template = CodingTemplates[templateIndex].concat(at);
  4826. template.sort(function (a, b) {
  4827. return a.y - b.y || a.x - b.x;
  4828. });
  4829. const templateLength = template.length;
  4830. const templateX = new Int8Array(templateLength);
  4831. const templateY = new Int8Array(templateLength);
  4832. const changingTemplateEntries = [];
  4833. let reuseMask = 0,
  4834. minX = 0,
  4835. maxX = 0,
  4836. minY = 0;
  4837. let c, k;
  4838. for (k = 0; k < templateLength; k++) {
  4839. templateX[k] = template[k].x;
  4840. templateY[k] = template[k].y;
  4841. minX = Math.min(minX, template[k].x);
  4842. maxX = Math.max(maxX, template[k].x);
  4843. minY = Math.min(minY, template[k].y);
  4844. if (k < templateLength - 1 && template[k].y === template[k + 1].y && template[k].x === template[k + 1].x - 1) {
  4845. reuseMask |= 1 << templateLength - 1 - k;
  4846. } else {
  4847. changingTemplateEntries.push(k);
  4848. }
  4849. }
  4850. const changingEntriesLength = changingTemplateEntries.length;
  4851. const changingTemplateX = new Int8Array(changingEntriesLength);
  4852. const changingTemplateY = new Int8Array(changingEntriesLength);
  4853. const changingTemplateBit = new Uint16Array(changingEntriesLength);
  4854. for (c = 0; c < changingEntriesLength; c++) {
  4855. k = changingTemplateEntries[c];
  4856. changingTemplateX[c] = template[k].x;
  4857. changingTemplateY[c] = template[k].y;
  4858. changingTemplateBit[c] = 1 << templateLength - 1 - k;
  4859. }
  4860. const sbb_left = -minX;
  4861. const sbb_top = -minY;
  4862. const sbb_right = width - maxX;
  4863. const pseudoPixelContext = ReusedContexts[templateIndex];
  4864. let row = new Uint8Array(width);
  4865. const bitmap = [];
  4866. const decoder = decodingContext.decoder;
  4867. const contexts = decodingContext.contextCache.getContexts("GB");
  4868. let ltp = 0,
  4869. j,
  4870. i0,
  4871. j0,
  4872. contextLabel = 0,
  4873. bit,
  4874. shift;
  4875. for (let i = 0; i < height; i++) {
  4876. if (prediction) {
  4877. const sltp = decoder.readBit(contexts, pseudoPixelContext);
  4878. ltp ^= sltp;
  4879. if (ltp) {
  4880. bitmap.push(row);
  4881. continue;
  4882. }
  4883. }
  4884. row = new Uint8Array(row);
  4885. bitmap.push(row);
  4886. for (j = 0; j < width; j++) {
  4887. if (useskip && skip[i][j]) {
  4888. row[j] = 0;
  4889. continue;
  4890. }
  4891. if (j >= sbb_left && j < sbb_right && i >= sbb_top) {
  4892. contextLabel = contextLabel << 1 & reuseMask;
  4893. for (k = 0; k < changingEntriesLength; k++) {
  4894. i0 = i + changingTemplateY[k];
  4895. j0 = j + changingTemplateX[k];
  4896. bit = bitmap[i0][j0];
  4897. if (bit) {
  4898. bit = changingTemplateBit[k];
  4899. contextLabel |= bit;
  4900. }
  4901. }
  4902. } else {
  4903. contextLabel = 0;
  4904. shift = templateLength - 1;
  4905. for (k = 0; k < templateLength; k++, shift--) {
  4906. j0 = j + templateX[k];
  4907. if (j0 >= 0 && j0 < width) {
  4908. i0 = i + templateY[k];
  4909. if (i0 >= 0) {
  4910. bit = bitmap[i0][j0];
  4911. if (bit) {
  4912. contextLabel |= bit << shift;
  4913. }
  4914. }
  4915. }
  4916. }
  4917. }
  4918. const pixel = decoder.readBit(contexts, contextLabel);
  4919. row[j] = pixel;
  4920. }
  4921. }
  4922. return bitmap;
  4923. }
  4924. function decodeRefinement(width, height, templateIndex, referenceBitmap, offsetX, offsetY, prediction, at, decodingContext) {
  4925. let codingTemplate = RefinementTemplates[templateIndex].coding;
  4926. if (templateIndex === 0) {
  4927. codingTemplate = codingTemplate.concat([at[0]]);
  4928. }
  4929. const codingTemplateLength = codingTemplate.length;
  4930. const codingTemplateX = new Int32Array(codingTemplateLength);
  4931. const codingTemplateY = new Int32Array(codingTemplateLength);
  4932. let k;
  4933. for (k = 0; k < codingTemplateLength; k++) {
  4934. codingTemplateX[k] = codingTemplate[k].x;
  4935. codingTemplateY[k] = codingTemplate[k].y;
  4936. }
  4937. let referenceTemplate = RefinementTemplates[templateIndex].reference;
  4938. if (templateIndex === 0) {
  4939. referenceTemplate = referenceTemplate.concat([at[1]]);
  4940. }
  4941. const referenceTemplateLength = referenceTemplate.length;
  4942. const referenceTemplateX = new Int32Array(referenceTemplateLength);
  4943. const referenceTemplateY = new Int32Array(referenceTemplateLength);
  4944. for (k = 0; k < referenceTemplateLength; k++) {
  4945. referenceTemplateX[k] = referenceTemplate[k].x;
  4946. referenceTemplateY[k] = referenceTemplate[k].y;
  4947. }
  4948. const referenceWidth = referenceBitmap[0].length;
  4949. const referenceHeight = referenceBitmap.length;
  4950. const pseudoPixelContext = RefinementReusedContexts[templateIndex];
  4951. const bitmap = [];
  4952. const decoder = decodingContext.decoder;
  4953. const contexts = decodingContext.contextCache.getContexts("GR");
  4954. let ltp = 0;
  4955. for (let i = 0; i < height; i++) {
  4956. if (prediction) {
  4957. const sltp = decoder.readBit(contexts, pseudoPixelContext);
  4958. ltp ^= sltp;
  4959. if (ltp) {
  4960. throw new Jbig2Error("prediction is not supported");
  4961. }
  4962. }
  4963. const row = new Uint8Array(width);
  4964. bitmap.push(row);
  4965. for (let j = 0; j < width; j++) {
  4966. let i0, j0;
  4967. let contextLabel = 0;
  4968. for (k = 0; k < codingTemplateLength; k++) {
  4969. i0 = i + codingTemplateY[k];
  4970. j0 = j + codingTemplateX[k];
  4971. if (i0 < 0 || j0 < 0 || j0 >= width) {
  4972. contextLabel <<= 1;
  4973. } else {
  4974. contextLabel = contextLabel << 1 | bitmap[i0][j0];
  4975. }
  4976. }
  4977. for (k = 0; k < referenceTemplateLength; k++) {
  4978. i0 = i + referenceTemplateY[k] - offsetY;
  4979. j0 = j + referenceTemplateX[k] - offsetX;
  4980. if (i0 < 0 || i0 >= referenceHeight || j0 < 0 || j0 >= referenceWidth) {
  4981. contextLabel <<= 1;
  4982. } else {
  4983. contextLabel = contextLabel << 1 | referenceBitmap[i0][j0];
  4984. }
  4985. }
  4986. const pixel = decoder.readBit(contexts, contextLabel);
  4987. row[j] = pixel;
  4988. }
  4989. }
  4990. return bitmap;
  4991. }
  4992. function decodeSymbolDictionary(huffman, refinement, symbols, numberOfNewSymbols, numberOfExportedSymbols, huffmanTables, templateIndex, at, refinementTemplateIndex, refinementAt, decodingContext, huffmanInput) {
  4993. if (huffman && refinement) {
  4994. throw new Jbig2Error("symbol refinement with Huffman is not supported");
  4995. }
  4996. const newSymbols = [];
  4997. let currentHeight = 0;
  4998. let symbolCodeLength = log2(symbols.length + numberOfNewSymbols);
  4999. const decoder = decodingContext.decoder;
  5000. const contextCache = decodingContext.contextCache;
  5001. let tableB1, symbolWidths;
  5002. if (huffman) {
  5003. tableB1 = getStandardTable(1);
  5004. symbolWidths = [];
  5005. symbolCodeLength = Math.max(symbolCodeLength, 1);
  5006. }
  5007. while (newSymbols.length < numberOfNewSymbols) {
  5008. const deltaHeight = huffman ? huffmanTables.tableDeltaHeight.decode(huffmanInput) : decodeInteger(contextCache, "IADH", decoder);
  5009. currentHeight += deltaHeight;
  5010. let currentWidth = 0,
  5011. totalWidth = 0;
  5012. const firstSymbol = huffman ? symbolWidths.length : 0;
  5013. while (true) {
  5014. const deltaWidth = huffman ? huffmanTables.tableDeltaWidth.decode(huffmanInput) : decodeInteger(contextCache, "IADW", decoder);
  5015. if (deltaWidth === null) {
  5016. break;
  5017. }
  5018. currentWidth += deltaWidth;
  5019. totalWidth += currentWidth;
  5020. let bitmap;
  5021. if (refinement) {
  5022. const numberOfInstances = decodeInteger(contextCache, "IAAI", decoder);
  5023. if (numberOfInstances > 1) {
  5024. bitmap = decodeTextRegion(huffman, refinement, currentWidth, currentHeight, 0, numberOfInstances, 1, symbols.concat(newSymbols), symbolCodeLength, 0, 0, 1, 0, huffmanTables, refinementTemplateIndex, refinementAt, decodingContext, 0, huffmanInput);
  5025. } else {
  5026. const symbolId = decodeIAID(contextCache, decoder, symbolCodeLength);
  5027. const rdx = decodeInteger(contextCache, "IARDX", decoder);
  5028. const rdy = decodeInteger(contextCache, "IARDY", decoder);
  5029. const symbol = symbolId < symbols.length ? symbols[symbolId] : newSymbols[symbolId - symbols.length];
  5030. bitmap = decodeRefinement(currentWidth, currentHeight, refinementTemplateIndex, symbol, rdx, rdy, false, refinementAt, decodingContext);
  5031. }
  5032. newSymbols.push(bitmap);
  5033. } else if (huffman) {
  5034. symbolWidths.push(currentWidth);
  5035. } else {
  5036. bitmap = decodeBitmap(false, currentWidth, currentHeight, templateIndex, false, null, at, decodingContext);
  5037. newSymbols.push(bitmap);
  5038. }
  5039. }
  5040. if (huffman && !refinement) {
  5041. const bitmapSize = huffmanTables.tableBitmapSize.decode(huffmanInput);
  5042. huffmanInput.byteAlign();
  5043. let collectiveBitmap;
  5044. if (bitmapSize === 0) {
  5045. collectiveBitmap = readUncompressedBitmap(huffmanInput, totalWidth, currentHeight);
  5046. } else {
  5047. const originalEnd = huffmanInput.end;
  5048. const bitmapEnd = huffmanInput.position + bitmapSize;
  5049. huffmanInput.end = bitmapEnd;
  5050. collectiveBitmap = decodeMMRBitmap(huffmanInput, totalWidth, currentHeight, false);
  5051. huffmanInput.end = originalEnd;
  5052. huffmanInput.position = bitmapEnd;
  5053. }
  5054. const numberOfSymbolsDecoded = symbolWidths.length;
  5055. if (firstSymbol === numberOfSymbolsDecoded - 1) {
  5056. newSymbols.push(collectiveBitmap);
  5057. } else {
  5058. let i,
  5059. y,
  5060. xMin = 0,
  5061. xMax,
  5062. bitmapWidth,
  5063. symbolBitmap;
  5064. for (i = firstSymbol; i < numberOfSymbolsDecoded; i++) {
  5065. bitmapWidth = symbolWidths[i];
  5066. xMax = xMin + bitmapWidth;
  5067. symbolBitmap = [];
  5068. for (y = 0; y < currentHeight; y++) {
  5069. symbolBitmap.push(collectiveBitmap[y].subarray(xMin, xMax));
  5070. }
  5071. newSymbols.push(symbolBitmap);
  5072. xMin = xMax;
  5073. }
  5074. }
  5075. }
  5076. }
  5077. const exportedSymbols = [],
  5078. flags = [];
  5079. let currentFlag = false,
  5080. i,
  5081. ii;
  5082. const totalSymbolsLength = symbols.length + numberOfNewSymbols;
  5083. while (flags.length < totalSymbolsLength) {
  5084. let runLength = huffman ? tableB1.decode(huffmanInput) : decodeInteger(contextCache, "IAEX", decoder);
  5085. while (runLength--) {
  5086. flags.push(currentFlag);
  5087. }
  5088. currentFlag = !currentFlag;
  5089. }
  5090. for (i = 0, ii = symbols.length; i < ii; i++) {
  5091. if (flags[i]) {
  5092. exportedSymbols.push(symbols[i]);
  5093. }
  5094. }
  5095. for (let j = 0; j < numberOfNewSymbols; i++, j++) {
  5096. if (flags[i]) {
  5097. exportedSymbols.push(newSymbols[j]);
  5098. }
  5099. }
  5100. return exportedSymbols;
  5101. }
  5102. function decodeTextRegion(huffman, refinement, width, height, defaultPixelValue, numberOfSymbolInstances, stripSize, inputSymbols, symbolCodeLength, transposed, dsOffset, referenceCorner, combinationOperator, huffmanTables, refinementTemplateIndex, refinementAt, decodingContext, logStripSize, huffmanInput) {
  5103. if (huffman && refinement) {
  5104. throw new Jbig2Error("refinement with Huffman is not supported");
  5105. }
  5106. const bitmap = [];
  5107. let i, row;
  5108. for (i = 0; i < height; i++) {
  5109. row = new Uint8Array(width);
  5110. if (defaultPixelValue) {
  5111. for (let j = 0; j < width; j++) {
  5112. row[j] = defaultPixelValue;
  5113. }
  5114. }
  5115. bitmap.push(row);
  5116. }
  5117. const decoder = decodingContext.decoder;
  5118. const contextCache = decodingContext.contextCache;
  5119. let stripT = huffman ? -huffmanTables.tableDeltaT.decode(huffmanInput) : -decodeInteger(contextCache, "IADT", decoder);
  5120. let firstS = 0;
  5121. i = 0;
  5122. while (i < numberOfSymbolInstances) {
  5123. const deltaT = huffman ? huffmanTables.tableDeltaT.decode(huffmanInput) : decodeInteger(contextCache, "IADT", decoder);
  5124. stripT += deltaT;
  5125. const deltaFirstS = huffman ? huffmanTables.tableFirstS.decode(huffmanInput) : decodeInteger(contextCache, "IAFS", decoder);
  5126. firstS += deltaFirstS;
  5127. let currentS = firstS;
  5128. do {
  5129. let currentT = 0;
  5130. if (stripSize > 1) {
  5131. currentT = huffman ? huffmanInput.readBits(logStripSize) : decodeInteger(contextCache, "IAIT", decoder);
  5132. }
  5133. const t = stripSize * stripT + currentT;
  5134. const symbolId = huffman ? huffmanTables.symbolIDTable.decode(huffmanInput) : decodeIAID(contextCache, decoder, symbolCodeLength);
  5135. const applyRefinement = refinement && (huffman ? huffmanInput.readBit() : decodeInteger(contextCache, "IARI", decoder));
  5136. let symbolBitmap = inputSymbols[symbolId];
  5137. let symbolWidth = symbolBitmap[0].length;
  5138. let symbolHeight = symbolBitmap.length;
  5139. if (applyRefinement) {
  5140. const rdw = decodeInteger(contextCache, "IARDW", decoder);
  5141. const rdh = decodeInteger(contextCache, "IARDH", decoder);
  5142. const rdx = decodeInteger(contextCache, "IARDX", decoder);
  5143. const rdy = decodeInteger(contextCache, "IARDY", decoder);
  5144. symbolWidth += rdw;
  5145. symbolHeight += rdh;
  5146. symbolBitmap = decodeRefinement(symbolWidth, symbolHeight, refinementTemplateIndex, symbolBitmap, (rdw >> 1) + rdx, (rdh >> 1) + rdy, false, refinementAt, decodingContext);
  5147. }
  5148. let increment = 0;
  5149. if (!transposed) {
  5150. if (referenceCorner > 1) {
  5151. currentS += symbolWidth - 1;
  5152. } else {
  5153. increment = symbolWidth - 1;
  5154. }
  5155. } else if (!(referenceCorner & 1)) {
  5156. currentS += symbolHeight - 1;
  5157. } else {
  5158. increment = symbolHeight - 1;
  5159. }
  5160. const offsetT = t - (referenceCorner & 1 ? 0 : symbolHeight - 1);
  5161. const offsetS = currentS - (referenceCorner & 2 ? symbolWidth - 1 : 0);
  5162. let s2, t2, symbolRow;
  5163. if (transposed) {
  5164. for (s2 = 0; s2 < symbolHeight; s2++) {
  5165. row = bitmap[offsetS + s2];
  5166. if (!row) {
  5167. continue;
  5168. }
  5169. symbolRow = symbolBitmap[s2];
  5170. const maxWidth = Math.min(width - offsetT, symbolWidth);
  5171. switch (combinationOperator) {
  5172. case 0:
  5173. for (t2 = 0; t2 < maxWidth; t2++) {
  5174. row[offsetT + t2] |= symbolRow[t2];
  5175. }
  5176. break;
  5177. case 2:
  5178. for (t2 = 0; t2 < maxWidth; t2++) {
  5179. row[offsetT + t2] ^= symbolRow[t2];
  5180. }
  5181. break;
  5182. default:
  5183. throw new Jbig2Error(`operator ${combinationOperator} is not supported`);
  5184. }
  5185. }
  5186. } else {
  5187. for (t2 = 0; t2 < symbolHeight; t2++) {
  5188. row = bitmap[offsetT + t2];
  5189. if (!row) {
  5190. continue;
  5191. }
  5192. symbolRow = symbolBitmap[t2];
  5193. switch (combinationOperator) {
  5194. case 0:
  5195. for (s2 = 0; s2 < symbolWidth; s2++) {
  5196. row[offsetS + s2] |= symbolRow[s2];
  5197. }
  5198. break;
  5199. case 2:
  5200. for (s2 = 0; s2 < symbolWidth; s2++) {
  5201. row[offsetS + s2] ^= symbolRow[s2];
  5202. }
  5203. break;
  5204. default:
  5205. throw new Jbig2Error(`operator ${combinationOperator} is not supported`);
  5206. }
  5207. }
  5208. }
  5209. i++;
  5210. const deltaS = huffman ? huffmanTables.tableDeltaS.decode(huffmanInput) : decodeInteger(contextCache, "IADS", decoder);
  5211. if (deltaS === null) {
  5212. break;
  5213. }
  5214. currentS += increment + deltaS + dsOffset;
  5215. } while (true);
  5216. }
  5217. return bitmap;
  5218. }
  5219. function decodePatternDictionary(mmr, patternWidth, patternHeight, maxPatternIndex, template, decodingContext) {
  5220. const at = [];
  5221. if (!mmr) {
  5222. at.push({
  5223. x: -patternWidth,
  5224. y: 0
  5225. });
  5226. if (template === 0) {
  5227. at.push({
  5228. x: -3,
  5229. y: -1
  5230. }, {
  5231. x: 2,
  5232. y: -2
  5233. }, {
  5234. x: -2,
  5235. y: -2
  5236. });
  5237. }
  5238. }
  5239. const collectiveWidth = (maxPatternIndex + 1) * patternWidth;
  5240. const collectiveBitmap = decodeBitmap(mmr, collectiveWidth, patternHeight, template, false, null, at, decodingContext);
  5241. const patterns = [];
  5242. for (let i = 0; i <= maxPatternIndex; i++) {
  5243. const patternBitmap = [];
  5244. const xMin = patternWidth * i;
  5245. const xMax = xMin + patternWidth;
  5246. for (let y = 0; y < patternHeight; y++) {
  5247. patternBitmap.push(collectiveBitmap[y].subarray(xMin, xMax));
  5248. }
  5249. patterns.push(patternBitmap);
  5250. }
  5251. return patterns;
  5252. }
  5253. function decodeHalftoneRegion(mmr, patterns, template, regionWidth, regionHeight, defaultPixelValue, enableSkip, combinationOperator, gridWidth, gridHeight, gridOffsetX, gridOffsetY, gridVectorX, gridVectorY, decodingContext) {
  5254. const skip = null;
  5255. if (enableSkip) {
  5256. throw new Jbig2Error("skip is not supported");
  5257. }
  5258. if (combinationOperator !== 0) {
  5259. throw new Jbig2Error(`operator "${combinationOperator}" is not supported in halftone region`);
  5260. }
  5261. const regionBitmap = [];
  5262. let i, j, row;
  5263. for (i = 0; i < regionHeight; i++) {
  5264. row = new Uint8Array(regionWidth);
  5265. if (defaultPixelValue) {
  5266. for (j = 0; j < regionWidth; j++) {
  5267. row[j] = defaultPixelValue;
  5268. }
  5269. }
  5270. regionBitmap.push(row);
  5271. }
  5272. const numberOfPatterns = patterns.length;
  5273. const pattern0 = patterns[0];
  5274. const patternWidth = pattern0[0].length,
  5275. patternHeight = pattern0.length;
  5276. const bitsPerValue = log2(numberOfPatterns);
  5277. const at = [];
  5278. if (!mmr) {
  5279. at.push({
  5280. x: template <= 1 ? 3 : 2,
  5281. y: -1
  5282. });
  5283. if (template === 0) {
  5284. at.push({
  5285. x: -3,
  5286. y: -1
  5287. }, {
  5288. x: 2,
  5289. y: -2
  5290. }, {
  5291. x: -2,
  5292. y: -2
  5293. });
  5294. }
  5295. }
  5296. const grayScaleBitPlanes = [];
  5297. let mmrInput, bitmap;
  5298. if (mmr) {
  5299. mmrInput = new Reader(decodingContext.data, decodingContext.start, decodingContext.end);
  5300. }
  5301. for (i = bitsPerValue - 1; i >= 0; i--) {
  5302. if (mmr) {
  5303. bitmap = decodeMMRBitmap(mmrInput, gridWidth, gridHeight, true);
  5304. } else {
  5305. bitmap = decodeBitmap(false, gridWidth, gridHeight, template, false, skip, at, decodingContext);
  5306. }
  5307. grayScaleBitPlanes[i] = bitmap;
  5308. }
  5309. let mg, ng, bit, patternIndex, patternBitmap, x, y, patternRow, regionRow;
  5310. for (mg = 0; mg < gridHeight; mg++) {
  5311. for (ng = 0; ng < gridWidth; ng++) {
  5312. bit = 0;
  5313. patternIndex = 0;
  5314. for (j = bitsPerValue - 1; j >= 0; j--) {
  5315. bit ^= grayScaleBitPlanes[j][mg][ng];
  5316. patternIndex |= bit << j;
  5317. }
  5318. patternBitmap = patterns[patternIndex];
  5319. x = gridOffsetX + mg * gridVectorY + ng * gridVectorX >> 8;
  5320. y = gridOffsetY + mg * gridVectorX - ng * gridVectorY >> 8;
  5321. if (x >= 0 && x + patternWidth <= regionWidth && y >= 0 && y + patternHeight <= regionHeight) {
  5322. for (i = 0; i < patternHeight; i++) {
  5323. regionRow = regionBitmap[y + i];
  5324. patternRow = patternBitmap[i];
  5325. for (j = 0; j < patternWidth; j++) {
  5326. regionRow[x + j] |= patternRow[j];
  5327. }
  5328. }
  5329. } else {
  5330. let regionX, regionY;
  5331. for (i = 0; i < patternHeight; i++) {
  5332. regionY = y + i;
  5333. if (regionY < 0 || regionY >= regionHeight) {
  5334. continue;
  5335. }
  5336. regionRow = regionBitmap[regionY];
  5337. patternRow = patternBitmap[i];
  5338. for (j = 0; j < patternWidth; j++) {
  5339. regionX = x + j;
  5340. if (regionX >= 0 && regionX < regionWidth) {
  5341. regionRow[regionX] |= patternRow[j];
  5342. }
  5343. }
  5344. }
  5345. }
  5346. }
  5347. }
  5348. return regionBitmap;
  5349. }
  5350. function readSegmentHeader(data, start) {
  5351. const segmentHeader = {};
  5352. segmentHeader.number = readUint32(data, start);
  5353. const flags = data[start + 4];
  5354. const segmentType = flags & 0x3f;
  5355. if (!SegmentTypes[segmentType]) {
  5356. throw new Jbig2Error("invalid segment type: " + segmentType);
  5357. }
  5358. segmentHeader.type = segmentType;
  5359. segmentHeader.typeName = SegmentTypes[segmentType];
  5360. segmentHeader.deferredNonRetain = !!(flags & 0x80);
  5361. const pageAssociationFieldSize = !!(flags & 0x40);
  5362. const referredFlags = data[start + 5];
  5363. let referredToCount = referredFlags >> 5 & 7;
  5364. const retainBits = [referredFlags & 31];
  5365. let position = start + 6;
  5366. if (referredFlags === 7) {
  5367. referredToCount = readUint32(data, position - 1) & 0x1fffffff;
  5368. position += 3;
  5369. let bytes = referredToCount + 7 >> 3;
  5370. retainBits[0] = data[position++];
  5371. while (--bytes > 0) {
  5372. retainBits.push(data[position++]);
  5373. }
  5374. } else if (referredFlags === 5 || referredFlags === 6) {
  5375. throw new Jbig2Error("invalid referred-to flags");
  5376. }
  5377. segmentHeader.retainBits = retainBits;
  5378. let referredToSegmentNumberSize = 4;
  5379. if (segmentHeader.number <= 256) {
  5380. referredToSegmentNumberSize = 1;
  5381. } else if (segmentHeader.number <= 65536) {
  5382. referredToSegmentNumberSize = 2;
  5383. }
  5384. const referredTo = [];
  5385. let i, ii;
  5386. for (i = 0; i < referredToCount; i++) {
  5387. let number;
  5388. if (referredToSegmentNumberSize === 1) {
  5389. number = data[position];
  5390. } else if (referredToSegmentNumberSize === 2) {
  5391. number = readUint16(data, position);
  5392. } else {
  5393. number = readUint32(data, position);
  5394. }
  5395. referredTo.push(number);
  5396. position += referredToSegmentNumberSize;
  5397. }
  5398. segmentHeader.referredTo = referredTo;
  5399. if (!pageAssociationFieldSize) {
  5400. segmentHeader.pageAssociation = data[position++];
  5401. } else {
  5402. segmentHeader.pageAssociation = readUint32(data, position);
  5403. position += 4;
  5404. }
  5405. segmentHeader.length = readUint32(data, position);
  5406. position += 4;
  5407. if (segmentHeader.length === 0xffffffff) {
  5408. if (segmentType === 38) {
  5409. const genericRegionInfo = readRegionSegmentInformation(data, position);
  5410. const genericRegionSegmentFlags = data[position + RegionSegmentInformationFieldLength];
  5411. const genericRegionMmr = !!(genericRegionSegmentFlags & 1);
  5412. const searchPatternLength = 6;
  5413. const searchPattern = new Uint8Array(searchPatternLength);
  5414. if (!genericRegionMmr) {
  5415. searchPattern[0] = 0xff;
  5416. searchPattern[1] = 0xac;
  5417. }
  5418. searchPattern[2] = genericRegionInfo.height >>> 24 & 0xff;
  5419. searchPattern[3] = genericRegionInfo.height >> 16 & 0xff;
  5420. searchPattern[4] = genericRegionInfo.height >> 8 & 0xff;
  5421. searchPattern[5] = genericRegionInfo.height & 0xff;
  5422. for (i = position, ii = data.length; i < ii; i++) {
  5423. let j = 0;
  5424. while (j < searchPatternLength && searchPattern[j] === data[i + j]) {
  5425. j++;
  5426. }
  5427. if (j === searchPatternLength) {
  5428. segmentHeader.length = i + searchPatternLength;
  5429. break;
  5430. }
  5431. }
  5432. if (segmentHeader.length === 0xffffffff) {
  5433. throw new Jbig2Error("segment end was not found");
  5434. }
  5435. } else {
  5436. throw new Jbig2Error("invalid unknown segment length");
  5437. }
  5438. }
  5439. segmentHeader.headerEnd = position;
  5440. return segmentHeader;
  5441. }
  5442. function readSegments(header, data, start, end) {
  5443. const segments = [];
  5444. let position = start;
  5445. while (position < end) {
  5446. const segmentHeader = readSegmentHeader(data, position);
  5447. position = segmentHeader.headerEnd;
  5448. const segment = {
  5449. header: segmentHeader,
  5450. data
  5451. };
  5452. if (!header.randomAccess) {
  5453. segment.start = position;
  5454. position += segmentHeader.length;
  5455. segment.end = position;
  5456. }
  5457. segments.push(segment);
  5458. if (segmentHeader.type === 51) {
  5459. break;
  5460. }
  5461. }
  5462. if (header.randomAccess) {
  5463. for (let i = 0, ii = segments.length; i < ii; i++) {
  5464. segments[i].start = position;
  5465. position += segments[i].header.length;
  5466. segments[i].end = position;
  5467. }
  5468. }
  5469. return segments;
  5470. }
  5471. function readRegionSegmentInformation(data, start) {
  5472. return {
  5473. width: readUint32(data, start),
  5474. height: readUint32(data, start + 4),
  5475. x: readUint32(data, start + 8),
  5476. y: readUint32(data, start + 12),
  5477. combinationOperator: data[start + 16] & 7
  5478. };
  5479. }
  5480. const RegionSegmentInformationFieldLength = 17;
  5481. function processSegment(segment, visitor) {
  5482. const header = segment.header;
  5483. const data = segment.data,
  5484. end = segment.end;
  5485. let position = segment.start;
  5486. let args, at, i, atLength;
  5487. switch (header.type) {
  5488. case 0:
  5489. const dictionary = {};
  5490. const dictionaryFlags = readUint16(data, position);
  5491. dictionary.huffman = !!(dictionaryFlags & 1);
  5492. dictionary.refinement = !!(dictionaryFlags & 2);
  5493. dictionary.huffmanDHSelector = dictionaryFlags >> 2 & 3;
  5494. dictionary.huffmanDWSelector = dictionaryFlags >> 4 & 3;
  5495. dictionary.bitmapSizeSelector = dictionaryFlags >> 6 & 1;
  5496. dictionary.aggregationInstancesSelector = dictionaryFlags >> 7 & 1;
  5497. dictionary.bitmapCodingContextUsed = !!(dictionaryFlags & 256);
  5498. dictionary.bitmapCodingContextRetained = !!(dictionaryFlags & 512);
  5499. dictionary.template = dictionaryFlags >> 10 & 3;
  5500. dictionary.refinementTemplate = dictionaryFlags >> 12 & 1;
  5501. position += 2;
  5502. if (!dictionary.huffman) {
  5503. atLength = dictionary.template === 0 ? 4 : 1;
  5504. at = [];
  5505. for (i = 0; i < atLength; i++) {
  5506. at.push({
  5507. x: readInt8(data, position),
  5508. y: readInt8(data, position + 1)
  5509. });
  5510. position += 2;
  5511. }
  5512. dictionary.at = at;
  5513. }
  5514. if (dictionary.refinement && !dictionary.refinementTemplate) {
  5515. at = [];
  5516. for (i = 0; i < 2; i++) {
  5517. at.push({
  5518. x: readInt8(data, position),
  5519. y: readInt8(data, position + 1)
  5520. });
  5521. position += 2;
  5522. }
  5523. dictionary.refinementAt = at;
  5524. }
  5525. dictionary.numberOfExportedSymbols = readUint32(data, position);
  5526. position += 4;
  5527. dictionary.numberOfNewSymbols = readUint32(data, position);
  5528. position += 4;
  5529. args = [dictionary, header.number, header.referredTo, data, position, end];
  5530. break;
  5531. case 6:
  5532. case 7:
  5533. const textRegion = {};
  5534. textRegion.info = readRegionSegmentInformation(data, position);
  5535. position += RegionSegmentInformationFieldLength;
  5536. const textRegionSegmentFlags = readUint16(data, position);
  5537. position += 2;
  5538. textRegion.huffman = !!(textRegionSegmentFlags & 1);
  5539. textRegion.refinement = !!(textRegionSegmentFlags & 2);
  5540. textRegion.logStripSize = textRegionSegmentFlags >> 2 & 3;
  5541. textRegion.stripSize = 1 << textRegion.logStripSize;
  5542. textRegion.referenceCorner = textRegionSegmentFlags >> 4 & 3;
  5543. textRegion.transposed = !!(textRegionSegmentFlags & 64);
  5544. textRegion.combinationOperator = textRegionSegmentFlags >> 7 & 3;
  5545. textRegion.defaultPixelValue = textRegionSegmentFlags >> 9 & 1;
  5546. textRegion.dsOffset = textRegionSegmentFlags << 17 >> 27;
  5547. textRegion.refinementTemplate = textRegionSegmentFlags >> 15 & 1;
  5548. if (textRegion.huffman) {
  5549. const textRegionHuffmanFlags = readUint16(data, position);
  5550. position += 2;
  5551. textRegion.huffmanFS = textRegionHuffmanFlags & 3;
  5552. textRegion.huffmanDS = textRegionHuffmanFlags >> 2 & 3;
  5553. textRegion.huffmanDT = textRegionHuffmanFlags >> 4 & 3;
  5554. textRegion.huffmanRefinementDW = textRegionHuffmanFlags >> 6 & 3;
  5555. textRegion.huffmanRefinementDH = textRegionHuffmanFlags >> 8 & 3;
  5556. textRegion.huffmanRefinementDX = textRegionHuffmanFlags >> 10 & 3;
  5557. textRegion.huffmanRefinementDY = textRegionHuffmanFlags >> 12 & 3;
  5558. textRegion.huffmanRefinementSizeSelector = !!(textRegionHuffmanFlags & 0x4000);
  5559. }
  5560. if (textRegion.refinement && !textRegion.refinementTemplate) {
  5561. at = [];
  5562. for (i = 0; i < 2; i++) {
  5563. at.push({
  5564. x: readInt8(data, position),
  5565. y: readInt8(data, position + 1)
  5566. });
  5567. position += 2;
  5568. }
  5569. textRegion.refinementAt = at;
  5570. }
  5571. textRegion.numberOfSymbolInstances = readUint32(data, position);
  5572. position += 4;
  5573. args = [textRegion, header.referredTo, data, position, end];
  5574. break;
  5575. case 16:
  5576. const patternDictionary = {};
  5577. const patternDictionaryFlags = data[position++];
  5578. patternDictionary.mmr = !!(patternDictionaryFlags & 1);
  5579. patternDictionary.template = patternDictionaryFlags >> 1 & 3;
  5580. patternDictionary.patternWidth = data[position++];
  5581. patternDictionary.patternHeight = data[position++];
  5582. patternDictionary.maxPatternIndex = readUint32(data, position);
  5583. position += 4;
  5584. args = [patternDictionary, header.number, data, position, end];
  5585. break;
  5586. case 22:
  5587. case 23:
  5588. const halftoneRegion = {};
  5589. halftoneRegion.info = readRegionSegmentInformation(data, position);
  5590. position += RegionSegmentInformationFieldLength;
  5591. const halftoneRegionFlags = data[position++];
  5592. halftoneRegion.mmr = !!(halftoneRegionFlags & 1);
  5593. halftoneRegion.template = halftoneRegionFlags >> 1 & 3;
  5594. halftoneRegion.enableSkip = !!(halftoneRegionFlags & 8);
  5595. halftoneRegion.combinationOperator = halftoneRegionFlags >> 4 & 7;
  5596. halftoneRegion.defaultPixelValue = halftoneRegionFlags >> 7 & 1;
  5597. halftoneRegion.gridWidth = readUint32(data, position);
  5598. position += 4;
  5599. halftoneRegion.gridHeight = readUint32(data, position);
  5600. position += 4;
  5601. halftoneRegion.gridOffsetX = readUint32(data, position) & 0xffffffff;
  5602. position += 4;
  5603. halftoneRegion.gridOffsetY = readUint32(data, position) & 0xffffffff;
  5604. position += 4;
  5605. halftoneRegion.gridVectorX = readUint16(data, position);
  5606. position += 2;
  5607. halftoneRegion.gridVectorY = readUint16(data, position);
  5608. position += 2;
  5609. args = [halftoneRegion, header.referredTo, data, position, end];
  5610. break;
  5611. case 38:
  5612. case 39:
  5613. const genericRegion = {};
  5614. genericRegion.info = readRegionSegmentInformation(data, position);
  5615. position += RegionSegmentInformationFieldLength;
  5616. const genericRegionSegmentFlags = data[position++];
  5617. genericRegion.mmr = !!(genericRegionSegmentFlags & 1);
  5618. genericRegion.template = genericRegionSegmentFlags >> 1 & 3;
  5619. genericRegion.prediction = !!(genericRegionSegmentFlags & 8);
  5620. if (!genericRegion.mmr) {
  5621. atLength = genericRegion.template === 0 ? 4 : 1;
  5622. at = [];
  5623. for (i = 0; i < atLength; i++) {
  5624. at.push({
  5625. x: readInt8(data, position),
  5626. y: readInt8(data, position + 1)
  5627. });
  5628. position += 2;
  5629. }
  5630. genericRegion.at = at;
  5631. }
  5632. args = [genericRegion, data, position, end];
  5633. break;
  5634. case 48:
  5635. const pageInfo = {
  5636. width: readUint32(data, position),
  5637. height: readUint32(data, position + 4),
  5638. resolutionX: readUint32(data, position + 8),
  5639. resolutionY: readUint32(data, position + 12)
  5640. };
  5641. if (pageInfo.height === 0xffffffff) {
  5642. delete pageInfo.height;
  5643. }
  5644. const pageSegmentFlags = data[position + 16];
  5645. readUint16(data, position + 17);
  5646. pageInfo.lossless = !!(pageSegmentFlags & 1);
  5647. pageInfo.refinement = !!(pageSegmentFlags & 2);
  5648. pageInfo.defaultPixelValue = pageSegmentFlags >> 2 & 1;
  5649. pageInfo.combinationOperator = pageSegmentFlags >> 3 & 3;
  5650. pageInfo.requiresBuffer = !!(pageSegmentFlags & 32);
  5651. pageInfo.combinationOperatorOverride = !!(pageSegmentFlags & 64);
  5652. args = [pageInfo];
  5653. break;
  5654. case 49:
  5655. break;
  5656. case 50:
  5657. break;
  5658. case 51:
  5659. break;
  5660. case 53:
  5661. args = [header.number, data, position, end];
  5662. break;
  5663. case 62:
  5664. break;
  5665. default:
  5666. throw new Jbig2Error(`segment type ${header.typeName}(${header.type}) is not implemented`);
  5667. }
  5668. const callbackName = "on" + header.typeName;
  5669. if (callbackName in visitor) {
  5670. visitor[callbackName].apply(visitor, args);
  5671. }
  5672. }
  5673. function processSegments(segments, visitor) {
  5674. for (let i = 0, ii = segments.length; i < ii; i++) {
  5675. processSegment(segments[i], visitor);
  5676. }
  5677. }
  5678. function parseJbig2Chunks(chunks) {
  5679. const visitor = new SimpleSegmentVisitor();
  5680. for (let i = 0, ii = chunks.length; i < ii; i++) {
  5681. const chunk = chunks[i];
  5682. const segments = readSegments({}, chunk.data, chunk.start, chunk.end);
  5683. processSegments(segments, visitor);
  5684. }
  5685. return visitor.buffer;
  5686. }
  5687. function parseJbig2(data) {
  5688. throw new Error("Not implemented: parseJbig2");
  5689. }
  5690. class SimpleSegmentVisitor {
  5691. onPageInformation(info) {
  5692. this.currentPageInfo = info;
  5693. const rowSize = info.width + 7 >> 3;
  5694. const buffer = new Uint8ClampedArray(rowSize * info.height);
  5695. if (info.defaultPixelValue) {
  5696. buffer.fill(0xff);
  5697. }
  5698. this.buffer = buffer;
  5699. }
  5700. drawBitmap(regionInfo, bitmap) {
  5701. const pageInfo = this.currentPageInfo;
  5702. const width = regionInfo.width,
  5703. height = regionInfo.height;
  5704. const rowSize = pageInfo.width + 7 >> 3;
  5705. const combinationOperator = pageInfo.combinationOperatorOverride ? regionInfo.combinationOperator : pageInfo.combinationOperator;
  5706. const buffer = this.buffer;
  5707. const mask0 = 128 >> (regionInfo.x & 7);
  5708. let offset0 = regionInfo.y * rowSize + (regionInfo.x >> 3);
  5709. let i, j, mask, offset;
  5710. switch (combinationOperator) {
  5711. case 0:
  5712. for (i = 0; i < height; i++) {
  5713. mask = mask0;
  5714. offset = offset0;
  5715. for (j = 0; j < width; j++) {
  5716. if (bitmap[i][j]) {
  5717. buffer[offset] |= mask;
  5718. }
  5719. mask >>= 1;
  5720. if (!mask) {
  5721. mask = 128;
  5722. offset++;
  5723. }
  5724. }
  5725. offset0 += rowSize;
  5726. }
  5727. break;
  5728. case 2:
  5729. for (i = 0; i < height; i++) {
  5730. mask = mask0;
  5731. offset = offset0;
  5732. for (j = 0; j < width; j++) {
  5733. if (bitmap[i][j]) {
  5734. buffer[offset] ^= mask;
  5735. }
  5736. mask >>= 1;
  5737. if (!mask) {
  5738. mask = 128;
  5739. offset++;
  5740. }
  5741. }
  5742. offset0 += rowSize;
  5743. }
  5744. break;
  5745. default:
  5746. throw new Jbig2Error(`operator ${combinationOperator} is not supported`);
  5747. }
  5748. }
  5749. onImmediateGenericRegion(region, data, start, end) {
  5750. const regionInfo = region.info;
  5751. const decodingContext = new DecodingContext(data, start, end);
  5752. const bitmap = decodeBitmap(region.mmr, regionInfo.width, regionInfo.height, region.template, region.prediction, null, region.at, decodingContext);
  5753. this.drawBitmap(regionInfo, bitmap);
  5754. }
  5755. onImmediateLosslessGenericRegion() {
  5756. this.onImmediateGenericRegion(...arguments);
  5757. }
  5758. onSymbolDictionary(dictionary, currentSegment, referredSegments, data, start, end) {
  5759. let huffmanTables, huffmanInput;
  5760. if (dictionary.huffman) {
  5761. huffmanTables = getSymbolDictionaryHuffmanTables(dictionary, referredSegments, this.customTables);
  5762. huffmanInput = new Reader(data, start, end);
  5763. }
  5764. let symbols = this.symbols;
  5765. if (!symbols) {
  5766. this.symbols = symbols = {};
  5767. }
  5768. const inputSymbols = [];
  5769. for (const referredSegment of referredSegments) {
  5770. const referredSymbols = symbols[referredSegment];
  5771. if (referredSymbols) {
  5772. inputSymbols.push(...referredSymbols);
  5773. }
  5774. }
  5775. const decodingContext = new DecodingContext(data, start, end);
  5776. symbols[currentSegment] = decodeSymbolDictionary(dictionary.huffman, dictionary.refinement, inputSymbols, dictionary.numberOfNewSymbols, dictionary.numberOfExportedSymbols, huffmanTables, dictionary.template, dictionary.at, dictionary.refinementTemplate, dictionary.refinementAt, decodingContext, huffmanInput);
  5777. }
  5778. onImmediateTextRegion(region, referredSegments, data, start, end) {
  5779. const regionInfo = region.info;
  5780. let huffmanTables, huffmanInput;
  5781. const symbols = this.symbols;
  5782. const inputSymbols = [];
  5783. for (const referredSegment of referredSegments) {
  5784. const referredSymbols = symbols[referredSegment];
  5785. if (referredSymbols) {
  5786. inputSymbols.push(...referredSymbols);
  5787. }
  5788. }
  5789. const symbolCodeLength = log2(inputSymbols.length);
  5790. if (region.huffman) {
  5791. huffmanInput = new Reader(data, start, end);
  5792. huffmanTables = getTextRegionHuffmanTables(region, referredSegments, this.customTables, inputSymbols.length, huffmanInput);
  5793. }
  5794. const decodingContext = new DecodingContext(data, start, end);
  5795. 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);
  5796. this.drawBitmap(regionInfo, bitmap);
  5797. }
  5798. onImmediateLosslessTextRegion() {
  5799. this.onImmediateTextRegion(...arguments);
  5800. }
  5801. onPatternDictionary(dictionary, currentSegment, data, start, end) {
  5802. let patterns = this.patterns;
  5803. if (!patterns) {
  5804. this.patterns = patterns = {};
  5805. }
  5806. const decodingContext = new DecodingContext(data, start, end);
  5807. patterns[currentSegment] = decodePatternDictionary(dictionary.mmr, dictionary.patternWidth, dictionary.patternHeight, dictionary.maxPatternIndex, dictionary.template, decodingContext);
  5808. }
  5809. onImmediateHalftoneRegion(region, referredSegments, data, start, end) {
  5810. const patterns = this.patterns[referredSegments[0]];
  5811. const regionInfo = region.info;
  5812. const decodingContext = new DecodingContext(data, start, end);
  5813. 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);
  5814. this.drawBitmap(regionInfo, bitmap);
  5815. }
  5816. onImmediateLosslessHalftoneRegion() {
  5817. this.onImmediateHalftoneRegion(...arguments);
  5818. }
  5819. onTables(currentSegment, data, start, end) {
  5820. let customTables = this.customTables;
  5821. if (!customTables) {
  5822. this.customTables = customTables = {};
  5823. }
  5824. customTables[currentSegment] = decodeTablesSegment(data, start, end);
  5825. }
  5826. }
  5827. class HuffmanLine {
  5828. constructor(lineData) {
  5829. if (lineData.length === 2) {
  5830. this.isOOB = true;
  5831. this.rangeLow = 0;
  5832. this.prefixLength = lineData[0];
  5833. this.rangeLength = 0;
  5834. this.prefixCode = lineData[1];
  5835. this.isLowerRange = false;
  5836. } else {
  5837. this.isOOB = false;
  5838. this.rangeLow = lineData[0];
  5839. this.prefixLength = lineData[1];
  5840. this.rangeLength = lineData[2];
  5841. this.prefixCode = lineData[3];
  5842. this.isLowerRange = lineData[4] === "lower";
  5843. }
  5844. }
  5845. }
  5846. class HuffmanTreeNode {
  5847. constructor(line) {
  5848. this.children = [];
  5849. if (line) {
  5850. this.isLeaf = true;
  5851. this.rangeLength = line.rangeLength;
  5852. this.rangeLow = line.rangeLow;
  5853. this.isLowerRange = line.isLowerRange;
  5854. this.isOOB = line.isOOB;
  5855. } else {
  5856. this.isLeaf = false;
  5857. }
  5858. }
  5859. buildTree(line, shift) {
  5860. const bit = line.prefixCode >> shift & 1;
  5861. if (shift <= 0) {
  5862. this.children[bit] = new HuffmanTreeNode(line);
  5863. } else {
  5864. let node = this.children[bit];
  5865. if (!node) {
  5866. this.children[bit] = node = new HuffmanTreeNode(null);
  5867. }
  5868. node.buildTree(line, shift - 1);
  5869. }
  5870. }
  5871. decodeNode(reader) {
  5872. if (this.isLeaf) {
  5873. if (this.isOOB) {
  5874. return null;
  5875. }
  5876. const htOffset = reader.readBits(this.rangeLength);
  5877. return this.rangeLow + (this.isLowerRange ? -htOffset : htOffset);
  5878. }
  5879. const node = this.children[reader.readBit()];
  5880. if (!node) {
  5881. throw new Jbig2Error("invalid Huffman data");
  5882. }
  5883. return node.decodeNode(reader);
  5884. }
  5885. }
  5886. class HuffmanTable {
  5887. constructor(lines, prefixCodesDone) {
  5888. if (!prefixCodesDone) {
  5889. this.assignPrefixCodes(lines);
  5890. }
  5891. this.rootNode = new HuffmanTreeNode(null);
  5892. for (let i = 0, ii = lines.length; i < ii; i++) {
  5893. const line = lines[i];
  5894. if (line.prefixLength > 0) {
  5895. this.rootNode.buildTree(line, line.prefixLength - 1);
  5896. }
  5897. }
  5898. }
  5899. decode(reader) {
  5900. return this.rootNode.decodeNode(reader);
  5901. }
  5902. assignPrefixCodes(lines) {
  5903. const linesLength = lines.length;
  5904. let prefixLengthMax = 0;
  5905. for (let i = 0; i < linesLength; i++) {
  5906. prefixLengthMax = Math.max(prefixLengthMax, lines[i].prefixLength);
  5907. }
  5908. const histogram = new Uint32Array(prefixLengthMax + 1);
  5909. for (let i = 0; i < linesLength; i++) {
  5910. histogram[lines[i].prefixLength]++;
  5911. }
  5912. let currentLength = 1,
  5913. firstCode = 0,
  5914. currentCode,
  5915. currentTemp,
  5916. line;
  5917. histogram[0] = 0;
  5918. while (currentLength <= prefixLengthMax) {
  5919. firstCode = firstCode + histogram[currentLength - 1] << 1;
  5920. currentCode = firstCode;
  5921. currentTemp = 0;
  5922. while (currentTemp < linesLength) {
  5923. line = lines[currentTemp];
  5924. if (line.prefixLength === currentLength) {
  5925. line.prefixCode = currentCode;
  5926. currentCode++;
  5927. }
  5928. currentTemp++;
  5929. }
  5930. currentLength++;
  5931. }
  5932. }
  5933. }
  5934. function decodeTablesSegment(data, start, end) {
  5935. const flags = data[start];
  5936. const lowestValue = readUint32(data, start + 1) & 0xffffffff;
  5937. const highestValue = readUint32(data, start + 5) & 0xffffffff;
  5938. const reader = new Reader(data, start + 9, end);
  5939. const prefixSizeBits = (flags >> 1 & 7) + 1;
  5940. const rangeSizeBits = (flags >> 4 & 7) + 1;
  5941. const lines = [];
  5942. let prefixLength,
  5943. rangeLength,
  5944. currentRangeLow = lowestValue;
  5945. do {
  5946. prefixLength = reader.readBits(prefixSizeBits);
  5947. rangeLength = reader.readBits(rangeSizeBits);
  5948. lines.push(new HuffmanLine([currentRangeLow, prefixLength, rangeLength, 0]));
  5949. currentRangeLow += 1 << rangeLength;
  5950. } while (currentRangeLow < highestValue);
  5951. prefixLength = reader.readBits(prefixSizeBits);
  5952. lines.push(new HuffmanLine([lowestValue - 1, prefixLength, 32, 0, "lower"]));
  5953. prefixLength = reader.readBits(prefixSizeBits);
  5954. lines.push(new HuffmanLine([highestValue, prefixLength, 32, 0]));
  5955. if (flags & 1) {
  5956. prefixLength = reader.readBits(prefixSizeBits);
  5957. lines.push(new HuffmanLine([prefixLength, 0]));
  5958. }
  5959. return new HuffmanTable(lines, false);
  5960. }
  5961. const standardTablesCache = {};
  5962. function getStandardTable(number) {
  5963. let table = standardTablesCache[number];
  5964. if (table) {
  5965. return table;
  5966. }
  5967. let lines;
  5968. switch (number) {
  5969. case 1:
  5970. lines = [[0, 1, 4, 0x0], [16, 2, 8, 0x2], [272, 3, 16, 0x6], [65808, 3, 32, 0x7]];
  5971. break;
  5972. case 2:
  5973. 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]];
  5974. break;
  5975. case 3:
  5976. 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]];
  5977. break;
  5978. case 4:
  5979. 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]];
  5980. break;
  5981. case 5:
  5982. 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]];
  5983. break;
  5984. case 6:
  5985. 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]];
  5986. break;
  5987. case 7:
  5988. 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]];
  5989. break;
  5990. case 8:
  5991. 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]];
  5992. break;
  5993. case 9:
  5994. 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]];
  5995. break;
  5996. case 10:
  5997. 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]];
  5998. break;
  5999. case 11:
  6000. 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]];
  6001. break;
  6002. case 12:
  6003. 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]];
  6004. break;
  6005. case 13:
  6006. 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]];
  6007. break;
  6008. case 14:
  6009. lines = [[-2, 3, 0, 0x4], [-1, 3, 0, 0x5], [0, 1, 0, 0x0], [1, 3, 0, 0x6], [2, 3, 0, 0x7]];
  6010. break;
  6011. case 15:
  6012. 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]];
  6013. break;
  6014. default:
  6015. throw new Jbig2Error(`standard table B.${number} does not exist`);
  6016. }
  6017. for (let i = 0, ii = lines.length; i < ii; i++) {
  6018. lines[i] = new HuffmanLine(lines[i]);
  6019. }
  6020. table = new HuffmanTable(lines, true);
  6021. standardTablesCache[number] = table;
  6022. return table;
  6023. }
  6024. class Reader {
  6025. constructor(data, start, end) {
  6026. this.data = data;
  6027. this.start = start;
  6028. this.end = end;
  6029. this.position = start;
  6030. this.shift = -1;
  6031. this.currentByte = 0;
  6032. }
  6033. readBit() {
  6034. if (this.shift < 0) {
  6035. if (this.position >= this.end) {
  6036. throw new Jbig2Error("end of data while reading bit");
  6037. }
  6038. this.currentByte = this.data[this.position++];
  6039. this.shift = 7;
  6040. }
  6041. const bit = this.currentByte >> this.shift & 1;
  6042. this.shift--;
  6043. return bit;
  6044. }
  6045. readBits(numBits) {
  6046. let result = 0,
  6047. i;
  6048. for (i = numBits - 1; i >= 0; i--) {
  6049. result |= this.readBit() << i;
  6050. }
  6051. return result;
  6052. }
  6053. byteAlign() {
  6054. this.shift = -1;
  6055. }
  6056. next() {
  6057. if (this.position >= this.end) {
  6058. return -1;
  6059. }
  6060. return this.data[this.position++];
  6061. }
  6062. }
  6063. function getCustomHuffmanTable(index, referredTo, customTables) {
  6064. let currentIndex = 0;
  6065. for (let i = 0, ii = referredTo.length; i < ii; i++) {
  6066. const table = customTables[referredTo[i]];
  6067. if (table) {
  6068. if (index === currentIndex) {
  6069. return table;
  6070. }
  6071. currentIndex++;
  6072. }
  6073. }
  6074. throw new Jbig2Error("can't find custom Huffman table");
  6075. }
  6076. function getTextRegionHuffmanTables(textRegion, referredTo, customTables, numberOfSymbols, reader) {
  6077. const codes = [];
  6078. for (let i = 0; i <= 34; i++) {
  6079. const codeLength = reader.readBits(4);
  6080. codes.push(new HuffmanLine([i, codeLength, 0, 0]));
  6081. }
  6082. const runCodesTable = new HuffmanTable(codes, false);
  6083. codes.length = 0;
  6084. for (let i = 0; i < numberOfSymbols;) {
  6085. const codeLength = runCodesTable.decode(reader);
  6086. if (codeLength >= 32) {
  6087. let repeatedLength, numberOfRepeats, j;
  6088. switch (codeLength) {
  6089. case 32:
  6090. if (i === 0) {
  6091. throw new Jbig2Error("no previous value in symbol ID table");
  6092. }
  6093. numberOfRepeats = reader.readBits(2) + 3;
  6094. repeatedLength = codes[i - 1].prefixLength;
  6095. break;
  6096. case 33:
  6097. numberOfRepeats = reader.readBits(3) + 3;
  6098. repeatedLength = 0;
  6099. break;
  6100. case 34:
  6101. numberOfRepeats = reader.readBits(7) + 11;
  6102. repeatedLength = 0;
  6103. break;
  6104. default:
  6105. throw new Jbig2Error("invalid code length in symbol ID table");
  6106. }
  6107. for (j = 0; j < numberOfRepeats; j++) {
  6108. codes.push(new HuffmanLine([i, repeatedLength, 0, 0]));
  6109. i++;
  6110. }
  6111. } else {
  6112. codes.push(new HuffmanLine([i, codeLength, 0, 0]));
  6113. i++;
  6114. }
  6115. }
  6116. reader.byteAlign();
  6117. const symbolIDTable = new HuffmanTable(codes, false);
  6118. let customIndex = 0,
  6119. tableFirstS,
  6120. tableDeltaS,
  6121. tableDeltaT;
  6122. switch (textRegion.huffmanFS) {
  6123. case 0:
  6124. case 1:
  6125. tableFirstS = getStandardTable(textRegion.huffmanFS + 6);
  6126. break;
  6127. case 3:
  6128. tableFirstS = getCustomHuffmanTable(customIndex, referredTo, customTables);
  6129. customIndex++;
  6130. break;
  6131. default:
  6132. throw new Jbig2Error("invalid Huffman FS selector");
  6133. }
  6134. switch (textRegion.huffmanDS) {
  6135. case 0:
  6136. case 1:
  6137. case 2:
  6138. tableDeltaS = getStandardTable(textRegion.huffmanDS + 8);
  6139. break;
  6140. case 3:
  6141. tableDeltaS = getCustomHuffmanTable(customIndex, referredTo, customTables);
  6142. customIndex++;
  6143. break;
  6144. default:
  6145. throw new Jbig2Error("invalid Huffman DS selector");
  6146. }
  6147. switch (textRegion.huffmanDT) {
  6148. case 0:
  6149. case 1:
  6150. case 2:
  6151. tableDeltaT = getStandardTable(textRegion.huffmanDT + 11);
  6152. break;
  6153. case 3:
  6154. tableDeltaT = getCustomHuffmanTable(customIndex, referredTo, customTables);
  6155. customIndex++;
  6156. break;
  6157. default:
  6158. throw new Jbig2Error("invalid Huffman DT selector");
  6159. }
  6160. if (textRegion.refinement) {
  6161. throw new Jbig2Error("refinement with Huffman is not supported");
  6162. }
  6163. return {
  6164. symbolIDTable,
  6165. tableFirstS,
  6166. tableDeltaS,
  6167. tableDeltaT
  6168. };
  6169. }
  6170. function getSymbolDictionaryHuffmanTables(dictionary, referredTo, customTables) {
  6171. let customIndex = 0,
  6172. tableDeltaHeight,
  6173. tableDeltaWidth;
  6174. switch (dictionary.huffmanDHSelector) {
  6175. case 0:
  6176. case 1:
  6177. tableDeltaHeight = getStandardTable(dictionary.huffmanDHSelector + 4);
  6178. break;
  6179. case 3:
  6180. tableDeltaHeight = getCustomHuffmanTable(customIndex, referredTo, customTables);
  6181. customIndex++;
  6182. break;
  6183. default:
  6184. throw new Jbig2Error("invalid Huffman DH selector");
  6185. }
  6186. switch (dictionary.huffmanDWSelector) {
  6187. case 0:
  6188. case 1:
  6189. tableDeltaWidth = getStandardTable(dictionary.huffmanDWSelector + 2);
  6190. break;
  6191. case 3:
  6192. tableDeltaWidth = getCustomHuffmanTable(customIndex, referredTo, customTables);
  6193. customIndex++;
  6194. break;
  6195. default:
  6196. throw new Jbig2Error("invalid Huffman DW selector");
  6197. }
  6198. let tableBitmapSize, tableAggregateInstances;
  6199. if (dictionary.bitmapSizeSelector) {
  6200. tableBitmapSize = getCustomHuffmanTable(customIndex, referredTo, customTables);
  6201. customIndex++;
  6202. } else {
  6203. tableBitmapSize = getStandardTable(1);
  6204. }
  6205. if (dictionary.aggregationInstancesSelector) {
  6206. tableAggregateInstances = getCustomHuffmanTable(customIndex, referredTo, customTables);
  6207. } else {
  6208. tableAggregateInstances = getStandardTable(1);
  6209. }
  6210. return {
  6211. tableDeltaHeight,
  6212. tableDeltaWidth,
  6213. tableBitmapSize,
  6214. tableAggregateInstances
  6215. };
  6216. }
  6217. function readUncompressedBitmap(reader, width, height) {
  6218. const bitmap = [];
  6219. for (let y = 0; y < height; y++) {
  6220. const row = new Uint8Array(width);
  6221. bitmap.push(row);
  6222. for (let x = 0; x < width; x++) {
  6223. row[x] = reader.readBit();
  6224. }
  6225. reader.byteAlign();
  6226. }
  6227. return bitmap;
  6228. }
  6229. function decodeMMRBitmap(input, width, height, endOfBlock) {
  6230. const params = {
  6231. K: -1,
  6232. Columns: width,
  6233. Rows: height,
  6234. BlackIs1: true,
  6235. EndOfBlock: endOfBlock
  6236. };
  6237. const decoder = new CCITTFaxDecoder(input, params);
  6238. const bitmap = [];
  6239. let currentByte,
  6240. eof = false;
  6241. for (let y = 0; y < height; y++) {
  6242. const row = new Uint8Array(width);
  6243. bitmap.push(row);
  6244. let shift = -1;
  6245. for (let x = 0; x < width; x++) {
  6246. if (shift < 0) {
  6247. currentByte = decoder.readNextChar();
  6248. if (currentByte === -1) {
  6249. currentByte = 0;
  6250. eof = true;
  6251. }
  6252. shift = 7;
  6253. }
  6254. row[x] = currentByte >> shift & 1;
  6255. shift--;
  6256. }
  6257. }
  6258. if (endOfBlock && !eof) {
  6259. const lookForEOFLimit = 5;
  6260. for (let i = 0; i < lookForEOFLimit; i++) {
  6261. if (decoder.readNextChar() === -1) {
  6262. break;
  6263. }
  6264. }
  6265. }
  6266. return bitmap;
  6267. }
  6268. class Jbig2Image {
  6269. parseChunks(chunks) {
  6270. return parseJbig2Chunks(chunks);
  6271. }
  6272. parse(data) {
  6273. throw new Error("Not implemented: Jbig2Image.parse");
  6274. }
  6275. }
  6276. ;// CONCATENATED MODULE: ./src/core/jbig2_stream.js
  6277. class Jbig2Stream extends DecodeStream {
  6278. constructor(stream, maybeLength, params) {
  6279. super(maybeLength);
  6280. this.stream = stream;
  6281. this.dict = stream.dict;
  6282. this.maybeLength = maybeLength;
  6283. this.params = params;
  6284. }
  6285. get bytes() {
  6286. return shadow(this, "bytes", this.stream.getBytes(this.maybeLength));
  6287. }
  6288. ensureBuffer(requested) {}
  6289. readBlock() {
  6290. this.decodeImage();
  6291. }
  6292. decodeImage(bytes) {
  6293. if (this.eof) {
  6294. return this.buffer;
  6295. }
  6296. bytes ||= this.bytes;
  6297. const jbig2Image = new Jbig2Image();
  6298. const chunks = [];
  6299. if (this.params instanceof Dict) {
  6300. const globalsStream = this.params.get("JBIG2Globals");
  6301. if (globalsStream instanceof BaseStream) {
  6302. const globals = globalsStream.getBytes();
  6303. chunks.push({
  6304. data: globals,
  6305. start: 0,
  6306. end: globals.length
  6307. });
  6308. }
  6309. }
  6310. chunks.push({
  6311. data: bytes,
  6312. start: 0,
  6313. end: bytes.length
  6314. });
  6315. const data = jbig2Image.parseChunks(chunks);
  6316. const dataLength = data.length;
  6317. for (let i = 0; i < dataLength; i++) {
  6318. data[i] ^= 0xff;
  6319. }
  6320. this.buffer = data;
  6321. this.bufferLength = dataLength;
  6322. this.eof = true;
  6323. return this.buffer;
  6324. }
  6325. get canAsyncDecodeImageFromBuffer() {
  6326. return this.stream.isAsync;
  6327. }
  6328. }
  6329. ;// CONCATENATED MODULE: ./src/shared/image_utils.js
  6330. function convertToRGBA(params) {
  6331. switch (params.kind) {
  6332. case ImageKind.GRAYSCALE_1BPP:
  6333. return convertBlackAndWhiteToRGBA(params);
  6334. case ImageKind.RGB_24BPP:
  6335. return convertRGBToRGBA(params);
  6336. }
  6337. return null;
  6338. }
  6339. function convertBlackAndWhiteToRGBA({
  6340. src,
  6341. srcPos = 0,
  6342. dest,
  6343. width,
  6344. height,
  6345. nonBlackColor = 0xffffffff,
  6346. inverseDecode = false
  6347. }) {
  6348. const black = FeatureTest.isLittleEndian ? 0xff000000 : 0x000000ff;
  6349. const [zeroMapping, oneMapping] = inverseDecode ? [nonBlackColor, black] : [black, nonBlackColor];
  6350. const widthInSource = width >> 3;
  6351. const widthRemainder = width & 7;
  6352. const srcLength = src.length;
  6353. dest = new Uint32Array(dest.buffer);
  6354. let destPos = 0;
  6355. for (let i = 0; i < height; i++) {
  6356. for (const max = srcPos + widthInSource; srcPos < max; srcPos++) {
  6357. const elem = srcPos < srcLength ? src[srcPos] : 255;
  6358. dest[destPos++] = elem & 0b10000000 ? oneMapping : zeroMapping;
  6359. dest[destPos++] = elem & 0b1000000 ? oneMapping : zeroMapping;
  6360. dest[destPos++] = elem & 0b100000 ? oneMapping : zeroMapping;
  6361. dest[destPos++] = elem & 0b10000 ? oneMapping : zeroMapping;
  6362. dest[destPos++] = elem & 0b1000 ? oneMapping : zeroMapping;
  6363. dest[destPos++] = elem & 0b100 ? oneMapping : zeroMapping;
  6364. dest[destPos++] = elem & 0b10 ? oneMapping : zeroMapping;
  6365. dest[destPos++] = elem & 0b1 ? oneMapping : zeroMapping;
  6366. }
  6367. if (widthRemainder === 0) {
  6368. continue;
  6369. }
  6370. const elem = srcPos < srcLength ? src[srcPos++] : 255;
  6371. for (let j = 0; j < widthRemainder; j++) {
  6372. dest[destPos++] = elem & 1 << 7 - j ? oneMapping : zeroMapping;
  6373. }
  6374. }
  6375. return {
  6376. srcPos,
  6377. destPos
  6378. };
  6379. }
  6380. function convertRGBToRGBA({
  6381. src,
  6382. srcPos = 0,
  6383. dest,
  6384. destPos = 0,
  6385. width,
  6386. height
  6387. }) {
  6388. let i = 0;
  6389. const len32 = src.length >> 2;
  6390. const src32 = new Uint32Array(src.buffer, srcPos, len32);
  6391. if (FeatureTest.isLittleEndian) {
  6392. for (; i < len32 - 2; i += 3, destPos += 4) {
  6393. const s1 = src32[i];
  6394. const s2 = src32[i + 1];
  6395. const s3 = src32[i + 2];
  6396. dest[destPos] = s1 | 0xff000000;
  6397. dest[destPos + 1] = s1 >>> 24 | s2 << 8 | 0xff000000;
  6398. dest[destPos + 2] = s2 >>> 16 | s3 << 16 | 0xff000000;
  6399. dest[destPos + 3] = s3 >>> 8 | 0xff000000;
  6400. }
  6401. for (let j = i * 4, jj = src.length; j < jj; j += 3) {
  6402. dest[destPos++] = src[j] | src[j + 1] << 8 | src[j + 2] << 16 | 0xff000000;
  6403. }
  6404. } else {
  6405. for (; i < len32 - 2; i += 3, destPos += 4) {
  6406. const s1 = src32[i];
  6407. const s2 = src32[i + 1];
  6408. const s3 = src32[i + 2];
  6409. dest[destPos] = s1 | 0xff;
  6410. dest[destPos + 1] = s1 << 24 | s2 >>> 8 | 0xff;
  6411. dest[destPos + 2] = s2 << 16 | s3 >>> 16 | 0xff;
  6412. dest[destPos + 3] = s3 << 8 | 0xff;
  6413. }
  6414. for (let j = i * 4, jj = src.length; j < jj; j += 3) {
  6415. dest[destPos++] = src[j] << 24 | src[j + 1] << 16 | src[j + 2] << 8 | 0xff;
  6416. }
  6417. }
  6418. return {
  6419. srcPos,
  6420. destPos
  6421. };
  6422. }
  6423. function grayToRGBA(src, dest) {
  6424. if (FeatureTest.isLittleEndian) {
  6425. for (let i = 0, ii = src.length; i < ii; i++) {
  6426. dest[i] = src[i] * 0x10101 | 0xff000000;
  6427. }
  6428. } else {
  6429. for (let i = 0, ii = src.length; i < ii; i++) {
  6430. dest[i] = src[i] * 0x1010100 | 0x000000ff;
  6431. }
  6432. }
  6433. }
  6434. ;// CONCATENATED MODULE: ./src/core/jpg.js
  6435. class JpegError extends BaseException {
  6436. constructor(msg) {
  6437. super(msg, "JpegError");
  6438. }
  6439. }
  6440. class DNLMarkerError extends BaseException {
  6441. constructor(message, scanLines) {
  6442. super(message, "DNLMarkerError");
  6443. this.scanLines = scanLines;
  6444. }
  6445. }
  6446. class EOIMarkerError extends BaseException {
  6447. constructor(msg) {
  6448. super(msg, "EOIMarkerError");
  6449. }
  6450. }
  6451. 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]);
  6452. const dctCos1 = 4017;
  6453. const dctSin1 = 799;
  6454. const dctCos3 = 3406;
  6455. const dctSin3 = 2276;
  6456. const dctCos6 = 1567;
  6457. const dctSin6 = 3784;
  6458. const dctSqrt2 = 5793;
  6459. const dctSqrt1d2 = 2896;
  6460. function buildHuffmanTable(codeLengths, values) {
  6461. let k = 0,
  6462. i,
  6463. j,
  6464. length = 16;
  6465. while (length > 0 && !codeLengths[length - 1]) {
  6466. length--;
  6467. }
  6468. const code = [{
  6469. children: [],
  6470. index: 0
  6471. }];
  6472. let p = code[0],
  6473. q;
  6474. for (i = 0; i < length; i++) {
  6475. for (j = 0; j < codeLengths[i]; j++) {
  6476. p = code.pop();
  6477. p.children[p.index] = values[k];
  6478. while (p.index > 0) {
  6479. p = code.pop();
  6480. }
  6481. p.index++;
  6482. code.push(p);
  6483. while (code.length <= i) {
  6484. code.push(q = {
  6485. children: [],
  6486. index: 0
  6487. });
  6488. p.children[p.index] = q.children;
  6489. p = q;
  6490. }
  6491. k++;
  6492. }
  6493. if (i + 1 < length) {
  6494. code.push(q = {
  6495. children: [],
  6496. index: 0
  6497. });
  6498. p.children[p.index] = q.children;
  6499. p = q;
  6500. }
  6501. }
  6502. return code[0].children;
  6503. }
  6504. function getBlockBufferOffset(component, row, col) {
  6505. return 64 * ((component.blocksPerLine + 1) * row + col);
  6506. }
  6507. function decodeScan(data, offset, frame, components, resetInterval, spectralStart, spectralEnd, successivePrev, successive, parseDNLMarker = false) {
  6508. const mcusPerLine = frame.mcusPerLine;
  6509. const progressive = frame.progressive;
  6510. const startOffset = offset;
  6511. let bitsData = 0,
  6512. bitsCount = 0;
  6513. function readBit() {
  6514. if (bitsCount > 0) {
  6515. bitsCount--;
  6516. return bitsData >> bitsCount & 1;
  6517. }
  6518. bitsData = data[offset++];
  6519. if (bitsData === 0xff) {
  6520. const nextByte = data[offset++];
  6521. if (nextByte) {
  6522. if (nextByte === 0xdc && parseDNLMarker) {
  6523. offset += 2;
  6524. const scanLines = readUint16(data, offset);
  6525. offset += 2;
  6526. if (scanLines > 0 && scanLines !== frame.scanLines) {
  6527. throw new DNLMarkerError("Found DNL marker (0xFFDC) while parsing scan data", scanLines);
  6528. }
  6529. } else if (nextByte === 0xd9) {
  6530. if (parseDNLMarker) {
  6531. const maybeScanLines = blockRow * (frame.precision === 8 ? 8 : 0);
  6532. if (maybeScanLines > 0 && Math.round(frame.scanLines / maybeScanLines) >= 5) {
  6533. throw new DNLMarkerError("Found EOI marker (0xFFD9) while parsing scan data, " + "possibly caused by incorrect `scanLines` parameter", maybeScanLines);
  6534. }
  6535. }
  6536. throw new EOIMarkerError("Found EOI marker (0xFFD9) while parsing scan data");
  6537. }
  6538. throw new JpegError(`unexpected marker ${(bitsData << 8 | nextByte).toString(16)}`);
  6539. }
  6540. }
  6541. bitsCount = 7;
  6542. return bitsData >>> 7;
  6543. }
  6544. function decodeHuffman(tree) {
  6545. let node = tree;
  6546. while (true) {
  6547. node = node[readBit()];
  6548. switch (typeof node) {
  6549. case "number":
  6550. return node;
  6551. case "object":
  6552. continue;
  6553. }
  6554. throw new JpegError("invalid huffman sequence");
  6555. }
  6556. }
  6557. function receive(length) {
  6558. let n = 0;
  6559. while (length > 0) {
  6560. n = n << 1 | readBit();
  6561. length--;
  6562. }
  6563. return n;
  6564. }
  6565. function receiveAndExtend(length) {
  6566. if (length === 1) {
  6567. return readBit() === 1 ? 1 : -1;
  6568. }
  6569. const n = receive(length);
  6570. if (n >= 1 << length - 1) {
  6571. return n;
  6572. }
  6573. return n + (-1 << length) + 1;
  6574. }
  6575. function decodeBaseline(component, blockOffset) {
  6576. const t = decodeHuffman(component.huffmanTableDC);
  6577. const diff = t === 0 ? 0 : receiveAndExtend(t);
  6578. component.blockData[blockOffset] = component.pred += diff;
  6579. let k = 1;
  6580. while (k < 64) {
  6581. const rs = decodeHuffman(component.huffmanTableAC);
  6582. const s = rs & 15,
  6583. r = rs >> 4;
  6584. if (s === 0) {
  6585. if (r < 15) {
  6586. break;
  6587. }
  6588. k += 16;
  6589. continue;
  6590. }
  6591. k += r;
  6592. const z = dctZigZag[k];
  6593. component.blockData[blockOffset + z] = receiveAndExtend(s);
  6594. k++;
  6595. }
  6596. }
  6597. function decodeDCFirst(component, blockOffset) {
  6598. const t = decodeHuffman(component.huffmanTableDC);
  6599. const diff = t === 0 ? 0 : receiveAndExtend(t) << successive;
  6600. component.blockData[blockOffset] = component.pred += diff;
  6601. }
  6602. function decodeDCSuccessive(component, blockOffset) {
  6603. component.blockData[blockOffset] |= readBit() << successive;
  6604. }
  6605. let eobrun = 0;
  6606. function decodeACFirst(component, blockOffset) {
  6607. if (eobrun > 0) {
  6608. eobrun--;
  6609. return;
  6610. }
  6611. let k = spectralStart;
  6612. const e = spectralEnd;
  6613. while (k <= e) {
  6614. const rs = decodeHuffman(component.huffmanTableAC);
  6615. const s = rs & 15,
  6616. r = rs >> 4;
  6617. if (s === 0) {
  6618. if (r < 15) {
  6619. eobrun = receive(r) + (1 << r) - 1;
  6620. break;
  6621. }
  6622. k += 16;
  6623. continue;
  6624. }
  6625. k += r;
  6626. const z = dctZigZag[k];
  6627. component.blockData[blockOffset + z] = receiveAndExtend(s) * (1 << successive);
  6628. k++;
  6629. }
  6630. }
  6631. let successiveACState = 0,
  6632. successiveACNextValue;
  6633. function decodeACSuccessive(component, blockOffset) {
  6634. let k = spectralStart;
  6635. const e = spectralEnd;
  6636. let r = 0;
  6637. let s;
  6638. let rs;
  6639. while (k <= e) {
  6640. const offsetZ = blockOffset + dctZigZag[k];
  6641. const sign = component.blockData[offsetZ] < 0 ? -1 : 1;
  6642. switch (successiveACState) {
  6643. case 0:
  6644. rs = decodeHuffman(component.huffmanTableAC);
  6645. s = rs & 15;
  6646. r = rs >> 4;
  6647. if (s === 0) {
  6648. if (r < 15) {
  6649. eobrun = receive(r) + (1 << r);
  6650. successiveACState = 4;
  6651. } else {
  6652. r = 16;
  6653. successiveACState = 1;
  6654. }
  6655. } else {
  6656. if (s !== 1) {
  6657. throw new JpegError("invalid ACn encoding");
  6658. }
  6659. successiveACNextValue = receiveAndExtend(s);
  6660. successiveACState = r ? 2 : 3;
  6661. }
  6662. continue;
  6663. case 1:
  6664. case 2:
  6665. if (component.blockData[offsetZ]) {
  6666. component.blockData[offsetZ] += sign * (readBit() << successive);
  6667. } else {
  6668. r--;
  6669. if (r === 0) {
  6670. successiveACState = successiveACState === 2 ? 3 : 0;
  6671. }
  6672. }
  6673. break;
  6674. case 3:
  6675. if (component.blockData[offsetZ]) {
  6676. component.blockData[offsetZ] += sign * (readBit() << successive);
  6677. } else {
  6678. component.blockData[offsetZ] = successiveACNextValue << successive;
  6679. successiveACState = 0;
  6680. }
  6681. break;
  6682. case 4:
  6683. if (component.blockData[offsetZ]) {
  6684. component.blockData[offsetZ] += sign * (readBit() << successive);
  6685. }
  6686. break;
  6687. }
  6688. k++;
  6689. }
  6690. if (successiveACState === 4) {
  6691. eobrun--;
  6692. if (eobrun === 0) {
  6693. successiveACState = 0;
  6694. }
  6695. }
  6696. }
  6697. let blockRow = 0;
  6698. function decodeMcu(component, decode, mcu, row, col) {
  6699. const mcuRow = mcu / mcusPerLine | 0;
  6700. const mcuCol = mcu % mcusPerLine;
  6701. blockRow = mcuRow * component.v + row;
  6702. const blockCol = mcuCol * component.h + col;
  6703. const blockOffset = getBlockBufferOffset(component, blockRow, blockCol);
  6704. decode(component, blockOffset);
  6705. }
  6706. function decodeBlock(component, decode, mcu) {
  6707. blockRow = mcu / component.blocksPerLine | 0;
  6708. const blockCol = mcu % component.blocksPerLine;
  6709. const blockOffset = getBlockBufferOffset(component, blockRow, blockCol);
  6710. decode(component, blockOffset);
  6711. }
  6712. const componentsLength = components.length;
  6713. let component, i, j, k, n;
  6714. let decodeFn;
  6715. if (progressive) {
  6716. if (spectralStart === 0) {
  6717. decodeFn = successivePrev === 0 ? decodeDCFirst : decodeDCSuccessive;
  6718. } else {
  6719. decodeFn = successivePrev === 0 ? decodeACFirst : decodeACSuccessive;
  6720. }
  6721. } else {
  6722. decodeFn = decodeBaseline;
  6723. }
  6724. let mcu = 0,
  6725. fileMarker;
  6726. const mcuExpected = componentsLength === 1 ? components[0].blocksPerLine * components[0].blocksPerColumn : mcusPerLine * frame.mcusPerColumn;
  6727. let h, v;
  6728. while (mcu <= mcuExpected) {
  6729. const mcuToRead = resetInterval ? Math.min(mcuExpected - mcu, resetInterval) : mcuExpected;
  6730. if (mcuToRead > 0) {
  6731. for (i = 0; i < componentsLength; i++) {
  6732. components[i].pred = 0;
  6733. }
  6734. eobrun = 0;
  6735. if (componentsLength === 1) {
  6736. component = components[0];
  6737. for (n = 0; n < mcuToRead; n++) {
  6738. decodeBlock(component, decodeFn, mcu);
  6739. mcu++;
  6740. }
  6741. } else {
  6742. for (n = 0; n < mcuToRead; n++) {
  6743. for (i = 0; i < componentsLength; i++) {
  6744. component = components[i];
  6745. h = component.h;
  6746. v = component.v;
  6747. for (j = 0; j < v; j++) {
  6748. for (k = 0; k < h; k++) {
  6749. decodeMcu(component, decodeFn, mcu, j, k);
  6750. }
  6751. }
  6752. }
  6753. mcu++;
  6754. }
  6755. }
  6756. }
  6757. bitsCount = 0;
  6758. fileMarker = findNextFileMarker(data, offset);
  6759. if (!fileMarker) {
  6760. break;
  6761. }
  6762. if (fileMarker.invalid) {
  6763. const partialMsg = mcuToRead > 0 ? "unexpected" : "excessive";
  6764. warn(`decodeScan - ${partialMsg} MCU data, current marker is: ${fileMarker.invalid}`);
  6765. offset = fileMarker.offset;
  6766. }
  6767. if (fileMarker.marker >= 0xffd0 && fileMarker.marker <= 0xffd7) {
  6768. offset += 2;
  6769. } else {
  6770. break;
  6771. }
  6772. }
  6773. return offset - startOffset;
  6774. }
  6775. function quantizeAndInverse(component, blockBufferOffset, p) {
  6776. const qt = component.quantizationTable,
  6777. blockData = component.blockData;
  6778. let v0, v1, v2, v3, v4, v5, v6, v7;
  6779. let p0, p1, p2, p3, p4, p5, p6, p7;
  6780. let t;
  6781. if (!qt) {
  6782. throw new JpegError("missing required Quantization Table.");
  6783. }
  6784. for (let row = 0; row < 64; row += 8) {
  6785. p0 = blockData[blockBufferOffset + row];
  6786. p1 = blockData[blockBufferOffset + row + 1];
  6787. p2 = blockData[blockBufferOffset + row + 2];
  6788. p3 = blockData[blockBufferOffset + row + 3];
  6789. p4 = blockData[blockBufferOffset + row + 4];
  6790. p5 = blockData[blockBufferOffset + row + 5];
  6791. p6 = blockData[blockBufferOffset + row + 6];
  6792. p7 = blockData[blockBufferOffset + row + 7];
  6793. p0 *= qt[row];
  6794. if ((p1 | p2 | p3 | p4 | p5 | p6 | p7) === 0) {
  6795. t = dctSqrt2 * p0 + 512 >> 10;
  6796. p[row] = t;
  6797. p[row + 1] = t;
  6798. p[row + 2] = t;
  6799. p[row + 3] = t;
  6800. p[row + 4] = t;
  6801. p[row + 5] = t;
  6802. p[row + 6] = t;
  6803. p[row + 7] = t;
  6804. continue;
  6805. }
  6806. p1 *= qt[row + 1];
  6807. p2 *= qt[row + 2];
  6808. p3 *= qt[row + 3];
  6809. p4 *= qt[row + 4];
  6810. p5 *= qt[row + 5];
  6811. p6 *= qt[row + 6];
  6812. p7 *= qt[row + 7];
  6813. v0 = dctSqrt2 * p0 + 128 >> 8;
  6814. v1 = dctSqrt2 * p4 + 128 >> 8;
  6815. v2 = p2;
  6816. v3 = p6;
  6817. v4 = dctSqrt1d2 * (p1 - p7) + 128 >> 8;
  6818. v7 = dctSqrt1d2 * (p1 + p7) + 128 >> 8;
  6819. v5 = p3 << 4;
  6820. v6 = p5 << 4;
  6821. v0 = v0 + v1 + 1 >> 1;
  6822. v1 = v0 - v1;
  6823. t = v2 * dctSin6 + v3 * dctCos6 + 128 >> 8;
  6824. v2 = v2 * dctCos6 - v3 * dctSin6 + 128 >> 8;
  6825. v3 = t;
  6826. v4 = v4 + v6 + 1 >> 1;
  6827. v6 = v4 - v6;
  6828. v7 = v7 + v5 + 1 >> 1;
  6829. v5 = v7 - v5;
  6830. v0 = v0 + v3 + 1 >> 1;
  6831. v3 = v0 - v3;
  6832. v1 = v1 + v2 + 1 >> 1;
  6833. v2 = v1 - v2;
  6834. t = v4 * dctSin3 + v7 * dctCos3 + 2048 >> 12;
  6835. v4 = v4 * dctCos3 - v7 * dctSin3 + 2048 >> 12;
  6836. v7 = t;
  6837. t = v5 * dctSin1 + v6 * dctCos1 + 2048 >> 12;
  6838. v5 = v5 * dctCos1 - v6 * dctSin1 + 2048 >> 12;
  6839. v6 = t;
  6840. p[row] = v0 + v7;
  6841. p[row + 7] = v0 - v7;
  6842. p[row + 1] = v1 + v6;
  6843. p[row + 6] = v1 - v6;
  6844. p[row + 2] = v2 + v5;
  6845. p[row + 5] = v2 - v5;
  6846. p[row + 3] = v3 + v4;
  6847. p[row + 4] = v3 - v4;
  6848. }
  6849. for (let col = 0; col < 8; ++col) {
  6850. p0 = p[col];
  6851. p1 = p[col + 8];
  6852. p2 = p[col + 16];
  6853. p3 = p[col + 24];
  6854. p4 = p[col + 32];
  6855. p5 = p[col + 40];
  6856. p6 = p[col + 48];
  6857. p7 = p[col + 56];
  6858. if ((p1 | p2 | p3 | p4 | p5 | p6 | p7) === 0) {
  6859. t = dctSqrt2 * p0 + 8192 >> 14;
  6860. if (t < -2040) {
  6861. t = 0;
  6862. } else if (t >= 2024) {
  6863. t = 255;
  6864. } else {
  6865. t = t + 2056 >> 4;
  6866. }
  6867. blockData[blockBufferOffset + col] = t;
  6868. blockData[blockBufferOffset + col + 8] = t;
  6869. blockData[blockBufferOffset + col + 16] = t;
  6870. blockData[blockBufferOffset + col + 24] = t;
  6871. blockData[blockBufferOffset + col + 32] = t;
  6872. blockData[blockBufferOffset + col + 40] = t;
  6873. blockData[blockBufferOffset + col + 48] = t;
  6874. blockData[blockBufferOffset + col + 56] = t;
  6875. continue;
  6876. }
  6877. v0 = dctSqrt2 * p0 + 2048 >> 12;
  6878. v1 = dctSqrt2 * p4 + 2048 >> 12;
  6879. v2 = p2;
  6880. v3 = p6;
  6881. v4 = dctSqrt1d2 * (p1 - p7) + 2048 >> 12;
  6882. v7 = dctSqrt1d2 * (p1 + p7) + 2048 >> 12;
  6883. v5 = p3;
  6884. v6 = p5;
  6885. v0 = (v0 + v1 + 1 >> 1) + 4112;
  6886. v1 = v0 - v1;
  6887. t = v2 * dctSin6 + v3 * dctCos6 + 2048 >> 12;
  6888. v2 = v2 * dctCos6 - v3 * dctSin6 + 2048 >> 12;
  6889. v3 = t;
  6890. v4 = v4 + v6 + 1 >> 1;
  6891. v6 = v4 - v6;
  6892. v7 = v7 + v5 + 1 >> 1;
  6893. v5 = v7 - v5;
  6894. v0 = v0 + v3 + 1 >> 1;
  6895. v3 = v0 - v3;
  6896. v1 = v1 + v2 + 1 >> 1;
  6897. v2 = v1 - v2;
  6898. t = v4 * dctSin3 + v7 * dctCos3 + 2048 >> 12;
  6899. v4 = v4 * dctCos3 - v7 * dctSin3 + 2048 >> 12;
  6900. v7 = t;
  6901. t = v5 * dctSin1 + v6 * dctCos1 + 2048 >> 12;
  6902. v5 = v5 * dctCos1 - v6 * dctSin1 + 2048 >> 12;
  6903. v6 = t;
  6904. p0 = v0 + v7;
  6905. p7 = v0 - v7;
  6906. p1 = v1 + v6;
  6907. p6 = v1 - v6;
  6908. p2 = v2 + v5;
  6909. p5 = v2 - v5;
  6910. p3 = v3 + v4;
  6911. p4 = v3 - v4;
  6912. if (p0 < 16) {
  6913. p0 = 0;
  6914. } else if (p0 >= 4080) {
  6915. p0 = 255;
  6916. } else {
  6917. p0 >>= 4;
  6918. }
  6919. if (p1 < 16) {
  6920. p1 = 0;
  6921. } else if (p1 >= 4080) {
  6922. p1 = 255;
  6923. } else {
  6924. p1 >>= 4;
  6925. }
  6926. if (p2 < 16) {
  6927. p2 = 0;
  6928. } else if (p2 >= 4080) {
  6929. p2 = 255;
  6930. } else {
  6931. p2 >>= 4;
  6932. }
  6933. if (p3 < 16) {
  6934. p3 = 0;
  6935. } else if (p3 >= 4080) {
  6936. p3 = 255;
  6937. } else {
  6938. p3 >>= 4;
  6939. }
  6940. if (p4 < 16) {
  6941. p4 = 0;
  6942. } else if (p4 >= 4080) {
  6943. p4 = 255;
  6944. } else {
  6945. p4 >>= 4;
  6946. }
  6947. if (p5 < 16) {
  6948. p5 = 0;
  6949. } else if (p5 >= 4080) {
  6950. p5 = 255;
  6951. } else {
  6952. p5 >>= 4;
  6953. }
  6954. if (p6 < 16) {
  6955. p6 = 0;
  6956. } else if (p6 >= 4080) {
  6957. p6 = 255;
  6958. } else {
  6959. p6 >>= 4;
  6960. }
  6961. if (p7 < 16) {
  6962. p7 = 0;
  6963. } else if (p7 >= 4080) {
  6964. p7 = 255;
  6965. } else {
  6966. p7 >>= 4;
  6967. }
  6968. blockData[blockBufferOffset + col] = p0;
  6969. blockData[blockBufferOffset + col + 8] = p1;
  6970. blockData[blockBufferOffset + col + 16] = p2;
  6971. blockData[blockBufferOffset + col + 24] = p3;
  6972. blockData[blockBufferOffset + col + 32] = p4;
  6973. blockData[blockBufferOffset + col + 40] = p5;
  6974. blockData[blockBufferOffset + col + 48] = p6;
  6975. blockData[blockBufferOffset + col + 56] = p7;
  6976. }
  6977. }
  6978. function buildComponentData(frame, component) {
  6979. const blocksPerLine = component.blocksPerLine;
  6980. const blocksPerColumn = component.blocksPerColumn;
  6981. const computationBuffer = new Int16Array(64);
  6982. for (let blockRow = 0; blockRow < blocksPerColumn; blockRow++) {
  6983. for (let blockCol = 0; blockCol < blocksPerLine; blockCol++) {
  6984. const offset = getBlockBufferOffset(component, blockRow, blockCol);
  6985. quantizeAndInverse(component, offset, computationBuffer);
  6986. }
  6987. }
  6988. return component.blockData;
  6989. }
  6990. function findNextFileMarker(data, currentPos, startPos = currentPos) {
  6991. const maxPos = data.length - 1;
  6992. let newPos = startPos < currentPos ? startPos : currentPos;
  6993. if (currentPos >= maxPos) {
  6994. return null;
  6995. }
  6996. const currentMarker = readUint16(data, currentPos);
  6997. if (currentMarker >= 0xffc0 && currentMarker <= 0xfffe) {
  6998. return {
  6999. invalid: null,
  7000. marker: currentMarker,
  7001. offset: currentPos
  7002. };
  7003. }
  7004. let newMarker = readUint16(data, newPos);
  7005. while (!(newMarker >= 0xffc0 && newMarker <= 0xfffe)) {
  7006. if (++newPos >= maxPos) {
  7007. return null;
  7008. }
  7009. newMarker = readUint16(data, newPos);
  7010. }
  7011. return {
  7012. invalid: currentMarker.toString(16),
  7013. marker: newMarker,
  7014. offset: newPos
  7015. };
  7016. }
  7017. class JpegImage {
  7018. constructor({
  7019. decodeTransform = null,
  7020. colorTransform = -1
  7021. } = {}) {
  7022. this._decodeTransform = decodeTransform;
  7023. this._colorTransform = colorTransform;
  7024. }
  7025. parse(data, {
  7026. dnlScanLines = null
  7027. } = {}) {
  7028. function readDataBlock() {
  7029. const length = readUint16(data, offset);
  7030. offset += 2;
  7031. let endOffset = offset + length - 2;
  7032. const fileMarker = findNextFileMarker(data, endOffset, offset);
  7033. if (fileMarker?.invalid) {
  7034. warn("readDataBlock - incorrect length, current marker is: " + fileMarker.invalid);
  7035. endOffset = fileMarker.offset;
  7036. }
  7037. const array = data.subarray(offset, endOffset);
  7038. offset += array.length;
  7039. return array;
  7040. }
  7041. function prepareComponents(frame) {
  7042. const mcusPerLine = Math.ceil(frame.samplesPerLine / 8 / frame.maxH);
  7043. const mcusPerColumn = Math.ceil(frame.scanLines / 8 / frame.maxV);
  7044. for (const component of frame.components) {
  7045. const blocksPerLine = Math.ceil(Math.ceil(frame.samplesPerLine / 8) * component.h / frame.maxH);
  7046. const blocksPerColumn = Math.ceil(Math.ceil(frame.scanLines / 8) * component.v / frame.maxV);
  7047. const blocksPerLineForMcu = mcusPerLine * component.h;
  7048. const blocksPerColumnForMcu = mcusPerColumn * component.v;
  7049. const blocksBufferSize = 64 * blocksPerColumnForMcu * (blocksPerLineForMcu + 1);
  7050. component.blockData = new Int16Array(blocksBufferSize);
  7051. component.blocksPerLine = blocksPerLine;
  7052. component.blocksPerColumn = blocksPerColumn;
  7053. }
  7054. frame.mcusPerLine = mcusPerLine;
  7055. frame.mcusPerColumn = mcusPerColumn;
  7056. }
  7057. let offset = 0;
  7058. let jfif = null;
  7059. let adobe = null;
  7060. let frame, resetInterval;
  7061. let numSOSMarkers = 0;
  7062. const quantizationTables = [];
  7063. const huffmanTablesAC = [],
  7064. huffmanTablesDC = [];
  7065. let fileMarker = readUint16(data, offset);
  7066. offset += 2;
  7067. if (fileMarker !== 0xffd8) {
  7068. throw new JpegError("SOI not found");
  7069. }
  7070. fileMarker = readUint16(data, offset);
  7071. offset += 2;
  7072. markerLoop: while (fileMarker !== 0xffd9) {
  7073. let i, j, l;
  7074. switch (fileMarker) {
  7075. case 0xffe0:
  7076. case 0xffe1:
  7077. case 0xffe2:
  7078. case 0xffe3:
  7079. case 0xffe4:
  7080. case 0xffe5:
  7081. case 0xffe6:
  7082. case 0xffe7:
  7083. case 0xffe8:
  7084. case 0xffe9:
  7085. case 0xffea:
  7086. case 0xffeb:
  7087. case 0xffec:
  7088. case 0xffed:
  7089. case 0xffee:
  7090. case 0xffef:
  7091. case 0xfffe:
  7092. const appData = readDataBlock();
  7093. if (fileMarker === 0xffe0) {
  7094. if (appData[0] === 0x4a && appData[1] === 0x46 && appData[2] === 0x49 && appData[3] === 0x46 && appData[4] === 0) {
  7095. jfif = {
  7096. version: {
  7097. major: appData[5],
  7098. minor: appData[6]
  7099. },
  7100. densityUnits: appData[7],
  7101. xDensity: appData[8] << 8 | appData[9],
  7102. yDensity: appData[10] << 8 | appData[11],
  7103. thumbWidth: appData[12],
  7104. thumbHeight: appData[13],
  7105. thumbData: appData.subarray(14, 14 + 3 * appData[12] * appData[13])
  7106. };
  7107. }
  7108. }
  7109. if (fileMarker === 0xffee) {
  7110. if (appData[0] === 0x41 && appData[1] === 0x64 && appData[2] === 0x6f && appData[3] === 0x62 && appData[4] === 0x65) {
  7111. adobe = {
  7112. version: appData[5] << 8 | appData[6],
  7113. flags0: appData[7] << 8 | appData[8],
  7114. flags1: appData[9] << 8 | appData[10],
  7115. transformCode: appData[11]
  7116. };
  7117. }
  7118. }
  7119. break;
  7120. case 0xffdb:
  7121. const quantizationTablesLength = readUint16(data, offset);
  7122. offset += 2;
  7123. const quantizationTablesEnd = quantizationTablesLength + offset - 2;
  7124. let z;
  7125. while (offset < quantizationTablesEnd) {
  7126. const quantizationTableSpec = data[offset++];
  7127. const tableData = new Uint16Array(64);
  7128. if (quantizationTableSpec >> 4 === 0) {
  7129. for (j = 0; j < 64; j++) {
  7130. z = dctZigZag[j];
  7131. tableData[z] = data[offset++];
  7132. }
  7133. } else if (quantizationTableSpec >> 4 === 1) {
  7134. for (j = 0; j < 64; j++) {
  7135. z = dctZigZag[j];
  7136. tableData[z] = readUint16(data, offset);
  7137. offset += 2;
  7138. }
  7139. } else {
  7140. throw new JpegError("DQT - invalid table spec");
  7141. }
  7142. quantizationTables[quantizationTableSpec & 15] = tableData;
  7143. }
  7144. break;
  7145. case 0xffc0:
  7146. case 0xffc1:
  7147. case 0xffc2:
  7148. if (frame) {
  7149. throw new JpegError("Only single frame JPEGs supported");
  7150. }
  7151. offset += 2;
  7152. frame = {};
  7153. frame.extended = fileMarker === 0xffc1;
  7154. frame.progressive = fileMarker === 0xffc2;
  7155. frame.precision = data[offset++];
  7156. const sofScanLines = readUint16(data, offset);
  7157. offset += 2;
  7158. frame.scanLines = dnlScanLines || sofScanLines;
  7159. frame.samplesPerLine = readUint16(data, offset);
  7160. offset += 2;
  7161. frame.components = [];
  7162. frame.componentIds = {};
  7163. const componentsCount = data[offset++];
  7164. let maxH = 0,
  7165. maxV = 0;
  7166. for (i = 0; i < componentsCount; i++) {
  7167. const componentId = data[offset];
  7168. const h = data[offset + 1] >> 4;
  7169. const v = data[offset + 1] & 15;
  7170. if (maxH < h) {
  7171. maxH = h;
  7172. }
  7173. if (maxV < v) {
  7174. maxV = v;
  7175. }
  7176. const qId = data[offset + 2];
  7177. l = frame.components.push({
  7178. h,
  7179. v,
  7180. quantizationId: qId,
  7181. quantizationTable: null
  7182. });
  7183. frame.componentIds[componentId] = l - 1;
  7184. offset += 3;
  7185. }
  7186. frame.maxH = maxH;
  7187. frame.maxV = maxV;
  7188. prepareComponents(frame);
  7189. break;
  7190. case 0xffc4:
  7191. const huffmanLength = readUint16(data, offset);
  7192. offset += 2;
  7193. for (i = 2; i < huffmanLength;) {
  7194. const huffmanTableSpec = data[offset++];
  7195. const codeLengths = new Uint8Array(16);
  7196. let codeLengthSum = 0;
  7197. for (j = 0; j < 16; j++, offset++) {
  7198. codeLengthSum += codeLengths[j] = data[offset];
  7199. }
  7200. const huffmanValues = new Uint8Array(codeLengthSum);
  7201. for (j = 0; j < codeLengthSum; j++, offset++) {
  7202. huffmanValues[j] = data[offset];
  7203. }
  7204. i += 17 + codeLengthSum;
  7205. (huffmanTableSpec >> 4 === 0 ? huffmanTablesDC : huffmanTablesAC)[huffmanTableSpec & 15] = buildHuffmanTable(codeLengths, huffmanValues);
  7206. }
  7207. break;
  7208. case 0xffdd:
  7209. offset += 2;
  7210. resetInterval = readUint16(data, offset);
  7211. offset += 2;
  7212. break;
  7213. case 0xffda:
  7214. const parseDNLMarker = ++numSOSMarkers === 1 && !dnlScanLines;
  7215. offset += 2;
  7216. const selectorsCount = data[offset++],
  7217. components = [];
  7218. for (i = 0; i < selectorsCount; i++) {
  7219. const index = data[offset++];
  7220. const componentIndex = frame.componentIds[index];
  7221. const component = frame.components[componentIndex];
  7222. component.index = index;
  7223. const tableSpec = data[offset++];
  7224. component.huffmanTableDC = huffmanTablesDC[tableSpec >> 4];
  7225. component.huffmanTableAC = huffmanTablesAC[tableSpec & 15];
  7226. components.push(component);
  7227. }
  7228. const spectralStart = data[offset++],
  7229. spectralEnd = data[offset++],
  7230. successiveApproximation = data[offset++];
  7231. try {
  7232. const processed = decodeScan(data, offset, frame, components, resetInterval, spectralStart, spectralEnd, successiveApproximation >> 4, successiveApproximation & 15, parseDNLMarker);
  7233. offset += processed;
  7234. } catch (ex) {
  7235. if (ex instanceof DNLMarkerError) {
  7236. warn(`${ex.message} -- attempting to re-parse the JPEG image.`);
  7237. return this.parse(data, {
  7238. dnlScanLines: ex.scanLines
  7239. });
  7240. } else if (ex instanceof EOIMarkerError) {
  7241. warn(`${ex.message} -- ignoring the rest of the image data.`);
  7242. break markerLoop;
  7243. }
  7244. throw ex;
  7245. }
  7246. break;
  7247. case 0xffdc:
  7248. offset += 4;
  7249. break;
  7250. case 0xffff:
  7251. if (data[offset] !== 0xff) {
  7252. offset--;
  7253. }
  7254. break;
  7255. default:
  7256. const nextFileMarker = findNextFileMarker(data, offset - 2, offset - 3);
  7257. if (nextFileMarker?.invalid) {
  7258. warn("JpegImage.parse - unexpected data, current marker is: " + nextFileMarker.invalid);
  7259. offset = nextFileMarker.offset;
  7260. break;
  7261. }
  7262. if (!nextFileMarker || offset >= data.length - 1) {
  7263. warn("JpegImage.parse - reached the end of the image data " + "without finding an EOI marker (0xFFD9).");
  7264. break markerLoop;
  7265. }
  7266. throw new JpegError("JpegImage.parse - unknown marker: " + fileMarker.toString(16));
  7267. }
  7268. fileMarker = readUint16(data, offset);
  7269. offset += 2;
  7270. }
  7271. if (!frame) {
  7272. throw new JpegError("JpegImage.parse - no frame data found.");
  7273. }
  7274. this.width = frame.samplesPerLine;
  7275. this.height = frame.scanLines;
  7276. this.jfif = jfif;
  7277. this.adobe = adobe;
  7278. this.components = [];
  7279. for (const component of frame.components) {
  7280. const quantizationTable = quantizationTables[component.quantizationId];
  7281. if (quantizationTable) {
  7282. component.quantizationTable = quantizationTable;
  7283. }
  7284. this.components.push({
  7285. index: component.index,
  7286. output: buildComponentData(frame, component),
  7287. scaleX: component.h / frame.maxH,
  7288. scaleY: component.v / frame.maxV,
  7289. blocksPerLine: component.blocksPerLine,
  7290. blocksPerColumn: component.blocksPerColumn
  7291. });
  7292. }
  7293. this.numComponents = this.components.length;
  7294. return undefined;
  7295. }
  7296. _getLinearizedBlockData(width, height, isSourcePDF = false) {
  7297. const scaleX = this.width / width,
  7298. scaleY = this.height / height;
  7299. let component, componentScaleX, componentScaleY, blocksPerScanline;
  7300. let x, y, i, j, k;
  7301. let index;
  7302. let offset = 0;
  7303. let output;
  7304. const numComponents = this.components.length;
  7305. const dataLength = width * height * numComponents;
  7306. const data = new Uint8ClampedArray(dataLength);
  7307. const xScaleBlockOffset = new Uint32Array(width);
  7308. const mask3LSB = 0xfffffff8;
  7309. let lastComponentScaleX;
  7310. for (i = 0; i < numComponents; i++) {
  7311. component = this.components[i];
  7312. componentScaleX = component.scaleX * scaleX;
  7313. componentScaleY = component.scaleY * scaleY;
  7314. offset = i;
  7315. output = component.output;
  7316. blocksPerScanline = component.blocksPerLine + 1 << 3;
  7317. if (componentScaleX !== lastComponentScaleX) {
  7318. for (x = 0; x < width; x++) {
  7319. j = 0 | x * componentScaleX;
  7320. xScaleBlockOffset[x] = (j & mask3LSB) << 3 | j & 7;
  7321. }
  7322. lastComponentScaleX = componentScaleX;
  7323. }
  7324. for (y = 0; y < height; y++) {
  7325. j = 0 | y * componentScaleY;
  7326. index = blocksPerScanline * (j & mask3LSB) | (j & 7) << 3;
  7327. for (x = 0; x < width; x++) {
  7328. data[offset] = output[index + xScaleBlockOffset[x]];
  7329. offset += numComponents;
  7330. }
  7331. }
  7332. }
  7333. let transform = this._decodeTransform;
  7334. if (!isSourcePDF && numComponents === 4 && !transform) {
  7335. transform = new Int32Array([-256, 255, -256, 255, -256, 255, -256, 255]);
  7336. }
  7337. if (transform) {
  7338. for (i = 0; i < dataLength;) {
  7339. for (j = 0, k = 0; j < numComponents; j++, i++, k += 2) {
  7340. data[i] = (data[i] * transform[k] >> 8) + transform[k + 1];
  7341. }
  7342. }
  7343. }
  7344. return data;
  7345. }
  7346. get _isColorConversionNeeded() {
  7347. if (this.adobe) {
  7348. return !!this.adobe.transformCode;
  7349. }
  7350. if (this.numComponents === 3) {
  7351. if (this._colorTransform === 0) {
  7352. return false;
  7353. } else if (this.components[0].index === 0x52 && this.components[1].index === 0x47 && this.components[2].index === 0x42) {
  7354. return false;
  7355. }
  7356. return true;
  7357. }
  7358. if (this._colorTransform === 1) {
  7359. return true;
  7360. }
  7361. return false;
  7362. }
  7363. _convertYccToRgb(data) {
  7364. let Y, Cb, Cr;
  7365. for (let i = 0, length = data.length; i < length; i += 3) {
  7366. Y = data[i];
  7367. Cb = data[i + 1];
  7368. Cr = data[i + 2];
  7369. data[i] = Y - 179.456 + 1.402 * Cr;
  7370. data[i + 1] = Y + 135.459 - 0.344 * Cb - 0.714 * Cr;
  7371. data[i + 2] = Y - 226.816 + 1.772 * Cb;
  7372. }
  7373. return data;
  7374. }
  7375. _convertYccToRgba(data, out) {
  7376. for (let i = 0, j = 0, length = data.length; i < length; i += 3, j += 4) {
  7377. const Y = data[i];
  7378. const Cb = data[i + 1];
  7379. const Cr = data[i + 2];
  7380. out[j] = Y - 179.456 + 1.402 * Cr;
  7381. out[j + 1] = Y + 135.459 - 0.344 * Cb - 0.714 * Cr;
  7382. out[j + 2] = Y - 226.816 + 1.772 * Cb;
  7383. out[j + 3] = 255;
  7384. }
  7385. return out;
  7386. }
  7387. _convertYcckToRgb(data) {
  7388. let Y, Cb, Cr, k;
  7389. let offset = 0;
  7390. for (let i = 0, length = data.length; i < length; i += 4) {
  7391. Y = data[i];
  7392. Cb = data[i + 1];
  7393. Cr = data[i + 2];
  7394. k = data[i + 3];
  7395. 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);
  7396. 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);
  7397. 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);
  7398. }
  7399. return data.subarray(0, offset);
  7400. }
  7401. _convertYcckToRgba(data) {
  7402. for (let i = 0, length = data.length; i < length; i += 4) {
  7403. const Y = data[i];
  7404. const Cb = data[i + 1];
  7405. const Cr = data[i + 2];
  7406. const k = data[i + 3];
  7407. 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);
  7408. 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);
  7409. 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);
  7410. data[i + 3] = 255;
  7411. }
  7412. return data;
  7413. }
  7414. _convertYcckToCmyk(data) {
  7415. let Y, Cb, Cr;
  7416. for (let i = 0, length = data.length; i < length; i += 4) {
  7417. Y = data[i];
  7418. Cb = data[i + 1];
  7419. Cr = data[i + 2];
  7420. data[i] = 434.456 - Y - 1.402 * Cr;
  7421. data[i + 1] = 119.541 - Y + 0.344 * Cb + 0.714 * Cr;
  7422. data[i + 2] = 481.816 - Y - 1.772 * Cb;
  7423. }
  7424. return data;
  7425. }
  7426. _convertCmykToRgb(data) {
  7427. let c, m, y, k;
  7428. let offset = 0;
  7429. for (let i = 0, length = data.length; i < length; i += 4) {
  7430. c = data[i];
  7431. m = data[i + 1];
  7432. y = data[i + 2];
  7433. k = data[i + 3];
  7434. 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);
  7435. 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);
  7436. 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);
  7437. }
  7438. return data.subarray(0, offset);
  7439. }
  7440. _convertCmykToRgba(data) {
  7441. for (let i = 0, length = data.length; i < length; i += 4) {
  7442. const c = data[i];
  7443. const m = data[i + 1];
  7444. const y = data[i + 2];
  7445. const k = data[i + 3];
  7446. 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);
  7447. 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);
  7448. 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);
  7449. data[i + 3] = 255;
  7450. }
  7451. return data;
  7452. }
  7453. getData({
  7454. width,
  7455. height,
  7456. forceRGBA = false,
  7457. forceRGB = false,
  7458. isSourcePDF = false
  7459. }) {
  7460. if (this.numComponents > 4) {
  7461. throw new JpegError("Unsupported color mode");
  7462. }
  7463. const data = this._getLinearizedBlockData(width, height, isSourcePDF);
  7464. if (this.numComponents === 1 && (forceRGBA || forceRGB)) {
  7465. const len = data.length * (forceRGBA ? 4 : 3);
  7466. const rgbaData = new Uint8ClampedArray(len);
  7467. let offset = 0;
  7468. if (forceRGBA) {
  7469. grayToRGBA(data, new Uint32Array(rgbaData.buffer));
  7470. } else {
  7471. for (const grayColor of data) {
  7472. rgbaData[offset++] = grayColor;
  7473. rgbaData[offset++] = grayColor;
  7474. rgbaData[offset++] = grayColor;
  7475. }
  7476. }
  7477. return rgbaData;
  7478. } else if (this.numComponents === 3 && this._isColorConversionNeeded) {
  7479. if (forceRGBA) {
  7480. const rgbaData = new Uint8ClampedArray(data.length / 3 * 4);
  7481. return this._convertYccToRgba(data, rgbaData);
  7482. }
  7483. return this._convertYccToRgb(data);
  7484. } else if (this.numComponents === 4) {
  7485. if (this._isColorConversionNeeded) {
  7486. if (forceRGBA) {
  7487. return this._convertYcckToRgba(data);
  7488. }
  7489. if (forceRGB) {
  7490. return this._convertYcckToRgb(data);
  7491. }
  7492. return this._convertYcckToCmyk(data);
  7493. } else if (forceRGBA) {
  7494. return this._convertCmykToRgba(data);
  7495. } else if (forceRGB) {
  7496. return this._convertCmykToRgb(data);
  7497. }
  7498. }
  7499. return data;
  7500. }
  7501. }
  7502. ;// CONCATENATED MODULE: ./src/core/jpeg_stream.js
  7503. class JpegStream extends DecodeStream {
  7504. constructor(stream, maybeLength, params) {
  7505. super(maybeLength);
  7506. this.stream = stream;
  7507. this.dict = stream.dict;
  7508. this.maybeLength = maybeLength;
  7509. this.params = params;
  7510. }
  7511. get bytes() {
  7512. return shadow(this, "bytes", this.stream.getBytes(this.maybeLength));
  7513. }
  7514. ensureBuffer(requested) {}
  7515. readBlock() {
  7516. this.decodeImage();
  7517. }
  7518. decodeImage(bytes) {
  7519. if (this.eof) {
  7520. return this.buffer;
  7521. }
  7522. bytes ||= this.bytes;
  7523. for (let i = 0, ii = bytes.length - 1; i < ii; i++) {
  7524. if (bytes[i] === 0xff && bytes[i + 1] === 0xd8) {
  7525. if (i > 0) {
  7526. bytes = bytes.subarray(i);
  7527. }
  7528. break;
  7529. }
  7530. }
  7531. const jpegOptions = {
  7532. decodeTransform: undefined,
  7533. colorTransform: undefined
  7534. };
  7535. const decodeArr = this.dict.getArray("D", "Decode");
  7536. if ((this.forceRGBA || this.forceRGB) && Array.isArray(decodeArr)) {
  7537. const bitsPerComponent = this.dict.get("BPC", "BitsPerComponent") || 8;
  7538. const decodeArrLength = decodeArr.length;
  7539. const transform = new Int32Array(decodeArrLength);
  7540. let transformNeeded = false;
  7541. const maxValue = (1 << bitsPerComponent) - 1;
  7542. for (let i = 0; i < decodeArrLength; i += 2) {
  7543. transform[i] = (decodeArr[i + 1] - decodeArr[i]) * 256 | 0;
  7544. transform[i + 1] = decodeArr[i] * maxValue | 0;
  7545. if (transform[i] !== 256 || transform[i + 1] !== 0) {
  7546. transformNeeded = true;
  7547. }
  7548. }
  7549. if (transformNeeded) {
  7550. jpegOptions.decodeTransform = transform;
  7551. }
  7552. }
  7553. if (this.params instanceof Dict) {
  7554. const colorTransform = this.params.get("ColorTransform");
  7555. if (Number.isInteger(colorTransform)) {
  7556. jpegOptions.colorTransform = colorTransform;
  7557. }
  7558. }
  7559. const jpegImage = new JpegImage(jpegOptions);
  7560. jpegImage.parse(bytes);
  7561. const data = jpegImage.getData({
  7562. width: this.drawWidth,
  7563. height: this.drawHeight,
  7564. forceRGBA: this.forceRGBA,
  7565. forceRGB: this.forceRGB,
  7566. isSourcePDF: true
  7567. });
  7568. this.buffer = data;
  7569. this.bufferLength = data.length;
  7570. this.eof = true;
  7571. return this.buffer;
  7572. }
  7573. get canAsyncDecodeImageFromBuffer() {
  7574. return this.stream.isAsync;
  7575. }
  7576. }
  7577. ;// CONCATENATED MODULE: ./external/openjpeg/openjpeg.js
  7578. var OpenJPEG = (() => {
  7579. var _scriptName = typeof document != 'undefined' ? document.currentScript?.src : undefined;
  7580. return function (moduleArg = {}) {
  7581. var moduleRtn;
  7582. var Module = moduleArg;
  7583. var readyPromiseResolve, readyPromiseReject;
  7584. var readyPromise = new Promise((resolve, reject) => {
  7585. readyPromiseResolve = resolve;
  7586. readyPromiseReject = reject;
  7587. });
  7588. var ENVIRONMENT_IS_WEB = true;
  7589. var ENVIRONMENT_IS_WORKER = false;
  7590. Module.decode = function (bytes, {
  7591. numComponents = 4,
  7592. isIndexedColormap = false,
  7593. smaskInData = false
  7594. }) {
  7595. const size = bytes.length;
  7596. const ptr = Module._malloc(size);
  7597. Module.HEAPU8.set(bytes, ptr);
  7598. const ret = Module._jp2_decode(ptr, size, numComponents > 0 ? numComponents : 0, !!isIndexedColormap, !!smaskInData);
  7599. Module._free(ptr);
  7600. if (ret) {
  7601. const {
  7602. errorMessages: errorMessages
  7603. } = Module;
  7604. if (errorMessages) {
  7605. delete Module.errorMessages;
  7606. return errorMessages;
  7607. }
  7608. return "Unknown error";
  7609. }
  7610. const {
  7611. imageData: imageData
  7612. } = Module;
  7613. Module.imageData = null;
  7614. return imageData;
  7615. };
  7616. var moduleOverrides = Object.assign({}, Module);
  7617. var arguments_ = [];
  7618. var thisProgram = "./this.program";
  7619. var quit_ = (status, toThrow) => {
  7620. throw toThrow;
  7621. };
  7622. var scriptDirectory = "";
  7623. var read_, readAsync, readBinary;
  7624. if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {
  7625. if (ENVIRONMENT_IS_WORKER) {
  7626. scriptDirectory = self.location.href;
  7627. } else if (typeof document != "undefined" && document.currentScript) {
  7628. scriptDirectory = document.currentScript.src;
  7629. }
  7630. if (_scriptName) {
  7631. scriptDirectory = _scriptName;
  7632. }
  7633. if (scriptDirectory.startsWith("blob:")) {
  7634. scriptDirectory = "";
  7635. } else {
  7636. scriptDirectory = scriptDirectory.substr(0, scriptDirectory.replace(/[?#].*/, "").lastIndexOf("/") + 1);
  7637. }
  7638. read_ = url => {
  7639. var xhr = new XMLHttpRequest();
  7640. xhr.open("GET", url, false);
  7641. xhr.send(null);
  7642. return xhr.responseText;
  7643. };
  7644. if (ENVIRONMENT_IS_WORKER) {
  7645. readBinary = url => {
  7646. var xhr = new XMLHttpRequest();
  7647. xhr.open("GET", url, false);
  7648. xhr.responseType = "arraybuffer";
  7649. xhr.send(null);
  7650. return new Uint8Array(xhr.response);
  7651. };
  7652. }
  7653. readAsync = (url, onload, onerror) => {
  7654. fetch(url, {
  7655. credentials: "same-origin"
  7656. }).then(response => {
  7657. if (response.ok) {
  7658. return response.arrayBuffer();
  7659. }
  7660. return Promise.reject(new Error(response.status + " : " + response.url));
  7661. }).then(onload, onerror);
  7662. };
  7663. } else {}
  7664. var out = Module["print"] || console.log.bind(console);
  7665. var err = Module["printErr"] || console.error.bind(console);
  7666. Object.assign(Module, moduleOverrides);
  7667. moduleOverrides = null;
  7668. if (Module["arguments"]) arguments_ = Module["arguments"];
  7669. if (Module["thisProgram"]) thisProgram = Module["thisProgram"];
  7670. if (Module["quit"]) quit_ = Module["quit"];
  7671. var wasmBinary;
  7672. if (Module["wasmBinary"]) wasmBinary = Module["wasmBinary"];
  7673. function intArrayFromBase64(s) {
  7674. var decoded = atob(s);
  7675. var bytes = new Uint8Array(decoded.length);
  7676. for (var i = 0; i < decoded.length; ++i) {
  7677. bytes[i] = decoded.charCodeAt(i);
  7678. }
  7679. return bytes;
  7680. }
  7681. function tryParseAsDataURI(filename) {
  7682. if (!isDataURI(filename)) {
  7683. return;
  7684. }
  7685. return intArrayFromBase64(filename.slice(dataURIPrefix.length));
  7686. }
  7687. var wasmMemory;
  7688. var ABORT = false;
  7689. var HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64;
  7690. function updateMemoryViews() {
  7691. var b = wasmMemory.buffer;
  7692. Module["HEAP8"] = HEAP8 = new Int8Array(b);
  7693. Module["HEAP16"] = HEAP16 = new Int16Array(b);
  7694. Module["HEAPU8"] = HEAPU8 = new Uint8Array(b);
  7695. Module["HEAPU16"] = HEAPU16 = new Uint16Array(b);
  7696. Module["HEAP32"] = HEAP32 = new Int32Array(b);
  7697. Module["HEAPU32"] = HEAPU32 = new Uint32Array(b);
  7698. Module["HEAPF32"] = HEAPF32 = new Float32Array(b);
  7699. Module["HEAPF64"] = HEAPF64 = new Float64Array(b);
  7700. }
  7701. var __ATPRERUN__ = [];
  7702. var __ATINIT__ = [];
  7703. var __ATPOSTRUN__ = [];
  7704. var runtimeInitialized = false;
  7705. function preRun() {
  7706. if (Module["preRun"]) {
  7707. if (typeof Module["preRun"] == "function") Module["preRun"] = [Module["preRun"]];
  7708. while (Module["preRun"].length) {
  7709. addOnPreRun(Module["preRun"].shift());
  7710. }
  7711. }
  7712. callRuntimeCallbacks(__ATPRERUN__);
  7713. }
  7714. function initRuntime() {
  7715. runtimeInitialized = true;
  7716. callRuntimeCallbacks(__ATINIT__);
  7717. }
  7718. function postRun() {
  7719. if (Module["postRun"]) {
  7720. if (typeof Module["postRun"] == "function") Module["postRun"] = [Module["postRun"]];
  7721. while (Module["postRun"].length) {
  7722. addOnPostRun(Module["postRun"].shift());
  7723. }
  7724. }
  7725. callRuntimeCallbacks(__ATPOSTRUN__);
  7726. }
  7727. function addOnPreRun(cb) {
  7728. __ATPRERUN__.unshift(cb);
  7729. }
  7730. function addOnInit(cb) {
  7731. __ATINIT__.unshift(cb);
  7732. }
  7733. function addOnPostRun(cb) {
  7734. __ATPOSTRUN__.unshift(cb);
  7735. }
  7736. var runDependencies = 0;
  7737. var runDependencyWatcher = null;
  7738. var dependenciesFulfilled = null;
  7739. function addRunDependency(id) {
  7740. runDependencies++;
  7741. Module["monitorRunDependencies"]?.(runDependencies);
  7742. }
  7743. function removeRunDependency(id) {
  7744. runDependencies--;
  7745. Module["monitorRunDependencies"]?.(runDependencies);
  7746. if (runDependencies == 0) {
  7747. if (runDependencyWatcher !== null) {
  7748. clearInterval(runDependencyWatcher);
  7749. runDependencyWatcher = null;
  7750. }
  7751. if (dependenciesFulfilled) {
  7752. var callback = dependenciesFulfilled;
  7753. dependenciesFulfilled = null;
  7754. callback();
  7755. }
  7756. }
  7757. }
  7758. var dataURIPrefix = "data:application/octet-stream;base64,";
  7759. var isDataURI = filename => filename.startsWith(dataURIPrefix);
  7760. function findWasmBinary() {
  7761. 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/AGACfH8BfAJbDwFhAWEAAgFhAWIAAQFhAWMABQFhAWQAAgFhAWUADAFhAWYABwFhAWcAAwFhAWgABwFhAWkABQFhAWoACQFhAWsABAFhAWwABgFhAW0ABgFhAW4ABAFhAW8AAwPAAb4BBwIFAAYEAAUGBAUBBAwFFAYCAgICAAYQEQQCChICBQIEBwQCDgICDQYCFQMHAAAEAwEWCQkDAAkGAQQEBQUODwEBAw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NAIAIgASgCADYCACABQQRqIQEgAkEEaiICIARJDQALDAELIANBBEkEQCAAIQIMAQsgACADQQRrIgRLBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsgAAswAQF/AkAgAEUNACABRQ0AQQggACABbCIBECUiAARAIABBACABEBUaCyAAIQILIAILEQAgAEUEQEEADwtBCCAAECUL8gICAn8BfgJAIAJFDQAgACABOgAAIAAgAmoiA0EBayABOgAAIAJBA0kNACAAIAE6AAIgACABOgABIANBA2sgAToAACADQQJrIAE6AAAgAkEHSQ0AIAAgAToAAyADQQRrIAE6AAAgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBBGsgATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQQhrIAE2AgAgAkEMayABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkEQayABNgIAIAJBFGsgATYCACACQRhrIAE2AgAgAkEcayABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa1CgYCAgBB+IQUgAyAEaiEBA0AgASAFNwMYIAEgBTcDECABIAU3AwggASAFNwMAIAFBIGohASACQSBrIgJBH0sNAAsLIAALJwEBfyMAQRBrIgMkACADIAI2AgwgACABIAJBAEEAEGsgA0EQaiQAC+gFAQl/IAFFBEBBAA8LAn8gAEUEQEEIIAEQJQwBCyABRQRAIAAQEEEADAELAkAgAUFHSw0AIAACf0EIIAFBA2pBfHEgAUEITRsiB0EIaiEBAkACfwJAIABBBGsiCiIEKAIAIgUgBGoiAigCACIJIAIgCWoiCEEEaygCAEcEQCAIIAEgBGoiA0EQak8EQCACKAIEIgUgAigCCCICNgIIIAIgBTYCBCADIAggA2siAjYCACADIAJBfHFqQQRrIAJBAXI2AgAgAwJ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IAcgLCAGG0EDdEEEa0ECdCIKaigCACEyIAZFBEAgFCABQQJ0IgFqIgYgBigCACAyIEUoAgBqQQJqQQJ1azYCACABICRqIgYgBigCACAKICRqKAIAIDwoAgBqQQJqQQJ1azYCACABICpqIgYgBigCACAKICpqKAIAIDooAgBqQQJqQQJ1azYCACABIClqIQEgCiApaigCACAmKAIAakECaiEGDAELIBQgAUECdCIBaiIGIAYoAgAgMiAGKAIQakECakECdWs2AgAgASAkaiIGIAYoAgAgCiAkaigCACAGKAIQakECakECdWs2AgAgASAqaiIGIAYoAgAgCiAqaigCACAGKAIQakECakECdWs2AgAgCiApaigCACABIClqIgEoAhBqQQJqIQYLIAEgASgCACAGQQJ1azYCACAHQQFqIgcgG0cNAAsLIA4gHE4NACAMIA4iASIHSgRAA0AgFCABQQV0aiIHIAf9AAIgIAf9AAIA/a4BQQH9rAEgB/0AAhD9rgH9CwIQIAFBAWoiASAMRw0ACyAMIQcLIAcgHE4NAANAIEMgB0EDdCIBQQJ0aiIyAn8gB0EASARAIBQoAgAhBiAHQX9HBEAgNiABQQJ0IgFqIgogCigCACAGajYCACABICBqIgYgBigCACAkKAIAajYCACABIB9qIgEgASgCACAqKAIAajYCACApKAIADAILIDYgAUECdCIBaiIKIAooAgAgVygCACAGakEBdWo2AgAgASAgaiIGIAYoAgAgVigCACAkKAIAakEBdWo2AgAgASAfaiIBIAEoAgAgVSgCACAqKAIAakEBdWo2AgAgVCgCACApKAIAakEBdQwBCyABID4gByASSBshBiASIAdBAWoiZkwEQCA2IAFBAnQiCmoiASABKAIAIGsoAgAgFCAGQQJ0aiIBKAIAakEBdWo2AgAgCiAgaiIGIAYoAgAgaigCACABKAIEakEBdWo2AgAgCiAfaiIGIAYoAgAgaSgCACABKAIIakEBdWo2AgAgaCgCACABKAIMakEBdQwBCyA2IAFBAnQiCmoiASABKAIAIBQgZkEFdGoiASgCACAUIAZBAnRqIgYoAgBqQQF1ajYCACAKICBqImYgZigCACABKAIEIAYoAgRqQQF1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QAgAUGAAkYNACAEIE5BCmpBAiAFEBpBAkcEQCAFQQFBAiAAKAK4ARtBlhJBABAPIAAoArgBRSFnDAELIE5BCmogTkEMakECEBEgTigCDCIBQZD/A0YNACABQdn/A0YEQCAAQYACNgIIIABBADYCzAEMAQsgBCkDCCKGAVAEfkIABSCGASAEKQM4fQtQBEAgAEHAADYCCCAFQQJBrD9BABAPDAELQQAhZyAFQQFB7D5BABAPCyBOQRBqJAAgZwsLACAABEAgABAQCwu0AQEBfyAAKAIMRQRAIAIgACgCJCABEQMADwsCQEEIEBQiA0UNACADIAI2AgQgAyABNgIAQQgQFCIBRQRAIAMQEA8LIAEgAzYCACAAIAAoAgRB5ABsIgI2AigDQCAAKAIYIAJKDQALIAEgACgCFDYCBCAAIAE2AhQgACAAKAIYQQFqNgIYIAAoAhwiAUUNACABKAIAQQA2AgggACABKAIENgIcIAAgACgCIEEBazYCICABEBALC/oCAQR/AkAgAEUNACAAKAKsKCIBBEAgACgCqCgiAgRAQQAhAQNAIAAoAqwoIAFBA3RqKAIAIgMEQCADEBAgACgCqCghAgsgAUEBaiIBIAJJDQALIAAoAqwoIQELIABBADYCqCggARAQIABBADYCrCgLIAAoArQoIgEEQCABEBAgAEEANgK0KAsgACgC0CsiAQRAIAEQECAAQQA2AtArCyAAKALsKyIBBEAgARAQIABBADYC7CsLIAAoAugrIgEEQCABEBAgAEEANgLoKwsgACgC/CsiAQRAIAEQECAAQQA2AoQsIABCADcC/CsLIAAoAvArIgEEQCAAKAL0KyIDBH9BACECA0AgASgCDCIEBEAgBBAQIAFBADYCDCAAKAL0KyEDCyABQRRqIQEgAkEBaiICIANJDQALIAAoAvArBSABCxAQIABBADYC8CsLIAAoAuQrIgEEQCABEBAgAEEANgLkKwsgACgC3CsiAUUNACABEBAgAEIANwLcKwsLyAcCEX8BfiAAKAIQIghBIE8EQCAAKQMIpw8LAkAgACgCFCIDQQROBEAgACgCACICQQNrKAIAIQEgACADQQRrIgM2AhQgACACQQRrNgIADAELIAN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IANBEGoQD0EAIQIMAwsgACACNgIMIABBNGohAEEBIQIgBEEBaiIEIAVHDQALDAELIAFBAUGnM0EAEA8LIANBIGokACACC9cGAQZ/IAAEQAJAIAAoAgAEQCAAKAIMIgEEQCABEC4gACgCDBAQIABBADYCDAsgACgCECIBBEAgARAQIABCADcDEAsgACgCQBAQIABCADcCPAwBCyAAKAIsIgEEQCABEBAgAEEANgIsCyAAKAIgIgEEQCABEBAgAEIANwMgCyAAKAI0IgFFDQAgARAQIABCADcCNAsgACgC0AEQVSAAKAKcASIBBEAgACgCaCAAKAJsbCIDBH8DQCABEC4gAUGMLGohASACQQFqIgIgA0cNAAsgACgCnAEFIAELEBAgAEEANgKcAQsgACgCdCIBBEAgACgCcCICBEBBACEBA0AgACgCdCABQQN0aigCACIDBEAgAxAQIAAoAnAhAgsgAUEBaiIBIAJJDQALIAAoAnQhAQsgAEEANgJwIAEQECAAQQA2AnQLIAAoAogBEBAgAEEANgJ4IABBADYCiAEgACgCZBAQIABBADYCZCAALQC8AUECcUUEQCAAKAKoARAQCyAAQdAAakEAQfAAEBUaIAAoAsABEDIgAEEANgLAASAAKALEARAyIABBADYCwAEgACgCyAEiAQRAIAEoAhwiAgRAIAIQECABQQA2AhwLIAEoAigiAgRAIAEoAiQEQANAIAIgBUEobCIDaigCJCIEBEAgBBAQIAEoAigiAiADakEANgIkCyACIANqKAIQIgQEQCAEEBAgASgCKCICIANqQQA2AhALIAIgA2ooAhgiBARAIAQQECABKAIoIgIgA2pBADYCGAsgBUEBaiIFIAEoAiRJDQALCyACEBAgAUEANgIoCyABEBALIABBADYCyAEgACgCSBAhIABBADYCSCAAKAJMECEgAEEANgJMIAAoAtQBIgMEQAJAIAMoAghFDQAgAygCDARAIANBADYCKANAIAMoAhhBAEoNAAsLIANBATYCECADKAIAEBAgAygCHCICRQ0AA0AgAigCBCEBIAIQECADIAE2AhwgASICDQALCyADKAIkIgIEQCACKAIEIgVBAEoEQEEAIQEDQCACKAIAIAFBDGxqIgQo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BADYCEEEBCwt+AgF/AX4gAL0iA0I0iKdB/w9xIgJB/w9HBHwgAkUEQCABIABEAAAAAAAAAABhBH9BAAUgAEQAAAAAAADwQ6IgARBlIQAgASgCAEFAags2AgAgAA8LIAEgAkH+B2s2AgAgA0L/////////h4B/g0KAgICAgICA8D+EvwUgAAsLSQEBfwJAQQFBLBATIgEEQCABQQA2AhACQCAAQQBMBEAgAUEBQQgQEyIANgIkIABFDQEMAwsgAUEANgIMCyABEBALQQAhAQsgAQuRAgAgAEUEQEEADwsCfwJAIAFB/wBNDQACQEGU0AEoAgAoAgBFBEAgAUGAf3FBgL8DRg0CDAELIAFB/w9NBEAgACABQT9xQYABcjoAASAAIAFBBnZBwAFyOgAAQQIMAwsgAUGAQHFBgMADRyABQYCwA09xRQRAIAAgAUE/cUGAAXI6AAIgACABQQx2QeABcjoAACAAIAFBBnZBP3FBgAFyOgABQQMMAwsgAUGAgARrQf//P00EQCAAIAFBP3FBgAFyOgADIAAgAUESdkHwAXI6AAAgACABQQZ2QT9xQYABcjoAAiAAIAFBDHZBP3FBgAFyOgABQQQMAwsLQZTHAUEZNgIAQX8MAQsgACABOgAAQQELC7wCAAJAAkACQAJAAkACQAJAAkACQAJAAkAgAUEJaw4SAAgJCggJAQIDBAoJCgoICQUGBwsgAiACKAIAIgFBBGo2AgAgACABKAIANgIADwsgAiACKAIAIgFBBGo2AgAgACABMgEANwMADwsgAiACKAIAIgFBBGo2AgAgACABMwEANwMADwsgAiACKAIAIgFBBGo2AgAgACABMAAANwMADwsgAiACKAIAIgFBBGo2AgAgACABMQAANwMADwsgAiACKAIAQQdqQXhxIgFBCGo2AgAgACABKwMAOQMADwsgACACIAMRAwALDwsgAiACKAIAIgFBBGo2AgAgACABNAIANwMADwsgAiACKAIAIgFBBGo2AgAgACABNQIANwMADwsgAiACKAIAQQdqQXhxIgFBCGo2AgAgACABKQMANwMAC3MBBn8gACgCACIDLAAAQTBrIgFBCUsEQEEADwsDQEF/IQQgAkHMmbPmAE0EQEF/IAEgAkEKbCIFaiABIAVB/////wdzSxshBAsgACADQQFqIgU2AgAgAywAASEGIAQhAiAFIQMgBkEwayIBQQpJDQALIAILtBQCFX8BfiMAQUBqIggkACAIIAE2AjwgCEEnaiEWIAhBKGohEQJAAkACQAJAA0BBACEHA0AgASENIAcgDkH/////B3NKDQIgByAOaiEOAkACQAJAAkAgASIHLQAAIgsEQANAAkACQCALQf8BcSIBRQRAIAchAQwBCyABQSVHDQEgByELA0AgCy0AAUElRwRAIAshAQwCCyAHQQFqIQcgCy0AAiEZIAtBAmoiASELIBlBJUYNAAsLIAcgDWsiByAOQf////8HcyIXSg0JIAAEQCAAIA0gBxAZCyAHDQcgCCABNgI8IAFBAWohB0F/IRACQCABLAABQTBrIglBCUsNACABLQACQSRHDQAgAUEDaiEHQQEhEiAJIRALIAggBzYCPEEAIQwCQCAHLAAAIgtBIGsiAUEfSwRAIAchCQwBCyAHIQlBASABdCIBQYnRBHFFDQADQCAIIAdBAWoiCTYCPCABIAxyIQwgBywAASILQSBrIgFBIE8NASAJIQdBASABdCIBQYnRBHENAAsLAkAgC0EqRgRAAn8CQCAJLAABQTBrIgFBCUsNACAJLQACQSRHDQACfyAARQRAIAQgAUECdGpBCjYCAEEADAELIAMgAUEDdGooAgALIQ8gCUEDaiEBQQEMAQsgEg0GIAlBAWohASAARQRAIAggATYCPEEAIRJBACEPDAMLIAIgAigCACIHQQRqNgIAIAcoAgAhD0EACyESIAggATYCPCAPQQBODQFBACAPayEPIAxBgMAAciEMDAELIAhBPGoQaSIPQQBIDQogCCgCPCEBC0EAIQdBfyEKAn9BACABLQAAQS5HDQAaIAEtAAFBKkYEQAJ/AkAgASwAAkEwayIJQQlLDQAgAS0AA0EkRw0AIAFBBGohAQJ/IABFBEAgBCAJQQJ0akEKNgIAQQAMAQsgAyAJQQN0aigCAAsMAQsgEg0GIAFBAmohAUEAIABFDQAaIAIgAigCACIJQQRqNgIAIAkoAgALIQogCCABNgI8IApBAE4MAQsgCCABQQF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IAIAZqIgU2AgAgAyADKAIEIAZrIgQ2AgQLIAQgAiACIARLGyIEBEAgBSABIAQQEhogAyADKAIAIARqIgU2AgAgAyADKAIEIARrNgIECyAFQQA6AAAgACAAKAIsIgE2AhwgACABNgIUIAILngUCBn4EfyABIAEoAgBBB2pBeHEiAUEQajYCACAAIQsgASkDACEDIAEpAwghByMAQSBrIggkACAHQv///////z+DIQQCfiAHQjCIQv//AYMiBaciCkGB+ABrQf0PTQRAIARCBIYgA0I8iIQhAiAKQYD4AGutIQUCQCADQv//////////D4MiA0KBgICAgICAgAhaBEAgAkIBfCECDAELIANCgICAgICAgIAIUg0AIAJCAYMgAnwhAgtCACACIAJC/////////wdWIgAbIQIgAK0gBXwMAQsCQCADIASEUA0AIAVC//8BUg0AIARCBIYgA0I8iIRCgICAgICAgASEIQJC/w8MAQtC/w8gCkH+hwFLDQAaQgBBgPgAQYH4ACAFUCIBGyIAIAprIglB8ABKDQAaIAMhAiAEIARCgICAgICAwACEIAEbIgYhBAJAQYABIAlrIgFBwABxBEAgAyABQUBqrYYhBEIAIQIMAQsgAUUNACAEIAGtIgWGIAJBwAAgAWutiIQhBCACIAWGIQILIAggAjcDECAIIAQ3AxgCQCAJQcAAcQRAIAYgCUFAaq2IIQNCACEGDAELIAlFDQAgBkHAACAJa62GIAMgCa0iAoiEIQMgBiACiCEGCyAIIAM3AwAgCCAGNwMIIAgpAwhCBIYgCCkDACICQjyIhCEDAkAgACAKRyAIKQMQIAgpAxiEQgBSca0gAkL//////////w+DhCICQoGAgICAgICACFoEQCADQgF8IQMMAQsgAkKAgICAgICAgAhSDQAgA0IBgyADfCEDCyADQoCAgICAgIAIhSADIANC/////////wdWIgAbIQIgAK0LIQMgCEEgaiQAIAsgB0KAgICAgICAgIB/gyADQjSGhCAChL85AwALhhgDE38BfAN+IwBBsARrIgwkACAMQQA2AiwCQCABvSIaQgBTBEBBASERQboIIRMgAZoiAb0hGgwBCyAEQYAQcQRAQQEhEUG9CCETDAELQcAIQbs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IAAoAgAgASACIAMQSEUEQCADQQFBqS9BABAPQQAPCyAAIAIgAxBxC2kCAn8BfCMAQRBrIgMkACACBEADQCAAIANBCGoQRCABAn8gAysDCCIFmUQAAAAAAADgQWMEQCAFqgwBC0GAgICAeAs2AgAgAUEEaiEBIABBCGohACAEQQFqIgQgAkcNAAsLIANBEGokAAuEAQICfwF9IwBBEGsiAyQAIAIEQANAIAMgAC0AADoADyADIAAtAAE6AA4gAyAALQACOgANIAMgAC0AAzoADCABAn8gAyoCDCIFi0MAAABPXQRAIAWoDAELQYCAgIB4CzYCACABQQRqIQEgAEEEaiEAIARBAWoiBCACRw0ACwsgA0EQaiQAC0sBAn8jAEEQayIDJAAgAgRAA0AgACADQQxqQQQQESABIAMoAgw2AgAgAUEEaiEBIABBBGohACAEQQFqIgQgAkcNAAsLIANBEGokAAtLAQJ/IwBBEGsiAyQAIAIEQANAIAAgA0EMakECEBEgASADKAIMNgIAIAFBBGohASAAQQJqIQAgBEEBaiIEIAJHDQALCyADQRBqJAALSgECfyMAQRBrIgMkACACBEADQCAAIANBCGoQRCABIAMrAwi2OAIAIAFBBGohASAAQQhqIQAgBEEBaiIEIAJHDQALCyADQRBqJAALaAECfyMAQRBrIgMkACACBEADQCADIAAtAAA6AA8gAyAALQABOgAOIAMgAC0AAjoADSADIAAtAAM6AAwgASADKgIMOAIAIAFBBGohASAAQQRqIQAgBEEBaiIEIAJHDQALCyADQRBqJAALTAECfyMAQRBrIgMkACACBEADQCAAIANBDGpBBBARIAEgAygCDLM4AgAgAUEEaiEBIABBBGohACAEQQFqIgQgAkcNAAsLIANBEGokAAtMAQJ/IwBBEGsiAyQAIAIEQANAIAAgA0EMakECEBEgASADKAIMszgCACABQQRqIQEgAEECaiEAIARBAWoiBCACRw0ACwsgA0EQaiQAC6oIAg1/AXsjAEEQayIIJAACfyAAKAIIQRBGBEAgACgCnAEgACgCzAFBjCxsagwBCyAAKAIMCyEJAkAgAkUEQCADQQFB8B9BABAPDAELIAAoAkghBk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GcxgELDmoAAABtAAAAiGgAAAAEAEG0xgELAQEAQcTGAQsF/////wo=";
  7762. return f;
  7763. }
  7764. var wasmBinaryFile;
  7765. function getBinarySync(file) {
  7766. if (file == wasmBinaryFile && wasmBinary) {
  7767. return new Uint8Array(wasmBinary);
  7768. }
  7769. var binary = tryParseAsDataURI(file);
  7770. if (binary) {
  7771. return binary;
  7772. }
  7773. if (readBinary) {
  7774. return readBinary(file);
  7775. }
  7776. 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)';
  7777. }
  7778. function instantiateSync(file, info) {
  7779. var module;
  7780. var binary = getBinarySync(file);
  7781. module = new WebAssembly.Module(binary);
  7782. var instance = new WebAssembly.Instance(module, info);
  7783. return [instance, module];
  7784. }
  7785. function getWasmImports() {
  7786. return {
  7787. a: wasmImports
  7788. };
  7789. }
  7790. function createWasm() {
  7791. var info = getWasmImports();
  7792. function receiveInstance(instance, module) {
  7793. wasmExports = instance.exports;
  7794. wasmMemory = wasmExports["p"];
  7795. updateMemoryViews();
  7796. addOnInit(wasmExports["q"]);
  7797. removeRunDependency("wasm-instantiate");
  7798. return wasmExports;
  7799. }
  7800. addRunDependency("wasm-instantiate");
  7801. if (Module["instantiateWasm"]) {
  7802. try {
  7803. return Module["instantiateWasm"](info, receiveInstance);
  7804. } catch (e) {
  7805. err(`Module.instantiateWasm callback failed with error: ${e}`);
  7806. readyPromiseReject(e);
  7807. }
  7808. }
  7809. if (!wasmBinaryFile) wasmBinaryFile = findWasmBinary();
  7810. var result = instantiateSync(wasmBinaryFile, info);
  7811. return receiveInstance(result[0]);
  7812. }
  7813. var callRuntimeCallbacks = callbacks => {
  7814. while (callbacks.length > 0) {
  7815. callbacks.shift()(Module);
  7816. }
  7817. };
  7818. var noExitRuntime = Module["noExitRuntime"] || true;
  7819. var __emscripten_memcpy_js = (dest, src, num) => HEAPU8.copyWithin(dest, src, src + num);
  7820. function _copy_pixels_1(compG_ptr, nb_pixels) {
  7821. compG_ptr >>= 2;
  7822. const imageData = Module.imageData = new Uint8ClampedArray(nb_pixels);
  7823. const compG = Module.HEAP32.subarray(compG_ptr, compG_ptr + nb_pixels);
  7824. imageData.set(compG);
  7825. }
  7826. function _copy_pixels_3(compR_ptr, compG_ptr, compB_ptr, nb_pixels) {
  7827. compR_ptr >>= 2;
  7828. compG_ptr >>= 2;
  7829. compB_ptr >>= 2;
  7830. const imageData = Module.imageData = new Uint8ClampedArray(nb_pixels * 3);
  7831. const compR = Module.HEAP32.subarray(compR_ptr, compR_ptr + nb_pixels);
  7832. const compG = Module.HEAP32.subarray(compG_ptr, compG_ptr + nb_pixels);
  7833. const compB = Module.HEAP32.subarray(compB_ptr, compB_ptr + nb_pixels);
  7834. for (let i = 0; i < nb_pixels; i++) {
  7835. imageData[3 * i] = compR[i];
  7836. imageData[3 * i + 1] = compG[i];
  7837. imageData[3 * i + 2] = compB[i];
  7838. }
  7839. }
  7840. function _copy_pixels_4(compR_ptr, compG_ptr, compB_ptr, compA_ptr, nb_pixels) {
  7841. compR_ptr >>= 2;
  7842. compG_ptr >>= 2;
  7843. compB_ptr >>= 2;
  7844. compA_ptr >>= 2;
  7845. const imageData = Module.imageData = new Uint8ClampedArray(nb_pixels * 4);
  7846. const compR = Module.HEAP32.subarray(compR_ptr, compR_ptr + nb_pixels);
  7847. const compG = Module.HEAP32.subarray(compG_ptr, compG_ptr + nb_pixels);
  7848. const compB = Module.HEAP32.subarray(compB_ptr, compB_ptr + nb_pixels);
  7849. const compA = Module.HEAP32.subarray(compA_ptr, compA_ptr + nb_pixels);
  7850. for (let i = 0; i < nb_pixels; i++) {
  7851. imageData[4 * i] = compR[i];
  7852. imageData[4 * i + 1] = compG[i];
  7853. imageData[4 * i + 2] = compB[i];
  7854. imageData[4 * i + 3] = compA[i];
  7855. }
  7856. }
  7857. var getHeapMax = () => 2147483648;
  7858. var growMemory = size => {
  7859. var b = wasmMemory.buffer;
  7860. var pages = (size - b.byteLength + 65535) / 65536;
  7861. try {
  7862. wasmMemory.grow(pages);
  7863. updateMemoryViews();
  7864. return 1;
  7865. } catch (e) {}
  7866. };
  7867. var _emscripten_resize_heap = requestedSize => {
  7868. var oldSize = HEAPU8.length;
  7869. requestedSize >>>= 0;
  7870. var maxHeapSize = getHeapMax();
  7871. if (requestedSize > maxHeapSize) {
  7872. return false;
  7873. }
  7874. var alignUp = (x, multiple) => x + (multiple - x % multiple) % multiple;
  7875. for (var cutDown = 1; cutDown <= 4; cutDown *= 2) {
  7876. var overGrownHeapSize = oldSize * (1 + .2 / cutDown);
  7877. overGrownHeapSize = Math.min(overGrownHeapSize, requestedSize + 100663296);
  7878. var newSize = Math.min(maxHeapSize, alignUp(Math.max(requestedSize, overGrownHeapSize), 65536));
  7879. var replacement = growMemory(newSize);
  7880. if (replacement) {
  7881. return true;
  7882. }
  7883. }
  7884. return false;
  7885. };
  7886. var ENV = {};
  7887. var getExecutableName = () => thisProgram || "./this.program";
  7888. var getEnvStrings = () => {
  7889. if (!getEnvStrings.strings) {
  7890. var lang = (typeof navigator == "object" && navigator.languages && navigator.languages[0] || "C").replace("-", "_") + ".UTF-8";
  7891. var env = {
  7892. USER: "web_user",
  7893. LOGNAME: "web_user",
  7894. PATH: "/",
  7895. PWD: "/",
  7896. HOME: "/home/web_user",
  7897. LANG: lang,
  7898. _: getExecutableName()
  7899. };
  7900. for (var x in ENV) {
  7901. if (ENV[x] === undefined) delete env[x];else env[x] = ENV[x];
  7902. }
  7903. var strings = [];
  7904. for (var x in env) {
  7905. strings.push(`${x}=${env[x]}`);
  7906. }
  7907. getEnvStrings.strings = strings;
  7908. }
  7909. return getEnvStrings.strings;
  7910. };
  7911. var stringToAscii = (str, buffer) => {
  7912. for (var i = 0; i < str.length; ++i) {
  7913. HEAP8[buffer++] = str.charCodeAt(i);
  7914. }
  7915. HEAP8[buffer] = 0;
  7916. };
  7917. var _environ_get = (__environ, environ_buf) => {
  7918. var bufSize = 0;
  7919. getEnvStrings().forEach((string, i) => {
  7920. var ptr = environ_buf + bufSize;
  7921. HEAPU32[__environ + i * 4 >> 2] = ptr;
  7922. stringToAscii(string, ptr);
  7923. bufSize += string.length + 1;
  7924. });
  7925. return 0;
  7926. };
  7927. var _environ_sizes_get = (penviron_count, penviron_buf_size) => {
  7928. var strings = getEnvStrings();
  7929. HEAPU32[penviron_count >> 2] = strings.length;
  7930. var bufSize = 0;
  7931. strings.forEach(string => bufSize += string.length + 1);
  7932. HEAPU32[penviron_buf_size >> 2] = bufSize;
  7933. return 0;
  7934. };
  7935. var _fd_close = fd => 52;
  7936. var convertI32PairToI53Checked = (lo, hi) => hi + 2097152 >>> 0 < 4194305 - !!lo ? (lo >>> 0) + hi * 4294967296 : NaN;
  7937. function _fd_seek(fd, offset_low, offset_high, whence, newOffset) {
  7938. var offset = convertI32PairToI53Checked(offset_low, offset_high);
  7939. return 70;
  7940. }
  7941. var printCharBuffers = [null, [], []];
  7942. var UTF8Decoder = typeof TextDecoder != "undefined" ? new TextDecoder("utf8") : undefined;
  7943. var UTF8ArrayToString = (heapOrArray, idx, maxBytesToRead) => {
  7944. var endIdx = idx + maxBytesToRead;
  7945. var endPtr = idx;
  7946. while (heapOrArray[endPtr] && !(endPtr >= endIdx)) ++endPtr;
  7947. if (endPtr - idx > 16 && heapOrArray.buffer && UTF8Decoder) {
  7948. return UTF8Decoder.decode(heapOrArray.subarray(idx, endPtr));
  7949. }
  7950. var str = "";
  7951. while (idx < endPtr) {
  7952. var u0 = heapOrArray[idx++];
  7953. if (!(u0 & 128)) {
  7954. str += String.fromCharCode(u0);
  7955. continue;
  7956. }
  7957. var u1 = heapOrArray[idx++] & 63;
  7958. if ((u0 & 224) == 192) {
  7959. str += String.fromCharCode((u0 & 31) << 6 | u1);
  7960. continue;
  7961. }
  7962. var u2 = heapOrArray[idx++] & 63;
  7963. if ((u0 & 240) == 224) {
  7964. u0 = (u0 & 15) << 12 | u1 << 6 | u2;
  7965. } else {
  7966. u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | heapOrArray[idx++] & 63;
  7967. }
  7968. if (u0 < 65536) {
  7969. str += String.fromCharCode(u0);
  7970. } else {
  7971. var ch = u0 - 65536;
  7972. str += String.fromCharCode(55296 | ch >> 10, 56320 | ch & 1023);
  7973. }
  7974. }
  7975. return str;
  7976. };
  7977. var printChar = (stream, curr) => {
  7978. var buffer = printCharBuffers[stream];
  7979. if (curr === 0 || curr === 10) {
  7980. (stream === 1 ? out : err)(UTF8ArrayToString(buffer, 0));
  7981. buffer.length = 0;
  7982. } else {
  7983. buffer.push(curr);
  7984. }
  7985. };
  7986. var UTF8ToString = (ptr, maxBytesToRead) => ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : "";
  7987. var _fd_write = (fd, iov, iovcnt, pnum) => {
  7988. var num = 0;
  7989. for (var i = 0; i < iovcnt; i++) {
  7990. var ptr = HEAPU32[iov >> 2];
  7991. var len = HEAPU32[iov + 4 >> 2];
  7992. iov += 8;
  7993. for (var j = 0; j < len; j++) {
  7994. printChar(fd, HEAPU8[ptr + j]);
  7995. }
  7996. num += len;
  7997. }
  7998. HEAPU32[pnum >> 2] = num;
  7999. return 0;
  8000. };
  8001. function _gray_to_rgba(compG_ptr, nb_pixels) {
  8002. compG_ptr >>= 2;
  8003. const imageData = Module.imageData = new Uint8ClampedArray(nb_pixels * 4);
  8004. const compG = Module.HEAP32.subarray(compG_ptr, compG_ptr + nb_pixels);
  8005. for (let i = 0; i < nb_pixels; i++) {
  8006. imageData[4 * i] = imageData[4 * i + 1] = imageData[4 * i + 2] = compG[i];
  8007. imageData[4 * i + 3] = 255;
  8008. }
  8009. }
  8010. function _graya_to_rgba(compG_ptr, compA_ptr, nb_pixels) {
  8011. compG_ptr >>= 2;
  8012. compA_ptr >>= 2;
  8013. const imageData = Module.imageData = new Uint8ClampedArray(nb_pixels * 4);
  8014. const compG = Module.HEAP32.subarray(compG_ptr, compG_ptr + nb_pixels);
  8015. const compA = Module.HEAP32.subarray(compA_ptr, compA_ptr + nb_pixels);
  8016. for (let i = 0; i < nb_pixels; i++) {
  8017. imageData[4 * i] = imageData[4 * i + 1] = imageData[4 * i + 2] = compG[i];
  8018. imageData[4 * i + 3] = compA[i];
  8019. }
  8020. }
  8021. function _jsPrintWarning(message_ptr) {
  8022. const message = UTF8ToString(message_ptr);
  8023. (Module.warn || console.warn)(`OpenJPEG: ${message}`);
  8024. }
  8025. function _rgb_to_rgba(compR_ptr, compG_ptr, compB_ptr, nb_pixels) {
  8026. compR_ptr >>= 2;
  8027. compG_ptr >>= 2;
  8028. compB_ptr >>= 2;
  8029. const imageData = Module.imageData = new Uint8ClampedArray(nb_pixels * 4);
  8030. const compR = Module.HEAP32.subarray(compR_ptr, compR_ptr + nb_pixels);
  8031. const compG = Module.HEAP32.subarray(compG_ptr, compG_ptr + nb_pixels);
  8032. const compB = Module.HEAP32.subarray(compB_ptr, compB_ptr + nb_pixels);
  8033. for (let i = 0; i < nb_pixels; i++) {
  8034. imageData[4 * i] = compR[i];
  8035. imageData[4 * i + 1] = compG[i];
  8036. imageData[4 * i + 2] = compB[i];
  8037. imageData[4 * i + 3] = 255;
  8038. }
  8039. }
  8040. function _storeErrorMessage(message_ptr) {
  8041. const message = UTF8ToString(message_ptr);
  8042. if (!Module.errorMessages) {
  8043. Module.errorMessages = message;
  8044. } else {
  8045. Module.errorMessages += "\n" + message;
  8046. }
  8047. }
  8048. var wasmImports = {
  8049. c: __emscripten_memcpy_js,
  8050. g: _copy_pixels_1,
  8051. f: _copy_pixels_3,
  8052. e: _copy_pixels_4,
  8053. k: _emscripten_resize_heap,
  8054. l: _environ_get,
  8055. m: _environ_sizes_get,
  8056. n: _fd_close,
  8057. j: _fd_seek,
  8058. b: _fd_write,
  8059. o: _gray_to_rgba,
  8060. i: _graya_to_rgba,
  8061. d: _jsPrintWarning,
  8062. h: _rgb_to_rgba,
  8063. a: _storeErrorMessage
  8064. };
  8065. var wasmExports = createWasm();
  8066. var ___wasm_call_ctors = wasmExports["q"];
  8067. var _malloc = Module["_malloc"] = wasmExports["r"];
  8068. var _free = Module["_free"] = wasmExports["s"];
  8069. var _jp2_decode = Module["_jp2_decode"] = wasmExports["u"];
  8070. var calledRun;
  8071. dependenciesFulfilled = function runCaller() {
  8072. if (!calledRun) run();
  8073. if (!calledRun) dependenciesFulfilled = runCaller;
  8074. };
  8075. function run() {
  8076. if (runDependencies > 0) {
  8077. return;
  8078. }
  8079. preRun();
  8080. if (runDependencies > 0) {
  8081. return;
  8082. }
  8083. function doRun() {
  8084. if (calledRun) return;
  8085. calledRun = true;
  8086. Module["calledRun"] = true;
  8087. if (ABORT) return;
  8088. initRuntime();
  8089. readyPromiseResolve(Module);
  8090. if (Module["onRuntimeInitialized"]) Module["onRuntimeInitialized"]();
  8091. postRun();
  8092. }
  8093. if (Module["setStatus"]) {
  8094. Module["setStatus"]("Running...");
  8095. setTimeout(function () {
  8096. setTimeout(function () {
  8097. Module["setStatus"]("");
  8098. }, 1);
  8099. doRun();
  8100. }, 1);
  8101. } else {
  8102. doRun();
  8103. }
  8104. }
  8105. if (Module["preInit"]) {
  8106. if (typeof Module["preInit"] == "function") Module["preInit"] = [Module["preInit"]];
  8107. while (Module["preInit"].length > 0) {
  8108. Module["preInit"].pop()();
  8109. }
  8110. }
  8111. run();
  8112. moduleRtn = Module;
  8113. return moduleRtn;
  8114. };
  8115. })();
  8116. /* harmony default export */ const openjpeg = (OpenJPEG);
  8117. ;// CONCATENATED MODULE: ./src/core/jpx.js
  8118. class JpxError extends BaseException {
  8119. constructor(msg) {
  8120. super(msg, "JpxError");
  8121. }
  8122. }
  8123. class JpxImage {
  8124. static #module = null;
  8125. static decode(data, decoderOptions) {
  8126. decoderOptions ||= {};
  8127. this.#module ||= openjpeg({
  8128. warn: warn
  8129. });
  8130. const imageData = this.#module.decode(data, decoderOptions);
  8131. if (typeof imageData === "string") {
  8132. throw new JpxError(imageData);
  8133. }
  8134. return imageData;
  8135. }
  8136. static cleanup() {
  8137. this.#module = null;
  8138. }
  8139. static parseImageProperties(stream) {
  8140. let newByte = stream.getByte();
  8141. while (newByte >= 0) {
  8142. const oldByte = newByte;
  8143. newByte = stream.getByte();
  8144. const code = oldByte << 8 | newByte;
  8145. if (code === 0xff51) {
  8146. stream.skip(4);
  8147. const Xsiz = stream.getInt32() >>> 0;
  8148. const Ysiz = stream.getInt32() >>> 0;
  8149. const XOsiz = stream.getInt32() >>> 0;
  8150. const YOsiz = stream.getInt32() >>> 0;
  8151. stream.skip(16);
  8152. const Csiz = stream.getUint16();
  8153. return {
  8154. width: Xsiz - XOsiz,
  8155. height: Ysiz - YOsiz,
  8156. bitsPerComponent: 8,
  8157. componentsCount: Csiz
  8158. };
  8159. }
  8160. }
  8161. throw new JpxError("No size marker found in JPX stream");
  8162. }
  8163. }
  8164. ;// CONCATENATED MODULE: ./src/core/jpx_stream.js
  8165. class JpxStream extends DecodeStream {
  8166. constructor(stream, maybeLength, params) {
  8167. super(maybeLength);
  8168. this.stream = stream;
  8169. this.dict = stream.dict;
  8170. this.maybeLength = maybeLength;
  8171. this.params = params;
  8172. }
  8173. get bytes() {
  8174. return shadow(this, "bytes", this.stream.getBytes(this.maybeLength));
  8175. }
  8176. ensureBuffer(requested) {}
  8177. readBlock(decoderOptions) {
  8178. this.decodeImage(null, decoderOptions);
  8179. }
  8180. decodeImage(bytes, decoderOptions) {
  8181. if (this.eof) {
  8182. return this.buffer;
  8183. }
  8184. bytes ||= this.bytes;
  8185. this.buffer = JpxImage.decode(bytes, decoderOptions);
  8186. this.bufferLength = this.buffer.length;
  8187. this.eof = true;
  8188. return this.buffer;
  8189. }
  8190. get canAsyncDecodeImageFromBuffer() {
  8191. return this.stream.isAsync;
  8192. }
  8193. }
  8194. ;// CONCATENATED MODULE: ./src/core/lzw_stream.js
  8195. class LZWStream extends DecodeStream {
  8196. constructor(str, maybeLength, earlyChange) {
  8197. super(maybeLength);
  8198. this.str = str;
  8199. this.dict = str.dict;
  8200. this.cachedData = 0;
  8201. this.bitsCached = 0;
  8202. const maxLzwDictionarySize = 4096;
  8203. const lzwState = {
  8204. earlyChange,
  8205. codeLength: 9,
  8206. nextCode: 258,
  8207. dictionaryValues: new Uint8Array(maxLzwDictionarySize),
  8208. dictionaryLengths: new Uint16Array(maxLzwDictionarySize),
  8209. dictionaryPrevCodes: new Uint16Array(maxLzwDictionarySize),
  8210. currentSequence: new Uint8Array(maxLzwDictionarySize),
  8211. currentSequenceLength: 0
  8212. };
  8213. for (let i = 0; i < 256; ++i) {
  8214. lzwState.dictionaryValues[i] = i;
  8215. lzwState.dictionaryLengths[i] = 1;
  8216. }
  8217. this.lzwState = lzwState;
  8218. }
  8219. readBits(n) {
  8220. let bitsCached = this.bitsCached;
  8221. let cachedData = this.cachedData;
  8222. while (bitsCached < n) {
  8223. const c = this.str.getByte();
  8224. if (c === -1) {
  8225. this.eof = true;
  8226. return null;
  8227. }
  8228. cachedData = cachedData << 8 | c;
  8229. bitsCached += 8;
  8230. }
  8231. this.bitsCached = bitsCached -= n;
  8232. this.cachedData = cachedData;
  8233. this.lastCode = null;
  8234. return cachedData >>> bitsCached & (1 << n) - 1;
  8235. }
  8236. readBlock() {
  8237. const blockSize = 512,
  8238. decodedSizeDelta = blockSize;
  8239. let estimatedDecodedSize = blockSize * 2;
  8240. let i, j, q;
  8241. const lzwState = this.lzwState;
  8242. if (!lzwState) {
  8243. return;
  8244. }
  8245. const earlyChange = lzwState.earlyChange;
  8246. let nextCode = lzwState.nextCode;
  8247. const dictionaryValues = lzwState.dictionaryValues;
  8248. const dictionaryLengths = lzwState.dictionaryLengths;
  8249. const dictionaryPrevCodes = lzwState.dictionaryPrevCodes;
  8250. let codeLength = lzwState.codeLength;
  8251. let prevCode = lzwState.prevCode;
  8252. const currentSequence = lzwState.currentSequence;
  8253. let currentSequenceLength = lzwState.currentSequenceLength;
  8254. let decodedLength = 0;
  8255. let currentBufferLength = this.bufferLength;
  8256. let buffer = this.ensureBuffer(this.bufferLength + estimatedDecodedSize);
  8257. for (i = 0; i < blockSize; i++) {
  8258. const code = this.readBits(codeLength);
  8259. const hasPrev = currentSequenceLength > 0;
  8260. if (code < 256) {
  8261. currentSequence[0] = code;
  8262. currentSequenceLength = 1;
  8263. } else if (code >= 258) {
  8264. if (code < nextCode) {
  8265. currentSequenceLength = dictionaryLengths[code];
  8266. for (j = currentSequenceLength - 1, q = code; j >= 0; j--) {
  8267. currentSequence[j] = dictionaryValues[q];
  8268. q = dictionaryPrevCodes[q];
  8269. }
  8270. } else {
  8271. currentSequence[currentSequenceLength++] = currentSequence[0];
  8272. }
  8273. } else if (code === 256) {
  8274. codeLength = 9;
  8275. nextCode = 258;
  8276. currentSequenceLength = 0;
  8277. continue;
  8278. } else {
  8279. this.eof = true;
  8280. delete this.lzwState;
  8281. break;
  8282. }
  8283. if (hasPrev) {
  8284. dictionaryPrevCodes[nextCode] = prevCode;
  8285. dictionaryLengths[nextCode] = dictionaryLengths[prevCode] + 1;
  8286. dictionaryValues[nextCode] = currentSequence[0];
  8287. nextCode++;
  8288. codeLength = nextCode + earlyChange & nextCode + earlyChange - 1 ? codeLength : Math.min(Math.log(nextCode + earlyChange) / 0.6931471805599453 + 1, 12) | 0;
  8289. }
  8290. prevCode = code;
  8291. decodedLength += currentSequenceLength;
  8292. if (estimatedDecodedSize < decodedLength) {
  8293. do {
  8294. estimatedDecodedSize += decodedSizeDelta;
  8295. } while (estimatedDecodedSize < decodedLength);
  8296. buffer = this.ensureBuffer(this.bufferLength + estimatedDecodedSize);
  8297. }
  8298. for (j = 0; j < currentSequenceLength; j++) {
  8299. buffer[currentBufferLength++] = currentSequence[j];
  8300. }
  8301. }
  8302. lzwState.nextCode = nextCode;
  8303. lzwState.codeLength = codeLength;
  8304. lzwState.prevCode = prevCode;
  8305. lzwState.currentSequenceLength = currentSequenceLength;
  8306. this.bufferLength = currentBufferLength;
  8307. }
  8308. }
  8309. ;// CONCATENATED MODULE: ./src/core/predictor_stream.js
  8310. class PredictorStream extends DecodeStream {
  8311. constructor(str, maybeLength, params) {
  8312. super(maybeLength);
  8313. if (!(params instanceof Dict)) {
  8314. return str;
  8315. }
  8316. const predictor = this.predictor = params.get("Predictor") || 1;
  8317. if (predictor <= 1) {
  8318. return str;
  8319. }
  8320. if (predictor !== 2 && (predictor < 10 || predictor > 15)) {
  8321. throw new FormatError(`Unsupported predictor: ${predictor}`);
  8322. }
  8323. this.readBlock = predictor === 2 ? this.readBlockTiff : this.readBlockPng;
  8324. this.str = str;
  8325. this.dict = str.dict;
  8326. const colors = this.colors = params.get("Colors") || 1;
  8327. const bits = this.bits = params.get("BPC", "BitsPerComponent") || 8;
  8328. const columns = this.columns = params.get("Columns") || 1;
  8329. this.pixBytes = colors * bits + 7 >> 3;
  8330. this.rowBytes = columns * colors * bits + 7 >> 3;
  8331. return this;
  8332. }
  8333. readBlockTiff() {
  8334. const rowBytes = this.rowBytes;
  8335. const bufferLength = this.bufferLength;
  8336. const buffer = this.ensureBuffer(bufferLength + rowBytes);
  8337. const bits = this.bits;
  8338. const colors = this.colors;
  8339. const rawBytes = this.str.getBytes(rowBytes);
  8340. this.eof = !rawBytes.length;
  8341. if (this.eof) {
  8342. return;
  8343. }
  8344. let inbuf = 0,
  8345. outbuf = 0;
  8346. let inbits = 0,
  8347. outbits = 0;
  8348. let pos = bufferLength;
  8349. let i;
  8350. if (bits === 1 && colors === 1) {
  8351. for (i = 0; i < rowBytes; ++i) {
  8352. let c = rawBytes[i] ^ inbuf;
  8353. c ^= c >> 1;
  8354. c ^= c >> 2;
  8355. c ^= c >> 4;
  8356. inbuf = (c & 1) << 7;
  8357. buffer[pos++] = c;
  8358. }
  8359. } else if (bits === 8) {
  8360. for (i = 0; i < colors; ++i) {
  8361. buffer[pos++] = rawBytes[i];
  8362. }
  8363. for (; i < rowBytes; ++i) {
  8364. buffer[pos] = buffer[pos - colors] + rawBytes[i];
  8365. pos++;
  8366. }
  8367. } else if (bits === 16) {
  8368. const bytesPerPixel = colors * 2;
  8369. for (i = 0; i < bytesPerPixel; ++i) {
  8370. buffer[pos++] = rawBytes[i];
  8371. }
  8372. for (; i < rowBytes; i += 2) {
  8373. const sum = ((rawBytes[i] & 0xff) << 8) + (rawBytes[i + 1] & 0xff) + ((buffer[pos - bytesPerPixel] & 0xff) << 8) + (buffer[pos - bytesPerPixel + 1] & 0xff);
  8374. buffer[pos++] = sum >> 8 & 0xff;
  8375. buffer[pos++] = sum & 0xff;
  8376. }
  8377. } else {
  8378. const compArray = new Uint8Array(colors + 1);
  8379. const bitMask = (1 << bits) - 1;
  8380. let j = 0,
  8381. k = bufferLength;
  8382. const columns = this.columns;
  8383. for (i = 0; i < columns; ++i) {
  8384. for (let kk = 0; kk < colors; ++kk) {
  8385. if (inbits < bits) {
  8386. inbuf = inbuf << 8 | rawBytes[j++] & 0xff;
  8387. inbits += 8;
  8388. }
  8389. compArray[kk] = compArray[kk] + (inbuf >> inbits - bits) & bitMask;
  8390. inbits -= bits;
  8391. outbuf = outbuf << bits | compArray[kk];
  8392. outbits += bits;
  8393. if (outbits >= 8) {
  8394. buffer[k++] = outbuf >> outbits - 8 & 0xff;
  8395. outbits -= 8;
  8396. }
  8397. }
  8398. }
  8399. if (outbits > 0) {
  8400. buffer[k++] = (outbuf << 8 - outbits) + (inbuf & (1 << 8 - outbits) - 1);
  8401. }
  8402. }
  8403. this.bufferLength += rowBytes;
  8404. }
  8405. readBlockPng() {
  8406. const rowBytes = this.rowBytes;
  8407. const pixBytes = this.pixBytes;
  8408. const predictor = this.str.getByte();
  8409. const rawBytes = this.str.getBytes(rowBytes);
  8410. this.eof = !rawBytes.length;
  8411. if (this.eof) {
  8412. return;
  8413. }
  8414. const bufferLength = this.bufferLength;
  8415. const buffer = this.ensureBuffer(bufferLength + rowBytes);
  8416. let prevRow = buffer.subarray(bufferLength - rowBytes, bufferLength);
  8417. if (prevRow.length === 0) {
  8418. prevRow = new Uint8Array(rowBytes);
  8419. }
  8420. let i,
  8421. j = bufferLength,
  8422. up,
  8423. c;
  8424. switch (predictor) {
  8425. case 0:
  8426. for (i = 0; i < rowBytes; ++i) {
  8427. buffer[j++] = rawBytes[i];
  8428. }
  8429. break;
  8430. case 1:
  8431. for (i = 0; i < pixBytes; ++i) {
  8432. buffer[j++] = rawBytes[i];
  8433. }
  8434. for (; i < rowBytes; ++i) {
  8435. buffer[j] = buffer[j - pixBytes] + rawBytes[i] & 0xff;
  8436. j++;
  8437. }
  8438. break;
  8439. case 2:
  8440. for (i = 0; i < rowBytes; ++i) {
  8441. buffer[j++] = prevRow[i] + rawBytes[i] & 0xff;
  8442. }
  8443. break;
  8444. case 3:
  8445. for (i = 0; i < pixBytes; ++i) {
  8446. buffer[j++] = (prevRow[i] >> 1) + rawBytes[i];
  8447. }
  8448. for (; i < rowBytes; ++i) {
  8449. buffer[j] = (prevRow[i] + buffer[j - pixBytes] >> 1) + rawBytes[i] & 0xff;
  8450. j++;
  8451. }
  8452. break;
  8453. case 4:
  8454. for (i = 0; i < pixBytes; ++i) {
  8455. up = prevRow[i];
  8456. c = rawBytes[i];
  8457. buffer[j++] = up + c;
  8458. }
  8459. for (; i < rowBytes; ++i) {
  8460. up = prevRow[i];
  8461. const upLeft = prevRow[i - pixBytes];
  8462. const left = buffer[j - pixBytes];
  8463. const p = left + up - upLeft;
  8464. let pa = p - left;
  8465. if (pa < 0) {
  8466. pa = -pa;
  8467. }
  8468. let pb = p - up;
  8469. if (pb < 0) {
  8470. pb = -pb;
  8471. }
  8472. let pc = p - upLeft;
  8473. if (pc < 0) {
  8474. pc = -pc;
  8475. }
  8476. c = rawBytes[i];
  8477. if (pa <= pb && pa <= pc) {
  8478. buffer[j++] = left + c;
  8479. } else if (pb <= pc) {
  8480. buffer[j++] = up + c;
  8481. } else {
  8482. buffer[j++] = upLeft + c;
  8483. }
  8484. }
  8485. break;
  8486. default:
  8487. throw new FormatError(`Unsupported predictor: ${predictor}`);
  8488. }
  8489. this.bufferLength += rowBytes;
  8490. }
  8491. }
  8492. ;// CONCATENATED MODULE: ./src/core/run_length_stream.js
  8493. class RunLengthStream extends DecodeStream {
  8494. constructor(str, maybeLength) {
  8495. super(maybeLength);
  8496. this.str = str;
  8497. this.dict = str.dict;
  8498. }
  8499. readBlock() {
  8500. const repeatHeader = this.str.getBytes(2);
  8501. if (!repeatHeader || repeatHeader.length < 2 || repeatHeader[0] === 128) {
  8502. this.eof = true;
  8503. return;
  8504. }
  8505. let buffer;
  8506. let bufferLength = this.bufferLength;
  8507. let n = repeatHeader[0];
  8508. if (n < 128) {
  8509. buffer = this.ensureBuffer(bufferLength + n + 1);
  8510. buffer[bufferLength++] = repeatHeader[1];
  8511. if (n > 0) {
  8512. const source = this.str.getBytes(n);
  8513. buffer.set(source, bufferLength);
  8514. bufferLength += n;
  8515. }
  8516. } else {
  8517. n = 257 - n;
  8518. const b = repeatHeader[1];
  8519. buffer = this.ensureBuffer(bufferLength + n + 1);
  8520. for (let i = 0; i < n; i++) {
  8521. buffer[bufferLength++] = b;
  8522. }
  8523. }
  8524. this.bufferLength = bufferLength;
  8525. }
  8526. }
  8527. ;// CONCATENATED MODULE: ./src/core/parser.js
  8528. const MAX_LENGTH_TO_CACHE = 1000;
  8529. function getInlineImageCacheKey(bytes) {
  8530. const strBuf = [],
  8531. ii = bytes.length;
  8532. let i = 0;
  8533. while (i < ii - 1) {
  8534. strBuf.push(bytes[i++] << 8 | bytes[i++]);
  8535. }
  8536. if (i < ii) {
  8537. strBuf.push(bytes[i]);
  8538. }
  8539. return ii + "_" + String.fromCharCode.apply(null, strBuf);
  8540. }
  8541. class Parser {
  8542. constructor({
  8543. lexer,
  8544. xref,
  8545. allowStreams = false,
  8546. recoveryMode = false
  8547. }) {
  8548. this.lexer = lexer;
  8549. this.xref = xref;
  8550. this.allowStreams = allowStreams;
  8551. this.recoveryMode = recoveryMode;
  8552. this.imageCache = Object.create(null);
  8553. this._imageId = 0;
  8554. this.refill();
  8555. }
  8556. refill() {
  8557. this.buf1 = this.lexer.getObj();
  8558. this.buf2 = this.lexer.getObj();
  8559. }
  8560. shift() {
  8561. if (this.buf2 instanceof Cmd && this.buf2.cmd === "ID") {
  8562. this.buf1 = this.buf2;
  8563. this.buf2 = null;
  8564. } else {
  8565. this.buf1 = this.buf2;
  8566. this.buf2 = this.lexer.getObj();
  8567. }
  8568. }
  8569. tryShift() {
  8570. try {
  8571. this.shift();
  8572. return true;
  8573. } catch (e) {
  8574. if (e instanceof MissingDataException) {
  8575. throw e;
  8576. }
  8577. return false;
  8578. }
  8579. }
  8580. getObj(cipherTransform = null) {
  8581. const buf1 = this.buf1;
  8582. this.shift();
  8583. if (buf1 instanceof Cmd) {
  8584. switch (buf1.cmd) {
  8585. case "BI":
  8586. return this.makeInlineImage(cipherTransform);
  8587. case "[":
  8588. const array = [];
  8589. while (!isCmd(this.buf1, "]") && this.buf1 !== EOF) {
  8590. array.push(this.getObj(cipherTransform));
  8591. }
  8592. if (this.buf1 === EOF) {
  8593. if (this.recoveryMode) {
  8594. return array;
  8595. }
  8596. throw new ParserEOFException("End of file inside array.");
  8597. }
  8598. this.shift();
  8599. return array;
  8600. case "<<":
  8601. const dict = new Dict(this.xref);
  8602. while (!isCmd(this.buf1, ">>") && this.buf1 !== EOF) {
  8603. if (!(this.buf1 instanceof Name)) {
  8604. info("Malformed dictionary: key must be a name object");
  8605. this.shift();
  8606. continue;
  8607. }
  8608. const key = this.buf1.name;
  8609. this.shift();
  8610. if (this.buf1 === EOF) {
  8611. break;
  8612. }
  8613. dict.set(key, this.getObj(cipherTransform));
  8614. }
  8615. if (this.buf1 === EOF) {
  8616. if (this.recoveryMode) {
  8617. return dict;
  8618. }
  8619. throw new ParserEOFException("End of file inside dictionary.");
  8620. }
  8621. if (isCmd(this.buf2, "stream")) {
  8622. return this.allowStreams ? this.makeStream(dict, cipherTransform) : dict;
  8623. }
  8624. this.shift();
  8625. return dict;
  8626. default:
  8627. return buf1;
  8628. }
  8629. }
  8630. if (Number.isInteger(buf1)) {
  8631. if (Number.isInteger(this.buf1) && isCmd(this.buf2, "R")) {
  8632. const ref = Ref.get(buf1, this.buf1);
  8633. this.shift();
  8634. this.shift();
  8635. return ref;
  8636. }
  8637. return buf1;
  8638. }
  8639. if (typeof buf1 === "string") {
  8640. if (cipherTransform) {
  8641. return cipherTransform.decryptString(buf1);
  8642. }
  8643. return buf1;
  8644. }
  8645. return buf1;
  8646. }
  8647. findDefaultInlineStreamEnd(stream) {
  8648. const E = 0x45,
  8649. I = 0x49,
  8650. SPACE = 0x20,
  8651. LF = 0xa,
  8652. CR = 0xd,
  8653. NUL = 0x0;
  8654. const {
  8655. knownCommands
  8656. } = this.lexer,
  8657. startPos = stream.pos,
  8658. n = 15;
  8659. let state = 0,
  8660. ch,
  8661. maybeEIPos;
  8662. while ((ch = stream.getByte()) !== -1) {
  8663. if (state === 0) {
  8664. state = ch === E ? 1 : 0;
  8665. } else if (state === 1) {
  8666. state = ch === I ? 2 : 0;
  8667. } else {
  8668. if (ch === SPACE || ch === LF || ch === CR) {
  8669. maybeEIPos = stream.pos;
  8670. const followingBytes = stream.peekBytes(n);
  8671. const ii = followingBytes.length;
  8672. if (ii === 0) {
  8673. break;
  8674. }
  8675. for (let i = 0; i < ii; i++) {
  8676. ch = followingBytes[i];
  8677. if (ch === NUL && followingBytes[i + 1] !== NUL) {
  8678. continue;
  8679. }
  8680. if (ch !== LF && ch !== CR && (ch < SPACE || ch > 0x7f)) {
  8681. state = 0;
  8682. break;
  8683. }
  8684. }
  8685. if (state !== 2) {
  8686. continue;
  8687. }
  8688. if (!knownCommands) {
  8689. warn("findDefaultInlineStreamEnd - `lexer.knownCommands` is undefined.");
  8690. continue;
  8691. }
  8692. const tmpLexer = new Lexer(new Stream(followingBytes.slice()), knownCommands);
  8693. tmpLexer._hexStringWarn = () => {};
  8694. let numArgs = 0;
  8695. while (true) {
  8696. const nextObj = tmpLexer.getObj();
  8697. if (nextObj === EOF) {
  8698. state = 0;
  8699. break;
  8700. }
  8701. if (nextObj instanceof Cmd) {
  8702. const knownCommand = knownCommands[nextObj.cmd];
  8703. if (!knownCommand) {
  8704. state = 0;
  8705. break;
  8706. } else if (knownCommand.variableArgs ? numArgs <= knownCommand.numArgs : numArgs === knownCommand.numArgs) {
  8707. break;
  8708. }
  8709. numArgs = 0;
  8710. continue;
  8711. }
  8712. numArgs++;
  8713. }
  8714. if (state === 2) {
  8715. break;
  8716. }
  8717. } else {
  8718. state = 0;
  8719. }
  8720. }
  8721. }
  8722. if (ch === -1) {
  8723. warn("findDefaultInlineStreamEnd: " + "Reached the end of the stream without finding a valid EI marker");
  8724. if (maybeEIPos) {
  8725. warn('... trying to recover by using the last "EI" occurrence.');
  8726. stream.skip(-(stream.pos - maybeEIPos));
  8727. }
  8728. }
  8729. let endOffset = 4;
  8730. stream.skip(-endOffset);
  8731. ch = stream.peekByte();
  8732. stream.skip(endOffset);
  8733. if (!isWhiteSpace(ch)) {
  8734. endOffset--;
  8735. }
  8736. return stream.pos - endOffset - startPos;
  8737. }
  8738. findDCTDecodeInlineStreamEnd(stream) {
  8739. const startPos = stream.pos;
  8740. let foundEOI = false,
  8741. b,
  8742. markerLength;
  8743. while ((b = stream.getByte()) !== -1) {
  8744. if (b !== 0xff) {
  8745. continue;
  8746. }
  8747. switch (stream.getByte()) {
  8748. case 0x00:
  8749. break;
  8750. case 0xff:
  8751. stream.skip(-1);
  8752. break;
  8753. case 0xd9:
  8754. foundEOI = true;
  8755. break;
  8756. case 0xc0:
  8757. case 0xc1:
  8758. case 0xc2:
  8759. case 0xc3:
  8760. case 0xc5:
  8761. case 0xc6:
  8762. case 0xc7:
  8763. case 0xc9:
  8764. case 0xca:
  8765. case 0xcb:
  8766. case 0xcd:
  8767. case 0xce:
  8768. case 0xcf:
  8769. case 0xc4:
  8770. case 0xcc:
  8771. case 0xda:
  8772. case 0xdb:
  8773. case 0xdc:
  8774. case 0xdd:
  8775. case 0xde:
  8776. case 0xdf:
  8777. case 0xe0:
  8778. case 0xe1:
  8779. case 0xe2:
  8780. case 0xe3:
  8781. case 0xe4:
  8782. case 0xe5:
  8783. case 0xe6:
  8784. case 0xe7:
  8785. case 0xe8:
  8786. case 0xe9:
  8787. case 0xea:
  8788. case 0xeb:
  8789. case 0xec:
  8790. case 0xed:
  8791. case 0xee:
  8792. case 0xef:
  8793. case 0xfe:
  8794. markerLength = stream.getUint16();
  8795. if (markerLength > 2) {
  8796. stream.skip(markerLength - 2);
  8797. } else {
  8798. stream.skip(-2);
  8799. }
  8800. break;
  8801. }
  8802. if (foundEOI) {
  8803. break;
  8804. }
  8805. }
  8806. const length = stream.pos - startPos;
  8807. if (b === -1) {
  8808. warn("Inline DCTDecode image stream: " + "EOI marker not found, searching for /EI/ instead.");
  8809. stream.skip(-length);
  8810. return this.findDefaultInlineStreamEnd(stream);
  8811. }
  8812. this.inlineStreamSkipEI(stream);
  8813. return length;
  8814. }
  8815. findASCII85DecodeInlineStreamEnd(stream) {
  8816. const TILDE = 0x7e,
  8817. GT = 0x3e;
  8818. const startPos = stream.pos;
  8819. let ch;
  8820. while ((ch = stream.getByte()) !== -1) {
  8821. if (ch === TILDE) {
  8822. const tildePos = stream.pos;
  8823. ch = stream.peekByte();
  8824. while (isWhiteSpace(ch)) {
  8825. stream.skip();
  8826. ch = stream.peekByte();
  8827. }
  8828. if (ch === GT) {
  8829. stream.skip();
  8830. break;
  8831. }
  8832. if (stream.pos > tildePos) {
  8833. const maybeEI = stream.peekBytes(2);
  8834. if (maybeEI[0] === 0x45 && maybeEI[1] === 0x49) {
  8835. break;
  8836. }
  8837. }
  8838. }
  8839. }
  8840. const length = stream.pos - startPos;
  8841. if (ch === -1) {
  8842. warn("Inline ASCII85Decode image stream: " + "EOD marker not found, searching for /EI/ instead.");
  8843. stream.skip(-length);
  8844. return this.findDefaultInlineStreamEnd(stream);
  8845. }
  8846. this.inlineStreamSkipEI(stream);
  8847. return length;
  8848. }
  8849. findASCIIHexDecodeInlineStreamEnd(stream) {
  8850. const GT = 0x3e;
  8851. const startPos = stream.pos;
  8852. let ch;
  8853. while ((ch = stream.getByte()) !== -1) {
  8854. if (ch === GT) {
  8855. break;
  8856. }
  8857. }
  8858. const length = stream.pos - startPos;
  8859. if (ch === -1) {
  8860. warn("Inline ASCIIHexDecode image stream: " + "EOD marker not found, searching for /EI/ instead.");
  8861. stream.skip(-length);
  8862. return this.findDefaultInlineStreamEnd(stream);
  8863. }
  8864. this.inlineStreamSkipEI(stream);
  8865. return length;
  8866. }
  8867. inlineStreamSkipEI(stream) {
  8868. const E = 0x45,
  8869. I = 0x49;
  8870. let state = 0,
  8871. ch;
  8872. while ((ch = stream.getByte()) !== -1) {
  8873. if (state === 0) {
  8874. state = ch === E ? 1 : 0;
  8875. } else if (state === 1) {
  8876. state = ch === I ? 2 : 0;
  8877. } else if (state === 2) {
  8878. break;
  8879. }
  8880. }
  8881. }
  8882. makeInlineImage(cipherTransform) {
  8883. const lexer = this.lexer;
  8884. const stream = lexer.stream;
  8885. const dictMap = Object.create(null);
  8886. let dictLength;
  8887. while (!isCmd(this.buf1, "ID") && this.buf1 !== EOF) {
  8888. if (!(this.buf1 instanceof Name)) {
  8889. throw new FormatError("Dictionary key must be a name object");
  8890. }
  8891. const key = this.buf1.name;
  8892. this.shift();
  8893. if (this.buf1 === EOF) {
  8894. break;
  8895. }
  8896. dictMap[key] = this.getObj(cipherTransform);
  8897. }
  8898. if (lexer.beginInlineImagePos !== -1) {
  8899. dictLength = stream.pos - lexer.beginInlineImagePos;
  8900. }
  8901. const filter = this.xref.fetchIfRef(dictMap.F || dictMap.Filter);
  8902. let filterName;
  8903. if (filter instanceof Name) {
  8904. filterName = filter.name;
  8905. } else if (Array.isArray(filter)) {
  8906. const filterZero = this.xref.fetchIfRef(filter[0]);
  8907. if (filterZero instanceof Name) {
  8908. filterName = filterZero.name;
  8909. }
  8910. }
  8911. const startPos = stream.pos;
  8912. let length;
  8913. switch (filterName) {
  8914. case "DCT":
  8915. case "DCTDecode":
  8916. length = this.findDCTDecodeInlineStreamEnd(stream);
  8917. break;
  8918. case "A85":
  8919. case "ASCII85Decode":
  8920. length = this.findASCII85DecodeInlineStreamEnd(stream);
  8921. break;
  8922. case "AHx":
  8923. case "ASCIIHexDecode":
  8924. length = this.findASCIIHexDecodeInlineStreamEnd(stream);
  8925. break;
  8926. default:
  8927. length = this.findDefaultInlineStreamEnd(stream);
  8928. }
  8929. let cacheKey;
  8930. if (length < MAX_LENGTH_TO_CACHE && dictLength > 0) {
  8931. const initialStreamPos = stream.pos;
  8932. stream.pos = lexer.beginInlineImagePos;
  8933. cacheKey = getInlineImageCacheKey(stream.getBytes(dictLength + length));
  8934. stream.pos = initialStreamPos;
  8935. const cacheEntry = this.imageCache[cacheKey];
  8936. if (cacheEntry !== undefined) {
  8937. this.buf2 = Cmd.get("EI");
  8938. this.shift();
  8939. cacheEntry.reset();
  8940. return cacheEntry;
  8941. }
  8942. }
  8943. const dict = new Dict(this.xref);
  8944. for (const key in dictMap) {
  8945. dict.set(key, dictMap[key]);
  8946. }
  8947. let imageStream = stream.makeSubStream(startPos, length, dict);
  8948. if (cipherTransform) {
  8949. imageStream = cipherTransform.createStream(imageStream, length);
  8950. }
  8951. imageStream = this.filter(imageStream, dict, length);
  8952. imageStream.dict = dict;
  8953. if (cacheKey !== undefined) {
  8954. imageStream.cacheKey = `inline_img_${++this._imageId}`;
  8955. this.imageCache[cacheKey] = imageStream;
  8956. }
  8957. this.buf2 = Cmd.get("EI");
  8958. this.shift();
  8959. return imageStream;
  8960. }
  8961. #findStreamLength(startPos) {
  8962. const {
  8963. stream
  8964. } = this.lexer;
  8965. stream.pos = startPos;
  8966. const SCAN_BLOCK_LENGTH = 2048;
  8967. const signatureLength = "endstream".length;
  8968. const END_SIGNATURE = new Uint8Array([0x65, 0x6e, 0x64]);
  8969. const endLength = END_SIGNATURE.length;
  8970. 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])];
  8971. const normalLength = signatureLength - endLength;
  8972. while (stream.pos < stream.end) {
  8973. const scanBytes = stream.peekBytes(SCAN_BLOCK_LENGTH);
  8974. const scanLength = scanBytes.length - signatureLength;
  8975. if (scanLength <= 0) {
  8976. break;
  8977. }
  8978. let pos = 0;
  8979. while (pos < scanLength) {
  8980. let j = 0;
  8981. while (j < endLength && scanBytes[pos + j] === END_SIGNATURE[j]) {
  8982. j++;
  8983. }
  8984. if (j >= endLength) {
  8985. let found = false;
  8986. for (const part of PARTIAL_SIGNATURE) {
  8987. const partLen = part.length;
  8988. let k = 0;
  8989. while (k < partLen && scanBytes[pos + j + k] === part[k]) {
  8990. k++;
  8991. }
  8992. if (k >= normalLength) {
  8993. found = true;
  8994. break;
  8995. }
  8996. if (k >= partLen) {
  8997. const lastByte = scanBytes[pos + j + k];
  8998. if (isWhiteSpace(lastByte)) {
  8999. info(`Found "${bytesToString([...END_SIGNATURE, ...part])}" when ` + "searching for endstream command.");
  9000. found = true;
  9001. }
  9002. break;
  9003. }
  9004. }
  9005. if (found) {
  9006. stream.pos += pos;
  9007. return stream.pos - startPos;
  9008. }
  9009. }
  9010. pos++;
  9011. }
  9012. stream.pos += scanLength;
  9013. }
  9014. return -1;
  9015. }
  9016. makeStream(dict, cipherTransform) {
  9017. const lexer = this.lexer;
  9018. let stream = lexer.stream;
  9019. lexer.skipToNextLine();
  9020. const startPos = stream.pos - 1;
  9021. let length = dict.get("Length");
  9022. if (!Number.isInteger(length)) {
  9023. info(`Bad length "${length && length.toString()}" in stream.`);
  9024. length = 0;
  9025. }
  9026. stream.pos = startPos + length;
  9027. lexer.nextChar();
  9028. if (this.tryShift() && isCmd(this.buf2, "endstream")) {
  9029. this.shift();
  9030. } else {
  9031. length = this.#findStreamLength(startPos);
  9032. if (length < 0) {
  9033. throw new FormatError("Missing endstream command.");
  9034. }
  9035. lexer.nextChar();
  9036. this.shift();
  9037. this.shift();
  9038. }
  9039. this.shift();
  9040. stream = stream.makeSubStream(startPos, length, dict);
  9041. if (cipherTransform) {
  9042. stream = cipherTransform.createStream(stream, length);
  9043. }
  9044. stream = this.filter(stream, dict, length);
  9045. stream.dict = dict;
  9046. return stream;
  9047. }
  9048. filter(stream, dict, length) {
  9049. let filter = dict.get("F", "Filter");
  9050. let params = dict.get("DP", "DecodeParms");
  9051. if (filter instanceof Name) {
  9052. if (Array.isArray(params)) {
  9053. warn("/DecodeParms should not be an Array, when /Filter is a Name.");
  9054. }
  9055. return this.makeFilter(stream, filter.name, length, params);
  9056. }
  9057. let maybeLength = length;
  9058. if (Array.isArray(filter)) {
  9059. const filterArray = filter;
  9060. const paramsArray = params;
  9061. for (let i = 0, ii = filterArray.length; i < ii; ++i) {
  9062. filter = this.xref.fetchIfRef(filterArray[i]);
  9063. if (!(filter instanceof Name)) {
  9064. throw new FormatError(`Bad filter name "${filter}"`);
  9065. }
  9066. params = null;
  9067. if (Array.isArray(paramsArray) && i in paramsArray) {
  9068. params = this.xref.fetchIfRef(paramsArray[i]);
  9069. }
  9070. stream = this.makeFilter(stream, filter.name, maybeLength, params);
  9071. maybeLength = null;
  9072. }
  9073. }
  9074. return stream;
  9075. }
  9076. makeFilter(stream, name, maybeLength, params) {
  9077. if (maybeLength === 0) {
  9078. warn(`Empty "${name}" stream.`);
  9079. return new NullStream();
  9080. }
  9081. try {
  9082. switch (name) {
  9083. case "Fl":
  9084. case "FlateDecode":
  9085. if (params) {
  9086. return new PredictorStream(new FlateStream(stream, maybeLength), maybeLength, params);
  9087. }
  9088. return new FlateStream(stream, maybeLength);
  9089. case "LZW":
  9090. case "LZWDecode":
  9091. let earlyChange = 1;
  9092. if (params) {
  9093. if (params.has("EarlyChange")) {
  9094. earlyChange = params.get("EarlyChange");
  9095. }
  9096. return new PredictorStream(new LZWStream(stream, maybeLength, earlyChange), maybeLength, params);
  9097. }
  9098. return new LZWStream(stream, maybeLength, earlyChange);
  9099. case "DCT":
  9100. case "DCTDecode":
  9101. return new JpegStream(stream, maybeLength, params);
  9102. case "JPX":
  9103. case "JPXDecode":
  9104. return new JpxStream(stream, maybeLength, params);
  9105. case "A85":
  9106. case "ASCII85Decode":
  9107. return new Ascii85Stream(stream, maybeLength);
  9108. case "AHx":
  9109. case "ASCIIHexDecode":
  9110. return new AsciiHexStream(stream, maybeLength);
  9111. case "CCF":
  9112. case "CCITTFaxDecode":
  9113. return new CCITTFaxStream(stream, maybeLength, params);
  9114. case "RL":
  9115. case "RunLengthDecode":
  9116. return new RunLengthStream(stream, maybeLength);
  9117. case "JBIG2Decode":
  9118. return new Jbig2Stream(stream, maybeLength, params);
  9119. }
  9120. warn(`Filter "${name}" is not supported.`);
  9121. return stream;
  9122. } catch (ex) {
  9123. if (ex instanceof MissingDataException) {
  9124. throw ex;
  9125. }
  9126. warn(`Invalid stream: "${ex}"`);
  9127. return new NullStream();
  9128. }
  9129. }
  9130. }
  9131. 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];
  9132. function toHexDigit(ch) {
  9133. if (ch >= 0x30 && ch <= 0x39) {
  9134. return ch & 0x0f;
  9135. }
  9136. if (ch >= 0x41 && ch <= 0x46 || ch >= 0x61 && ch <= 0x66) {
  9137. return (ch & 0x0f) + 9;
  9138. }
  9139. return -1;
  9140. }
  9141. class Lexer {
  9142. constructor(stream, knownCommands = null) {
  9143. this.stream = stream;
  9144. this.nextChar();
  9145. this.strBuf = [];
  9146. this.knownCommands = knownCommands;
  9147. this._hexStringNumWarn = 0;
  9148. this.beginInlineImagePos = -1;
  9149. }
  9150. nextChar() {
  9151. return this.currentChar = this.stream.getByte();
  9152. }
  9153. peekChar() {
  9154. return this.stream.peekByte();
  9155. }
  9156. getNumber() {
  9157. let ch = this.currentChar;
  9158. let eNotation = false;
  9159. let divideBy = 0;
  9160. let sign = 1;
  9161. if (ch === 0x2d) {
  9162. sign = -1;
  9163. ch = this.nextChar();
  9164. if (ch === 0x2d) {
  9165. ch = this.nextChar();
  9166. }
  9167. } else if (ch === 0x2b) {
  9168. ch = this.nextChar();
  9169. }
  9170. if (ch === 0x0a || ch === 0x0d) {
  9171. do {
  9172. ch = this.nextChar();
  9173. } while (ch === 0x0a || ch === 0x0d);
  9174. }
  9175. if (ch === 0x2e) {
  9176. divideBy = 10;
  9177. ch = this.nextChar();
  9178. }
  9179. if (ch < 0x30 || ch > 0x39) {
  9180. const msg = `Invalid number: ${String.fromCharCode(ch)} (charCode ${ch})`;
  9181. if (isWhiteSpace(ch) || ch === -1) {
  9182. info(`Lexer.getNumber - "${msg}".`);
  9183. return 0;
  9184. }
  9185. throw new FormatError(msg);
  9186. }
  9187. let baseValue = ch - 0x30;
  9188. let powerValue = 0;
  9189. let powerValueSign = 1;
  9190. while ((ch = this.nextChar()) >= 0) {
  9191. if (ch >= 0x30 && ch <= 0x39) {
  9192. const currentDigit = ch - 0x30;
  9193. if (eNotation) {
  9194. powerValue = powerValue * 10 + currentDigit;
  9195. } else {
  9196. if (divideBy !== 0) {
  9197. divideBy *= 10;
  9198. }
  9199. baseValue = baseValue * 10 + currentDigit;
  9200. }
  9201. } else if (ch === 0x2e) {
  9202. if (divideBy === 0) {
  9203. divideBy = 1;
  9204. } else {
  9205. break;
  9206. }
  9207. } else if (ch === 0x2d) {
  9208. warn("Badly formatted number: minus sign in the middle");
  9209. } else if (ch === 0x45 || ch === 0x65) {
  9210. ch = this.peekChar();
  9211. if (ch === 0x2b || ch === 0x2d) {
  9212. powerValueSign = ch === 0x2d ? -1 : 1;
  9213. this.nextChar();
  9214. } else if (ch < 0x30 || ch > 0x39) {
  9215. break;
  9216. }
  9217. eNotation = true;
  9218. } else {
  9219. break;
  9220. }
  9221. }
  9222. if (divideBy !== 0) {
  9223. baseValue /= divideBy;
  9224. }
  9225. if (eNotation) {
  9226. baseValue *= 10 ** (powerValueSign * powerValue);
  9227. }
  9228. return sign * baseValue;
  9229. }
  9230. getString() {
  9231. let numParen = 1;
  9232. let done = false;
  9233. const strBuf = this.strBuf;
  9234. strBuf.length = 0;
  9235. let ch = this.nextChar();
  9236. while (true) {
  9237. let charBuffered = false;
  9238. switch (ch | 0) {
  9239. case -1:
  9240. warn("Unterminated string");
  9241. done = true;
  9242. break;
  9243. case 0x28:
  9244. ++numParen;
  9245. strBuf.push("(");
  9246. break;
  9247. case 0x29:
  9248. if (--numParen === 0) {
  9249. this.nextChar();
  9250. done = true;
  9251. } else {
  9252. strBuf.push(")");
  9253. }
  9254. break;
  9255. case 0x5c:
  9256. ch = this.nextChar();
  9257. switch (ch) {
  9258. case -1:
  9259. warn("Unterminated string");
  9260. done = true;
  9261. break;
  9262. case 0x6e:
  9263. strBuf.push("\n");
  9264. break;
  9265. case 0x72:
  9266. strBuf.push("\r");
  9267. break;
  9268. case 0x74:
  9269. strBuf.push("\t");
  9270. break;
  9271. case 0x62:
  9272. strBuf.push("\b");
  9273. break;
  9274. case 0x66:
  9275. strBuf.push("\f");
  9276. break;
  9277. case 0x5c:
  9278. case 0x28:
  9279. case 0x29:
  9280. strBuf.push(String.fromCharCode(ch));
  9281. break;
  9282. case 0x30:
  9283. case 0x31:
  9284. case 0x32:
  9285. case 0x33:
  9286. case 0x34:
  9287. case 0x35:
  9288. case 0x36:
  9289. case 0x37:
  9290. let x = ch & 0x0f;
  9291. ch = this.nextChar();
  9292. charBuffered = true;
  9293. if (ch >= 0x30 && ch <= 0x37) {
  9294. x = (x << 3) + (ch & 0x0f);
  9295. ch = this.nextChar();
  9296. if (ch >= 0x30 && ch <= 0x37) {
  9297. charBuffered = false;
  9298. x = (x << 3) + (ch & 0x0f);
  9299. }
  9300. }
  9301. strBuf.push(String.fromCharCode(x));
  9302. break;
  9303. case 0x0d:
  9304. if (this.peekChar() === 0x0a) {
  9305. this.nextChar();
  9306. }
  9307. break;
  9308. case 0x0a:
  9309. break;
  9310. default:
  9311. strBuf.push(String.fromCharCode(ch));
  9312. break;
  9313. }
  9314. break;
  9315. default:
  9316. strBuf.push(String.fromCharCode(ch));
  9317. break;
  9318. }
  9319. if (done) {
  9320. break;
  9321. }
  9322. if (!charBuffered) {
  9323. ch = this.nextChar();
  9324. }
  9325. }
  9326. return strBuf.join("");
  9327. }
  9328. getName() {
  9329. let ch, previousCh;
  9330. const strBuf = this.strBuf;
  9331. strBuf.length = 0;
  9332. while ((ch = this.nextChar()) >= 0 && !specialChars[ch]) {
  9333. if (ch === 0x23) {
  9334. ch = this.nextChar();
  9335. if (specialChars[ch]) {
  9336. warn("Lexer_getName: " + "NUMBER SIGN (#) should be followed by a hexadecimal number.");
  9337. strBuf.push("#");
  9338. break;
  9339. }
  9340. const x = toHexDigit(ch);
  9341. if (x !== -1) {
  9342. previousCh = ch;
  9343. ch = this.nextChar();
  9344. const x2 = toHexDigit(ch);
  9345. if (x2 === -1) {
  9346. warn(`Lexer_getName: Illegal digit (${String.fromCharCode(ch)}) ` + "in hexadecimal number.");
  9347. strBuf.push("#", String.fromCharCode(previousCh));
  9348. if (specialChars[ch]) {
  9349. break;
  9350. }
  9351. strBuf.push(String.fromCharCode(ch));
  9352. continue;
  9353. }
  9354. strBuf.push(String.fromCharCode(x << 4 | x2));
  9355. } else {
  9356. strBuf.push("#", String.fromCharCode(ch));
  9357. }
  9358. } else {
  9359. strBuf.push(String.fromCharCode(ch));
  9360. }
  9361. }
  9362. if (strBuf.length > 127) {
  9363. warn(`Name token is longer than allowed by the spec: ${strBuf.length}`);
  9364. }
  9365. return Name.get(strBuf.join(""));
  9366. }
  9367. _hexStringWarn(ch) {
  9368. const MAX_HEX_STRING_NUM_WARN = 5;
  9369. if (this._hexStringNumWarn++ === MAX_HEX_STRING_NUM_WARN) {
  9370. warn("getHexString - ignoring additional invalid characters.");
  9371. return;
  9372. }
  9373. if (this._hexStringNumWarn > MAX_HEX_STRING_NUM_WARN) {
  9374. return;
  9375. }
  9376. warn(`getHexString - ignoring invalid character: ${ch}`);
  9377. }
  9378. getHexString() {
  9379. const strBuf = this.strBuf;
  9380. strBuf.length = 0;
  9381. let ch = this.currentChar;
  9382. let isFirstHex = true;
  9383. let firstDigit, secondDigit;
  9384. this._hexStringNumWarn = 0;
  9385. while (true) {
  9386. if (ch < 0) {
  9387. warn("Unterminated hex string");
  9388. break;
  9389. } else if (ch === 0x3e) {
  9390. this.nextChar();
  9391. break;
  9392. } else if (specialChars[ch] === 1) {
  9393. ch = this.nextChar();
  9394. continue;
  9395. } else {
  9396. if (isFirstHex) {
  9397. firstDigit = toHexDigit(ch);
  9398. if (firstDigit === -1) {
  9399. this._hexStringWarn(ch);
  9400. ch = this.nextChar();
  9401. continue;
  9402. }
  9403. } else {
  9404. secondDigit = toHexDigit(ch);
  9405. if (secondDigit === -1) {
  9406. this._hexStringWarn(ch);
  9407. ch = this.nextChar();
  9408. continue;
  9409. }
  9410. strBuf.push(String.fromCharCode(firstDigit << 4 | secondDigit));
  9411. }
  9412. isFirstHex = !isFirstHex;
  9413. ch = this.nextChar();
  9414. }
  9415. }
  9416. return strBuf.join("");
  9417. }
  9418. getObj() {
  9419. let comment = false;
  9420. let ch = this.currentChar;
  9421. while (true) {
  9422. if (ch < 0) {
  9423. return EOF;
  9424. }
  9425. if (comment) {
  9426. if (ch === 0x0a || ch === 0x0d) {
  9427. comment = false;
  9428. }
  9429. } else if (ch === 0x25) {
  9430. comment = true;
  9431. } else if (specialChars[ch] !== 1) {
  9432. break;
  9433. }
  9434. ch = this.nextChar();
  9435. }
  9436. switch (ch | 0) {
  9437. case 0x30:
  9438. case 0x31:
  9439. case 0x32:
  9440. case 0x33:
  9441. case 0x34:
  9442. case 0x35:
  9443. case 0x36:
  9444. case 0x37:
  9445. case 0x38:
  9446. case 0x39:
  9447. case 0x2b:
  9448. case 0x2d:
  9449. case 0x2e:
  9450. return this.getNumber();
  9451. case 0x28:
  9452. return this.getString();
  9453. case 0x2f:
  9454. return this.getName();
  9455. case 0x5b:
  9456. this.nextChar();
  9457. return Cmd.get("[");
  9458. case 0x5d:
  9459. this.nextChar();
  9460. return Cmd.get("]");
  9461. case 0x3c:
  9462. ch = this.nextChar();
  9463. if (ch === 0x3c) {
  9464. this.nextChar();
  9465. return Cmd.get("<<");
  9466. }
  9467. return this.getHexString();
  9468. case 0x3e:
  9469. ch = this.nextChar();
  9470. if (ch === 0x3e) {
  9471. this.nextChar();
  9472. return Cmd.get(">>");
  9473. }
  9474. return Cmd.get(">");
  9475. case 0x7b:
  9476. this.nextChar();
  9477. return Cmd.get("{");
  9478. case 0x7d:
  9479. this.nextChar();
  9480. return Cmd.get("}");
  9481. case 0x29:
  9482. this.nextChar();
  9483. throw new FormatError(`Illegal character: ${ch}`);
  9484. }
  9485. let str = String.fromCharCode(ch);
  9486. if (ch < 0x20 || ch > 0x7f) {
  9487. const nextCh = this.peekChar();
  9488. if (nextCh >= 0x20 && nextCh <= 0x7f) {
  9489. this.nextChar();
  9490. return Cmd.get(str);
  9491. }
  9492. }
  9493. const knownCommands = this.knownCommands;
  9494. let knownCommandFound = knownCommands?.[str] !== undefined;
  9495. while ((ch = this.nextChar()) >= 0 && !specialChars[ch]) {
  9496. const possibleCommand = str + String.fromCharCode(ch);
  9497. if (knownCommandFound && knownCommands[possibleCommand] === undefined) {
  9498. break;
  9499. }
  9500. if (str.length === 128) {
  9501. throw new FormatError(`Command token too long: ${str.length}`);
  9502. }
  9503. str = possibleCommand;
  9504. knownCommandFound = knownCommands?.[str] !== undefined;
  9505. }
  9506. if (str === "true") {
  9507. return true;
  9508. }
  9509. if (str === "false") {
  9510. return false;
  9511. }
  9512. if (str === "null") {
  9513. return null;
  9514. }
  9515. if (str === "BI") {
  9516. this.beginInlineImagePos = this.stream.pos;
  9517. }
  9518. return Cmd.get(str);
  9519. }
  9520. skipToNextLine() {
  9521. let ch = this.currentChar;
  9522. while (ch >= 0) {
  9523. if (ch === 0x0d) {
  9524. ch = this.nextChar();
  9525. if (ch === 0x0a) {
  9526. this.nextChar();
  9527. }
  9528. break;
  9529. } else if (ch === 0x0a) {
  9530. this.nextChar();
  9531. break;
  9532. }
  9533. ch = this.nextChar();
  9534. }
  9535. }
  9536. }
  9537. class Linearization {
  9538. static create(stream) {
  9539. function getInt(linDict, name, allowZeroValue = false) {
  9540. const obj = linDict.get(name);
  9541. if (Number.isInteger(obj) && (allowZeroValue ? obj >= 0 : obj > 0)) {
  9542. return obj;
  9543. }
  9544. throw new Error(`The "${name}" parameter in the linearization ` + "dictionary is invalid.");
  9545. }
  9546. function getHints(linDict) {
  9547. const hints = linDict.get("H");
  9548. let hintsLength;
  9549. if (Array.isArray(hints) && ((hintsLength = hints.length) === 2 || hintsLength === 4)) {
  9550. for (let index = 0; index < hintsLength; index++) {
  9551. const hint = hints[index];
  9552. if (!(Number.isInteger(hint) && hint > 0)) {
  9553. throw new Error(`Hint (${index}) in the linearization dictionary is invalid.`);
  9554. }
  9555. }
  9556. return hints;
  9557. }
  9558. throw new Error("Hint array in the linearization dictionary is invalid.");
  9559. }
  9560. const parser = new Parser({
  9561. lexer: new Lexer(stream),
  9562. xref: null
  9563. });
  9564. const obj1 = parser.getObj();
  9565. const obj2 = parser.getObj();
  9566. const obj3 = parser.getObj();
  9567. const linDict = parser.getObj();
  9568. let obj, length;
  9569. if (!(Number.isInteger(obj1) && Number.isInteger(obj2) && isCmd(obj3, "obj") && linDict instanceof Dict && typeof (obj = linDict.get("Linearized")) === "number" && obj > 0)) {
  9570. return null;
  9571. } else if ((length = getInt(linDict, "L")) !== stream.length) {
  9572. throw new Error('The "L" parameter in the linearization dictionary ' + "does not equal the stream length.");
  9573. }
  9574. return {
  9575. length,
  9576. hints: getHints(linDict),
  9577. objectNumberFirst: getInt(linDict, "O"),
  9578. endFirst: getInt(linDict, "E"),
  9579. numPages: getInt(linDict, "N"),
  9580. mainXRefEntriesOffset: getInt(linDict, "T"),
  9581. pageFirst: linDict.has("P") ? getInt(linDict, "P", true) : 0
  9582. };
  9583. }
  9584. }
  9585. ;// CONCATENATED MODULE: ./src/core/cmap.js
  9586. 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"];
  9587. const MAX_MAP_RANGE = 2 ** 24 - 1;
  9588. class CMap {
  9589. constructor(builtInCMap = false) {
  9590. this.codespaceRanges = [[], [], [], []];
  9591. this.numCodespaceRanges = 0;
  9592. this._map = [];
  9593. this.name = "";
  9594. this.vertical = false;
  9595. this.useCMap = null;
  9596. this.builtInCMap = builtInCMap;
  9597. }
  9598. addCodespaceRange(n, low, high) {
  9599. this.codespaceRanges[n - 1].push(low, high);
  9600. this.numCodespaceRanges++;
  9601. }
  9602. mapCidRange(low, high, dstLow) {
  9603. if (high - low > MAX_MAP_RANGE) {
  9604. throw new Error("mapCidRange - ignoring data above MAX_MAP_RANGE.");
  9605. }
  9606. while (low <= high) {
  9607. this._map[low++] = dstLow++;
  9608. }
  9609. }
  9610. mapBfRange(low, high, dstLow) {
  9611. if (high - low > MAX_MAP_RANGE) {
  9612. throw new Error("mapBfRange - ignoring data above MAX_MAP_RANGE.");
  9613. }
  9614. const lastByte = dstLow.length - 1;
  9615. while (low <= high) {
  9616. this._map[low++] = dstLow;
  9617. const nextCharCode = dstLow.charCodeAt(lastByte) + 1;
  9618. if (nextCharCode > 0xff) {
  9619. dstLow = dstLow.substring(0, lastByte - 1) + String.fromCharCode(dstLow.charCodeAt(lastByte - 1) + 1) + "\x00";
  9620. continue;
  9621. }
  9622. dstLow = dstLow.substring(0, lastByte) + String.fromCharCode(nextCharCode);
  9623. }
  9624. }
  9625. mapBfRangeToArray(low, high, array) {
  9626. if (high - low > MAX_MAP_RANGE) {
  9627. throw new Error("mapBfRangeToArray - ignoring data above MAX_MAP_RANGE.");
  9628. }
  9629. const ii = array.length;
  9630. let i = 0;
  9631. while (low <= high && i < ii) {
  9632. this._map[low] = array[i++];
  9633. ++low;
  9634. }
  9635. }
  9636. mapOne(src, dst) {
  9637. this._map[src] = dst;
  9638. }
  9639. lookup(code) {
  9640. return this._map[code];
  9641. }
  9642. contains(code) {
  9643. return this._map[code] !== undefined;
  9644. }
  9645. forEach(callback) {
  9646. const map = this._map;
  9647. const length = map.length;
  9648. if (length <= 0x10000) {
  9649. for (let i = 0; i < length; i++) {
  9650. if (map[i] !== undefined) {
  9651. callback(i, map[i]);
  9652. }
  9653. }
  9654. } else {
  9655. for (const i in map) {
  9656. callback(i, map[i]);
  9657. }
  9658. }
  9659. }
  9660. charCodeOf(value) {
  9661. const map = this._map;
  9662. if (map.length <= 0x10000) {
  9663. return map.indexOf(value);
  9664. }
  9665. for (const charCode in map) {
  9666. if (map[charCode] === value) {
  9667. return charCode | 0;
  9668. }
  9669. }
  9670. return -1;
  9671. }
  9672. getMap() {
  9673. return this._map;
  9674. }
  9675. readCharCode(str, offset, out) {
  9676. let c = 0;
  9677. const codespaceRanges = this.codespaceRanges;
  9678. for (let n = 0, nn = codespaceRanges.length; n < nn; n++) {
  9679. c = (c << 8 | str.charCodeAt(offset + n)) >>> 0;
  9680. const codespaceRange = codespaceRanges[n];
  9681. for (let k = 0, kk = codespaceRange.length; k < kk;) {
  9682. const low = codespaceRange[k++];
  9683. const high = codespaceRange[k++];
  9684. if (c >= low && c <= high) {
  9685. out.charcode = c;
  9686. out.length = n + 1;
  9687. return;
  9688. }
  9689. }
  9690. }
  9691. out.charcode = 0;
  9692. out.length = 1;
  9693. }
  9694. getCharCodeLength(charCode) {
  9695. const codespaceRanges = this.codespaceRanges;
  9696. for (let n = 0, nn = codespaceRanges.length; n < nn; n++) {
  9697. const codespaceRange = codespaceRanges[n];
  9698. for (let k = 0, kk = codespaceRange.length; k < kk;) {
  9699. const low = codespaceRange[k++];
  9700. const high = codespaceRange[k++];
  9701. if (charCode >= low && charCode <= high) {
  9702. return n + 1;
  9703. }
  9704. }
  9705. }
  9706. return 1;
  9707. }
  9708. get length() {
  9709. return this._map.length;
  9710. }
  9711. get isIdentityCMap() {
  9712. if (!(this.name === "Identity-H" || this.name === "Identity-V")) {
  9713. return false;
  9714. }
  9715. if (this._map.length !== 0x10000) {
  9716. return false;
  9717. }
  9718. for (let i = 0; i < 0x10000; i++) {
  9719. if (this._map[i] !== i) {
  9720. return false;
  9721. }
  9722. }
  9723. return true;
  9724. }
  9725. }
  9726. class IdentityCMap extends CMap {
  9727. constructor(vertical, n) {
  9728. super();
  9729. this.vertical = vertical;
  9730. this.addCodespaceRange(n, 0, 0xffff);
  9731. }
  9732. mapCidRange(low, high, dstLow) {
  9733. unreachable("should not call mapCidRange");
  9734. }
  9735. mapBfRange(low, high, dstLow) {
  9736. unreachable("should not call mapBfRange");
  9737. }
  9738. mapBfRangeToArray(low, high, array) {
  9739. unreachable("should not call mapBfRangeToArray");
  9740. }
  9741. mapOne(src, dst) {
  9742. unreachable("should not call mapCidOne");
  9743. }
  9744. lookup(code) {
  9745. return Number.isInteger(code) && code <= 0xffff ? code : undefined;
  9746. }
  9747. contains(code) {
  9748. return Number.isInteger(code) && code <= 0xffff;
  9749. }
  9750. forEach(callback) {
  9751. for (let i = 0; i <= 0xffff; i++) {
  9752. callback(i, i);
  9753. }
  9754. }
  9755. charCodeOf(value) {
  9756. return Number.isInteger(value) && value <= 0xffff ? value : -1;
  9757. }
  9758. getMap() {
  9759. const map = new Array(0x10000);
  9760. for (let i = 0; i <= 0xffff; i++) {
  9761. map[i] = i;
  9762. }
  9763. return map;
  9764. }
  9765. get length() {
  9766. return 0x10000;
  9767. }
  9768. get isIdentityCMap() {
  9769. unreachable("should not access .isIdentityCMap");
  9770. }
  9771. }
  9772. function strToInt(str) {
  9773. let a = 0;
  9774. for (let i = 0; i < str.length; i++) {
  9775. a = a << 8 | str.charCodeAt(i);
  9776. }
  9777. return a >>> 0;
  9778. }
  9779. function expectString(obj) {
  9780. if (typeof obj !== "string") {
  9781. throw new FormatError("Malformed CMap: expected string.");
  9782. }
  9783. }
  9784. function expectInt(obj) {
  9785. if (!Number.isInteger(obj)) {
  9786. throw new FormatError("Malformed CMap: expected int.");
  9787. }
  9788. }
  9789. function parseBfChar(cMap, lexer) {
  9790. while (true) {
  9791. let obj = lexer.getObj();
  9792. if (obj === EOF) {
  9793. break;
  9794. }
  9795. if (isCmd(obj, "endbfchar")) {
  9796. return;
  9797. }
  9798. expectString(obj);
  9799. const src = strToInt(obj);
  9800. obj = lexer.getObj();
  9801. expectString(obj);
  9802. const dst = obj;
  9803. cMap.mapOne(src, dst);
  9804. }
  9805. }
  9806. function parseBfRange(cMap, lexer) {
  9807. while (true) {
  9808. let obj = lexer.getObj();
  9809. if (obj === EOF) {
  9810. break;
  9811. }
  9812. if (isCmd(obj, "endbfrange")) {
  9813. return;
  9814. }
  9815. expectString(obj);
  9816. const low = strToInt(obj);
  9817. obj = lexer.getObj();
  9818. expectString(obj);
  9819. const high = strToInt(obj);
  9820. obj = lexer.getObj();
  9821. if (Number.isInteger(obj) || typeof obj === "string") {
  9822. const dstLow = Number.isInteger(obj) ? String.fromCharCode(obj) : obj;
  9823. cMap.mapBfRange(low, high, dstLow);
  9824. } else if (isCmd(obj, "[")) {
  9825. obj = lexer.getObj();
  9826. const array = [];
  9827. while (!isCmd(obj, "]") && obj !== EOF) {
  9828. array.push(obj);
  9829. obj = lexer.getObj();
  9830. }
  9831. cMap.mapBfRangeToArray(low, high, array);
  9832. } else {
  9833. break;
  9834. }
  9835. }
  9836. throw new FormatError("Invalid bf range.");
  9837. }
  9838. function parseCidChar(cMap, lexer) {
  9839. while (true) {
  9840. let obj = lexer.getObj();
  9841. if (obj === EOF) {
  9842. break;
  9843. }
  9844. if (isCmd(obj, "endcidchar")) {
  9845. return;
  9846. }
  9847. expectString(obj);
  9848. const src = strToInt(obj);
  9849. obj = lexer.getObj();
  9850. expectInt(obj);
  9851. const dst = obj;
  9852. cMap.mapOne(src, dst);
  9853. }
  9854. }
  9855. function parseCidRange(cMap, lexer) {
  9856. while (true) {
  9857. let obj = lexer.getObj();
  9858. if (obj === EOF) {
  9859. break;
  9860. }
  9861. if (isCmd(obj, "endcidrange")) {
  9862. return;
  9863. }
  9864. expectString(obj);
  9865. const low = strToInt(obj);
  9866. obj = lexer.getObj();
  9867. expectString(obj);
  9868. const high = strToInt(obj);
  9869. obj = lexer.getObj();
  9870. expectInt(obj);
  9871. const dstLow = obj;
  9872. cMap.mapCidRange(low, high, dstLow);
  9873. }
  9874. }
  9875. function parseCodespaceRange(cMap, lexer) {
  9876. while (true) {
  9877. let obj = lexer.getObj();
  9878. if (obj === EOF) {
  9879. break;
  9880. }
  9881. if (isCmd(obj, "endcodespacerange")) {
  9882. return;
  9883. }
  9884. if (typeof obj !== "string") {
  9885. break;
  9886. }
  9887. const low = strToInt(obj);
  9888. obj = lexer.getObj();
  9889. if (typeof obj !== "string") {
  9890. break;
  9891. }
  9892. const high = strToInt(obj);
  9893. cMap.addCodespaceRange(obj.length, low, high);
  9894. }
  9895. throw new FormatError("Invalid codespace range.");
  9896. }
  9897. function parseWMode(cMap, lexer) {
  9898. const obj = lexer.getObj();
  9899. if (Number.isInteger(obj)) {
  9900. cMap.vertical = !!obj;
  9901. }
  9902. }
  9903. function parseCMapName(cMap, lexer) {
  9904. const obj = lexer.getObj();
  9905. if (obj instanceof Name) {
  9906. cMap.name = obj.name;
  9907. }
  9908. }
  9909. async function parseCMap(cMap, lexer, fetchBuiltInCMap, useCMap) {
  9910. let previous, embeddedUseCMap;
  9911. objLoop: while (true) {
  9912. try {
  9913. const obj = lexer.getObj();
  9914. if (obj === EOF) {
  9915. break;
  9916. } else if (obj instanceof Name) {
  9917. if (obj.name === "WMode") {
  9918. parseWMode(cMap, lexer);
  9919. } else if (obj.name === "CMapName") {
  9920. parseCMapName(cMap, lexer);
  9921. }
  9922. previous = obj;
  9923. } else if (obj instanceof Cmd) {
  9924. switch (obj.cmd) {
  9925. case "endcmap":
  9926. break objLoop;
  9927. case "usecmap":
  9928. if (previous instanceof Name) {
  9929. embeddedUseCMap = previous.name;
  9930. }
  9931. break;
  9932. case "begincodespacerange":
  9933. parseCodespaceRange(cMap, lexer);
  9934. break;
  9935. case "beginbfchar":
  9936. parseBfChar(cMap, lexer);
  9937. break;
  9938. case "begincidchar":
  9939. parseCidChar(cMap, lexer);
  9940. break;
  9941. case "beginbfrange":
  9942. parseBfRange(cMap, lexer);
  9943. break;
  9944. case "begincidrange":
  9945. parseCidRange(cMap, lexer);
  9946. break;
  9947. }
  9948. }
  9949. } catch (ex) {
  9950. if (ex instanceof MissingDataException) {
  9951. throw ex;
  9952. }
  9953. warn("Invalid cMap data: " + ex);
  9954. continue;
  9955. }
  9956. }
  9957. if (!useCMap && embeddedUseCMap) {
  9958. useCMap = embeddedUseCMap;
  9959. }
  9960. if (useCMap) {
  9961. return extendCMap(cMap, fetchBuiltInCMap, useCMap);
  9962. }
  9963. return cMap;
  9964. }
  9965. async function extendCMap(cMap, fetchBuiltInCMap, useCMap) {
  9966. cMap.useCMap = await createBuiltInCMap(useCMap, fetchBuiltInCMap);
  9967. if (cMap.numCodespaceRanges === 0) {
  9968. const useCodespaceRanges = cMap.useCMap.codespaceRanges;
  9969. for (let i = 0; i < useCodespaceRanges.length; i++) {
  9970. cMap.codespaceRanges[i] = useCodespaceRanges[i].slice();
  9971. }
  9972. cMap.numCodespaceRanges = cMap.useCMap.numCodespaceRanges;
  9973. }
  9974. cMap.useCMap.forEach(function (key, value) {
  9975. if (!cMap.contains(key)) {
  9976. cMap.mapOne(key, cMap.useCMap.lookup(key));
  9977. }
  9978. });
  9979. return cMap;
  9980. }
  9981. async function createBuiltInCMap(name, fetchBuiltInCMap) {
  9982. if (name === "Identity-H") {
  9983. return new IdentityCMap(false, 2);
  9984. } else if (name === "Identity-V") {
  9985. return new IdentityCMap(true, 2);
  9986. }
  9987. if (!BUILT_IN_CMAPS.includes(name)) {
  9988. throw new Error("Unknown CMap name: " + name);
  9989. }
  9990. if (!fetchBuiltInCMap) {
  9991. throw new Error("Built-in CMap parameters are not provided.");
  9992. }
  9993. const {
  9994. cMapData,
  9995. compressionType
  9996. } = await fetchBuiltInCMap(name);
  9997. const cMap = new CMap(true);
  9998. if (compressionType === CMapCompressionType.BINARY) {
  9999. return new BinaryCMapReader().process(cMapData, cMap, useCMap => extendCMap(cMap, fetchBuiltInCMap, useCMap));
  10000. }
  10001. if (compressionType === CMapCompressionType.NONE) {
  10002. const lexer = new Lexer(new Stream(cMapData));
  10003. return parseCMap(cMap, lexer, fetchBuiltInCMap, null);
  10004. }
  10005. throw new Error(`Invalid CMap "compressionType" value: ${compressionType}`);
  10006. }
  10007. class CMapFactory {
  10008. static async create({
  10009. encoding,
  10010. fetchBuiltInCMap,
  10011. useCMap
  10012. }) {
  10013. if (encoding instanceof Name) {
  10014. return createBuiltInCMap(encoding.name, fetchBuiltInCMap);
  10015. } else if (encoding instanceof BaseStream) {
  10016. const parsedCMap = await parseCMap(new CMap(), new Lexer(encoding), fetchBuiltInCMap, useCMap);
  10017. if (parsedCMap.isIdentityCMap) {
  10018. return createBuiltInCMap(parsedCMap.name, fetchBuiltInCMap);
  10019. }
  10020. return parsedCMap;
  10021. }
  10022. throw new Error("Encoding required.");
  10023. }
  10024. }
  10025. ;// CONCATENATED MODULE: ./src/core/charsets.js
  10026. 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"];
  10027. 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"];
  10028. 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"];
  10029. ;// CONCATENATED MODULE: ./src/core/encodings.js
  10030. 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"];
  10031. 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", "", "", "", ""];
  10032. 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"];
  10033. 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", "", "", "", ""];
  10034. 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"];
  10035. 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", ""];
  10036. 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", ""];
  10037. function getEncoding(encodingName) {
  10038. switch (encodingName) {
  10039. case "WinAnsiEncoding":
  10040. return WinAnsiEncoding;
  10041. case "StandardEncoding":
  10042. return StandardEncoding;
  10043. case "MacRomanEncoding":
  10044. return MacRomanEncoding;
  10045. case "SymbolSetEncoding":
  10046. return SymbolSetEncoding;
  10047. case "ZapfDingbatsEncoding":
  10048. return ZapfDingbatsEncoding;
  10049. case "ExpertEncoding":
  10050. return ExpertEncoding;
  10051. case "MacExpertEncoding":
  10052. return MacExpertEncoding;
  10053. default:
  10054. return null;
  10055. }
  10056. }
  10057. ;// CONCATENATED MODULE: ./src/core/cff_parser.js
  10058. const MAX_SUBR_NESTING = 10;
  10059. 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"];
  10060. const NUM_STANDARD_CFF_STRINGS = 391;
  10061. const CharstringValidationData = [null, {
  10062. id: "hstem",
  10063. min: 2,
  10064. stackClearing: true,
  10065. stem: true
  10066. }, null, {
  10067. id: "vstem",
  10068. min: 2,
  10069. stackClearing: true,
  10070. stem: true
  10071. }, {
  10072. id: "vmoveto",
  10073. min: 1,
  10074. stackClearing: true
  10075. }, {
  10076. id: "rlineto",
  10077. min: 2,
  10078. resetStack: true
  10079. }, {
  10080. id: "hlineto",
  10081. min: 1,
  10082. resetStack: true
  10083. }, {
  10084. id: "vlineto",
  10085. min: 1,
  10086. resetStack: true
  10087. }, {
  10088. id: "rrcurveto",
  10089. min: 6,
  10090. resetStack: true
  10091. }, null, {
  10092. id: "callsubr",
  10093. min: 1,
  10094. undefStack: true
  10095. }, {
  10096. id: "return",
  10097. min: 0,
  10098. undefStack: true
  10099. }, null, null, {
  10100. id: "endchar",
  10101. min: 0,
  10102. stackClearing: true
  10103. }, null, null, null, {
  10104. id: "hstemhm",
  10105. min: 2,
  10106. stackClearing: true,
  10107. stem: true
  10108. }, {
  10109. id: "hintmask",
  10110. min: 0,
  10111. stackClearing: true
  10112. }, {
  10113. id: "cntrmask",
  10114. min: 0,
  10115. stackClearing: true
  10116. }, {
  10117. id: "rmoveto",
  10118. min: 2,
  10119. stackClearing: true
  10120. }, {
  10121. id: "hmoveto",
  10122. min: 1,
  10123. stackClearing: true
  10124. }, {
  10125. id: "vstemhm",
  10126. min: 2,
  10127. stackClearing: true,
  10128. stem: true
  10129. }, {
  10130. id: "rcurveline",
  10131. min: 8,
  10132. resetStack: true
  10133. }, {
  10134. id: "rlinecurve",
  10135. min: 8,
  10136. resetStack: true
  10137. }, {
  10138. id: "vvcurveto",
  10139. min: 4,
  10140. resetStack: true
  10141. }, {
  10142. id: "hhcurveto",
  10143. min: 4,
  10144. resetStack: true
  10145. }, null, {
  10146. id: "callgsubr",
  10147. min: 1,
  10148. undefStack: true
  10149. }, {
  10150. id: "vhcurveto",
  10151. min: 4,
  10152. resetStack: true
  10153. }, {
  10154. id: "hvcurveto",
  10155. min: 4,
  10156. resetStack: true
  10157. }];
  10158. const CharstringValidationData12 = [null, null, null, {
  10159. id: "and",
  10160. min: 2,
  10161. stackDelta: -1
  10162. }, {
  10163. id: "or",
  10164. min: 2,
  10165. stackDelta: -1
  10166. }, {
  10167. id: "not",
  10168. min: 1,
  10169. stackDelta: 0
  10170. }, null, null, null, {
  10171. id: "abs",
  10172. min: 1,
  10173. stackDelta: 0
  10174. }, {
  10175. id: "add",
  10176. min: 2,
  10177. stackDelta: -1,
  10178. stackFn(stack, index) {
  10179. stack[index - 2] = stack[index - 2] + stack[index - 1];
  10180. }
  10181. }, {
  10182. id: "sub",
  10183. min: 2,
  10184. stackDelta: -1,
  10185. stackFn(stack, index) {
  10186. stack[index - 2] = stack[index - 2] - stack[index - 1];
  10187. }
  10188. }, {
  10189. id: "div",
  10190. min: 2,
  10191. stackDelta: -1,
  10192. stackFn(stack, index) {
  10193. stack[index - 2] = stack[index - 2] / stack[index - 1];
  10194. }
  10195. }, null, {
  10196. id: "neg",
  10197. min: 1,
  10198. stackDelta: 0,
  10199. stackFn(stack, index) {
  10200. stack[index - 1] = -stack[index - 1];
  10201. }
  10202. }, {
  10203. id: "eq",
  10204. min: 2,
  10205. stackDelta: -1
  10206. }, null, null, {
  10207. id: "drop",
  10208. min: 1,
  10209. stackDelta: -1
  10210. }, null, {
  10211. id: "put",
  10212. min: 2,
  10213. stackDelta: -2
  10214. }, {
  10215. id: "get",
  10216. min: 1,
  10217. stackDelta: 0
  10218. }, {
  10219. id: "ifelse",
  10220. min: 4,
  10221. stackDelta: -3
  10222. }, {
  10223. id: "random",
  10224. min: 0,
  10225. stackDelta: 1
  10226. }, {
  10227. id: "mul",
  10228. min: 2,
  10229. stackDelta: -1,
  10230. stackFn(stack, index) {
  10231. stack[index - 2] = stack[index - 2] * stack[index - 1];
  10232. }
  10233. }, null, {
  10234. id: "sqrt",
  10235. min: 1,
  10236. stackDelta: 0
  10237. }, {
  10238. id: "dup",
  10239. min: 1,
  10240. stackDelta: 1
  10241. }, {
  10242. id: "exch",
  10243. min: 2,
  10244. stackDelta: 0
  10245. }, {
  10246. id: "index",
  10247. min: 2,
  10248. stackDelta: 0
  10249. }, {
  10250. id: "roll",
  10251. min: 3,
  10252. stackDelta: -2
  10253. }, null, null, null, {
  10254. id: "hflex",
  10255. min: 7,
  10256. resetStack: true
  10257. }, {
  10258. id: "flex",
  10259. min: 13,
  10260. resetStack: true
  10261. }, {
  10262. id: "hflex1",
  10263. min: 9,
  10264. resetStack: true
  10265. }, {
  10266. id: "flex1",
  10267. min: 11,
  10268. resetStack: true
  10269. }];
  10270. class CFFParser {
  10271. constructor(file, properties, seacAnalysisEnabled) {
  10272. this.bytes = file.getBytes();
  10273. this.properties = properties;
  10274. this.seacAnalysisEnabled = !!seacAnalysisEnabled;
  10275. }
  10276. parse() {
  10277. const properties = this.properties;
  10278. const cff = new CFF();
  10279. this.cff = cff;
  10280. const header = this.parseHeader();
  10281. const nameIndex = this.parseIndex(header.endPos);
  10282. const topDictIndex = this.parseIndex(nameIndex.endPos);
  10283. const stringIndex = this.parseIndex(topDictIndex.endPos);
  10284. const globalSubrIndex = this.parseIndex(stringIndex.endPos);
  10285. const topDictParsed = this.parseDict(topDictIndex.obj.get(0));
  10286. const topDict = this.createDict(CFFTopDict, topDictParsed, cff.strings);
  10287. cff.header = header.obj;
  10288. cff.names = this.parseNameIndex(nameIndex.obj);
  10289. cff.strings = this.parseStringIndex(stringIndex.obj);
  10290. cff.topDict = topDict;
  10291. cff.globalSubrIndex = globalSubrIndex.obj;
  10292. this.parsePrivateDict(cff.topDict);
  10293. cff.isCIDFont = topDict.hasName("ROS");
  10294. const charStringOffset = topDict.getByName("CharStrings");
  10295. const charStringIndex = this.parseIndex(charStringOffset).obj;
  10296. const fontMatrix = topDict.getByName("FontMatrix");
  10297. if (fontMatrix) {
  10298. properties.fontMatrix = fontMatrix;
  10299. }
  10300. const fontBBox = topDict.getByName("FontBBox");
  10301. if (fontBBox) {
  10302. properties.ascent = Math.max(fontBBox[3], fontBBox[1]);
  10303. properties.descent = Math.min(fontBBox[1], fontBBox[3]);
  10304. properties.ascentScaled = true;
  10305. }
  10306. let charset, encoding;
  10307. if (cff.isCIDFont) {
  10308. const fdArrayIndex = this.parseIndex(topDict.getByName("FDArray")).obj;
  10309. for (let i = 0, ii = fdArrayIndex.count; i < ii; ++i) {
  10310. const dictRaw = fdArrayIndex.get(i);
  10311. const fontDict = this.createDict(CFFTopDict, this.parseDict(dictRaw), cff.strings);
  10312. this.parsePrivateDict(fontDict);
  10313. cff.fdArray.push(fontDict);
  10314. }
  10315. encoding = null;
  10316. charset = this.parseCharsets(topDict.getByName("charset"), charStringIndex.count, cff.strings, true);
  10317. cff.fdSelect = this.parseFDSelect(topDict.getByName("FDSelect"), charStringIndex.count);
  10318. } else {
  10319. charset = this.parseCharsets(topDict.getByName("charset"), charStringIndex.count, cff.strings, false);
  10320. encoding = this.parseEncoding(topDict.getByName("Encoding"), properties, cff.strings, charset.charset);
  10321. }
  10322. cff.charset = charset;
  10323. cff.encoding = encoding;
  10324. const charStringsAndSeacs = this.parseCharStrings({
  10325. charStrings: charStringIndex,
  10326. localSubrIndex: topDict.privateDict.subrsIndex,
  10327. globalSubrIndex: globalSubrIndex.obj,
  10328. fdSelect: cff.fdSelect,
  10329. fdArray: cff.fdArray,
  10330. privateDict: topDict.privateDict
  10331. });
  10332. cff.charStrings = charStringsAndSeacs.charStrings;
  10333. cff.seacs = charStringsAndSeacs.seacs;
  10334. cff.widths = charStringsAndSeacs.widths;
  10335. return cff;
  10336. }
  10337. parseHeader() {
  10338. let bytes = this.bytes;
  10339. const bytesLength = bytes.length;
  10340. let offset = 0;
  10341. while (offset < bytesLength && bytes[offset] !== 1) {
  10342. ++offset;
  10343. }
  10344. if (offset >= bytesLength) {
  10345. throw new FormatError("Invalid CFF header");
  10346. }
  10347. if (offset !== 0) {
  10348. info("cff data is shifted");
  10349. bytes = bytes.subarray(offset);
  10350. this.bytes = bytes;
  10351. }
  10352. const major = bytes[0];
  10353. const minor = bytes[1];
  10354. const hdrSize = bytes[2];
  10355. const offSize = bytes[3];
  10356. const header = new CFFHeader(major, minor, hdrSize, offSize);
  10357. return {
  10358. obj: header,
  10359. endPos: hdrSize
  10360. };
  10361. }
  10362. parseDict(dict) {
  10363. let pos = 0;
  10364. function parseOperand() {
  10365. let value = dict[pos++];
  10366. if (value === 30) {
  10367. return parseFloatOperand();
  10368. } else if (value === 28) {
  10369. value = dict[pos++];
  10370. value = (value << 24 | dict[pos++] << 16) >> 16;
  10371. return value;
  10372. } else if (value === 29) {
  10373. value = dict[pos++];
  10374. value = value << 8 | dict[pos++];
  10375. value = value << 8 | dict[pos++];
  10376. value = value << 8 | dict[pos++];
  10377. return value;
  10378. } else if (value >= 32 && value <= 246) {
  10379. return value - 139;
  10380. } else if (value >= 247 && value <= 250) {
  10381. return (value - 247) * 256 + dict[pos++] + 108;
  10382. } else if (value >= 251 && value <= 254) {
  10383. return -((value - 251) * 256) - dict[pos++] - 108;
  10384. }
  10385. warn('CFFParser_parseDict: "' + value + '" is a reserved command.');
  10386. return NaN;
  10387. }
  10388. function parseFloatOperand() {
  10389. let str = "";
  10390. const eof = 15;
  10391. const lookup = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ".", "E", "E-", null, "-"];
  10392. const length = dict.length;
  10393. while (pos < length) {
  10394. const b = dict[pos++];
  10395. const b1 = b >> 4;
  10396. const b2 = b & 15;
  10397. if (b1 === eof) {
  10398. break;
  10399. }
  10400. str += lookup[b1];
  10401. if (b2 === eof) {
  10402. break;
  10403. }
  10404. str += lookup[b2];
  10405. }
  10406. return parseFloat(str);
  10407. }
  10408. let operands = [];
  10409. const entries = [];
  10410. pos = 0;
  10411. const end = dict.length;
  10412. while (pos < end) {
  10413. let b = dict[pos];
  10414. if (b <= 21) {
  10415. if (b === 12) {
  10416. b = b << 8 | dict[++pos];
  10417. }
  10418. entries.push([b, operands]);
  10419. operands = [];
  10420. ++pos;
  10421. } else {
  10422. operands.push(parseOperand());
  10423. }
  10424. }
  10425. return entries;
  10426. }
  10427. parseIndex(pos) {
  10428. const cffIndex = new CFFIndex();
  10429. const bytes = this.bytes;
  10430. const count = bytes[pos++] << 8 | bytes[pos++];
  10431. const offsets = [];
  10432. let end = pos;
  10433. let i, ii;
  10434. if (count !== 0) {
  10435. const offsetSize = bytes[pos++];
  10436. const startPos = pos + (count + 1) * offsetSize - 1;
  10437. for (i = 0, ii = count + 1; i < ii; ++i) {
  10438. let offset = 0;
  10439. for (let j = 0; j < offsetSize; ++j) {
  10440. offset <<= 8;
  10441. offset += bytes[pos++];
  10442. }
  10443. offsets.push(startPos + offset);
  10444. }
  10445. end = offsets[count];
  10446. }
  10447. for (i = 0, ii = offsets.length - 1; i < ii; ++i) {
  10448. const offsetStart = offsets[i];
  10449. const offsetEnd = offsets[i + 1];
  10450. cffIndex.add(bytes.subarray(offsetStart, offsetEnd));
  10451. }
  10452. return {
  10453. obj: cffIndex,
  10454. endPos: end
  10455. };
  10456. }
  10457. parseNameIndex(index) {
  10458. const names = [];
  10459. for (let i = 0, ii = index.count; i < ii; ++i) {
  10460. const name = index.get(i);
  10461. names.push(bytesToString(name));
  10462. }
  10463. return names;
  10464. }
  10465. parseStringIndex(index) {
  10466. const strings = new CFFStrings();
  10467. for (let i = 0, ii = index.count; i < ii; ++i) {
  10468. const data = index.get(i);
  10469. strings.add(bytesToString(data));
  10470. }
  10471. return strings;
  10472. }
  10473. createDict(Type, dict, strings) {
  10474. const cffDict = new Type(strings);
  10475. for (const [key, value] of dict) {
  10476. cffDict.setByKey(key, value);
  10477. }
  10478. return cffDict;
  10479. }
  10480. parseCharString(state, data, localSubrIndex, globalSubrIndex) {
  10481. if (!data || state.callDepth > MAX_SUBR_NESTING) {
  10482. return false;
  10483. }
  10484. let stackSize = state.stackSize;
  10485. const stack = state.stack;
  10486. let length = data.length;
  10487. for (let j = 0; j < length;) {
  10488. const value = data[j++];
  10489. let validationCommand = null;
  10490. if (value === 12) {
  10491. const q = data[j++];
  10492. if (q === 0) {
  10493. data[j - 2] = 139;
  10494. data[j - 1] = 22;
  10495. stackSize = 0;
  10496. } else {
  10497. validationCommand = CharstringValidationData12[q];
  10498. }
  10499. } else if (value === 28) {
  10500. stack[stackSize] = (data[j] << 24 | data[j + 1] << 16) >> 16;
  10501. j += 2;
  10502. stackSize++;
  10503. } else if (value === 14) {
  10504. if (stackSize >= 4) {
  10505. stackSize -= 4;
  10506. if (this.seacAnalysisEnabled) {
  10507. state.seac = stack.slice(stackSize, stackSize + 4);
  10508. return false;
  10509. }
  10510. }
  10511. validationCommand = CharstringValidationData[value];
  10512. } else if (value >= 32 && value <= 246) {
  10513. stack[stackSize] = value - 139;
  10514. stackSize++;
  10515. } else if (value >= 247 && value <= 254) {
  10516. stack[stackSize] = value < 251 ? (value - 247 << 8) + data[j] + 108 : -(value - 251 << 8) - data[j] - 108;
  10517. j++;
  10518. stackSize++;
  10519. } else if (value === 255) {
  10520. stack[stackSize] = (data[j] << 24 | data[j + 1] << 16 | data[j + 2] << 8 | data[j + 3]) / 65536;
  10521. j += 4;
  10522. stackSize++;
  10523. } else if (value === 19 || value === 20) {
  10524. state.hints += stackSize >> 1;
  10525. if (state.hints === 0) {
  10526. data.copyWithin(j - 1, j, -1);
  10527. j -= 1;
  10528. length -= 1;
  10529. continue;
  10530. }
  10531. j += state.hints + 7 >> 3;
  10532. stackSize %= 2;
  10533. validationCommand = CharstringValidationData[value];
  10534. } else if (value === 10 || value === 29) {
  10535. const subrsIndex = value === 10 ? localSubrIndex : globalSubrIndex;
  10536. if (!subrsIndex) {
  10537. validationCommand = CharstringValidationData[value];
  10538. warn("Missing subrsIndex for " + validationCommand.id);
  10539. return false;
  10540. }
  10541. let bias = 32768;
  10542. if (subrsIndex.count < 1240) {
  10543. bias = 107;
  10544. } else if (subrsIndex.count < 33900) {
  10545. bias = 1131;
  10546. }
  10547. const subrNumber = stack[--stackSize] + bias;
  10548. if (subrNumber < 0 || subrNumber >= subrsIndex.count || isNaN(subrNumber)) {
  10549. validationCommand = CharstringValidationData[value];
  10550. warn("Out of bounds subrIndex for " + validationCommand.id);
  10551. return false;
  10552. }
  10553. state.stackSize = stackSize;
  10554. state.callDepth++;
  10555. const valid = this.parseCharString(state, subrsIndex.get(subrNumber), localSubrIndex, globalSubrIndex);
  10556. if (!valid) {
  10557. return false;
  10558. }
  10559. state.callDepth--;
  10560. stackSize = state.stackSize;
  10561. continue;
  10562. } else if (value === 11) {
  10563. state.stackSize = stackSize;
  10564. return true;
  10565. } else if (value === 0 && j === data.length) {
  10566. data[j - 1] = 14;
  10567. validationCommand = CharstringValidationData[14];
  10568. } else if (value === 9) {
  10569. data.copyWithin(j - 1, j, -1);
  10570. j -= 1;
  10571. length -= 1;
  10572. continue;
  10573. } else {
  10574. validationCommand = CharstringValidationData[value];
  10575. }
  10576. if (validationCommand) {
  10577. if (validationCommand.stem) {
  10578. state.hints += stackSize >> 1;
  10579. if (value === 3 || value === 23) {
  10580. state.hasVStems = true;
  10581. } else if (state.hasVStems && (value === 1 || value === 18)) {
  10582. warn("CFF stem hints are in wrong order");
  10583. data[j - 1] = value === 1 ? 3 : 23;
  10584. }
  10585. }
  10586. if ("min" in validationCommand) {
  10587. if (!state.undefStack && stackSize < validationCommand.min) {
  10588. warn("Not enough parameters for " + validationCommand.id + "; actual: " + stackSize + ", expected: " + validationCommand.min);
  10589. if (stackSize === 0) {
  10590. data[j - 1] = 14;
  10591. return true;
  10592. }
  10593. return false;
  10594. }
  10595. }
  10596. if (state.firstStackClearing && validationCommand.stackClearing) {
  10597. state.firstStackClearing = false;
  10598. stackSize -= validationCommand.min;
  10599. if (stackSize >= 2 && validationCommand.stem) {
  10600. stackSize %= 2;
  10601. } else if (stackSize > 1) {
  10602. warn("Found too many parameters for stack-clearing command");
  10603. }
  10604. if (stackSize > 0) {
  10605. state.width = stack[stackSize - 1];
  10606. }
  10607. }
  10608. if ("stackDelta" in validationCommand) {
  10609. if ("stackFn" in validationCommand) {
  10610. validationCommand.stackFn(stack, stackSize);
  10611. }
  10612. stackSize += validationCommand.stackDelta;
  10613. } else if (validationCommand.stackClearing) {
  10614. stackSize = 0;
  10615. } else if (validationCommand.resetStack) {
  10616. stackSize = 0;
  10617. state.undefStack = false;
  10618. } else if (validationCommand.undefStack) {
  10619. stackSize = 0;
  10620. state.undefStack = true;
  10621. state.firstStackClearing = false;
  10622. }
  10623. }
  10624. }
  10625. if (length < data.length) {
  10626. data.fill(14, length);
  10627. }
  10628. state.stackSize = stackSize;
  10629. return true;
  10630. }
  10631. parseCharStrings({
  10632. charStrings,
  10633. localSubrIndex,
  10634. globalSubrIndex,
  10635. fdSelect,
  10636. fdArray,
  10637. privateDict
  10638. }) {
  10639. const seacs = [];
  10640. const widths = [];
  10641. const count = charStrings.count;
  10642. for (let i = 0; i < count; i++) {
  10643. const charstring = charStrings.get(i);
  10644. const state = {
  10645. callDepth: 0,
  10646. stackSize: 0,
  10647. stack: [],
  10648. undefStack: true,
  10649. hints: 0,
  10650. firstStackClearing: true,
  10651. seac: null,
  10652. width: null,
  10653. hasVStems: false
  10654. };
  10655. let valid = true;
  10656. let localSubrToUse = null;
  10657. let privateDictToUse = privateDict;
  10658. if (fdSelect && fdArray.length) {
  10659. const fdIndex = fdSelect.getFDIndex(i);
  10660. if (fdIndex === -1) {
  10661. warn("Glyph index is not in fd select.");
  10662. valid = false;
  10663. }
  10664. if (fdIndex >= fdArray.length) {
  10665. warn("Invalid fd index for glyph index.");
  10666. valid = false;
  10667. }
  10668. if (valid) {
  10669. privateDictToUse = fdArray[fdIndex].privateDict;
  10670. localSubrToUse = privateDictToUse.subrsIndex;
  10671. }
  10672. } else if (localSubrIndex) {
  10673. localSubrToUse = localSubrIndex;
  10674. }
  10675. if (valid) {
  10676. valid = this.parseCharString(state, charstring, localSubrToUse, globalSubrIndex);
  10677. }
  10678. if (state.width !== null) {
  10679. const nominalWidth = privateDictToUse.getByName("nominalWidthX");
  10680. widths[i] = nominalWidth + state.width;
  10681. } else {
  10682. const defaultWidth = privateDictToUse.getByName("defaultWidthX");
  10683. widths[i] = defaultWidth;
  10684. }
  10685. if (state.seac !== null) {
  10686. seacs[i] = state.seac;
  10687. }
  10688. if (!valid) {
  10689. charStrings.set(i, new Uint8Array([14]));
  10690. }
  10691. }
  10692. return {
  10693. charStrings,
  10694. seacs,
  10695. widths
  10696. };
  10697. }
  10698. emptyPrivateDictionary(parentDict) {
  10699. const privateDict = this.createDict(CFFPrivateDict, [], parentDict.strings);
  10700. parentDict.setByKey(18, [0, 0]);
  10701. parentDict.privateDict = privateDict;
  10702. }
  10703. parsePrivateDict(parentDict) {
  10704. if (!parentDict.hasName("Private")) {
  10705. this.emptyPrivateDictionary(parentDict);
  10706. return;
  10707. }
  10708. const privateOffset = parentDict.getByName("Private");
  10709. if (!Array.isArray(privateOffset) || privateOffset.length !== 2) {
  10710. parentDict.removeByName("Private");
  10711. return;
  10712. }
  10713. const size = privateOffset[0];
  10714. const offset = privateOffset[1];
  10715. if (size === 0 || offset >= this.bytes.length) {
  10716. this.emptyPrivateDictionary(parentDict);
  10717. return;
  10718. }
  10719. const privateDictEnd = offset + size;
  10720. const dictData = this.bytes.subarray(offset, privateDictEnd);
  10721. const dict = this.parseDict(dictData);
  10722. const privateDict = this.createDict(CFFPrivateDict, dict, parentDict.strings);
  10723. parentDict.privateDict = privateDict;
  10724. if (privateDict.getByName("ExpansionFactor") === 0) {
  10725. privateDict.setByName("ExpansionFactor", 0.06);
  10726. }
  10727. if (!privateDict.getByName("Subrs")) {
  10728. return;
  10729. }
  10730. const subrsOffset = privateDict.getByName("Subrs");
  10731. const relativeOffset = offset + subrsOffset;
  10732. if (subrsOffset === 0 || relativeOffset >= this.bytes.length) {
  10733. this.emptyPrivateDictionary(parentDict);
  10734. return;
  10735. }
  10736. const subrsIndex = this.parseIndex(relativeOffset);
  10737. privateDict.subrsIndex = subrsIndex.obj;
  10738. }
  10739. parseCharsets(pos, length, strings, cid) {
  10740. if (pos === 0) {
  10741. return new CFFCharset(true, CFFCharsetPredefinedTypes.ISO_ADOBE, ISOAdobeCharset);
  10742. } else if (pos === 1) {
  10743. return new CFFCharset(true, CFFCharsetPredefinedTypes.EXPERT, ExpertCharset);
  10744. } else if (pos === 2) {
  10745. return new CFFCharset(true, CFFCharsetPredefinedTypes.EXPERT_SUBSET, ExpertSubsetCharset);
  10746. }
  10747. const bytes = this.bytes;
  10748. const start = pos;
  10749. const format = bytes[pos++];
  10750. const charset = [cid ? 0 : ".notdef"];
  10751. let id, count, i;
  10752. length -= 1;
  10753. switch (format) {
  10754. case 0:
  10755. for (i = 0; i < length; i++) {
  10756. id = bytes[pos++] << 8 | bytes[pos++];
  10757. charset.push(cid ? id : strings.get(id));
  10758. }
  10759. break;
  10760. case 1:
  10761. while (charset.length <= length) {
  10762. id = bytes[pos++] << 8 | bytes[pos++];
  10763. count = bytes[pos++];
  10764. for (i = 0; i <= count; i++) {
  10765. charset.push(cid ? id++ : strings.get(id++));
  10766. }
  10767. }
  10768. break;
  10769. case 2:
  10770. while (charset.length <= length) {
  10771. id = bytes[pos++] << 8 | bytes[pos++];
  10772. count = bytes[pos++] << 8 | bytes[pos++];
  10773. for (i = 0; i <= count; i++) {
  10774. charset.push(cid ? id++ : strings.get(id++));
  10775. }
  10776. }
  10777. break;
  10778. default:
  10779. throw new FormatError("Unknown charset format");
  10780. }
  10781. const end = pos;
  10782. const raw = bytes.subarray(start, end);
  10783. return new CFFCharset(false, format, charset, raw);
  10784. }
  10785. parseEncoding(pos, properties, strings, charset) {
  10786. const encoding = Object.create(null);
  10787. const bytes = this.bytes;
  10788. let predefined = false;
  10789. let format, i, ii;
  10790. let raw = null;
  10791. function readSupplement() {
  10792. const supplementsCount = bytes[pos++];
  10793. for (i = 0; i < supplementsCount; i++) {
  10794. const code = bytes[pos++];
  10795. const sid = (bytes[pos++] << 8) + (bytes[pos++] & 0xff);
  10796. encoding[code] = charset.indexOf(strings.get(sid));
  10797. }
  10798. }
  10799. if (pos === 0 || pos === 1) {
  10800. predefined = true;
  10801. format = pos;
  10802. const baseEncoding = pos ? ExpertEncoding : StandardEncoding;
  10803. for (i = 0, ii = charset.length; i < ii; i++) {
  10804. const index = baseEncoding.indexOf(charset[i]);
  10805. if (index !== -1) {
  10806. encoding[index] = i;
  10807. }
  10808. }
  10809. } else {
  10810. const dataStart = pos;
  10811. format = bytes[pos++];
  10812. switch (format & 0x7f) {
  10813. case 0:
  10814. const glyphsCount = bytes[pos++];
  10815. for (i = 1; i <= glyphsCount; i++) {
  10816. encoding[bytes[pos++]] = i;
  10817. }
  10818. break;
  10819. case 1:
  10820. const rangesCount = bytes[pos++];
  10821. let gid = 1;
  10822. for (i = 0; i < rangesCount; i++) {
  10823. const start = bytes[pos++];
  10824. const left = bytes[pos++];
  10825. for (let j = start; j <= start + left; j++) {
  10826. encoding[j] = gid++;
  10827. }
  10828. }
  10829. break;
  10830. default:
  10831. throw new FormatError(`Unknown encoding format: ${format} in CFF`);
  10832. }
  10833. const dataEnd = pos;
  10834. if (format & 0x80) {
  10835. bytes[dataStart] &= 0x7f;
  10836. readSupplement();
  10837. }
  10838. raw = bytes.subarray(dataStart, dataEnd);
  10839. }
  10840. format &= 0x7f;
  10841. return new CFFEncoding(predefined, format, encoding, raw);
  10842. }
  10843. parseFDSelect(pos, length) {
  10844. const bytes = this.bytes;
  10845. const format = bytes[pos++];
  10846. const fdSelect = [];
  10847. let i;
  10848. switch (format) {
  10849. case 0:
  10850. for (i = 0; i < length; ++i) {
  10851. const id = bytes[pos++];
  10852. fdSelect.push(id);
  10853. }
  10854. break;
  10855. case 3:
  10856. const rangesCount = bytes[pos++] << 8 | bytes[pos++];
  10857. for (i = 0; i < rangesCount; ++i) {
  10858. let first = bytes[pos++] << 8 | bytes[pos++];
  10859. if (i === 0 && first !== 0) {
  10860. warn("parseFDSelect: The first range must have a first GID of 0" + " -- trying to recover.");
  10861. first = 0;
  10862. }
  10863. const fdIndex = bytes[pos++];
  10864. const next = bytes[pos] << 8 | bytes[pos + 1];
  10865. for (let j = first; j < next; ++j) {
  10866. fdSelect.push(fdIndex);
  10867. }
  10868. }
  10869. pos += 2;
  10870. break;
  10871. default:
  10872. throw new FormatError(`parseFDSelect: Unknown format "${format}".`);
  10873. }
  10874. if (fdSelect.length !== length) {
  10875. throw new FormatError("parseFDSelect: Invalid font data.");
  10876. }
  10877. return new CFFFDSelect(format, fdSelect);
  10878. }
  10879. }
  10880. class CFF {
  10881. constructor() {
  10882. this.header = null;
  10883. this.names = [];
  10884. this.topDict = null;
  10885. this.strings = new CFFStrings();
  10886. this.globalSubrIndex = null;
  10887. this.encoding = null;
  10888. this.charset = null;
  10889. this.charStrings = null;
  10890. this.fdArray = [];
  10891. this.fdSelect = null;
  10892. this.isCIDFont = false;
  10893. }
  10894. duplicateFirstGlyph() {
  10895. if (this.charStrings.count >= 65535) {
  10896. warn("Not enough space in charstrings to duplicate first glyph.");
  10897. return;
  10898. }
  10899. const glyphZero = this.charStrings.get(0);
  10900. this.charStrings.add(glyphZero);
  10901. if (this.isCIDFont) {
  10902. this.fdSelect.fdSelect.push(this.fdSelect.fdSelect[0]);
  10903. }
  10904. }
  10905. hasGlyphId(id) {
  10906. if (id < 0 || id >= this.charStrings.count) {
  10907. return false;
  10908. }
  10909. const glyph = this.charStrings.get(id);
  10910. return glyph.length > 0;
  10911. }
  10912. }
  10913. class CFFHeader {
  10914. constructor(major, minor, hdrSize, offSize) {
  10915. this.major = major;
  10916. this.minor = minor;
  10917. this.hdrSize = hdrSize;
  10918. this.offSize = offSize;
  10919. }
  10920. }
  10921. class CFFStrings {
  10922. constructor() {
  10923. this.strings = [];
  10924. }
  10925. get(index) {
  10926. if (index >= 0 && index <= NUM_STANDARD_CFF_STRINGS - 1) {
  10927. return CFFStandardStrings[index];
  10928. }
  10929. if (index - NUM_STANDARD_CFF_STRINGS <= this.strings.length) {
  10930. return this.strings[index - NUM_STANDARD_CFF_STRINGS];
  10931. }
  10932. return CFFStandardStrings[0];
  10933. }
  10934. getSID(str) {
  10935. let index = CFFStandardStrings.indexOf(str);
  10936. if (index !== -1) {
  10937. return index;
  10938. }
  10939. index = this.strings.indexOf(str);
  10940. if (index !== -1) {
  10941. return index + NUM_STANDARD_CFF_STRINGS;
  10942. }
  10943. return -1;
  10944. }
  10945. add(value) {
  10946. this.strings.push(value);
  10947. }
  10948. get count() {
  10949. return this.strings.length;
  10950. }
  10951. }
  10952. class CFFIndex {
  10953. constructor() {
  10954. this.objects = [];
  10955. this.length = 0;
  10956. }
  10957. add(data) {
  10958. this.length += data.length;
  10959. this.objects.push(data);
  10960. }
  10961. set(index, data) {
  10962. this.length += data.length - this.objects[index].length;
  10963. this.objects[index] = data;
  10964. }
  10965. get(index) {
  10966. return this.objects[index];
  10967. }
  10968. get count() {
  10969. return this.objects.length;
  10970. }
  10971. }
  10972. class CFFDict {
  10973. constructor(tables, strings) {
  10974. this.keyToNameMap = tables.keyToNameMap;
  10975. this.nameToKeyMap = tables.nameToKeyMap;
  10976. this.defaults = tables.defaults;
  10977. this.types = tables.types;
  10978. this.opcodes = tables.opcodes;
  10979. this.order = tables.order;
  10980. this.strings = strings;
  10981. this.values = Object.create(null);
  10982. }
  10983. setByKey(key, value) {
  10984. if (!(key in this.keyToNameMap)) {
  10985. return false;
  10986. }
  10987. if (value.length === 0) {
  10988. return true;
  10989. }
  10990. for (const val of value) {
  10991. if (isNaN(val)) {
  10992. warn(`Invalid CFFDict value: "${value}" for key "${key}".`);
  10993. return true;
  10994. }
  10995. }
  10996. const type = this.types[key];
  10997. if (type === "num" || type === "sid" || type === "offset") {
  10998. value = value[0];
  10999. }
  11000. this.values[key] = value;
  11001. return true;
  11002. }
  11003. setByName(name, value) {
  11004. if (!(name in this.nameToKeyMap)) {
  11005. throw new FormatError(`Invalid dictionary name "${name}"`);
  11006. }
  11007. this.values[this.nameToKeyMap[name]] = value;
  11008. }
  11009. hasName(name) {
  11010. return this.nameToKeyMap[name] in this.values;
  11011. }
  11012. getByName(name) {
  11013. if (!(name in this.nameToKeyMap)) {
  11014. throw new FormatError(`Invalid dictionary name ${name}"`);
  11015. }
  11016. const key = this.nameToKeyMap[name];
  11017. if (!(key in this.values)) {
  11018. return this.defaults[key];
  11019. }
  11020. return this.values[key];
  11021. }
  11022. removeByName(name) {
  11023. delete this.values[this.nameToKeyMap[name]];
  11024. }
  11025. static createTables(layout) {
  11026. const tables = {
  11027. keyToNameMap: {},
  11028. nameToKeyMap: {},
  11029. defaults: {},
  11030. types: {},
  11031. opcodes: {},
  11032. order: []
  11033. };
  11034. for (const entry of layout) {
  11035. const key = Array.isArray(entry[0]) ? (entry[0][0] << 8) + entry[0][1] : entry[0];
  11036. tables.keyToNameMap[key] = entry[1];
  11037. tables.nameToKeyMap[entry[1]] = key;
  11038. tables.types[key] = entry[2];
  11039. tables.defaults[key] = entry[3];
  11040. tables.opcodes[key] = Array.isArray(entry[0]) ? entry[0] : [entry[0]];
  11041. tables.order.push(key);
  11042. }
  11043. return tables;
  11044. }
  11045. }
  11046. 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]];
  11047. class CFFTopDict extends CFFDict {
  11048. static get tables() {
  11049. return shadow(this, "tables", this.createTables(CFFTopDictLayout));
  11050. }
  11051. constructor(strings) {
  11052. super(CFFTopDict.tables, strings);
  11053. this.privateDict = null;
  11054. }
  11055. }
  11056. 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]];
  11057. class CFFPrivateDict extends CFFDict {
  11058. static get tables() {
  11059. return shadow(this, "tables", this.createTables(CFFPrivateDictLayout));
  11060. }
  11061. constructor(strings) {
  11062. super(CFFPrivateDict.tables, strings);
  11063. this.subrsIndex = null;
  11064. }
  11065. }
  11066. const CFFCharsetPredefinedTypes = {
  11067. ISO_ADOBE: 0,
  11068. EXPERT: 1,
  11069. EXPERT_SUBSET: 2
  11070. };
  11071. class CFFCharset {
  11072. constructor(predefined, format, charset, raw) {
  11073. this.predefined = predefined;
  11074. this.format = format;
  11075. this.charset = charset;
  11076. this.raw = raw;
  11077. }
  11078. }
  11079. class CFFEncoding {
  11080. constructor(predefined, format, encoding, raw) {
  11081. this.predefined = predefined;
  11082. this.format = format;
  11083. this.encoding = encoding;
  11084. this.raw = raw;
  11085. }
  11086. }
  11087. class CFFFDSelect {
  11088. constructor(format, fdSelect) {
  11089. this.format = format;
  11090. this.fdSelect = fdSelect;
  11091. }
  11092. getFDIndex(glyphIndex) {
  11093. if (glyphIndex < 0 || glyphIndex >= this.fdSelect.length) {
  11094. return -1;
  11095. }
  11096. return this.fdSelect[glyphIndex];
  11097. }
  11098. }
  11099. class CFFOffsetTracker {
  11100. constructor() {
  11101. this.offsets = Object.create(null);
  11102. }
  11103. isTracking(key) {
  11104. return key in this.offsets;
  11105. }
  11106. track(key, location) {
  11107. if (key in this.offsets) {
  11108. throw new FormatError(`Already tracking location of ${key}`);
  11109. }
  11110. this.offsets[key] = location;
  11111. }
  11112. offset(value) {
  11113. for (const key in this.offsets) {
  11114. this.offsets[key] += value;
  11115. }
  11116. }
  11117. setEntryLocation(key, values, output) {
  11118. if (!(key in this.offsets)) {
  11119. throw new FormatError(`Not tracking location of ${key}`);
  11120. }
  11121. const data = output.data;
  11122. const dataOffset = this.offsets[key];
  11123. const size = 5;
  11124. for (let i = 0, ii = values.length; i < ii; ++i) {
  11125. const offset0 = i * size + dataOffset;
  11126. const offset1 = offset0 + 1;
  11127. const offset2 = offset0 + 2;
  11128. const offset3 = offset0 + 3;
  11129. const offset4 = offset0 + 4;
  11130. if (data[offset0] !== 0x1d || data[offset1] !== 0 || data[offset2] !== 0 || data[offset3] !== 0 || data[offset4] !== 0) {
  11131. throw new FormatError("writing to an offset that is not empty");
  11132. }
  11133. const value = values[i];
  11134. data[offset0] = 0x1d;
  11135. data[offset1] = value >> 24 & 0xff;
  11136. data[offset2] = value >> 16 & 0xff;
  11137. data[offset3] = value >> 8 & 0xff;
  11138. data[offset4] = value & 0xff;
  11139. }
  11140. }
  11141. }
  11142. class CFFCompiler {
  11143. constructor(cff) {
  11144. this.cff = cff;
  11145. }
  11146. compile() {
  11147. const cff = this.cff;
  11148. const output = {
  11149. data: [],
  11150. length: 0,
  11151. add(data) {
  11152. try {
  11153. this.data.push(...data);
  11154. } catch {
  11155. this.data = this.data.concat(data);
  11156. }
  11157. this.length = this.data.length;
  11158. }
  11159. };
  11160. const header = this.compileHeader(cff.header);
  11161. output.add(header);
  11162. const nameIndex = this.compileNameIndex(cff.names);
  11163. output.add(nameIndex);
  11164. if (cff.isCIDFont) {
  11165. if (cff.topDict.hasName("FontMatrix")) {
  11166. const base = cff.topDict.getByName("FontMatrix");
  11167. cff.topDict.removeByName("FontMatrix");
  11168. for (const subDict of cff.fdArray) {
  11169. let matrix = base.slice(0);
  11170. if (subDict.hasName("FontMatrix")) {
  11171. matrix = Util.transform(matrix, subDict.getByName("FontMatrix"));
  11172. }
  11173. subDict.setByName("FontMatrix", matrix);
  11174. }
  11175. }
  11176. }
  11177. const xuid = cff.topDict.getByName("XUID");
  11178. if (xuid?.length > 16) {
  11179. cff.topDict.removeByName("XUID");
  11180. }
  11181. cff.topDict.setByName("charset", 0);
  11182. let compiled = this.compileTopDicts([cff.topDict], output.length, cff.isCIDFont);
  11183. output.add(compiled.output);
  11184. const topDictTracker = compiled.trackers[0];
  11185. const stringIndex = this.compileStringIndex(cff.strings.strings);
  11186. output.add(stringIndex);
  11187. const globalSubrIndex = this.compileIndex(cff.globalSubrIndex);
  11188. output.add(globalSubrIndex);
  11189. if (cff.encoding && cff.topDict.hasName("Encoding")) {
  11190. if (cff.encoding.predefined) {
  11191. topDictTracker.setEntryLocation("Encoding", [cff.encoding.format], output);
  11192. } else {
  11193. const encoding = this.compileEncoding(cff.encoding);
  11194. topDictTracker.setEntryLocation("Encoding", [output.length], output);
  11195. output.add(encoding);
  11196. }
  11197. }
  11198. const charset = this.compileCharset(cff.charset, cff.charStrings.count, cff.strings, cff.isCIDFont);
  11199. topDictTracker.setEntryLocation("charset", [output.length], output);
  11200. output.add(charset);
  11201. const charStrings = this.compileCharStrings(cff.charStrings);
  11202. topDictTracker.setEntryLocation("CharStrings", [output.length], output);
  11203. output.add(charStrings);
  11204. if (cff.isCIDFont) {
  11205. topDictTracker.setEntryLocation("FDSelect", [output.length], output);
  11206. const fdSelect = this.compileFDSelect(cff.fdSelect);
  11207. output.add(fdSelect);
  11208. compiled = this.compileTopDicts(cff.fdArray, output.length, true);
  11209. topDictTracker.setEntryLocation("FDArray", [output.length], output);
  11210. output.add(compiled.output);
  11211. const fontDictTrackers = compiled.trackers;
  11212. this.compilePrivateDicts(cff.fdArray, fontDictTrackers, output);
  11213. }
  11214. this.compilePrivateDicts([cff.topDict], [topDictTracker], output);
  11215. output.add([0]);
  11216. return output.data;
  11217. }
  11218. encodeNumber(value) {
  11219. if (Number.isInteger(value)) {
  11220. return this.encodeInteger(value);
  11221. }
  11222. return this.encodeFloat(value);
  11223. }
  11224. static get EncodeFloatRegExp() {
  11225. return shadow(this, "EncodeFloatRegExp", /\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/);
  11226. }
  11227. encodeFloat(num) {
  11228. let value = num.toString();
  11229. const m = CFFCompiler.EncodeFloatRegExp.exec(value);
  11230. if (m) {
  11231. const epsilon = parseFloat("1e" + ((m[2] ? +m[2] : 0) + m[1].length));
  11232. value = (Math.round(num * epsilon) / epsilon).toString();
  11233. }
  11234. let nibbles = "";
  11235. let i, ii;
  11236. for (i = 0, ii = value.length; i < ii; ++i) {
  11237. const a = value[i];
  11238. if (a === "e") {
  11239. nibbles += value[++i] === "-" ? "c" : "b";
  11240. } else if (a === ".") {
  11241. nibbles += "a";
  11242. } else if (a === "-") {
  11243. nibbles += "e";
  11244. } else {
  11245. nibbles += a;
  11246. }
  11247. }
  11248. nibbles += nibbles.length & 1 ? "f" : "ff";
  11249. const out = [30];
  11250. for (i = 0, ii = nibbles.length; i < ii; i += 2) {
  11251. out.push(parseInt(nibbles.substring(i, i + 2), 16));
  11252. }
  11253. return out;
  11254. }
  11255. encodeInteger(value) {
  11256. let code;
  11257. if (value >= -107 && value <= 107) {
  11258. code = [value + 139];
  11259. } else if (value >= 108 && value <= 1131) {
  11260. value -= 108;
  11261. code = [(value >> 8) + 247, value & 0xff];
  11262. } else if (value >= -1131 && value <= -108) {
  11263. value = -value - 108;
  11264. code = [(value >> 8) + 251, value & 0xff];
  11265. } else if (value >= -32768 && value <= 32767) {
  11266. code = [0x1c, value >> 8 & 0xff, value & 0xff];
  11267. } else {
  11268. code = [0x1d, value >> 24 & 0xff, value >> 16 & 0xff, value >> 8 & 0xff, value & 0xff];
  11269. }
  11270. return code;
  11271. }
  11272. compileHeader(header) {
  11273. return [header.major, header.minor, 4, header.offSize];
  11274. }
  11275. compileNameIndex(names) {
  11276. const nameIndex = new CFFIndex();
  11277. for (const name of names) {
  11278. const length = Math.min(name.length, 127);
  11279. let sanitizedName = new Array(length);
  11280. for (let j = 0; j < length; j++) {
  11281. let char = name[j];
  11282. if (char < "!" || char > "~" || char === "[" || char === "]" || char === "(" || char === ")" || char === "{" || char === "}" || char === "<" || char === ">" || char === "/" || char === "%") {
  11283. char = "_";
  11284. }
  11285. sanitizedName[j] = char;
  11286. }
  11287. sanitizedName = sanitizedName.join("");
  11288. if (sanitizedName === "") {
  11289. sanitizedName = "Bad_Font_Name";
  11290. }
  11291. nameIndex.add(stringToBytes(sanitizedName));
  11292. }
  11293. return this.compileIndex(nameIndex);
  11294. }
  11295. compileTopDicts(dicts, length, removeCidKeys) {
  11296. const fontDictTrackers = [];
  11297. let fdArrayIndex = new CFFIndex();
  11298. for (const fontDict of dicts) {
  11299. if (removeCidKeys) {
  11300. fontDict.removeByName("CIDFontVersion");
  11301. fontDict.removeByName("CIDFontRevision");
  11302. fontDict.removeByName("CIDFontType");
  11303. fontDict.removeByName("CIDCount");
  11304. fontDict.removeByName("UIDBase");
  11305. }
  11306. const fontDictTracker = new CFFOffsetTracker();
  11307. const fontDictData = this.compileDict(fontDict, fontDictTracker);
  11308. fontDictTrackers.push(fontDictTracker);
  11309. fdArrayIndex.add(fontDictData);
  11310. fontDictTracker.offset(length);
  11311. }
  11312. fdArrayIndex = this.compileIndex(fdArrayIndex, fontDictTrackers);
  11313. return {
  11314. trackers: fontDictTrackers,
  11315. output: fdArrayIndex
  11316. };
  11317. }
  11318. compilePrivateDicts(dicts, trackers, output) {
  11319. for (let i = 0, ii = dicts.length; i < ii; ++i) {
  11320. const fontDict = dicts[i];
  11321. const privateDict = fontDict.privateDict;
  11322. if (!privateDict || !fontDict.hasName("Private")) {
  11323. throw new FormatError("There must be a private dictionary.");
  11324. }
  11325. const privateDictTracker = new CFFOffsetTracker();
  11326. const privateDictData = this.compileDict(privateDict, privateDictTracker);
  11327. let outputLength = output.length;
  11328. privateDictTracker.offset(outputLength);
  11329. if (!privateDictData.length) {
  11330. outputLength = 0;
  11331. }
  11332. trackers[i].setEntryLocation("Private", [privateDictData.length, outputLength], output);
  11333. output.add(privateDictData);
  11334. if (privateDict.subrsIndex && privateDict.hasName("Subrs")) {
  11335. const subrs = this.compileIndex(privateDict.subrsIndex);
  11336. privateDictTracker.setEntryLocation("Subrs", [privateDictData.length], output);
  11337. output.add(subrs);
  11338. }
  11339. }
  11340. }
  11341. compileDict(dict, offsetTracker) {
  11342. const out = [];
  11343. for (const key of dict.order) {
  11344. if (!(key in dict.values)) {
  11345. continue;
  11346. }
  11347. let values = dict.values[key];
  11348. let types = dict.types[key];
  11349. if (!Array.isArray(types)) {
  11350. types = [types];
  11351. }
  11352. if (!Array.isArray(values)) {
  11353. values = [values];
  11354. }
  11355. if (values.length === 0) {
  11356. continue;
  11357. }
  11358. for (let j = 0, jj = types.length; j < jj; ++j) {
  11359. const type = types[j];
  11360. const value = values[j];
  11361. switch (type) {
  11362. case "num":
  11363. case "sid":
  11364. out.push(...this.encodeNumber(value));
  11365. break;
  11366. case "offset":
  11367. const name = dict.keyToNameMap[key];
  11368. if (!offsetTracker.isTracking(name)) {
  11369. offsetTracker.track(name, out.length);
  11370. }
  11371. out.push(0x1d, 0, 0, 0, 0);
  11372. break;
  11373. case "array":
  11374. case "delta":
  11375. out.push(...this.encodeNumber(value));
  11376. for (let k = 1, kk = values.length; k < kk; ++k) {
  11377. out.push(...this.encodeNumber(values[k]));
  11378. }
  11379. break;
  11380. default:
  11381. throw new FormatError(`Unknown data type of ${type}`);
  11382. }
  11383. }
  11384. out.push(...dict.opcodes[key]);
  11385. }
  11386. return out;
  11387. }
  11388. compileStringIndex(strings) {
  11389. const stringIndex = new CFFIndex();
  11390. for (const string of strings) {
  11391. stringIndex.add(stringToBytes(string));
  11392. }
  11393. return this.compileIndex(stringIndex);
  11394. }
  11395. compileCharStrings(charStrings) {
  11396. const charStringsIndex = new CFFIndex();
  11397. for (let i = 0; i < charStrings.count; i++) {
  11398. const glyph = charStrings.get(i);
  11399. if (glyph.length === 0) {
  11400. charStringsIndex.add(new Uint8Array([0x8b, 0x0e]));
  11401. continue;
  11402. }
  11403. charStringsIndex.add(glyph);
  11404. }
  11405. return this.compileIndex(charStringsIndex);
  11406. }
  11407. compileCharset(charset, numGlyphs, strings, isCIDFont) {
  11408. let out;
  11409. const numGlyphsLessNotDef = numGlyphs - 1;
  11410. if (isCIDFont) {
  11411. out = new Uint8Array([2, 0, 0, numGlyphsLessNotDef >> 8 & 0xff, numGlyphsLessNotDef & 0xff]);
  11412. } else {
  11413. const length = 1 + numGlyphsLessNotDef * 2;
  11414. out = new Uint8Array(length);
  11415. out[0] = 0;
  11416. let charsetIndex = 0;
  11417. const numCharsets = charset.charset.length;
  11418. let warned = false;
  11419. for (let i = 1; i < out.length; i += 2) {
  11420. let sid = 0;
  11421. if (charsetIndex < numCharsets) {
  11422. const name = charset.charset[charsetIndex++];
  11423. sid = strings.getSID(name);
  11424. if (sid === -1) {
  11425. sid = 0;
  11426. if (!warned) {
  11427. warned = true;
  11428. warn(`Couldn't find ${name} in CFF strings`);
  11429. }
  11430. }
  11431. }
  11432. out[i] = sid >> 8 & 0xff;
  11433. out[i + 1] = sid & 0xff;
  11434. }
  11435. }
  11436. return this.compileTypedArray(out);
  11437. }
  11438. compileEncoding(encoding) {
  11439. return this.compileTypedArray(encoding.raw);
  11440. }
  11441. compileFDSelect(fdSelect) {
  11442. const format = fdSelect.format;
  11443. let out, i;
  11444. switch (format) {
  11445. case 0:
  11446. out = new Uint8Array(1 + fdSelect.fdSelect.length);
  11447. out[0] = format;
  11448. for (i = 0; i < fdSelect.fdSelect.length; i++) {
  11449. out[i + 1] = fdSelect.fdSelect[i];
  11450. }
  11451. break;
  11452. case 3:
  11453. const start = 0;
  11454. let lastFD = fdSelect.fdSelect[0];
  11455. const ranges = [format, 0, 0, start >> 8 & 0xff, start & 0xff, lastFD];
  11456. for (i = 1; i < fdSelect.fdSelect.length; i++) {
  11457. const currentFD = fdSelect.fdSelect[i];
  11458. if (currentFD !== lastFD) {
  11459. ranges.push(i >> 8 & 0xff, i & 0xff, currentFD);
  11460. lastFD = currentFD;
  11461. }
  11462. }
  11463. const numRanges = (ranges.length - 3) / 3;
  11464. ranges[1] = numRanges >> 8 & 0xff;
  11465. ranges[2] = numRanges & 0xff;
  11466. ranges.push(i >> 8 & 0xff, i & 0xff);
  11467. out = new Uint8Array(ranges);
  11468. break;
  11469. }
  11470. return this.compileTypedArray(out);
  11471. }
  11472. compileTypedArray(data) {
  11473. return Array.from(data);
  11474. }
  11475. compileIndex(index, trackers = []) {
  11476. const objects = index.objects;
  11477. const count = objects.length;
  11478. if (count === 0) {
  11479. return [0, 0];
  11480. }
  11481. const data = [count >> 8 & 0xff, count & 0xff];
  11482. let lastOffset = 1,
  11483. i;
  11484. for (i = 0; i < count; ++i) {
  11485. lastOffset += objects[i].length;
  11486. }
  11487. let offsetSize;
  11488. if (lastOffset < 0x100) {
  11489. offsetSize = 1;
  11490. } else if (lastOffset < 0x10000) {
  11491. offsetSize = 2;
  11492. } else if (lastOffset < 0x1000000) {
  11493. offsetSize = 3;
  11494. } else {
  11495. offsetSize = 4;
  11496. }
  11497. data.push(offsetSize);
  11498. let relativeOffset = 1;
  11499. for (i = 0; i < count + 1; i++) {
  11500. if (offsetSize === 1) {
  11501. data.push(relativeOffset & 0xff);
  11502. } else if (offsetSize === 2) {
  11503. data.push(relativeOffset >> 8 & 0xff, relativeOffset & 0xff);
  11504. } else if (offsetSize === 3) {
  11505. data.push(relativeOffset >> 16 & 0xff, relativeOffset >> 8 & 0xff, relativeOffset & 0xff);
  11506. } else {
  11507. data.push(relativeOffset >>> 24 & 0xff, relativeOffset >> 16 & 0xff, relativeOffset >> 8 & 0xff, relativeOffset & 0xff);
  11508. }
  11509. if (objects[i]) {
  11510. relativeOffset += objects[i].length;
  11511. }
  11512. }
  11513. for (i = 0; i < count; i++) {
  11514. if (trackers[i]) {
  11515. trackers[i].offset(data.length);
  11516. }
  11517. data.push(...objects[i]);
  11518. }
  11519. return data;
  11520. }
  11521. }
  11522. ;// CONCATENATED MODULE: ./src/core/glyphlist.js
  11523. const getGlyphsUnicode = getLookupTableFactory(function (t) {
  11524. t.A = 0x0041;
  11525. t.AE = 0x00c6;
  11526. t.AEacute = 0x01fc;
  11527. t.AEmacron = 0x01e2;
  11528. t.AEsmall = 0xf7e6;
  11529. t.Aacute = 0x00c1;
  11530. t.Aacutesmall = 0xf7e1;
  11531. t.Abreve = 0x0102;
  11532. t.Abreveacute = 0x1eae;
  11533. t.Abrevecyrillic = 0x04d0;
  11534. t.Abrevedotbelow = 0x1eb6;
  11535. t.Abrevegrave = 0x1eb0;
  11536. t.Abrevehookabove = 0x1eb2;
  11537. t.Abrevetilde = 0x1eb4;
  11538. t.Acaron = 0x01cd;
  11539. t.Acircle = 0x24b6;
  11540. t.Acircumflex = 0x00c2;
  11541. t.Acircumflexacute = 0x1ea4;
  11542. t.Acircumflexdotbelow = 0x1eac;
  11543. t.Acircumflexgrave = 0x1ea6;
  11544. t.Acircumflexhookabove = 0x1ea8;
  11545. t.Acircumflexsmall = 0xf7e2;
  11546. t.Acircumflextilde = 0x1eaa;
  11547. t.Acute = 0xf6c9;
  11548. t.Acutesmall = 0xf7b4;
  11549. t.Acyrillic = 0x0410;
  11550. t.Adblgrave = 0x0200;
  11551. t.Adieresis = 0x00c4;
  11552. t.Adieresiscyrillic = 0x04d2;
  11553. t.Adieresismacron = 0x01de;
  11554. t.Adieresissmall = 0xf7e4;
  11555. t.Adotbelow = 0x1ea0;
  11556. t.Adotmacron = 0x01e0;
  11557. t.Agrave = 0x00c0;
  11558. t.Agravesmall = 0xf7e0;
  11559. t.Ahookabove = 0x1ea2;
  11560. t.Aiecyrillic = 0x04d4;
  11561. t.Ainvertedbreve = 0x0202;
  11562. t.Alpha = 0x0391;
  11563. t.Alphatonos = 0x0386;
  11564. t.Amacron = 0x0100;
  11565. t.Amonospace = 0xff21;
  11566. t.Aogonek = 0x0104;
  11567. t.Aring = 0x00c5;
  11568. t.Aringacute = 0x01fa;
  11569. t.Aringbelow = 0x1e00;
  11570. t.Aringsmall = 0xf7e5;
  11571. t.Asmall = 0xf761;
  11572. t.Atilde = 0x00c3;
  11573. t.Atildesmall = 0xf7e3;
  11574. t.Aybarmenian = 0x0531;
  11575. t.B = 0x0042;
  11576. t.Bcircle = 0x24b7;
  11577. t.Bdotaccent = 0x1e02;
  11578. t.Bdotbelow = 0x1e04;
  11579. t.Becyrillic = 0x0411;
  11580. t.Benarmenian = 0x0532;
  11581. t.Beta = 0x0392;
  11582. t.Bhook = 0x0181;
  11583. t.Blinebelow = 0x1e06;
  11584. t.Bmonospace = 0xff22;
  11585. t.Brevesmall = 0xf6f4;
  11586. t.Bsmall = 0xf762;
  11587. t.Btopbar = 0x0182;
  11588. t.C = 0x0043;
  11589. t.Caarmenian = 0x053e;
  11590. t.Cacute = 0x0106;
  11591. t.Caron = 0xf6ca;
  11592. t.Caronsmall = 0xf6f5;
  11593. t.Ccaron = 0x010c;
  11594. t.Ccedilla = 0x00c7;
  11595. t.Ccedillaacute = 0x1e08;
  11596. t.Ccedillasmall = 0xf7e7;
  11597. t.Ccircle = 0x24b8;
  11598. t.Ccircumflex = 0x0108;
  11599. t.Cdot = 0x010a;
  11600. t.Cdotaccent = 0x010a;
  11601. t.Cedillasmall = 0xf7b8;
  11602. t.Chaarmenian = 0x0549;
  11603. t.Cheabkhasiancyrillic = 0x04bc;
  11604. t.Checyrillic = 0x0427;
  11605. t.Chedescenderabkhasiancyrillic = 0x04be;
  11606. t.Chedescendercyrillic = 0x04b6;
  11607. t.Chedieresiscyrillic = 0x04f4;
  11608. t.Cheharmenian = 0x0543;
  11609. t.Chekhakassiancyrillic = 0x04cb;
  11610. t.Cheverticalstrokecyrillic = 0x04b8;
  11611. t.Chi = 0x03a7;
  11612. t.Chook = 0x0187;
  11613. t.Circumflexsmall = 0xf6f6;
  11614. t.Cmonospace = 0xff23;
  11615. t.Coarmenian = 0x0551;
  11616. t.Csmall = 0xf763;
  11617. t.D = 0x0044;
  11618. t.DZ = 0x01f1;
  11619. t.DZcaron = 0x01c4;
  11620. t.Daarmenian = 0x0534;
  11621. t.Dafrican = 0x0189;
  11622. t.Dcaron = 0x010e;
  11623. t.Dcedilla = 0x1e10;
  11624. t.Dcircle = 0x24b9;
  11625. t.Dcircumflexbelow = 0x1e12;
  11626. t.Dcroat = 0x0110;
  11627. t.Ddotaccent = 0x1e0a;
  11628. t.Ddotbelow = 0x1e0c;
  11629. t.Decyrillic = 0x0414;
  11630. t.Deicoptic = 0x03ee;
  11631. t.Delta = 0x2206;
  11632. t.Deltagreek = 0x0394;
  11633. t.Dhook = 0x018a;
  11634. t.Dieresis = 0xf6cb;
  11635. t.DieresisAcute = 0xf6cc;
  11636. t.DieresisGrave = 0xf6cd;
  11637. t.Dieresissmall = 0xf7a8;
  11638. t.Digammagreek = 0x03dc;
  11639. t.Djecyrillic = 0x0402;
  11640. t.Dlinebelow = 0x1e0e;
  11641. t.Dmonospace = 0xff24;
  11642. t.Dotaccentsmall = 0xf6f7;
  11643. t.Dslash = 0x0110;
  11644. t.Dsmall = 0xf764;
  11645. t.Dtopbar = 0x018b;
  11646. t.Dz = 0x01f2;
  11647. t.Dzcaron = 0x01c5;
  11648. t.Dzeabkhasiancyrillic = 0x04e0;
  11649. t.Dzecyrillic = 0x0405;
  11650. t.Dzhecyrillic = 0x040f;
  11651. t.E = 0x0045;
  11652. t.Eacute = 0x00c9;
  11653. t.Eacutesmall = 0xf7e9;
  11654. t.Ebreve = 0x0114;
  11655. t.Ecaron = 0x011a;
  11656. t.Ecedillabreve = 0x1e1c;
  11657. t.Echarmenian = 0x0535;
  11658. t.Ecircle = 0x24ba;
  11659. t.Ecircumflex = 0x00ca;
  11660. t.Ecircumflexacute = 0x1ebe;
  11661. t.Ecircumflexbelow = 0x1e18;
  11662. t.Ecircumflexdotbelow = 0x1ec6;
  11663. t.Ecircumflexgrave = 0x1ec0;
  11664. t.Ecircumflexhookabove = 0x1ec2;
  11665. t.Ecircumflexsmall = 0xf7ea;
  11666. t.Ecircumflextilde = 0x1ec4;
  11667. t.Ecyrillic = 0x0404;
  11668. t.Edblgrave = 0x0204;
  11669. t.Edieresis = 0x00cb;
  11670. t.Edieresissmall = 0xf7eb;
  11671. t.Edot = 0x0116;
  11672. t.Edotaccent = 0x0116;
  11673. t.Edotbelow = 0x1eb8;
  11674. t.Efcyrillic = 0x0424;
  11675. t.Egrave = 0x00c8;
  11676. t.Egravesmall = 0xf7e8;
  11677. t.Eharmenian = 0x0537;
  11678. t.Ehookabove = 0x1eba;
  11679. t.Eightroman = 0x2167;
  11680. t.Einvertedbreve = 0x0206;
  11681. t.Eiotifiedcyrillic = 0x0464;
  11682. t.Elcyrillic = 0x041b;
  11683. t.Elevenroman = 0x216a;
  11684. t.Emacron = 0x0112;
  11685. t.Emacronacute = 0x1e16;
  11686. t.Emacrongrave = 0x1e14;
  11687. t.Emcyrillic = 0x041c;
  11688. t.Emonospace = 0xff25;
  11689. t.Encyrillic = 0x041d;
  11690. t.Endescendercyrillic = 0x04a2;
  11691. t.Eng = 0x014a;
  11692. t.Enghecyrillic = 0x04a4;
  11693. t.Enhookcyrillic = 0x04c7;
  11694. t.Eogonek = 0x0118;
  11695. t.Eopen = 0x0190;
  11696. t.Epsilon = 0x0395;
  11697. t.Epsilontonos = 0x0388;
  11698. t.Ercyrillic = 0x0420;
  11699. t.Ereversed = 0x018e;
  11700. t.Ereversedcyrillic = 0x042d;
  11701. t.Escyrillic = 0x0421;
  11702. t.Esdescendercyrillic = 0x04aa;
  11703. t.Esh = 0x01a9;
  11704. t.Esmall = 0xf765;
  11705. t.Eta = 0x0397;
  11706. t.Etarmenian = 0x0538;
  11707. t.Etatonos = 0x0389;
  11708. t.Eth = 0x00d0;
  11709. t.Ethsmall = 0xf7f0;
  11710. t.Etilde = 0x1ebc;
  11711. t.Etildebelow = 0x1e1a;
  11712. t.Euro = 0x20ac;
  11713. t.Ezh = 0x01b7;
  11714. t.Ezhcaron = 0x01ee;
  11715. t.Ezhreversed = 0x01b8;
  11716. t.F = 0x0046;
  11717. t.Fcircle = 0x24bb;
  11718. t.Fdotaccent = 0x1e1e;
  11719. t.Feharmenian = 0x0556;
  11720. t.Feicoptic = 0x03e4;
  11721. t.Fhook = 0x0191;
  11722. t.Fitacyrillic = 0x0472;
  11723. t.Fiveroman = 0x2164;
  11724. t.Fmonospace = 0xff26;
  11725. t.Fourroman = 0x2163;
  11726. t.Fsmall = 0xf766;
  11727. t.G = 0x0047;
  11728. t.GBsquare = 0x3387;
  11729. t.Gacute = 0x01f4;
  11730. t.Gamma = 0x0393;
  11731. t.Gammaafrican = 0x0194;
  11732. t.Gangiacoptic = 0x03ea;
  11733. t.Gbreve = 0x011e;
  11734. t.Gcaron = 0x01e6;
  11735. t.Gcedilla = 0x0122;
  11736. t.Gcircle = 0x24bc;
  11737. t.Gcircumflex = 0x011c;
  11738. t.Gcommaaccent = 0x0122;
  11739. t.Gdot = 0x0120;
  11740. t.Gdotaccent = 0x0120;
  11741. t.Gecyrillic = 0x0413;
  11742. t.Ghadarmenian = 0x0542;
  11743. t.Ghemiddlehookcyrillic = 0x0494;
  11744. t.Ghestrokecyrillic = 0x0492;
  11745. t.Gheupturncyrillic = 0x0490;
  11746. t.Ghook = 0x0193;
  11747. t.Gimarmenian = 0x0533;
  11748. t.Gjecyrillic = 0x0403;
  11749. t.Gmacron = 0x1e20;
  11750. t.Gmonospace = 0xff27;
  11751. t.Grave = 0xf6ce;
  11752. t.Gravesmall = 0xf760;
  11753. t.Gsmall = 0xf767;
  11754. t.Gsmallhook = 0x029b;
  11755. t.Gstroke = 0x01e4;
  11756. t.H = 0x0048;
  11757. t.H18533 = 0x25cf;
  11758. t.H18543 = 0x25aa;
  11759. t.H18551 = 0x25ab;
  11760. t.H22073 = 0x25a1;
  11761. t.HPsquare = 0x33cb;
  11762. t.Haabkhasiancyrillic = 0x04a8;
  11763. t.Hadescendercyrillic = 0x04b2;
  11764. t.Hardsigncyrillic = 0x042a;
  11765. t.Hbar = 0x0126;
  11766. t.Hbrevebelow = 0x1e2a;
  11767. t.Hcedilla = 0x1e28;
  11768. t.Hcircle = 0x24bd;
  11769. t.Hcircumflex = 0x0124;
  11770. t.Hdieresis = 0x1e26;
  11771. t.Hdotaccent = 0x1e22;
  11772. t.Hdotbelow = 0x1e24;
  11773. t.Hmonospace = 0xff28;
  11774. t.Hoarmenian = 0x0540;
  11775. t.Horicoptic = 0x03e8;
  11776. t.Hsmall = 0xf768;
  11777. t.Hungarumlaut = 0xf6cf;
  11778. t.Hungarumlautsmall = 0xf6f8;
  11779. t.Hzsquare = 0x3390;
  11780. t.I = 0x0049;
  11781. t.IAcyrillic = 0x042f;
  11782. t.IJ = 0x0132;
  11783. t.IUcyrillic = 0x042e;
  11784. t.Iacute = 0x00cd;
  11785. t.Iacutesmall = 0xf7ed;
  11786. t.Ibreve = 0x012c;
  11787. t.Icaron = 0x01cf;
  11788. t.Icircle = 0x24be;
  11789. t.Icircumflex = 0x00ce;
  11790. t.Icircumflexsmall = 0xf7ee;
  11791. t.Icyrillic = 0x0406;
  11792. t.Idblgrave = 0x0208;
  11793. t.Idieresis = 0x00cf;
  11794. t.Idieresisacute = 0x1e2e;
  11795. t.Idieresiscyrillic = 0x04e4;
  11796. t.Idieresissmall = 0xf7ef;
  11797. t.Idot = 0x0130;
  11798. t.Idotaccent = 0x0130;
  11799. t.Idotbelow = 0x1eca;
  11800. t.Iebrevecyrillic = 0x04d6;
  11801. t.Iecyrillic = 0x0415;
  11802. t.Ifraktur = 0x2111;
  11803. t.Igrave = 0x00cc;
  11804. t.Igravesmall = 0xf7ec;
  11805. t.Ihookabove = 0x1ec8;
  11806. t.Iicyrillic = 0x0418;
  11807. t.Iinvertedbreve = 0x020a;
  11808. t.Iishortcyrillic = 0x0419;
  11809. t.Imacron = 0x012a;
  11810. t.Imacroncyrillic = 0x04e2;
  11811. t.Imonospace = 0xff29;
  11812. t.Iniarmenian = 0x053b;
  11813. t.Iocyrillic = 0x0401;
  11814. t.Iogonek = 0x012e;
  11815. t.Iota = 0x0399;
  11816. t.Iotaafrican = 0x0196;
  11817. t.Iotadieresis = 0x03aa;
  11818. t.Iotatonos = 0x038a;
  11819. t.Ismall = 0xf769;
  11820. t.Istroke = 0x0197;
  11821. t.Itilde = 0x0128;
  11822. t.Itildebelow = 0x1e2c;
  11823. t.Izhitsacyrillic = 0x0474;
  11824. t.Izhitsadblgravecyrillic = 0x0476;
  11825. t.J = 0x004a;
  11826. t.Jaarmenian = 0x0541;
  11827. t.Jcircle = 0x24bf;
  11828. t.Jcircumflex = 0x0134;
  11829. t.Jecyrillic = 0x0408;
  11830. t.Jheharmenian = 0x054b;
  11831. t.Jmonospace = 0xff2a;
  11832. t.Jsmall = 0xf76a;
  11833. t.K = 0x004b;
  11834. t.KBsquare = 0x3385;
  11835. t.KKsquare = 0x33cd;
  11836. t.Kabashkircyrillic = 0x04a0;
  11837. t.Kacute = 0x1e30;
  11838. t.Kacyrillic = 0x041a;
  11839. t.Kadescendercyrillic = 0x049a;
  11840. t.Kahookcyrillic = 0x04c3;
  11841. t.Kappa = 0x039a;
  11842. t.Kastrokecyrillic = 0x049e;
  11843. t.Kaverticalstrokecyrillic = 0x049c;
  11844. t.Kcaron = 0x01e8;
  11845. t.Kcedilla = 0x0136;
  11846. t.Kcircle = 0x24c0;
  11847. t.Kcommaaccent = 0x0136;
  11848. t.Kdotbelow = 0x1e32;
  11849. t.Keharmenian = 0x0554;
  11850. t.Kenarmenian = 0x053f;
  11851. t.Khacyrillic = 0x0425;
  11852. t.Kheicoptic = 0x03e6;
  11853. t.Khook = 0x0198;
  11854. t.Kjecyrillic = 0x040c;
  11855. t.Klinebelow = 0x1e34;
  11856. t.Kmonospace = 0xff2b;
  11857. t.Koppacyrillic = 0x0480;
  11858. t.Koppagreek = 0x03de;
  11859. t.Ksicyrillic = 0x046e;
  11860. t.Ksmall = 0xf76b;
  11861. t.L = 0x004c;
  11862. t.LJ = 0x01c7;
  11863. t.LL = 0xf6bf;
  11864. t.Lacute = 0x0139;
  11865. t.Lambda = 0x039b;
  11866. t.Lcaron = 0x013d;
  11867. t.Lcedilla = 0x013b;
  11868. t.Lcircle = 0x24c1;
  11869. t.Lcircumflexbelow = 0x1e3c;
  11870. t.Lcommaaccent = 0x013b;
  11871. t.Ldot = 0x013f;
  11872. t.Ldotaccent = 0x013f;
  11873. t.Ldotbelow = 0x1e36;
  11874. t.Ldotbelowmacron = 0x1e38;
  11875. t.Liwnarmenian = 0x053c;
  11876. t.Lj = 0x01c8;
  11877. t.Ljecyrillic = 0x0409;
  11878. t.Llinebelow = 0x1e3a;
  11879. t.Lmonospace = 0xff2c;
  11880. t.Lslash = 0x0141;
  11881. t.Lslashsmall = 0xf6f9;
  11882. t.Lsmall = 0xf76c;
  11883. t.M = 0x004d;
  11884. t.MBsquare = 0x3386;
  11885. t.Macron = 0xf6d0;
  11886. t.Macronsmall = 0xf7af;
  11887. t.Macute = 0x1e3e;
  11888. t.Mcircle = 0x24c2;
  11889. t.Mdotaccent = 0x1e40;
  11890. t.Mdotbelow = 0x1e42;
  11891. t.Menarmenian = 0x0544;
  11892. t.Mmonospace = 0xff2d;
  11893. t.Msmall = 0xf76d;
  11894. t.Mturned = 0x019c;
  11895. t.Mu = 0x039c;
  11896. t.N = 0x004e;
  11897. t.NJ = 0x01ca;
  11898. t.Nacute = 0x0143;
  11899. t.Ncaron = 0x0147;
  11900. t.Ncedilla = 0x0145;
  11901. t.Ncircle = 0x24c3;
  11902. t.Ncircumflexbelow = 0x1e4a;
  11903. t.Ncommaaccent = 0x0145;
  11904. t.Ndotaccent = 0x1e44;
  11905. t.Ndotbelow = 0x1e46;
  11906. t.Nhookleft = 0x019d;
  11907. t.Nineroman = 0x2168;
  11908. t.Nj = 0x01cb;
  11909. t.Njecyrillic = 0x040a;
  11910. t.Nlinebelow = 0x1e48;
  11911. t.Nmonospace = 0xff2e;
  11912. t.Nowarmenian = 0x0546;
  11913. t.Nsmall = 0xf76e;
  11914. t.Ntilde = 0x00d1;
  11915. t.Ntildesmall = 0xf7f1;
  11916. t.Nu = 0x039d;
  11917. t.O = 0x004f;
  11918. t.OE = 0x0152;
  11919. t.OEsmall = 0xf6fa;
  11920. t.Oacute = 0x00d3;
  11921. t.Oacutesmall = 0xf7f3;
  11922. t.Obarredcyrillic = 0x04e8;
  11923. t.Obarreddieresiscyrillic = 0x04ea;
  11924. t.Obreve = 0x014e;
  11925. t.Ocaron = 0x01d1;
  11926. t.Ocenteredtilde = 0x019f;
  11927. t.Ocircle = 0x24c4;
  11928. t.Ocircumflex = 0x00d4;
  11929. t.Ocircumflexacute = 0x1ed0;
  11930. t.Ocircumflexdotbelow = 0x1ed8;
  11931. t.Ocircumflexgrave = 0x1ed2;
  11932. t.Ocircumflexhookabove = 0x1ed4;
  11933. t.Ocircumflexsmall = 0xf7f4;
  11934. t.Ocircumflextilde = 0x1ed6;
  11935. t.Ocyrillic = 0x041e;
  11936. t.Odblacute = 0x0150;
  11937. t.Odblgrave = 0x020c;
  11938. t.Odieresis = 0x00d6;
  11939. t.Odieresiscyrillic = 0x04e6;
  11940. t.Odieresissmall = 0xf7f6;
  11941. t.Odotbelow = 0x1ecc;
  11942. t.Ogoneksmall = 0xf6fb;
  11943. t.Ograve = 0x00d2;
  11944. t.Ogravesmall = 0xf7f2;
  11945. t.Oharmenian = 0x0555;
  11946. t.Ohm = 0x2126;
  11947. t.Ohookabove = 0x1ece;
  11948. t.Ohorn = 0x01a0;
  11949. t.Ohornacute = 0x1eda;
  11950. t.Ohorndotbelow = 0x1ee2;
  11951. t.Ohorngrave = 0x1edc;
  11952. t.Ohornhookabove = 0x1ede;
  11953. t.Ohorntilde = 0x1ee0;
  11954. t.Ohungarumlaut = 0x0150;
  11955. t.Oi = 0x01a2;
  11956. t.Oinvertedbreve = 0x020e;
  11957. t.Omacron = 0x014c;
  11958. t.Omacronacute = 0x1e52;
  11959. t.Omacrongrave = 0x1e50;
  11960. t.Omega = 0x2126;
  11961. t.Omegacyrillic = 0x0460;
  11962. t.Omegagreek = 0x03a9;
  11963. t.Omegaroundcyrillic = 0x047a;
  11964. t.Omegatitlocyrillic = 0x047c;
  11965. t.Omegatonos = 0x038f;
  11966. t.Omicron = 0x039f;
  11967. t.Omicrontonos = 0x038c;
  11968. t.Omonospace = 0xff2f;
  11969. t.Oneroman = 0x2160;
  11970. t.Oogonek = 0x01ea;
  11971. t.Oogonekmacron = 0x01ec;
  11972. t.Oopen = 0x0186;
  11973. t.Oslash = 0x00d8;
  11974. t.Oslashacute = 0x01fe;
  11975. t.Oslashsmall = 0xf7f8;
  11976. t.Osmall = 0xf76f;
  11977. t.Ostrokeacute = 0x01fe;
  11978. t.Otcyrillic = 0x047e;
  11979. t.Otilde = 0x00d5;
  11980. t.Otildeacute = 0x1e4c;
  11981. t.Otildedieresis = 0x1e4e;
  11982. t.Otildesmall = 0xf7f5;
  11983. t.P = 0x0050;
  11984. t.Pacute = 0x1e54;
  11985. t.Pcircle = 0x24c5;
  11986. t.Pdotaccent = 0x1e56;
  11987. t.Pecyrillic = 0x041f;
  11988. t.Peharmenian = 0x054a;
  11989. t.Pemiddlehookcyrillic = 0x04a6;
  11990. t.Phi = 0x03a6;
  11991. t.Phook = 0x01a4;
  11992. t.Pi = 0x03a0;
  11993. t.Piwrarmenian = 0x0553;
  11994. t.Pmonospace = 0xff30;
  11995. t.Psi = 0x03a8;
  11996. t.Psicyrillic = 0x0470;
  11997. t.Psmall = 0xf770;
  11998. t.Q = 0x0051;
  11999. t.Qcircle = 0x24c6;
  12000. t.Qmonospace = 0xff31;
  12001. t.Qsmall = 0xf771;
  12002. t.R = 0x0052;
  12003. t.Raarmenian = 0x054c;
  12004. t.Racute = 0x0154;
  12005. t.Rcaron = 0x0158;
  12006. t.Rcedilla = 0x0156;
  12007. t.Rcircle = 0x24c7;
  12008. t.Rcommaaccent = 0x0156;
  12009. t.Rdblgrave = 0x0210;
  12010. t.Rdotaccent = 0x1e58;
  12011. t.Rdotbelow = 0x1e5a;
  12012. t.Rdotbelowmacron = 0x1e5c;
  12013. t.Reharmenian = 0x0550;
  12014. t.Rfraktur = 0x211c;
  12015. t.Rho = 0x03a1;
  12016. t.Ringsmall = 0xf6fc;
  12017. t.Rinvertedbreve = 0x0212;
  12018. t.Rlinebelow = 0x1e5e;
  12019. t.Rmonospace = 0xff32;
  12020. t.Rsmall = 0xf772;
  12021. t.Rsmallinverted = 0x0281;
  12022. t.Rsmallinvertedsuperior = 0x02b6;
  12023. t.S = 0x0053;
  12024. t.SF010000 = 0x250c;
  12025. t.SF020000 = 0x2514;
  12026. t.SF030000 = 0x2510;
  12027. t.SF040000 = 0x2518;
  12028. t.SF050000 = 0x253c;
  12029. t.SF060000 = 0x252c;
  12030. t.SF070000 = 0x2534;
  12031. t.SF080000 = 0x251c;
  12032. t.SF090000 = 0x2524;
  12033. t.SF100000 = 0x2500;
  12034. t.SF110000 = 0x2502;
  12035. t.SF190000 = 0x2561;
  12036. t.SF200000 = 0x2562;
  12037. t.SF210000 = 0x2556;
  12038. t.SF220000 = 0x2555;
  12039. t.SF230000 = 0x2563;
  12040. t.SF240000 = 0x2551;
  12041. t.SF250000 = 0x2557;
  12042. t.SF260000 = 0x255d;
  12043. t.SF270000 = 0x255c;
  12044. t.SF280000 = 0x255b;
  12045. t.SF360000 = 0x255e;
  12046. t.SF370000 = 0x255f;
  12047. t.SF380000 = 0x255a;
  12048. t.SF390000 = 0x2554;
  12049. t.SF400000 = 0x2569;
  12050. t.SF410000 = 0x2566;
  12051. t.SF420000 = 0x2560;
  12052. t.SF430000 = 0x2550;
  12053. t.SF440000 = 0x256c;
  12054. t.SF450000 = 0x2567;
  12055. t.SF460000 = 0x2568;
  12056. t.SF470000 = 0x2564;
  12057. t.SF480000 = 0x2565;
  12058. t.SF490000 = 0x2559;
  12059. t.SF500000 = 0x2558;
  12060. t.SF510000 = 0x2552;
  12061. t.SF520000 = 0x2553;
  12062. t.SF530000 = 0x256b;
  12063. t.SF540000 = 0x256a;
  12064. t.Sacute = 0x015a;
  12065. t.Sacutedotaccent = 0x1e64;
  12066. t.Sampigreek = 0x03e0;
  12067. t.Scaron = 0x0160;
  12068. t.Scarondotaccent = 0x1e66;
  12069. t.Scaronsmall = 0xf6fd;
  12070. t.Scedilla = 0x015e;
  12071. t.Schwa = 0x018f;
  12072. t.Schwacyrillic = 0x04d8;
  12073. t.Schwadieresiscyrillic = 0x04da;
  12074. t.Scircle = 0x24c8;
  12075. t.Scircumflex = 0x015c;
  12076. t.Scommaaccent = 0x0218;
  12077. t.Sdotaccent = 0x1e60;
  12078. t.Sdotbelow = 0x1e62;
  12079. t.Sdotbelowdotaccent = 0x1e68;
  12080. t.Seharmenian = 0x054d;
  12081. t.Sevenroman = 0x2166;
  12082. t.Shaarmenian = 0x0547;
  12083. t.Shacyrillic = 0x0428;
  12084. t.Shchacyrillic = 0x0429;
  12085. t.Sheicoptic = 0x03e2;
  12086. t.Shhacyrillic = 0x04ba;
  12087. t.Shimacoptic = 0x03ec;
  12088. t.Sigma = 0x03a3;
  12089. t.Sixroman = 0x2165;
  12090. t.Smonospace = 0xff33;
  12091. t.Softsigncyrillic = 0x042c;
  12092. t.Ssmall = 0xf773;
  12093. t.Stigmagreek = 0x03da;
  12094. t.T = 0x0054;
  12095. t.Tau = 0x03a4;
  12096. t.Tbar = 0x0166;
  12097. t.Tcaron = 0x0164;
  12098. t.Tcedilla = 0x0162;
  12099. t.Tcircle = 0x24c9;
  12100. t.Tcircumflexbelow = 0x1e70;
  12101. t.Tcommaaccent = 0x0162;
  12102. t.Tdotaccent = 0x1e6a;
  12103. t.Tdotbelow = 0x1e6c;
  12104. t.Tecyrillic = 0x0422;
  12105. t.Tedescendercyrillic = 0x04ac;
  12106. t.Tenroman = 0x2169;
  12107. t.Tetsecyrillic = 0x04b4;
  12108. t.Theta = 0x0398;
  12109. t.Thook = 0x01ac;
  12110. t.Thorn = 0x00de;
  12111. t.Thornsmall = 0xf7fe;
  12112. t.Threeroman = 0x2162;
  12113. t.Tildesmall = 0xf6fe;
  12114. t.Tiwnarmenian = 0x054f;
  12115. t.Tlinebelow = 0x1e6e;
  12116. t.Tmonospace = 0xff34;
  12117. t.Toarmenian = 0x0539;
  12118. t.Tonefive = 0x01bc;
  12119. t.Tonesix = 0x0184;
  12120. t.Tonetwo = 0x01a7;
  12121. t.Tretroflexhook = 0x01ae;
  12122. t.Tsecyrillic = 0x0426;
  12123. t.Tshecyrillic = 0x040b;
  12124. t.Tsmall = 0xf774;
  12125. t.Twelveroman = 0x216b;
  12126. t.Tworoman = 0x2161;
  12127. t.U = 0x0055;
  12128. t.Uacute = 0x00da;
  12129. t.Uacutesmall = 0xf7fa;
  12130. t.Ubreve = 0x016c;
  12131. t.Ucaron = 0x01d3;
  12132. t.Ucircle = 0x24ca;
  12133. t.Ucircumflex = 0x00db;
  12134. t.Ucircumflexbelow = 0x1e76;
  12135. t.Ucircumflexsmall = 0xf7fb;
  12136. t.Ucyrillic = 0x0423;
  12137. t.Udblacute = 0x0170;
  12138. t.Udblgrave = 0x0214;
  12139. t.Udieresis = 0x00dc;
  12140. t.Udieresisacute = 0x01d7;
  12141. t.Udieresisbelow = 0x1e72;
  12142. t.Udieresiscaron = 0x01d9;
  12143. t.Udieresiscyrillic = 0x04f0;
  12144. t.Udieresisgrave = 0x01db;
  12145. t.Udieresismacron = 0x01d5;
  12146. t.Udieresissmall = 0xf7fc;
  12147. t.Udotbelow = 0x1ee4;
  12148. t.Ugrave = 0x00d9;
  12149. t.Ugravesmall = 0xf7f9;
  12150. t.Uhookabove = 0x1ee6;
  12151. t.Uhorn = 0x01af;
  12152. t.Uhornacute = 0x1ee8;
  12153. t.Uhorndotbelow = 0x1ef0;
  12154. t.Uhorngrave = 0x1eea;
  12155. t.Uhornhookabove = 0x1eec;
  12156. t.Uhorntilde = 0x1eee;
  12157. t.Uhungarumlaut = 0x0170;
  12158. t.Uhungarumlautcyrillic = 0x04f2;
  12159. t.Uinvertedbreve = 0x0216;
  12160. t.Ukcyrillic = 0x0478;
  12161. t.Umacron = 0x016a;
  12162. t.Umacroncyrillic = 0x04ee;
  12163. t.Umacrondieresis = 0x1e7a;
  12164. t.Umonospace = 0xff35;
  12165. t.Uogonek = 0x0172;
  12166. t.Upsilon = 0x03a5;
  12167. t.Upsilon1 = 0x03d2;
  12168. t.Upsilonacutehooksymbolgreek = 0x03d3;
  12169. t.Upsilonafrican = 0x01b1;
  12170. t.Upsilondieresis = 0x03ab;
  12171. t.Upsilondieresishooksymbolgreek = 0x03d4;
  12172. t.Upsilonhooksymbol = 0x03d2;
  12173. t.Upsilontonos = 0x038e;
  12174. t.Uring = 0x016e;
  12175. t.Ushortcyrillic = 0x040e;
  12176. t.Usmall = 0xf775;
  12177. t.Ustraightcyrillic = 0x04ae;
  12178. t.Ustraightstrokecyrillic = 0x04b0;
  12179. t.Utilde = 0x0168;
  12180. t.Utildeacute = 0x1e78;
  12181. t.Utildebelow = 0x1e74;
  12182. t.V = 0x0056;
  12183. t.Vcircle = 0x24cb;
  12184. t.Vdotbelow = 0x1e7e;
  12185. t.Vecyrillic = 0x0412;
  12186. t.Vewarmenian = 0x054e;
  12187. t.Vhook = 0x01b2;
  12188. t.Vmonospace = 0xff36;
  12189. t.Voarmenian = 0x0548;
  12190. t.Vsmall = 0xf776;
  12191. t.Vtilde = 0x1e7c;
  12192. t.W = 0x0057;
  12193. t.Wacute = 0x1e82;
  12194. t.Wcircle = 0x24cc;
  12195. t.Wcircumflex = 0x0174;
  12196. t.Wdieresis = 0x1e84;
  12197. t.Wdotaccent = 0x1e86;
  12198. t.Wdotbelow = 0x1e88;
  12199. t.Wgrave = 0x1e80;
  12200. t.Wmonospace = 0xff37;
  12201. t.Wsmall = 0xf777;
  12202. t.X = 0x0058;
  12203. t.Xcircle = 0x24cd;
  12204. t.Xdieresis = 0x1e8c;
  12205. t.Xdotaccent = 0x1e8a;
  12206. t.Xeharmenian = 0x053d;
  12207. t.Xi = 0x039e;
  12208. t.Xmonospace = 0xff38;
  12209. t.Xsmall = 0xf778;
  12210. t.Y = 0x0059;
  12211. t.Yacute = 0x00dd;
  12212. t.Yacutesmall = 0xf7fd;
  12213. t.Yatcyrillic = 0x0462;
  12214. t.Ycircle = 0x24ce;
  12215. t.Ycircumflex = 0x0176;
  12216. t.Ydieresis = 0x0178;
  12217. t.Ydieresissmall = 0xf7ff;
  12218. t.Ydotaccent = 0x1e8e;
  12219. t.Ydotbelow = 0x1ef4;
  12220. t.Yericyrillic = 0x042b;
  12221. t.Yerudieresiscyrillic = 0x04f8;
  12222. t.Ygrave = 0x1ef2;
  12223. t.Yhook = 0x01b3;
  12224. t.Yhookabove = 0x1ef6;
  12225. t.Yiarmenian = 0x0545;
  12226. t.Yicyrillic = 0x0407;
  12227. t.Yiwnarmenian = 0x0552;
  12228. t.Ymonospace = 0xff39;
  12229. t.Ysmall = 0xf779;
  12230. t.Ytilde = 0x1ef8;
  12231. t.Yusbigcyrillic = 0x046a;
  12232. t.Yusbigiotifiedcyrillic = 0x046c;
  12233. t.Yuslittlecyrillic = 0x0466;
  12234. t.Yuslittleiotifiedcyrillic = 0x0468;
  12235. t.Z = 0x005a;
  12236. t.Zaarmenian = 0x0536;
  12237. t.Zacute = 0x0179;
  12238. t.Zcaron = 0x017d;
  12239. t.Zcaronsmall = 0xf6ff;
  12240. t.Zcircle = 0x24cf;
  12241. t.Zcircumflex = 0x1e90;
  12242. t.Zdot = 0x017b;
  12243. t.Zdotaccent = 0x017b;
  12244. t.Zdotbelow = 0x1e92;
  12245. t.Zecyrillic = 0x0417;
  12246. t.Zedescendercyrillic = 0x0498;
  12247. t.Zedieresiscyrillic = 0x04de;
  12248. t.Zeta = 0x0396;
  12249. t.Zhearmenian = 0x053a;
  12250. t.Zhebrevecyrillic = 0x04c1;
  12251. t.Zhecyrillic = 0x0416;
  12252. t.Zhedescendercyrillic = 0x0496;
  12253. t.Zhedieresiscyrillic = 0x04dc;
  12254. t.Zlinebelow = 0x1e94;
  12255. t.Zmonospace = 0xff3a;
  12256. t.Zsmall = 0xf77a;
  12257. t.Zstroke = 0x01b5;
  12258. t.a = 0x0061;
  12259. t.aabengali = 0x0986;
  12260. t.aacute = 0x00e1;
  12261. t.aadeva = 0x0906;
  12262. t.aagujarati = 0x0a86;
  12263. t.aagurmukhi = 0x0a06;
  12264. t.aamatragurmukhi = 0x0a3e;
  12265. t.aarusquare = 0x3303;
  12266. t.aavowelsignbengali = 0x09be;
  12267. t.aavowelsigndeva = 0x093e;
  12268. t.aavowelsigngujarati = 0x0abe;
  12269. t.abbreviationmarkarmenian = 0x055f;
  12270. t.abbreviationsigndeva = 0x0970;
  12271. t.abengali = 0x0985;
  12272. t.abopomofo = 0x311a;
  12273. t.abreve = 0x0103;
  12274. t.abreveacute = 0x1eaf;
  12275. t.abrevecyrillic = 0x04d1;
  12276. t.abrevedotbelow = 0x1eb7;
  12277. t.abrevegrave = 0x1eb1;
  12278. t.abrevehookabove = 0x1eb3;
  12279. t.abrevetilde = 0x1eb5;
  12280. t.acaron = 0x01ce;
  12281. t.acircle = 0x24d0;
  12282. t.acircumflex = 0x00e2;
  12283. t.acircumflexacute = 0x1ea5;
  12284. t.acircumflexdotbelow = 0x1ead;
  12285. t.acircumflexgrave = 0x1ea7;
  12286. t.acircumflexhookabove = 0x1ea9;
  12287. t.acircumflextilde = 0x1eab;
  12288. t.acute = 0x00b4;
  12289. t.acutebelowcmb = 0x0317;
  12290. t.acutecmb = 0x0301;
  12291. t.acutecomb = 0x0301;
  12292. t.acutedeva = 0x0954;
  12293. t.acutelowmod = 0x02cf;
  12294. t.acutetonecmb = 0x0341;
  12295. t.acyrillic = 0x0430;
  12296. t.adblgrave = 0x0201;
  12297. t.addakgurmukhi = 0x0a71;
  12298. t.adeva = 0x0905;
  12299. t.adieresis = 0x00e4;
  12300. t.adieresiscyrillic = 0x04d3;
  12301. t.adieresismacron = 0x01df;
  12302. t.adotbelow = 0x1ea1;
  12303. t.adotmacron = 0x01e1;
  12304. t.ae = 0x00e6;
  12305. t.aeacute = 0x01fd;
  12306. t.aekorean = 0x3150;
  12307. t.aemacron = 0x01e3;
  12308. t.afii00208 = 0x2015;
  12309. t.afii08941 = 0x20a4;
  12310. t.afii10017 = 0x0410;
  12311. t.afii10018 = 0x0411;
  12312. t.afii10019 = 0x0412;
  12313. t.afii10020 = 0x0413;
  12314. t.afii10021 = 0x0414;
  12315. t.afii10022 = 0x0415;
  12316. t.afii10023 = 0x0401;
  12317. t.afii10024 = 0x0416;
  12318. t.afii10025 = 0x0417;
  12319. t.afii10026 = 0x0418;
  12320. t.afii10027 = 0x0419;
  12321. t.afii10028 = 0x041a;
  12322. t.afii10029 = 0x041b;
  12323. t.afii10030 = 0x041c;
  12324. t.afii10031 = 0x041d;
  12325. t.afii10032 = 0x041e;
  12326. t.afii10033 = 0x041f;
  12327. t.afii10034 = 0x0420;
  12328. t.afii10035 = 0x0421;
  12329. t.afii10036 = 0x0422;
  12330. t.afii10037 = 0x0423;
  12331. t.afii10038 = 0x0424;
  12332. t.afii10039 = 0x0425;
  12333. t.afii10040 = 0x0426;
  12334. t.afii10041 = 0x0427;
  12335. t.afii10042 = 0x0428;
  12336. t.afii10043 = 0x0429;
  12337. t.afii10044 = 0x042a;
  12338. t.afii10045 = 0x042b;
  12339. t.afii10046 = 0x042c;
  12340. t.afii10047 = 0x042d;
  12341. t.afii10048 = 0x042e;
  12342. t.afii10049 = 0x042f;
  12343. t.afii10050 = 0x0490;
  12344. t.afii10051 = 0x0402;
  12345. t.afii10052 = 0x0403;
  12346. t.afii10053 = 0x0404;
  12347. t.afii10054 = 0x0405;
  12348. t.afii10055 = 0x0406;
  12349. t.afii10056 = 0x0407;
  12350. t.afii10057 = 0x0408;
  12351. t.afii10058 = 0x0409;
  12352. t.afii10059 = 0x040a;
  12353. t.afii10060 = 0x040b;
  12354. t.afii10061 = 0x040c;
  12355. t.afii10062 = 0x040e;
  12356. t.afii10063 = 0xf6c4;
  12357. t.afii10064 = 0xf6c5;
  12358. t.afii10065 = 0x0430;
  12359. t.afii10066 = 0x0431;
  12360. t.afii10067 = 0x0432;
  12361. t.afii10068 = 0x0433;
  12362. t.afii10069 = 0x0434;
  12363. t.afii10070 = 0x0435;
  12364. t.afii10071 = 0x0451;
  12365. t.afii10072 = 0x0436;
  12366. t.afii10073 = 0x0437;
  12367. t.afii10074 = 0x0438;
  12368. t.afii10075 = 0x0439;
  12369. t.afii10076 = 0x043a;
  12370. t.afii10077 = 0x043b;
  12371. t.afii10078 = 0x043c;
  12372. t.afii10079 = 0x043d;
  12373. t.afii10080 = 0x043e;
  12374. t.afii10081 = 0x043f;
  12375. t.afii10082 = 0x0440;
  12376. t.afii10083 = 0x0441;
  12377. t.afii10084 = 0x0442;
  12378. t.afii10085 = 0x0443;
  12379. t.afii10086 = 0x0444;
  12380. t.afii10087 = 0x0445;
  12381. t.afii10088 = 0x0446;
  12382. t.afii10089 = 0x0447;
  12383. t.afii10090 = 0x0448;
  12384. t.afii10091 = 0x0449;
  12385. t.afii10092 = 0x044a;
  12386. t.afii10093 = 0x044b;
  12387. t.afii10094 = 0x044c;
  12388. t.afii10095 = 0x044d;
  12389. t.afii10096 = 0x044e;
  12390. t.afii10097 = 0x044f;
  12391. t.afii10098 = 0x0491;
  12392. t.afii10099 = 0x0452;
  12393. t.afii10100 = 0x0453;
  12394. t.afii10101 = 0x0454;
  12395. t.afii10102 = 0x0455;
  12396. t.afii10103 = 0x0456;
  12397. t.afii10104 = 0x0457;
  12398. t.afii10105 = 0x0458;
  12399. t.afii10106 = 0x0459;
  12400. t.afii10107 = 0x045a;
  12401. t.afii10108 = 0x045b;
  12402. t.afii10109 = 0x045c;
  12403. t.afii10110 = 0x045e;
  12404. t.afii10145 = 0x040f;
  12405. t.afii10146 = 0x0462;
  12406. t.afii10147 = 0x0472;
  12407. t.afii10148 = 0x0474;
  12408. t.afii10192 = 0xf6c6;
  12409. t.afii10193 = 0x045f;
  12410. t.afii10194 = 0x0463;
  12411. t.afii10195 = 0x0473;
  12412. t.afii10196 = 0x0475;
  12413. t.afii10831 = 0xf6c7;
  12414. t.afii10832 = 0xf6c8;
  12415. t.afii10846 = 0x04d9;
  12416. t.afii299 = 0x200e;
  12417. t.afii300 = 0x200f;
  12418. t.afii301 = 0x200d;
  12419. t.afii57381 = 0x066a;
  12420. t.afii57388 = 0x060c;
  12421. t.afii57392 = 0x0660;
  12422. t.afii57393 = 0x0661;
  12423. t.afii57394 = 0x0662;
  12424. t.afii57395 = 0x0663;
  12425. t.afii57396 = 0x0664;
  12426. t.afii57397 = 0x0665;
  12427. t.afii57398 = 0x0666;
  12428. t.afii57399 = 0x0667;
  12429. t.afii57400 = 0x0668;
  12430. t.afii57401 = 0x0669;
  12431. t.afii57403 = 0x061b;
  12432. t.afii57407 = 0x061f;
  12433. t.afii57409 = 0x0621;
  12434. t.afii57410 = 0x0622;
  12435. t.afii57411 = 0x0623;
  12436. t.afii57412 = 0x0624;
  12437. t.afii57413 = 0x0625;
  12438. t.afii57414 = 0x0626;
  12439. t.afii57415 = 0x0627;
  12440. t.afii57416 = 0x0628;
  12441. t.afii57417 = 0x0629;
  12442. t.afii57418 = 0x062a;
  12443. t.afii57419 = 0x062b;
  12444. t.afii57420 = 0x062c;
  12445. t.afii57421 = 0x062d;
  12446. t.afii57422 = 0x062e;
  12447. t.afii57423 = 0x062f;
  12448. t.afii57424 = 0x0630;
  12449. t.afii57425 = 0x0631;
  12450. t.afii57426 = 0x0632;
  12451. t.afii57427 = 0x0633;
  12452. t.afii57428 = 0x0634;
  12453. t.afii57429 = 0x0635;
  12454. t.afii57430 = 0x0636;
  12455. t.afii57431 = 0x0637;
  12456. t.afii57432 = 0x0638;
  12457. t.afii57433 = 0x0639;
  12458. t.afii57434 = 0x063a;
  12459. t.afii57440 = 0x0640;
  12460. t.afii57441 = 0x0641;
  12461. t.afii57442 = 0x0642;
  12462. t.afii57443 = 0x0643;
  12463. t.afii57444 = 0x0644;
  12464. t.afii57445 = 0x0645;
  12465. t.afii57446 = 0x0646;
  12466. t.afii57448 = 0x0648;
  12467. t.afii57449 = 0x0649;
  12468. t.afii57450 = 0x064a;
  12469. t.afii57451 = 0x064b;
  12470. t.afii57452 = 0x064c;
  12471. t.afii57453 = 0x064d;
  12472. t.afii57454 = 0x064e;
  12473. t.afii57455 = 0x064f;
  12474. t.afii57456 = 0x0650;
  12475. t.afii57457 = 0x0651;
  12476. t.afii57458 = 0x0652;
  12477. t.afii57470 = 0x0647;
  12478. t.afii57505 = 0x06a4;
  12479. t.afii57506 = 0x067e;
  12480. t.afii57507 = 0x0686;
  12481. t.afii57508 = 0x0698;
  12482. t.afii57509 = 0x06af;
  12483. t.afii57511 = 0x0679;
  12484. t.afii57512 = 0x0688;
  12485. t.afii57513 = 0x0691;
  12486. t.afii57514 = 0x06ba;
  12487. t.afii57519 = 0x06d2;
  12488. t.afii57534 = 0x06d5;
  12489. t.afii57636 = 0x20aa;
  12490. t.afii57645 = 0x05be;
  12491. t.afii57658 = 0x05c3;
  12492. t.afii57664 = 0x05d0;
  12493. t.afii57665 = 0x05d1;
  12494. t.afii57666 = 0x05d2;
  12495. t.afii57667 = 0x05d3;
  12496. t.afii57668 = 0x05d4;
  12497. t.afii57669 = 0x05d5;
  12498. t.afii57670 = 0x05d6;
  12499. t.afii57671 = 0x05d7;
  12500. t.afii57672 = 0x05d8;
  12501. t.afii57673 = 0x05d9;
  12502. t.afii57674 = 0x05da;
  12503. t.afii57675 = 0x05db;
  12504. t.afii57676 = 0x05dc;
  12505. t.afii57677 = 0x05dd;
  12506. t.afii57678 = 0x05de;
  12507. t.afii57679 = 0x05df;
  12508. t.afii57680 = 0x05e0;
  12509. t.afii57681 = 0x05e1;
  12510. t.afii57682 = 0x05e2;
  12511. t.afii57683 = 0x05e3;
  12512. t.afii57684 = 0x05e4;
  12513. t.afii57685 = 0x05e5;
  12514. t.afii57686 = 0x05e6;
  12515. t.afii57687 = 0x05e7;
  12516. t.afii57688 = 0x05e8;
  12517. t.afii57689 = 0x05e9;
  12518. t.afii57690 = 0x05ea;
  12519. t.afii57694 = 0xfb2a;
  12520. t.afii57695 = 0xfb2b;
  12521. t.afii57700 = 0xfb4b;
  12522. t.afii57705 = 0xfb1f;
  12523. t.afii57716 = 0x05f0;
  12524. t.afii57717 = 0x05f1;
  12525. t.afii57718 = 0x05f2;
  12526. t.afii57723 = 0xfb35;
  12527. t.afii57793 = 0x05b4;
  12528. t.afii57794 = 0x05b5;
  12529. t.afii57795 = 0x05b6;
  12530. t.afii57796 = 0x05bb;
  12531. t.afii57797 = 0x05b8;
  12532. t.afii57798 = 0x05b7;
  12533. t.afii57799 = 0x05b0;
  12534. t.afii57800 = 0x05b2;
  12535. t.afii57801 = 0x05b1;
  12536. t.afii57802 = 0x05b3;
  12537. t.afii57803 = 0x05c2;
  12538. t.afii57804 = 0x05c1;
  12539. t.afii57806 = 0x05b9;
  12540. t.afii57807 = 0x05bc;
  12541. t.afii57839 = 0x05bd;
  12542. t.afii57841 = 0x05bf;
  12543. t.afii57842 = 0x05c0;
  12544. t.afii57929 = 0x02bc;
  12545. t.afii61248 = 0x2105;
  12546. t.afii61289 = 0x2113;
  12547. t.afii61352 = 0x2116;
  12548. t.afii61573 = 0x202c;
  12549. t.afii61574 = 0x202d;
  12550. t.afii61575 = 0x202e;
  12551. t.afii61664 = 0x200c;
  12552. t.afii63167 = 0x066d;
  12553. t.afii64937 = 0x02bd;
  12554. t.agrave = 0x00e0;
  12555. t.agujarati = 0x0a85;
  12556. t.agurmukhi = 0x0a05;
  12557. t.ahiragana = 0x3042;
  12558. t.ahookabove = 0x1ea3;
  12559. t.aibengali = 0x0990;
  12560. t.aibopomofo = 0x311e;
  12561. t.aideva = 0x0910;
  12562. t.aiecyrillic = 0x04d5;
  12563. t.aigujarati = 0x0a90;
  12564. t.aigurmukhi = 0x0a10;
  12565. t.aimatragurmukhi = 0x0a48;
  12566. t.ainarabic = 0x0639;
  12567. t.ainfinalarabic = 0xfeca;
  12568. t.aininitialarabic = 0xfecb;
  12569. t.ainmedialarabic = 0xfecc;
  12570. t.ainvertedbreve = 0x0203;
  12571. t.aivowelsignbengali = 0x09c8;
  12572. t.aivowelsigndeva = 0x0948;
  12573. t.aivowelsigngujarati = 0x0ac8;
  12574. t.akatakana = 0x30a2;
  12575. t.akatakanahalfwidth = 0xff71;
  12576. t.akorean = 0x314f;
  12577. t.alef = 0x05d0;
  12578. t.alefarabic = 0x0627;
  12579. t.alefdageshhebrew = 0xfb30;
  12580. t.aleffinalarabic = 0xfe8e;
  12581. t.alefhamzaabovearabic = 0x0623;
  12582. t.alefhamzaabovefinalarabic = 0xfe84;
  12583. t.alefhamzabelowarabic = 0x0625;
  12584. t.alefhamzabelowfinalarabic = 0xfe88;
  12585. t.alefhebrew = 0x05d0;
  12586. t.aleflamedhebrew = 0xfb4f;
  12587. t.alefmaddaabovearabic = 0x0622;
  12588. t.alefmaddaabovefinalarabic = 0xfe82;
  12589. t.alefmaksuraarabic = 0x0649;
  12590. t.alefmaksurafinalarabic = 0xfef0;
  12591. t.alefmaksurainitialarabic = 0xfef3;
  12592. t.alefmaksuramedialarabic = 0xfef4;
  12593. t.alefpatahhebrew = 0xfb2e;
  12594. t.alefqamatshebrew = 0xfb2f;
  12595. t.aleph = 0x2135;
  12596. t.allequal = 0x224c;
  12597. t.alpha = 0x03b1;
  12598. t.alphatonos = 0x03ac;
  12599. t.amacron = 0x0101;
  12600. t.amonospace = 0xff41;
  12601. t.ampersand = 0x0026;
  12602. t.ampersandmonospace = 0xff06;
  12603. t.ampersandsmall = 0xf726;
  12604. t.amsquare = 0x33c2;
  12605. t.anbopomofo = 0x3122;
  12606. t.angbopomofo = 0x3124;
  12607. t.angbracketleft = 0x3008;
  12608. t.angbracketright = 0x3009;
  12609. t.angkhankhuthai = 0x0e5a;
  12610. t.angle = 0x2220;
  12611. t.anglebracketleft = 0x3008;
  12612. t.anglebracketleftvertical = 0xfe3f;
  12613. t.anglebracketright = 0x3009;
  12614. t.anglebracketrightvertical = 0xfe40;
  12615. t.angleleft = 0x2329;
  12616. t.angleright = 0x232a;
  12617. t.angstrom = 0x212b;
  12618. t.anoteleia = 0x0387;
  12619. t.anudattadeva = 0x0952;
  12620. t.anusvarabengali = 0x0982;
  12621. t.anusvaradeva = 0x0902;
  12622. t.anusvaragujarati = 0x0a82;
  12623. t.aogonek = 0x0105;
  12624. t.apaatosquare = 0x3300;
  12625. t.aparen = 0x249c;
  12626. t.apostrophearmenian = 0x055a;
  12627. t.apostrophemod = 0x02bc;
  12628. t.apple = 0xf8ff;
  12629. t.approaches = 0x2250;
  12630. t.approxequal = 0x2248;
  12631. t.approxequalorimage = 0x2252;
  12632. t.approximatelyequal = 0x2245;
  12633. t.araeaekorean = 0x318e;
  12634. t.araeakorean = 0x318d;
  12635. t.arc = 0x2312;
  12636. t.arighthalfring = 0x1e9a;
  12637. t.aring = 0x00e5;
  12638. t.aringacute = 0x01fb;
  12639. t.aringbelow = 0x1e01;
  12640. t.arrowboth = 0x2194;
  12641. t.arrowdashdown = 0x21e3;
  12642. t.arrowdashleft = 0x21e0;
  12643. t.arrowdashright = 0x21e2;
  12644. t.arrowdashup = 0x21e1;
  12645. t.arrowdblboth = 0x21d4;
  12646. t.arrowdbldown = 0x21d3;
  12647. t.arrowdblleft = 0x21d0;
  12648. t.arrowdblright = 0x21d2;
  12649. t.arrowdblup = 0x21d1;
  12650. t.arrowdown = 0x2193;
  12651. t.arrowdownleft = 0x2199;
  12652. t.arrowdownright = 0x2198;
  12653. t.arrowdownwhite = 0x21e9;
  12654. t.arrowheaddownmod = 0x02c5;
  12655. t.arrowheadleftmod = 0x02c2;
  12656. t.arrowheadrightmod = 0x02c3;
  12657. t.arrowheadupmod = 0x02c4;
  12658. t.arrowhorizex = 0xf8e7;
  12659. t.arrowleft = 0x2190;
  12660. t.arrowleftdbl = 0x21d0;
  12661. t.arrowleftdblstroke = 0x21cd;
  12662. t.arrowleftoverright = 0x21c6;
  12663. t.arrowleftwhite = 0x21e6;
  12664. t.arrowright = 0x2192;
  12665. t.arrowrightdblstroke = 0x21cf;
  12666. t.arrowrightheavy = 0x279e;
  12667. t.arrowrightoverleft = 0x21c4;
  12668. t.arrowrightwhite = 0x21e8;
  12669. t.arrowtableft = 0x21e4;
  12670. t.arrowtabright = 0x21e5;
  12671. t.arrowup = 0x2191;
  12672. t.arrowupdn = 0x2195;
  12673. t.arrowupdnbse = 0x21a8;
  12674. t.arrowupdownbase = 0x21a8;
  12675. t.arrowupleft = 0x2196;
  12676. t.arrowupleftofdown = 0x21c5;
  12677. t.arrowupright = 0x2197;
  12678. t.arrowupwhite = 0x21e7;
  12679. t.arrowvertex = 0xf8e6;
  12680. t.asciicircum = 0x005e;
  12681. t.asciicircummonospace = 0xff3e;
  12682. t.asciitilde = 0x007e;
  12683. t.asciitildemonospace = 0xff5e;
  12684. t.ascript = 0x0251;
  12685. t.ascriptturned = 0x0252;
  12686. t.asmallhiragana = 0x3041;
  12687. t.asmallkatakana = 0x30a1;
  12688. t.asmallkatakanahalfwidth = 0xff67;
  12689. t.asterisk = 0x002a;
  12690. t.asteriskaltonearabic = 0x066d;
  12691. t.asteriskarabic = 0x066d;
  12692. t.asteriskmath = 0x2217;
  12693. t.asteriskmonospace = 0xff0a;
  12694. t.asterisksmall = 0xfe61;
  12695. t.asterism = 0x2042;
  12696. t.asuperior = 0xf6e9;
  12697. t.asymptoticallyequal = 0x2243;
  12698. t.at = 0x0040;
  12699. t.atilde = 0x00e3;
  12700. t.atmonospace = 0xff20;
  12701. t.atsmall = 0xfe6b;
  12702. t.aturned = 0x0250;
  12703. t.aubengali = 0x0994;
  12704. t.aubopomofo = 0x3120;
  12705. t.audeva = 0x0914;
  12706. t.augujarati = 0x0a94;
  12707. t.augurmukhi = 0x0a14;
  12708. t.aulengthmarkbengali = 0x09d7;
  12709. t.aumatragurmukhi = 0x0a4c;
  12710. t.auvowelsignbengali = 0x09cc;
  12711. t.auvowelsigndeva = 0x094c;
  12712. t.auvowelsigngujarati = 0x0acc;
  12713. t.avagrahadeva = 0x093d;
  12714. t.aybarmenian = 0x0561;
  12715. t.ayin = 0x05e2;
  12716. t.ayinaltonehebrew = 0xfb20;
  12717. t.ayinhebrew = 0x05e2;
  12718. t.b = 0x0062;
  12719. t.babengali = 0x09ac;
  12720. t.backslash = 0x005c;
  12721. t.backslashmonospace = 0xff3c;
  12722. t.badeva = 0x092c;
  12723. t.bagujarati = 0x0aac;
  12724. t.bagurmukhi = 0x0a2c;
  12725. t.bahiragana = 0x3070;
  12726. t.bahtthai = 0x0e3f;
  12727. t.bakatakana = 0x30d0;
  12728. t.bar = 0x007c;
  12729. t.barmonospace = 0xff5c;
  12730. t.bbopomofo = 0x3105;
  12731. t.bcircle = 0x24d1;
  12732. t.bdotaccent = 0x1e03;
  12733. t.bdotbelow = 0x1e05;
  12734. t.beamedsixteenthnotes = 0x266c;
  12735. t.because = 0x2235;
  12736. t.becyrillic = 0x0431;
  12737. t.beharabic = 0x0628;
  12738. t.behfinalarabic = 0xfe90;
  12739. t.behinitialarabic = 0xfe91;
  12740. t.behiragana = 0x3079;
  12741. t.behmedialarabic = 0xfe92;
  12742. t.behmeeminitialarabic = 0xfc9f;
  12743. t.behmeemisolatedarabic = 0xfc08;
  12744. t.behnoonfinalarabic = 0xfc6d;
  12745. t.bekatakana = 0x30d9;
  12746. t.benarmenian = 0x0562;
  12747. t.bet = 0x05d1;
  12748. t.beta = 0x03b2;
  12749. t.betasymbolgreek = 0x03d0;
  12750. t.betdagesh = 0xfb31;
  12751. t.betdageshhebrew = 0xfb31;
  12752. t.bethebrew = 0x05d1;
  12753. t.betrafehebrew = 0xfb4c;
  12754. t.bhabengali = 0x09ad;
  12755. t.bhadeva = 0x092d;
  12756. t.bhagujarati = 0x0aad;
  12757. t.bhagurmukhi = 0x0a2d;
  12758. t.bhook = 0x0253;
  12759. t.bihiragana = 0x3073;
  12760. t.bikatakana = 0x30d3;
  12761. t.bilabialclick = 0x0298;
  12762. t.bindigurmukhi = 0x0a02;
  12763. t.birusquare = 0x3331;
  12764. t.blackcircle = 0x25cf;
  12765. t.blackdiamond = 0x25c6;
  12766. t.blackdownpointingtriangle = 0x25bc;
  12767. t.blackleftpointingpointer = 0x25c4;
  12768. t.blackleftpointingtriangle = 0x25c0;
  12769. t.blacklenticularbracketleft = 0x3010;
  12770. t.blacklenticularbracketleftvertical = 0xfe3b;
  12771. t.blacklenticularbracketright = 0x3011;
  12772. t.blacklenticularbracketrightvertical = 0xfe3c;
  12773. t.blacklowerlefttriangle = 0x25e3;
  12774. t.blacklowerrighttriangle = 0x25e2;
  12775. t.blackrectangle = 0x25ac;
  12776. t.blackrightpointingpointer = 0x25ba;
  12777. t.blackrightpointingtriangle = 0x25b6;
  12778. t.blacksmallsquare = 0x25aa;
  12779. t.blacksmilingface = 0x263b;
  12780. t.blacksquare = 0x25a0;
  12781. t.blackstar = 0x2605;
  12782. t.blackupperlefttriangle = 0x25e4;
  12783. t.blackupperrighttriangle = 0x25e5;
  12784. t.blackuppointingsmalltriangle = 0x25b4;
  12785. t.blackuppointingtriangle = 0x25b2;
  12786. t.blank = 0x2423;
  12787. t.blinebelow = 0x1e07;
  12788. t.block = 0x2588;
  12789. t.bmonospace = 0xff42;
  12790. t.bobaimaithai = 0x0e1a;
  12791. t.bohiragana = 0x307c;
  12792. t.bokatakana = 0x30dc;
  12793. t.bparen = 0x249d;
  12794. t.bqsquare = 0x33c3;
  12795. t.braceex = 0xf8f4;
  12796. t.braceleft = 0x007b;
  12797. t.braceleftbt = 0xf8f3;
  12798. t.braceleftmid = 0xf8f2;
  12799. t.braceleftmonospace = 0xff5b;
  12800. t.braceleftsmall = 0xfe5b;
  12801. t.bracelefttp = 0xf8f1;
  12802. t.braceleftvertical = 0xfe37;
  12803. t.braceright = 0x007d;
  12804. t.bracerightbt = 0xf8fe;
  12805. t.bracerightmid = 0xf8fd;
  12806. t.bracerightmonospace = 0xff5d;
  12807. t.bracerightsmall = 0xfe5c;
  12808. t.bracerighttp = 0xf8fc;
  12809. t.bracerightvertical = 0xfe38;
  12810. t.bracketleft = 0x005b;
  12811. t.bracketleftbt = 0xf8f0;
  12812. t.bracketleftex = 0xf8ef;
  12813. t.bracketleftmonospace = 0xff3b;
  12814. t.bracketlefttp = 0xf8ee;
  12815. t.bracketright = 0x005d;
  12816. t.bracketrightbt = 0xf8fb;
  12817. t.bracketrightex = 0xf8fa;
  12818. t.bracketrightmonospace = 0xff3d;
  12819. t.bracketrighttp = 0xf8f9;
  12820. t.breve = 0x02d8;
  12821. t.brevebelowcmb = 0x032e;
  12822. t.brevecmb = 0x0306;
  12823. t.breveinvertedbelowcmb = 0x032f;
  12824. t.breveinvertedcmb = 0x0311;
  12825. t.breveinverteddoublecmb = 0x0361;
  12826. t.bridgebelowcmb = 0x032a;
  12827. t.bridgeinvertedbelowcmb = 0x033a;
  12828. t.brokenbar = 0x00a6;
  12829. t.bstroke = 0x0180;
  12830. t.bsuperior = 0xf6ea;
  12831. t.btopbar = 0x0183;
  12832. t.buhiragana = 0x3076;
  12833. t.bukatakana = 0x30d6;
  12834. t.bullet = 0x2022;
  12835. t.bulletinverse = 0x25d8;
  12836. t.bulletoperator = 0x2219;
  12837. t.bullseye = 0x25ce;
  12838. t.c = 0x0063;
  12839. t.caarmenian = 0x056e;
  12840. t.cabengali = 0x099a;
  12841. t.cacute = 0x0107;
  12842. t.cadeva = 0x091a;
  12843. t.cagujarati = 0x0a9a;
  12844. t.cagurmukhi = 0x0a1a;
  12845. t.calsquare = 0x3388;
  12846. t.candrabindubengali = 0x0981;
  12847. t.candrabinducmb = 0x0310;
  12848. t.candrabindudeva = 0x0901;
  12849. t.candrabindugujarati = 0x0a81;
  12850. t.capslock = 0x21ea;
  12851. t.careof = 0x2105;
  12852. t.caron = 0x02c7;
  12853. t.caronbelowcmb = 0x032c;
  12854. t.caroncmb = 0x030c;
  12855. t.carriagereturn = 0x21b5;
  12856. t.cbopomofo = 0x3118;
  12857. t.ccaron = 0x010d;
  12858. t.ccedilla = 0x00e7;
  12859. t.ccedillaacute = 0x1e09;
  12860. t.ccircle = 0x24d2;
  12861. t.ccircumflex = 0x0109;
  12862. t.ccurl = 0x0255;
  12863. t.cdot = 0x010b;
  12864. t.cdotaccent = 0x010b;
  12865. t.cdsquare = 0x33c5;
  12866. t.cedilla = 0x00b8;
  12867. t.cedillacmb = 0x0327;
  12868. t.cent = 0x00a2;
  12869. t.centigrade = 0x2103;
  12870. t.centinferior = 0xf6df;
  12871. t.centmonospace = 0xffe0;
  12872. t.centoldstyle = 0xf7a2;
  12873. t.centsuperior = 0xf6e0;
  12874. t.chaarmenian = 0x0579;
  12875. t.chabengali = 0x099b;
  12876. t.chadeva = 0x091b;
  12877. t.chagujarati = 0x0a9b;
  12878. t.chagurmukhi = 0x0a1b;
  12879. t.chbopomofo = 0x3114;
  12880. t.cheabkhasiancyrillic = 0x04bd;
  12881. t.checkmark = 0x2713;
  12882. t.checyrillic = 0x0447;
  12883. t.chedescenderabkhasiancyrillic = 0x04bf;
  12884. t.chedescendercyrillic = 0x04b7;
  12885. t.chedieresiscyrillic = 0x04f5;
  12886. t.cheharmenian = 0x0573;
  12887. t.chekhakassiancyrillic = 0x04cc;
  12888. t.cheverticalstrokecyrillic = 0x04b9;
  12889. t.chi = 0x03c7;
  12890. t.chieuchacirclekorean = 0x3277;
  12891. t.chieuchaparenkorean = 0x3217;
  12892. t.chieuchcirclekorean = 0x3269;
  12893. t.chieuchkorean = 0x314a;
  12894. t.chieuchparenkorean = 0x3209;
  12895. t.chochangthai = 0x0e0a;
  12896. t.chochanthai = 0x0e08;
  12897. t.chochingthai = 0x0e09;
  12898. t.chochoethai = 0x0e0c;
  12899. t.chook = 0x0188;
  12900. t.cieucacirclekorean = 0x3276;
  12901. t.cieucaparenkorean = 0x3216;
  12902. t.cieuccirclekorean = 0x3268;
  12903. t.cieuckorean = 0x3148;
  12904. t.cieucparenkorean = 0x3208;
  12905. t.cieucuparenkorean = 0x321c;
  12906. t.circle = 0x25cb;
  12907. t.circlecopyrt = 0x00a9;
  12908. t.circlemultiply = 0x2297;
  12909. t.circleot = 0x2299;
  12910. t.circleplus = 0x2295;
  12911. t.circlepostalmark = 0x3036;
  12912. t.circlewithlefthalfblack = 0x25d0;
  12913. t.circlewithrighthalfblack = 0x25d1;
  12914. t.circumflex = 0x02c6;
  12915. t.circumflexbelowcmb = 0x032d;
  12916. t.circumflexcmb = 0x0302;
  12917. t.clear = 0x2327;
  12918. t.clickalveolar = 0x01c2;
  12919. t.clickdental = 0x01c0;
  12920. t.clicklateral = 0x01c1;
  12921. t.clickretroflex = 0x01c3;
  12922. t.club = 0x2663;
  12923. t.clubsuitblack = 0x2663;
  12924. t.clubsuitwhite = 0x2667;
  12925. t.cmcubedsquare = 0x33a4;
  12926. t.cmonospace = 0xff43;
  12927. t.cmsquaredsquare = 0x33a0;
  12928. t.coarmenian = 0x0581;
  12929. t.colon = 0x003a;
  12930. t.colonmonetary = 0x20a1;
  12931. t.colonmonospace = 0xff1a;
  12932. t.colonsign = 0x20a1;
  12933. t.colonsmall = 0xfe55;
  12934. t.colontriangularhalfmod = 0x02d1;
  12935. t.colontriangularmod = 0x02d0;
  12936. t.comma = 0x002c;
  12937. t.commaabovecmb = 0x0313;
  12938. t.commaaboverightcmb = 0x0315;
  12939. t.commaaccent = 0xf6c3;
  12940. t.commaarabic = 0x060c;
  12941. t.commaarmenian = 0x055d;
  12942. t.commainferior = 0xf6e1;
  12943. t.commamonospace = 0xff0c;
  12944. t.commareversedabovecmb = 0x0314;
  12945. t.commareversedmod = 0x02bd;
  12946. t.commasmall = 0xfe50;
  12947. t.commasuperior = 0xf6e2;
  12948. t.commaturnedabovecmb = 0x0312;
  12949. t.commaturnedmod = 0x02bb;
  12950. t.compass = 0x263c;
  12951. t.congruent = 0x2245;
  12952. t.contourintegral = 0x222e;
  12953. t.control = 0x2303;
  12954. t.controlACK = 0x0006;
  12955. t.controlBEL = 0x0007;
  12956. t.controlBS = 0x0008;
  12957. t.controlCAN = 0x0018;
  12958. t.controlCR = 0x000d;
  12959. t.controlDC1 = 0x0011;
  12960. t.controlDC2 = 0x0012;
  12961. t.controlDC3 = 0x0013;
  12962. t.controlDC4 = 0x0014;
  12963. t.controlDEL = 0x007f;
  12964. t.controlDLE = 0x0010;
  12965. t.controlEM = 0x0019;
  12966. t.controlENQ = 0x0005;
  12967. t.controlEOT = 0x0004;
  12968. t.controlESC = 0x001b;
  12969. t.controlETB = 0x0017;
  12970. t.controlETX = 0x0003;
  12971. t.controlFF = 0x000c;
  12972. t.controlFS = 0x001c;
  12973. t.controlGS = 0x001d;
  12974. t.controlHT = 0x0009;
  12975. t.controlLF = 0x000a;
  12976. t.controlNAK = 0x0015;
  12977. t.controlNULL = 0x0000;
  12978. t.controlRS = 0x001e;
  12979. t.controlSI = 0x000f;
  12980. t.controlSO = 0x000e;
  12981. t.controlSOT = 0x0002;
  12982. t.controlSTX = 0x0001;
  12983. t.controlSUB = 0x001a;
  12984. t.controlSYN = 0x0016;
  12985. t.controlUS = 0x001f;
  12986. t.controlVT = 0x000b;
  12987. t.copyright = 0x00a9;
  12988. t.copyrightsans = 0xf8e9;
  12989. t.copyrightserif = 0xf6d9;
  12990. t.cornerbracketleft = 0x300c;
  12991. t.cornerbracketlefthalfwidth = 0xff62;
  12992. t.cornerbracketleftvertical = 0xfe41;
  12993. t.cornerbracketright = 0x300d;
  12994. t.cornerbracketrighthalfwidth = 0xff63;
  12995. t.cornerbracketrightvertical = 0xfe42;
  12996. t.corporationsquare = 0x337f;
  12997. t.cosquare = 0x33c7;
  12998. t.coverkgsquare = 0x33c6;
  12999. t.cparen = 0x249e;
  13000. t.cruzeiro = 0x20a2;
  13001. t.cstretched = 0x0297;
  13002. t.curlyand = 0x22cf;
  13003. t.curlyor = 0x22ce;
  13004. t.currency = 0x00a4;
  13005. t.cyrBreve = 0xf6d1;
  13006. t.cyrFlex = 0xf6d2;
  13007. t.cyrbreve = 0xf6d4;
  13008. t.cyrflex = 0xf6d5;
  13009. t.d = 0x0064;
  13010. t.daarmenian = 0x0564;
  13011. t.dabengali = 0x09a6;
  13012. t.dadarabic = 0x0636;
  13013. t.dadeva = 0x0926;
  13014. t.dadfinalarabic = 0xfebe;
  13015. t.dadinitialarabic = 0xfebf;
  13016. t.dadmedialarabic = 0xfec0;
  13017. t.dagesh = 0x05bc;
  13018. t.dageshhebrew = 0x05bc;
  13019. t.dagger = 0x2020;
  13020. t.daggerdbl = 0x2021;
  13021. t.dagujarati = 0x0aa6;
  13022. t.dagurmukhi = 0x0a26;
  13023. t.dahiragana = 0x3060;
  13024. t.dakatakana = 0x30c0;
  13025. t.dalarabic = 0x062f;
  13026. t.dalet = 0x05d3;
  13027. t.daletdagesh = 0xfb33;
  13028. t.daletdageshhebrew = 0xfb33;
  13029. t.dalethebrew = 0x05d3;
  13030. t.dalfinalarabic = 0xfeaa;
  13031. t.dammaarabic = 0x064f;
  13032. t.dammalowarabic = 0x064f;
  13033. t.dammatanaltonearabic = 0x064c;
  13034. t.dammatanarabic = 0x064c;
  13035. t.danda = 0x0964;
  13036. t.dargahebrew = 0x05a7;
  13037. t.dargalefthebrew = 0x05a7;
  13038. t.dasiapneumatacyrilliccmb = 0x0485;
  13039. t.dblGrave = 0xf6d3;
  13040. t.dblanglebracketleft = 0x300a;
  13041. t.dblanglebracketleftvertical = 0xfe3d;
  13042. t.dblanglebracketright = 0x300b;
  13043. t.dblanglebracketrightvertical = 0xfe3e;
  13044. t.dblarchinvertedbelowcmb = 0x032b;
  13045. t.dblarrowleft = 0x21d4;
  13046. t.dblarrowright = 0x21d2;
  13047. t.dbldanda = 0x0965;
  13048. t.dblgrave = 0xf6d6;
  13049. t.dblgravecmb = 0x030f;
  13050. t.dblintegral = 0x222c;
  13051. t.dbllowline = 0x2017;
  13052. t.dbllowlinecmb = 0x0333;
  13053. t.dbloverlinecmb = 0x033f;
  13054. t.dblprimemod = 0x02ba;
  13055. t.dblverticalbar = 0x2016;
  13056. t.dblverticallineabovecmb = 0x030e;
  13057. t.dbopomofo = 0x3109;
  13058. t.dbsquare = 0x33c8;
  13059. t.dcaron = 0x010f;
  13060. t.dcedilla = 0x1e11;
  13061. t.dcircle = 0x24d3;
  13062. t.dcircumflexbelow = 0x1e13;
  13063. t.dcroat = 0x0111;
  13064. t.ddabengali = 0x09a1;
  13065. t.ddadeva = 0x0921;
  13066. t.ddagujarati = 0x0aa1;
  13067. t.ddagurmukhi = 0x0a21;
  13068. t.ddalarabic = 0x0688;
  13069. t.ddalfinalarabic = 0xfb89;
  13070. t.dddhadeva = 0x095c;
  13071. t.ddhabengali = 0x09a2;
  13072. t.ddhadeva = 0x0922;
  13073. t.ddhagujarati = 0x0aa2;
  13074. t.ddhagurmukhi = 0x0a22;
  13075. t.ddotaccent = 0x1e0b;
  13076. t.ddotbelow = 0x1e0d;
  13077. t.decimalseparatorarabic = 0x066b;
  13078. t.decimalseparatorpersian = 0x066b;
  13079. t.decyrillic = 0x0434;
  13080. t.degree = 0x00b0;
  13081. t.dehihebrew = 0x05ad;
  13082. t.dehiragana = 0x3067;
  13083. t.deicoptic = 0x03ef;
  13084. t.dekatakana = 0x30c7;
  13085. t.deleteleft = 0x232b;
  13086. t.deleteright = 0x2326;
  13087. t.delta = 0x03b4;
  13088. t.deltaturned = 0x018d;
  13089. t.denominatorminusonenumeratorbengali = 0x09f8;
  13090. t.dezh = 0x02a4;
  13091. t.dhabengali = 0x09a7;
  13092. t.dhadeva = 0x0927;
  13093. t.dhagujarati = 0x0aa7;
  13094. t.dhagurmukhi = 0x0a27;
  13095. t.dhook = 0x0257;
  13096. t.dialytikatonos = 0x0385;
  13097. t.dialytikatonoscmb = 0x0344;
  13098. t.diamond = 0x2666;
  13099. t.diamondsuitwhite = 0x2662;
  13100. t.dieresis = 0x00a8;
  13101. t.dieresisacute = 0xf6d7;
  13102. t.dieresisbelowcmb = 0x0324;
  13103. t.dieresiscmb = 0x0308;
  13104. t.dieresisgrave = 0xf6d8;
  13105. t.dieresistonos = 0x0385;
  13106. t.dihiragana = 0x3062;
  13107. t.dikatakana = 0x30c2;
  13108. t.dittomark = 0x3003;
  13109. t.divide = 0x00f7;
  13110. t.divides = 0x2223;
  13111. t.divisionslash = 0x2215;
  13112. t.djecyrillic = 0x0452;
  13113. t.dkshade = 0x2593;
  13114. t.dlinebelow = 0x1e0f;
  13115. t.dlsquare = 0x3397;
  13116. t.dmacron = 0x0111;
  13117. t.dmonospace = 0xff44;
  13118. t.dnblock = 0x2584;
  13119. t.dochadathai = 0x0e0e;
  13120. t.dodekthai = 0x0e14;
  13121. t.dohiragana = 0x3069;
  13122. t.dokatakana = 0x30c9;
  13123. t.dollar = 0x0024;
  13124. t.dollarinferior = 0xf6e3;
  13125. t.dollarmonospace = 0xff04;
  13126. t.dollaroldstyle = 0xf724;
  13127. t.dollarsmall = 0xfe69;
  13128. t.dollarsuperior = 0xf6e4;
  13129. t.dong = 0x20ab;
  13130. t.dorusquare = 0x3326;
  13131. t.dotaccent = 0x02d9;
  13132. t.dotaccentcmb = 0x0307;
  13133. t.dotbelowcmb = 0x0323;
  13134. t.dotbelowcomb = 0x0323;
  13135. t.dotkatakana = 0x30fb;
  13136. t.dotlessi = 0x0131;
  13137. t.dotlessj = 0xf6be;
  13138. t.dotlessjstrokehook = 0x0284;
  13139. t.dotmath = 0x22c5;
  13140. t.dottedcircle = 0x25cc;
  13141. t.doubleyodpatah = 0xfb1f;
  13142. t.doubleyodpatahhebrew = 0xfb1f;
  13143. t.downtackbelowcmb = 0x031e;
  13144. t.downtackmod = 0x02d5;
  13145. t.dparen = 0x249f;
  13146. t.dsuperior = 0xf6eb;
  13147. t.dtail = 0x0256;
  13148. t.dtopbar = 0x018c;
  13149. t.duhiragana = 0x3065;
  13150. t.dukatakana = 0x30c5;
  13151. t.dz = 0x01f3;
  13152. t.dzaltone = 0x02a3;
  13153. t.dzcaron = 0x01c6;
  13154. t.dzcurl = 0x02a5;
  13155. t.dzeabkhasiancyrillic = 0x04e1;
  13156. t.dzecyrillic = 0x0455;
  13157. t.dzhecyrillic = 0x045f;
  13158. t.e = 0x0065;
  13159. t.eacute = 0x00e9;
  13160. t.earth = 0x2641;
  13161. t.ebengali = 0x098f;
  13162. t.ebopomofo = 0x311c;
  13163. t.ebreve = 0x0115;
  13164. t.ecandradeva = 0x090d;
  13165. t.ecandragujarati = 0x0a8d;
  13166. t.ecandravowelsigndeva = 0x0945;
  13167. t.ecandravowelsigngujarati = 0x0ac5;
  13168. t.ecaron = 0x011b;
  13169. t.ecedillabreve = 0x1e1d;
  13170. t.echarmenian = 0x0565;
  13171. t.echyiwnarmenian = 0x0587;
  13172. t.ecircle = 0x24d4;
  13173. t.ecircumflex = 0x00ea;
  13174. t.ecircumflexacute = 0x1ebf;
  13175. t.ecircumflexbelow = 0x1e19;
  13176. t.ecircumflexdotbelow = 0x1ec7;
  13177. t.ecircumflexgrave = 0x1ec1;
  13178. t.ecircumflexhookabove = 0x1ec3;
  13179. t.ecircumflextilde = 0x1ec5;
  13180. t.ecyrillic = 0x0454;
  13181. t.edblgrave = 0x0205;
  13182. t.edeva = 0x090f;
  13183. t.edieresis = 0x00eb;
  13184. t.edot = 0x0117;
  13185. t.edotaccent = 0x0117;
  13186. t.edotbelow = 0x1eb9;
  13187. t.eegurmukhi = 0x0a0f;
  13188. t.eematragurmukhi = 0x0a47;
  13189. t.efcyrillic = 0x0444;
  13190. t.egrave = 0x00e8;
  13191. t.egujarati = 0x0a8f;
  13192. t.eharmenian = 0x0567;
  13193. t.ehbopomofo = 0x311d;
  13194. t.ehiragana = 0x3048;
  13195. t.ehookabove = 0x1ebb;
  13196. t.eibopomofo = 0x311f;
  13197. t.eight = 0x0038;
  13198. t.eightarabic = 0x0668;
  13199. t.eightbengali = 0x09ee;
  13200. t.eightcircle = 0x2467;
  13201. t.eightcircleinversesansserif = 0x2791;
  13202. t.eightdeva = 0x096e;
  13203. t.eighteencircle = 0x2471;
  13204. t.eighteenparen = 0x2485;
  13205. t.eighteenperiod = 0x2499;
  13206. t.eightgujarati = 0x0aee;
  13207. t.eightgurmukhi = 0x0a6e;
  13208. t.eighthackarabic = 0x0668;
  13209. t.eighthangzhou = 0x3028;
  13210. t.eighthnotebeamed = 0x266b;
  13211. t.eightideographicparen = 0x3227;
  13212. t.eightinferior = 0x2088;
  13213. t.eightmonospace = 0xff18;
  13214. t.eightoldstyle = 0xf738;
  13215. t.eightparen = 0x247b;
  13216. t.eightperiod = 0x248f;
  13217. t.eightpersian = 0x06f8;
  13218. t.eightroman = 0x2177;
  13219. t.eightsuperior = 0x2078;
  13220. t.eightthai = 0x0e58;
  13221. t.einvertedbreve = 0x0207;
  13222. t.eiotifiedcyrillic = 0x0465;
  13223. t.ekatakana = 0x30a8;
  13224. t.ekatakanahalfwidth = 0xff74;
  13225. t.ekonkargurmukhi = 0x0a74;
  13226. t.ekorean = 0x3154;
  13227. t.elcyrillic = 0x043b;
  13228. t.element = 0x2208;
  13229. t.elevencircle = 0x246a;
  13230. t.elevenparen = 0x247e;
  13231. t.elevenperiod = 0x2492;
  13232. t.elevenroman = 0x217a;
  13233. t.ellipsis = 0x2026;
  13234. t.ellipsisvertical = 0x22ee;
  13235. t.emacron = 0x0113;
  13236. t.emacronacute = 0x1e17;
  13237. t.emacrongrave = 0x1e15;
  13238. t.emcyrillic = 0x043c;
  13239. t.emdash = 0x2014;
  13240. t.emdashvertical = 0xfe31;
  13241. t.emonospace = 0xff45;
  13242. t.emphasismarkarmenian = 0x055b;
  13243. t.emptyset = 0x2205;
  13244. t.enbopomofo = 0x3123;
  13245. t.encyrillic = 0x043d;
  13246. t.endash = 0x2013;
  13247. t.endashvertical = 0xfe32;
  13248. t.endescendercyrillic = 0x04a3;
  13249. t.eng = 0x014b;
  13250. t.engbopomofo = 0x3125;
  13251. t.enghecyrillic = 0x04a5;
  13252. t.enhookcyrillic = 0x04c8;
  13253. t.enspace = 0x2002;
  13254. t.eogonek = 0x0119;
  13255. t.eokorean = 0x3153;
  13256. t.eopen = 0x025b;
  13257. t.eopenclosed = 0x029a;
  13258. t.eopenreversed = 0x025c;
  13259. t.eopenreversedclosed = 0x025e;
  13260. t.eopenreversedhook = 0x025d;
  13261. t.eparen = 0x24a0;
  13262. t.epsilon = 0x03b5;
  13263. t.epsilontonos = 0x03ad;
  13264. t.equal = 0x003d;
  13265. t.equalmonospace = 0xff1d;
  13266. t.equalsmall = 0xfe66;
  13267. t.equalsuperior = 0x207c;
  13268. t.equivalence = 0x2261;
  13269. t.erbopomofo = 0x3126;
  13270. t.ercyrillic = 0x0440;
  13271. t.ereversed = 0x0258;
  13272. t.ereversedcyrillic = 0x044d;
  13273. t.escyrillic = 0x0441;
  13274. t.esdescendercyrillic = 0x04ab;
  13275. t.esh = 0x0283;
  13276. t.eshcurl = 0x0286;
  13277. t.eshortdeva = 0x090e;
  13278. t.eshortvowelsigndeva = 0x0946;
  13279. t.eshreversedloop = 0x01aa;
  13280. t.eshsquatreversed = 0x0285;
  13281. t.esmallhiragana = 0x3047;
  13282. t.esmallkatakana = 0x30a7;
  13283. t.esmallkatakanahalfwidth = 0xff6a;
  13284. t.estimated = 0x212e;
  13285. t.esuperior = 0xf6ec;
  13286. t.eta = 0x03b7;
  13287. t.etarmenian = 0x0568;
  13288. t.etatonos = 0x03ae;
  13289. t.eth = 0x00f0;
  13290. t.etilde = 0x1ebd;
  13291. t.etildebelow = 0x1e1b;
  13292. t.etnahtafoukhhebrew = 0x0591;
  13293. t.etnahtafoukhlefthebrew = 0x0591;
  13294. t.etnahtahebrew = 0x0591;
  13295. t.etnahtalefthebrew = 0x0591;
  13296. t.eturned = 0x01dd;
  13297. t.eukorean = 0x3161;
  13298. t.euro = 0x20ac;
  13299. t.evowelsignbengali = 0x09c7;
  13300. t.evowelsigndeva = 0x0947;
  13301. t.evowelsigngujarati = 0x0ac7;
  13302. t.exclam = 0x0021;
  13303. t.exclamarmenian = 0x055c;
  13304. t.exclamdbl = 0x203c;
  13305. t.exclamdown = 0x00a1;
  13306. t.exclamdownsmall = 0xf7a1;
  13307. t.exclammonospace = 0xff01;
  13308. t.exclamsmall = 0xf721;
  13309. t.existential = 0x2203;
  13310. t.ezh = 0x0292;
  13311. t.ezhcaron = 0x01ef;
  13312. t.ezhcurl = 0x0293;
  13313. t.ezhreversed = 0x01b9;
  13314. t.ezhtail = 0x01ba;
  13315. t.f = 0x0066;
  13316. t.fadeva = 0x095e;
  13317. t.fagurmukhi = 0x0a5e;
  13318. t.fahrenheit = 0x2109;
  13319. t.fathaarabic = 0x064e;
  13320. t.fathalowarabic = 0x064e;
  13321. t.fathatanarabic = 0x064b;
  13322. t.fbopomofo = 0x3108;
  13323. t.fcircle = 0x24d5;
  13324. t.fdotaccent = 0x1e1f;
  13325. t.feharabic = 0x0641;
  13326. t.feharmenian = 0x0586;
  13327. t.fehfinalarabic = 0xfed2;
  13328. t.fehinitialarabic = 0xfed3;
  13329. t.fehmedialarabic = 0xfed4;
  13330. t.feicoptic = 0x03e5;
  13331. t.female = 0x2640;
  13332. t.ff = 0xfb00;
  13333. t.f_f = 0xfb00;
  13334. t.ffi = 0xfb03;
  13335. t.f_f_i = 0xfb03;
  13336. t.ffl = 0xfb04;
  13337. t.f_f_l = 0xfb04;
  13338. t.fi = 0xfb01;
  13339. t.f_i = 0xfb01;
  13340. t.fifteencircle = 0x246e;
  13341. t.fifteenparen = 0x2482;
  13342. t.fifteenperiod = 0x2496;
  13343. t.figuredash = 0x2012;
  13344. t.filledbox = 0x25a0;
  13345. t.filledrect = 0x25ac;
  13346. t.finalkaf = 0x05da;
  13347. t.finalkafdagesh = 0xfb3a;
  13348. t.finalkafdageshhebrew = 0xfb3a;
  13349. t.finalkafhebrew = 0x05da;
  13350. t.finalmem = 0x05dd;
  13351. t.finalmemhebrew = 0x05dd;
  13352. t.finalnun = 0x05df;
  13353. t.finalnunhebrew = 0x05df;
  13354. t.finalpe = 0x05e3;
  13355. t.finalpehebrew = 0x05e3;
  13356. t.finaltsadi = 0x05e5;
  13357. t.finaltsadihebrew = 0x05e5;
  13358. t.firsttonechinese = 0x02c9;
  13359. t.fisheye = 0x25c9;
  13360. t.fitacyrillic = 0x0473;
  13361. t.five = 0x0035;
  13362. t.fivearabic = 0x0665;
  13363. t.fivebengali = 0x09eb;
  13364. t.fivecircle = 0x2464;
  13365. t.fivecircleinversesansserif = 0x278e;
  13366. t.fivedeva = 0x096b;
  13367. t.fiveeighths = 0x215d;
  13368. t.fivegujarati = 0x0aeb;
  13369. t.fivegurmukhi = 0x0a6b;
  13370. t.fivehackarabic = 0x0665;
  13371. t.fivehangzhou = 0x3025;
  13372. t.fiveideographicparen = 0x3224;
  13373. t.fiveinferior = 0x2085;
  13374. t.fivemonospace = 0xff15;
  13375. t.fiveoldstyle = 0xf735;
  13376. t.fiveparen = 0x2478;
  13377. t.fiveperiod = 0x248c;
  13378. t.fivepersian = 0x06f5;
  13379. t.fiveroman = 0x2174;
  13380. t.fivesuperior = 0x2075;
  13381. t.fivethai = 0x0e55;
  13382. t.fl = 0xfb02;
  13383. t.f_l = 0xfb02;
  13384. t.florin = 0x0192;
  13385. t.fmonospace = 0xff46;
  13386. t.fmsquare = 0x3399;
  13387. t.fofanthai = 0x0e1f;
  13388. t.fofathai = 0x0e1d;
  13389. t.fongmanthai = 0x0e4f;
  13390. t.forall = 0x2200;
  13391. t.four = 0x0034;
  13392. t.fourarabic = 0x0664;
  13393. t.fourbengali = 0x09ea;
  13394. t.fourcircle = 0x2463;
  13395. t.fourcircleinversesansserif = 0x278d;
  13396. t.fourdeva = 0x096a;
  13397. t.fourgujarati = 0x0aea;
  13398. t.fourgurmukhi = 0x0a6a;
  13399. t.fourhackarabic = 0x0664;
  13400. t.fourhangzhou = 0x3024;
  13401. t.fourideographicparen = 0x3223;
  13402. t.fourinferior = 0x2084;
  13403. t.fourmonospace = 0xff14;
  13404. t.fournumeratorbengali = 0x09f7;
  13405. t.fouroldstyle = 0xf734;
  13406. t.fourparen = 0x2477;
  13407. t.fourperiod = 0x248b;
  13408. t.fourpersian = 0x06f4;
  13409. t.fourroman = 0x2173;
  13410. t.foursuperior = 0x2074;
  13411. t.fourteencircle = 0x246d;
  13412. t.fourteenparen = 0x2481;
  13413. t.fourteenperiod = 0x2495;
  13414. t.fourthai = 0x0e54;
  13415. t.fourthtonechinese = 0x02cb;
  13416. t.fparen = 0x24a1;
  13417. t.fraction = 0x2044;
  13418. t.franc = 0x20a3;
  13419. t.g = 0x0067;
  13420. t.gabengali = 0x0997;
  13421. t.gacute = 0x01f5;
  13422. t.gadeva = 0x0917;
  13423. t.gafarabic = 0x06af;
  13424. t.gaffinalarabic = 0xfb93;
  13425. t.gafinitialarabic = 0xfb94;
  13426. t.gafmedialarabic = 0xfb95;
  13427. t.gagujarati = 0x0a97;
  13428. t.gagurmukhi = 0x0a17;
  13429. t.gahiragana = 0x304c;
  13430. t.gakatakana = 0x30ac;
  13431. t.gamma = 0x03b3;
  13432. t.gammalatinsmall = 0x0263;
  13433. t.gammasuperior = 0x02e0;
  13434. t.gangiacoptic = 0x03eb;
  13435. t.gbopomofo = 0x310d;
  13436. t.gbreve = 0x011f;
  13437. t.gcaron = 0x01e7;
  13438. t.gcedilla = 0x0123;
  13439. t.gcircle = 0x24d6;
  13440. t.gcircumflex = 0x011d;
  13441. t.gcommaaccent = 0x0123;
  13442. t.gdot = 0x0121;
  13443. t.gdotaccent = 0x0121;
  13444. t.gecyrillic = 0x0433;
  13445. t.gehiragana = 0x3052;
  13446. t.gekatakana = 0x30b2;
  13447. t.geometricallyequal = 0x2251;
  13448. t.gereshaccenthebrew = 0x059c;
  13449. t.gereshhebrew = 0x05f3;
  13450. t.gereshmuqdamhebrew = 0x059d;
  13451. t.germandbls = 0x00df;
  13452. t.gershayimaccenthebrew = 0x059e;
  13453. t.gershayimhebrew = 0x05f4;
  13454. t.getamark = 0x3013;
  13455. t.ghabengali = 0x0998;
  13456. t.ghadarmenian = 0x0572;
  13457. t.ghadeva = 0x0918;
  13458. t.ghagujarati = 0x0a98;
  13459. t.ghagurmukhi = 0x0a18;
  13460. t.ghainarabic = 0x063a;
  13461. t.ghainfinalarabic = 0xfece;
  13462. t.ghaininitialarabic = 0xfecf;
  13463. t.ghainmedialarabic = 0xfed0;
  13464. t.ghemiddlehookcyrillic = 0x0495;
  13465. t.ghestrokecyrillic = 0x0493;
  13466. t.gheupturncyrillic = 0x0491;
  13467. t.ghhadeva = 0x095a;
  13468. t.ghhagurmukhi = 0x0a5a;
  13469. t.ghook = 0x0260;
  13470. t.ghzsquare = 0x3393;
  13471. t.gihiragana = 0x304e;
  13472. t.gikatakana = 0x30ae;
  13473. t.gimarmenian = 0x0563;
  13474. t.gimel = 0x05d2;
  13475. t.gimeldagesh = 0xfb32;
  13476. t.gimeldageshhebrew = 0xfb32;
  13477. t.gimelhebrew = 0x05d2;
  13478. t.gjecyrillic = 0x0453;
  13479. t.glottalinvertedstroke = 0x01be;
  13480. t.glottalstop = 0x0294;
  13481. t.glottalstopinverted = 0x0296;
  13482. t.glottalstopmod = 0x02c0;
  13483. t.glottalstopreversed = 0x0295;
  13484. t.glottalstopreversedmod = 0x02c1;
  13485. t.glottalstopreversedsuperior = 0x02e4;
  13486. t.glottalstopstroke = 0x02a1;
  13487. t.glottalstopstrokereversed = 0x02a2;
  13488. t.gmacron = 0x1e21;
  13489. t.gmonospace = 0xff47;
  13490. t.gohiragana = 0x3054;
  13491. t.gokatakana = 0x30b4;
  13492. t.gparen = 0x24a2;
  13493. t.gpasquare = 0x33ac;
  13494. t.gradient = 0x2207;
  13495. t.grave = 0x0060;
  13496. t.gravebelowcmb = 0x0316;
  13497. t.gravecmb = 0x0300;
  13498. t.gravecomb = 0x0300;
  13499. t.gravedeva = 0x0953;
  13500. t.gravelowmod = 0x02ce;
  13501. t.gravemonospace = 0xff40;
  13502. t.gravetonecmb = 0x0340;
  13503. t.greater = 0x003e;
  13504. t.greaterequal = 0x2265;
  13505. t.greaterequalorless = 0x22db;
  13506. t.greatermonospace = 0xff1e;
  13507. t.greaterorequivalent = 0x2273;
  13508. t.greaterorless = 0x2277;
  13509. t.greateroverequal = 0x2267;
  13510. t.greatersmall = 0xfe65;
  13511. t.gscript = 0x0261;
  13512. t.gstroke = 0x01e5;
  13513. t.guhiragana = 0x3050;
  13514. t.guillemotleft = 0x00ab;
  13515. t.guillemotright = 0x00bb;
  13516. t.guilsinglleft = 0x2039;
  13517. t.guilsinglright = 0x203a;
  13518. t.gukatakana = 0x30b0;
  13519. t.guramusquare = 0x3318;
  13520. t.gysquare = 0x33c9;
  13521. t.h = 0x0068;
  13522. t.haabkhasiancyrillic = 0x04a9;
  13523. t.haaltonearabic = 0x06c1;
  13524. t.habengali = 0x09b9;
  13525. t.hadescendercyrillic = 0x04b3;
  13526. t.hadeva = 0x0939;
  13527. t.hagujarati = 0x0ab9;
  13528. t.hagurmukhi = 0x0a39;
  13529. t.haharabic = 0x062d;
  13530. t.hahfinalarabic = 0xfea2;
  13531. t.hahinitialarabic = 0xfea3;
  13532. t.hahiragana = 0x306f;
  13533. t.hahmedialarabic = 0xfea4;
  13534. t.haitusquare = 0x332a;
  13535. t.hakatakana = 0x30cf;
  13536. t.hakatakanahalfwidth = 0xff8a;
  13537. t.halantgurmukhi = 0x0a4d;
  13538. t.hamzaarabic = 0x0621;
  13539. t.hamzalowarabic = 0x0621;
  13540. t.hangulfiller = 0x3164;
  13541. t.hardsigncyrillic = 0x044a;
  13542. t.harpoonleftbarbup = 0x21bc;
  13543. t.harpoonrightbarbup = 0x21c0;
  13544. t.hasquare = 0x33ca;
  13545. t.hatafpatah = 0x05b2;
  13546. t.hatafpatah16 = 0x05b2;
  13547. t.hatafpatah23 = 0x05b2;
  13548. t.hatafpatah2f = 0x05b2;
  13549. t.hatafpatahhebrew = 0x05b2;
  13550. t.hatafpatahnarrowhebrew = 0x05b2;
  13551. t.hatafpatahquarterhebrew = 0x05b2;
  13552. t.hatafpatahwidehebrew = 0x05b2;
  13553. t.hatafqamats = 0x05b3;
  13554. t.hatafqamats1b = 0x05b3;
  13555. t.hatafqamats28 = 0x05b3;
  13556. t.hatafqamats34 = 0x05b3;
  13557. t.hatafqamatshebrew = 0x05b3;
  13558. t.hatafqamatsnarrowhebrew = 0x05b3;
  13559. t.hatafqamatsquarterhebrew = 0x05b3;
  13560. t.hatafqamatswidehebrew = 0x05b3;
  13561. t.hatafsegol = 0x05b1;
  13562. t.hatafsegol17 = 0x05b1;
  13563. t.hatafsegol24 = 0x05b1;
  13564. t.hatafsegol30 = 0x05b1;
  13565. t.hatafsegolhebrew = 0x05b1;
  13566. t.hatafsegolnarrowhebrew = 0x05b1;
  13567. t.hatafsegolquarterhebrew = 0x05b1;
  13568. t.hatafsegolwidehebrew = 0x05b1;
  13569. t.hbar = 0x0127;
  13570. t.hbopomofo = 0x310f;
  13571. t.hbrevebelow = 0x1e2b;
  13572. t.hcedilla = 0x1e29;
  13573. t.hcircle = 0x24d7;
  13574. t.hcircumflex = 0x0125;
  13575. t.hdieresis = 0x1e27;
  13576. t.hdotaccent = 0x1e23;
  13577. t.hdotbelow = 0x1e25;
  13578. t.he = 0x05d4;
  13579. t.heart = 0x2665;
  13580. t.heartsuitblack = 0x2665;
  13581. t.heartsuitwhite = 0x2661;
  13582. t.hedagesh = 0xfb34;
  13583. t.hedageshhebrew = 0xfb34;
  13584. t.hehaltonearabic = 0x06c1;
  13585. t.heharabic = 0x0647;
  13586. t.hehebrew = 0x05d4;
  13587. t.hehfinalaltonearabic = 0xfba7;
  13588. t.hehfinalalttwoarabic = 0xfeea;
  13589. t.hehfinalarabic = 0xfeea;
  13590. t.hehhamzaabovefinalarabic = 0xfba5;
  13591. t.hehhamzaaboveisolatedarabic = 0xfba4;
  13592. t.hehinitialaltonearabic = 0xfba8;
  13593. t.hehinitialarabic = 0xfeeb;
  13594. t.hehiragana = 0x3078;
  13595. t.hehmedialaltonearabic = 0xfba9;
  13596. t.hehmedialarabic = 0xfeec;
  13597. t.heiseierasquare = 0x337b;
  13598. t.hekatakana = 0x30d8;
  13599. t.hekatakanahalfwidth = 0xff8d;
  13600. t.hekutaarusquare = 0x3336;
  13601. t.henghook = 0x0267;
  13602. t.herutusquare = 0x3339;
  13603. t.het = 0x05d7;
  13604. t.hethebrew = 0x05d7;
  13605. t.hhook = 0x0266;
  13606. t.hhooksuperior = 0x02b1;
  13607. t.hieuhacirclekorean = 0x327b;
  13608. t.hieuhaparenkorean = 0x321b;
  13609. t.hieuhcirclekorean = 0x326d;
  13610. t.hieuhkorean = 0x314e;
  13611. t.hieuhparenkorean = 0x320d;
  13612. t.hihiragana = 0x3072;
  13613. t.hikatakana = 0x30d2;
  13614. t.hikatakanahalfwidth = 0xff8b;
  13615. t.hiriq = 0x05b4;
  13616. t.hiriq14 = 0x05b4;
  13617. t.hiriq21 = 0x05b4;
  13618. t.hiriq2d = 0x05b4;
  13619. t.hiriqhebrew = 0x05b4;
  13620. t.hiriqnarrowhebrew = 0x05b4;
  13621. t.hiriqquarterhebrew = 0x05b4;
  13622. t.hiriqwidehebrew = 0x05b4;
  13623. t.hlinebelow = 0x1e96;
  13624. t.hmonospace = 0xff48;
  13625. t.hoarmenian = 0x0570;
  13626. t.hohipthai = 0x0e2b;
  13627. t.hohiragana = 0x307b;
  13628. t.hokatakana = 0x30db;
  13629. t.hokatakanahalfwidth = 0xff8e;
  13630. t.holam = 0x05b9;
  13631. t.holam19 = 0x05b9;
  13632. t.holam26 = 0x05b9;
  13633. t.holam32 = 0x05b9;
  13634. t.holamhebrew = 0x05b9;
  13635. t.holamnarrowhebrew = 0x05b9;
  13636. t.holamquarterhebrew = 0x05b9;
  13637. t.holamwidehebrew = 0x05b9;
  13638. t.honokhukthai = 0x0e2e;
  13639. t.hookabovecomb = 0x0309;
  13640. t.hookcmb = 0x0309;
  13641. t.hookpalatalizedbelowcmb = 0x0321;
  13642. t.hookretroflexbelowcmb = 0x0322;
  13643. t.hoonsquare = 0x3342;
  13644. t.horicoptic = 0x03e9;
  13645. t.horizontalbar = 0x2015;
  13646. t.horncmb = 0x031b;
  13647. t.hotsprings = 0x2668;
  13648. t.house = 0x2302;
  13649. t.hparen = 0x24a3;
  13650. t.hsuperior = 0x02b0;
  13651. t.hturned = 0x0265;
  13652. t.huhiragana = 0x3075;
  13653. t.huiitosquare = 0x3333;
  13654. t.hukatakana = 0x30d5;
  13655. t.hukatakanahalfwidth = 0xff8c;
  13656. t.hungarumlaut = 0x02dd;
  13657. t.hungarumlautcmb = 0x030b;
  13658. t.hv = 0x0195;
  13659. t.hyphen = 0x002d;
  13660. t.hypheninferior = 0xf6e5;
  13661. t.hyphenmonospace = 0xff0d;
  13662. t.hyphensmall = 0xfe63;
  13663. t.hyphensuperior = 0xf6e6;
  13664. t.hyphentwo = 0x2010;
  13665. t.i = 0x0069;
  13666. t.iacute = 0x00ed;
  13667. t.iacyrillic = 0x044f;
  13668. t.ibengali = 0x0987;
  13669. t.ibopomofo = 0x3127;
  13670. t.ibreve = 0x012d;
  13671. t.icaron = 0x01d0;
  13672. t.icircle = 0x24d8;
  13673. t.icircumflex = 0x00ee;
  13674. t.icyrillic = 0x0456;
  13675. t.idblgrave = 0x0209;
  13676. t.ideographearthcircle = 0x328f;
  13677. t.ideographfirecircle = 0x328b;
  13678. t.ideographicallianceparen = 0x323f;
  13679. t.ideographiccallparen = 0x323a;
  13680. t.ideographiccentrecircle = 0x32a5;
  13681. t.ideographicclose = 0x3006;
  13682. t.ideographiccomma = 0x3001;
  13683. t.ideographiccommaleft = 0xff64;
  13684. t.ideographiccongratulationparen = 0x3237;
  13685. t.ideographiccorrectcircle = 0x32a3;
  13686. t.ideographicearthparen = 0x322f;
  13687. t.ideographicenterpriseparen = 0x323d;
  13688. t.ideographicexcellentcircle = 0x329d;
  13689. t.ideographicfestivalparen = 0x3240;
  13690. t.ideographicfinancialcircle = 0x3296;
  13691. t.ideographicfinancialparen = 0x3236;
  13692. t.ideographicfireparen = 0x322b;
  13693. t.ideographichaveparen = 0x3232;
  13694. t.ideographichighcircle = 0x32a4;
  13695. t.ideographiciterationmark = 0x3005;
  13696. t.ideographiclaborcircle = 0x3298;
  13697. t.ideographiclaborparen = 0x3238;
  13698. t.ideographicleftcircle = 0x32a7;
  13699. t.ideographiclowcircle = 0x32a6;
  13700. t.ideographicmedicinecircle = 0x32a9;
  13701. t.ideographicmetalparen = 0x322e;
  13702. t.ideographicmoonparen = 0x322a;
  13703. t.ideographicnameparen = 0x3234;
  13704. t.ideographicperiod = 0x3002;
  13705. t.ideographicprintcircle = 0x329e;
  13706. t.ideographicreachparen = 0x3243;
  13707. t.ideographicrepresentparen = 0x3239;
  13708. t.ideographicresourceparen = 0x323e;
  13709. t.ideographicrightcircle = 0x32a8;
  13710. t.ideographicsecretcircle = 0x3299;
  13711. t.ideographicselfparen = 0x3242;
  13712. t.ideographicsocietyparen = 0x3233;
  13713. t.ideographicspace = 0x3000;
  13714. t.ideographicspecialparen = 0x3235;
  13715. t.ideographicstockparen = 0x3231;
  13716. t.ideographicstudyparen = 0x323b;
  13717. t.ideographicsunparen = 0x3230;
  13718. t.ideographicsuperviseparen = 0x323c;
  13719. t.ideographicwaterparen = 0x322c;
  13720. t.ideographicwoodparen = 0x322d;
  13721. t.ideographiczero = 0x3007;
  13722. t.ideographmetalcircle = 0x328e;
  13723. t.ideographmooncircle = 0x328a;
  13724. t.ideographnamecircle = 0x3294;
  13725. t.ideographsuncircle = 0x3290;
  13726. t.ideographwatercircle = 0x328c;
  13727. t.ideographwoodcircle = 0x328d;
  13728. t.ideva = 0x0907;
  13729. t.idieresis = 0x00ef;
  13730. t.idieresisacute = 0x1e2f;
  13731. t.idieresiscyrillic = 0x04e5;
  13732. t.idotbelow = 0x1ecb;
  13733. t.iebrevecyrillic = 0x04d7;
  13734. t.iecyrillic = 0x0435;
  13735. t.ieungacirclekorean = 0x3275;
  13736. t.ieungaparenkorean = 0x3215;
  13737. t.ieungcirclekorean = 0x3267;
  13738. t.ieungkorean = 0x3147;
  13739. t.ieungparenkorean = 0x3207;
  13740. t.igrave = 0x00ec;
  13741. t.igujarati = 0x0a87;
  13742. t.igurmukhi = 0x0a07;
  13743. t.ihiragana = 0x3044;
  13744. t.ihookabove = 0x1ec9;
  13745. t.iibengali = 0x0988;
  13746. t.iicyrillic = 0x0438;
  13747. t.iideva = 0x0908;
  13748. t.iigujarati = 0x0a88;
  13749. t.iigurmukhi = 0x0a08;
  13750. t.iimatragurmukhi = 0x0a40;
  13751. t.iinvertedbreve = 0x020b;
  13752. t.iishortcyrillic = 0x0439;
  13753. t.iivowelsignbengali = 0x09c0;
  13754. t.iivowelsigndeva = 0x0940;
  13755. t.iivowelsigngujarati = 0x0ac0;
  13756. t.ij = 0x0133;
  13757. t.ikatakana = 0x30a4;
  13758. t.ikatakanahalfwidth = 0xff72;
  13759. t.ikorean = 0x3163;
  13760. t.ilde = 0x02dc;
  13761. t.iluyhebrew = 0x05ac;
  13762. t.imacron = 0x012b;
  13763. t.imacroncyrillic = 0x04e3;
  13764. t.imageorapproximatelyequal = 0x2253;
  13765. t.imatragurmukhi = 0x0a3f;
  13766. t.imonospace = 0xff49;
  13767. t.increment = 0x2206;
  13768. t.infinity = 0x221e;
  13769. t.iniarmenian = 0x056b;
  13770. t.integral = 0x222b;
  13771. t.integralbottom = 0x2321;
  13772. t.integralbt = 0x2321;
  13773. t.integralex = 0xf8f5;
  13774. t.integraltop = 0x2320;
  13775. t.integraltp = 0x2320;
  13776. t.intersection = 0x2229;
  13777. t.intisquare = 0x3305;
  13778. t.invbullet = 0x25d8;
  13779. t.invcircle = 0x25d9;
  13780. t.invsmileface = 0x263b;
  13781. t.iocyrillic = 0x0451;
  13782. t.iogonek = 0x012f;
  13783. t.iota = 0x03b9;
  13784. t.iotadieresis = 0x03ca;
  13785. t.iotadieresistonos = 0x0390;
  13786. t.iotalatin = 0x0269;
  13787. t.iotatonos = 0x03af;
  13788. t.iparen = 0x24a4;
  13789. t.irigurmukhi = 0x0a72;
  13790. t.ismallhiragana = 0x3043;
  13791. t.ismallkatakana = 0x30a3;
  13792. t.ismallkatakanahalfwidth = 0xff68;
  13793. t.issharbengali = 0x09fa;
  13794. t.istroke = 0x0268;
  13795. t.isuperior = 0xf6ed;
  13796. t.iterationhiragana = 0x309d;
  13797. t.iterationkatakana = 0x30fd;
  13798. t.itilde = 0x0129;
  13799. t.itildebelow = 0x1e2d;
  13800. t.iubopomofo = 0x3129;
  13801. t.iucyrillic = 0x044e;
  13802. t.ivowelsignbengali = 0x09bf;
  13803. t.ivowelsigndeva = 0x093f;
  13804. t.ivowelsigngujarati = 0x0abf;
  13805. t.izhitsacyrillic = 0x0475;
  13806. t.izhitsadblgravecyrillic = 0x0477;
  13807. t.j = 0x006a;
  13808. t.jaarmenian = 0x0571;
  13809. t.jabengali = 0x099c;
  13810. t.jadeva = 0x091c;
  13811. t.jagujarati = 0x0a9c;
  13812. t.jagurmukhi = 0x0a1c;
  13813. t.jbopomofo = 0x3110;
  13814. t.jcaron = 0x01f0;
  13815. t.jcircle = 0x24d9;
  13816. t.jcircumflex = 0x0135;
  13817. t.jcrossedtail = 0x029d;
  13818. t.jdotlessstroke = 0x025f;
  13819. t.jecyrillic = 0x0458;
  13820. t.jeemarabic = 0x062c;
  13821. t.jeemfinalarabic = 0xfe9e;
  13822. t.jeeminitialarabic = 0xfe9f;
  13823. t.jeemmedialarabic = 0xfea0;
  13824. t.jeharabic = 0x0698;
  13825. t.jehfinalarabic = 0xfb8b;
  13826. t.jhabengali = 0x099d;
  13827. t.jhadeva = 0x091d;
  13828. t.jhagujarati = 0x0a9d;
  13829. t.jhagurmukhi = 0x0a1d;
  13830. t.jheharmenian = 0x057b;
  13831. t.jis = 0x3004;
  13832. t.jmonospace = 0xff4a;
  13833. t.jparen = 0x24a5;
  13834. t.jsuperior = 0x02b2;
  13835. t.k = 0x006b;
  13836. t.kabashkircyrillic = 0x04a1;
  13837. t.kabengali = 0x0995;
  13838. t.kacute = 0x1e31;
  13839. t.kacyrillic = 0x043a;
  13840. t.kadescendercyrillic = 0x049b;
  13841. t.kadeva = 0x0915;
  13842. t.kaf = 0x05db;
  13843. t.kafarabic = 0x0643;
  13844. t.kafdagesh = 0xfb3b;
  13845. t.kafdageshhebrew = 0xfb3b;
  13846. t.kaffinalarabic = 0xfeda;
  13847. t.kafhebrew = 0x05db;
  13848. t.kafinitialarabic = 0xfedb;
  13849. t.kafmedialarabic = 0xfedc;
  13850. t.kafrafehebrew = 0xfb4d;
  13851. t.kagujarati = 0x0a95;
  13852. t.kagurmukhi = 0x0a15;
  13853. t.kahiragana = 0x304b;
  13854. t.kahookcyrillic = 0x04c4;
  13855. t.kakatakana = 0x30ab;
  13856. t.kakatakanahalfwidth = 0xff76;
  13857. t.kappa = 0x03ba;
  13858. t.kappasymbolgreek = 0x03f0;
  13859. t.kapyeounmieumkorean = 0x3171;
  13860. t.kapyeounphieuphkorean = 0x3184;
  13861. t.kapyeounpieupkorean = 0x3178;
  13862. t.kapyeounssangpieupkorean = 0x3179;
  13863. t.karoriisquare = 0x330d;
  13864. t.kashidaautoarabic = 0x0640;
  13865. t.kashidaautonosidebearingarabic = 0x0640;
  13866. t.kasmallkatakana = 0x30f5;
  13867. t.kasquare = 0x3384;
  13868. t.kasraarabic = 0x0650;
  13869. t.kasratanarabic = 0x064d;
  13870. t.kastrokecyrillic = 0x049f;
  13871. t.katahiraprolongmarkhalfwidth = 0xff70;
  13872. t.kaverticalstrokecyrillic = 0x049d;
  13873. t.kbopomofo = 0x310e;
  13874. t.kcalsquare = 0x3389;
  13875. t.kcaron = 0x01e9;
  13876. t.kcedilla = 0x0137;
  13877. t.kcircle = 0x24da;
  13878. t.kcommaaccent = 0x0137;
  13879. t.kdotbelow = 0x1e33;
  13880. t.keharmenian = 0x0584;
  13881. t.kehiragana = 0x3051;
  13882. t.kekatakana = 0x30b1;
  13883. t.kekatakanahalfwidth = 0xff79;
  13884. t.kenarmenian = 0x056f;
  13885. t.kesmallkatakana = 0x30f6;
  13886. t.kgreenlandic = 0x0138;
  13887. t.khabengali = 0x0996;
  13888. t.khacyrillic = 0x0445;
  13889. t.khadeva = 0x0916;
  13890. t.khagujarati = 0x0a96;
  13891. t.khagurmukhi = 0x0a16;
  13892. t.khaharabic = 0x062e;
  13893. t.khahfinalarabic = 0xfea6;
  13894. t.khahinitialarabic = 0xfea7;
  13895. t.khahmedialarabic = 0xfea8;
  13896. t.kheicoptic = 0x03e7;
  13897. t.khhadeva = 0x0959;
  13898. t.khhagurmukhi = 0x0a59;
  13899. t.khieukhacirclekorean = 0x3278;
  13900. t.khieukhaparenkorean = 0x3218;
  13901. t.khieukhcirclekorean = 0x326a;
  13902. t.khieukhkorean = 0x314b;
  13903. t.khieukhparenkorean = 0x320a;
  13904. t.khokhaithai = 0x0e02;
  13905. t.khokhonthai = 0x0e05;
  13906. t.khokhuatthai = 0x0e03;
  13907. t.khokhwaithai = 0x0e04;
  13908. t.khomutthai = 0x0e5b;
  13909. t.khook = 0x0199;
  13910. t.khorakhangthai = 0x0e06;
  13911. t.khzsquare = 0x3391;
  13912. t.kihiragana = 0x304d;
  13913. t.kikatakana = 0x30ad;
  13914. t.kikatakanahalfwidth = 0xff77;
  13915. t.kiroguramusquare = 0x3315;
  13916. t.kiromeetorusquare = 0x3316;
  13917. t.kirosquare = 0x3314;
  13918. t.kiyeokacirclekorean = 0x326e;
  13919. t.kiyeokaparenkorean = 0x320e;
  13920. t.kiyeokcirclekorean = 0x3260;
  13921. t.kiyeokkorean = 0x3131;
  13922. t.kiyeokparenkorean = 0x3200;
  13923. t.kiyeoksioskorean = 0x3133;
  13924. t.kjecyrillic = 0x045c;
  13925. t.klinebelow = 0x1e35;
  13926. t.klsquare = 0x3398;
  13927. t.kmcubedsquare = 0x33a6;
  13928. t.kmonospace = 0xff4b;
  13929. t.kmsquaredsquare = 0x33a2;
  13930. t.kohiragana = 0x3053;
  13931. t.kohmsquare = 0x33c0;
  13932. t.kokaithai = 0x0e01;
  13933. t.kokatakana = 0x30b3;
  13934. t.kokatakanahalfwidth = 0xff7a;
  13935. t.kooposquare = 0x331e;
  13936. t.koppacyrillic = 0x0481;
  13937. t.koreanstandardsymbol = 0x327f;
  13938. t.koroniscmb = 0x0343;
  13939. t.kparen = 0x24a6;
  13940. t.kpasquare = 0x33aa;
  13941. t.ksicyrillic = 0x046f;
  13942. t.ktsquare = 0x33cf;
  13943. t.kturned = 0x029e;
  13944. t.kuhiragana = 0x304f;
  13945. t.kukatakana = 0x30af;
  13946. t.kukatakanahalfwidth = 0xff78;
  13947. t.kvsquare = 0x33b8;
  13948. t.kwsquare = 0x33be;
  13949. t.l = 0x006c;
  13950. t.labengali = 0x09b2;
  13951. t.lacute = 0x013a;
  13952. t.ladeva = 0x0932;
  13953. t.lagujarati = 0x0ab2;
  13954. t.lagurmukhi = 0x0a32;
  13955. t.lakkhangyaothai = 0x0e45;
  13956. t.lamaleffinalarabic = 0xfefc;
  13957. t.lamalefhamzaabovefinalarabic = 0xfef8;
  13958. t.lamalefhamzaaboveisolatedarabic = 0xfef7;
  13959. t.lamalefhamzabelowfinalarabic = 0xfefa;
  13960. t.lamalefhamzabelowisolatedarabic = 0xfef9;
  13961. t.lamalefisolatedarabic = 0xfefb;
  13962. t.lamalefmaddaabovefinalarabic = 0xfef6;
  13963. t.lamalefmaddaaboveisolatedarabic = 0xfef5;
  13964. t.lamarabic = 0x0644;
  13965. t.lambda = 0x03bb;
  13966. t.lambdastroke = 0x019b;
  13967. t.lamed = 0x05dc;
  13968. t.lameddagesh = 0xfb3c;
  13969. t.lameddageshhebrew = 0xfb3c;
  13970. t.lamedhebrew = 0x05dc;
  13971. t.lamfinalarabic = 0xfede;
  13972. t.lamhahinitialarabic = 0xfcca;
  13973. t.laminitialarabic = 0xfedf;
  13974. t.lamjeeminitialarabic = 0xfcc9;
  13975. t.lamkhahinitialarabic = 0xfccb;
  13976. t.lamlamhehisolatedarabic = 0xfdf2;
  13977. t.lammedialarabic = 0xfee0;
  13978. t.lammeemhahinitialarabic = 0xfd88;
  13979. t.lammeeminitialarabic = 0xfccc;
  13980. t.largecircle = 0x25ef;
  13981. t.lbar = 0x019a;
  13982. t.lbelt = 0x026c;
  13983. t.lbopomofo = 0x310c;
  13984. t.lcaron = 0x013e;
  13985. t.lcedilla = 0x013c;
  13986. t.lcircle = 0x24db;
  13987. t.lcircumflexbelow = 0x1e3d;
  13988. t.lcommaaccent = 0x013c;
  13989. t.ldot = 0x0140;
  13990. t.ldotaccent = 0x0140;
  13991. t.ldotbelow = 0x1e37;
  13992. t.ldotbelowmacron = 0x1e39;
  13993. t.leftangleabovecmb = 0x031a;
  13994. t.lefttackbelowcmb = 0x0318;
  13995. t.less = 0x003c;
  13996. t.lessequal = 0x2264;
  13997. t.lessequalorgreater = 0x22da;
  13998. t.lessmonospace = 0xff1c;
  13999. t.lessorequivalent = 0x2272;
  14000. t.lessorgreater = 0x2276;
  14001. t.lessoverequal = 0x2266;
  14002. t.lesssmall = 0xfe64;
  14003. t.lezh = 0x026e;
  14004. t.lfblock = 0x258c;
  14005. t.lhookretroflex = 0x026d;
  14006. t.lira = 0x20a4;
  14007. t.liwnarmenian = 0x056c;
  14008. t.lj = 0x01c9;
  14009. t.ljecyrillic = 0x0459;
  14010. t.ll = 0xf6c0;
  14011. t.lladeva = 0x0933;
  14012. t.llagujarati = 0x0ab3;
  14013. t.llinebelow = 0x1e3b;
  14014. t.llladeva = 0x0934;
  14015. t.llvocalicbengali = 0x09e1;
  14016. t.llvocalicdeva = 0x0961;
  14017. t.llvocalicvowelsignbengali = 0x09e3;
  14018. t.llvocalicvowelsigndeva = 0x0963;
  14019. t.lmiddletilde = 0x026b;
  14020. t.lmonospace = 0xff4c;
  14021. t.lmsquare = 0x33d0;
  14022. t.lochulathai = 0x0e2c;
  14023. t.logicaland = 0x2227;
  14024. t.logicalnot = 0x00ac;
  14025. t.logicalnotreversed = 0x2310;
  14026. t.logicalor = 0x2228;
  14027. t.lolingthai = 0x0e25;
  14028. t.longs = 0x017f;
  14029. t.lowlinecenterline = 0xfe4e;
  14030. t.lowlinecmb = 0x0332;
  14031. t.lowlinedashed = 0xfe4d;
  14032. t.lozenge = 0x25ca;
  14033. t.lparen = 0x24a7;
  14034. t.lslash = 0x0142;
  14035. t.lsquare = 0x2113;
  14036. t.lsuperior = 0xf6ee;
  14037. t.ltshade = 0x2591;
  14038. t.luthai = 0x0e26;
  14039. t.lvocalicbengali = 0x098c;
  14040. t.lvocalicdeva = 0x090c;
  14041. t.lvocalicvowelsignbengali = 0x09e2;
  14042. t.lvocalicvowelsigndeva = 0x0962;
  14043. t.lxsquare = 0x33d3;
  14044. t.m = 0x006d;
  14045. t.mabengali = 0x09ae;
  14046. t.macron = 0x00af;
  14047. t.macronbelowcmb = 0x0331;
  14048. t.macroncmb = 0x0304;
  14049. t.macronlowmod = 0x02cd;
  14050. t.macronmonospace = 0xffe3;
  14051. t.macute = 0x1e3f;
  14052. t.madeva = 0x092e;
  14053. t.magujarati = 0x0aae;
  14054. t.magurmukhi = 0x0a2e;
  14055. t.mahapakhhebrew = 0x05a4;
  14056. t.mahapakhlefthebrew = 0x05a4;
  14057. t.mahiragana = 0x307e;
  14058. t.maichattawalowleftthai = 0xf895;
  14059. t.maichattawalowrightthai = 0xf894;
  14060. t.maichattawathai = 0x0e4b;
  14061. t.maichattawaupperleftthai = 0xf893;
  14062. t.maieklowleftthai = 0xf88c;
  14063. t.maieklowrightthai = 0xf88b;
  14064. t.maiekthai = 0x0e48;
  14065. t.maiekupperleftthai = 0xf88a;
  14066. t.maihanakatleftthai = 0xf884;
  14067. t.maihanakatthai = 0x0e31;
  14068. t.maitaikhuleftthai = 0xf889;
  14069. t.maitaikhuthai = 0x0e47;
  14070. t.maitholowleftthai = 0xf88f;
  14071. t.maitholowrightthai = 0xf88e;
  14072. t.maithothai = 0x0e49;
  14073. t.maithoupperleftthai = 0xf88d;
  14074. t.maitrilowleftthai = 0xf892;
  14075. t.maitrilowrightthai = 0xf891;
  14076. t.maitrithai = 0x0e4a;
  14077. t.maitriupperleftthai = 0xf890;
  14078. t.maiyamokthai = 0x0e46;
  14079. t.makatakana = 0x30de;
  14080. t.makatakanahalfwidth = 0xff8f;
  14081. t.male = 0x2642;
  14082. t.mansyonsquare = 0x3347;
  14083. t.maqafhebrew = 0x05be;
  14084. t.mars = 0x2642;
  14085. t.masoracirclehebrew = 0x05af;
  14086. t.masquare = 0x3383;
  14087. t.mbopomofo = 0x3107;
  14088. t.mbsquare = 0x33d4;
  14089. t.mcircle = 0x24dc;
  14090. t.mcubedsquare = 0x33a5;
  14091. t.mdotaccent = 0x1e41;
  14092. t.mdotbelow = 0x1e43;
  14093. t.meemarabic = 0x0645;
  14094. t.meemfinalarabic = 0xfee2;
  14095. t.meeminitialarabic = 0xfee3;
  14096. t.meemmedialarabic = 0xfee4;
  14097. t.meemmeeminitialarabic = 0xfcd1;
  14098. t.meemmeemisolatedarabic = 0xfc48;
  14099. t.meetorusquare = 0x334d;
  14100. t.mehiragana = 0x3081;
  14101. t.meizierasquare = 0x337e;
  14102. t.mekatakana = 0x30e1;
  14103. t.mekatakanahalfwidth = 0xff92;
  14104. t.mem = 0x05de;
  14105. t.memdagesh = 0xfb3e;
  14106. t.memdageshhebrew = 0xfb3e;
  14107. t.memhebrew = 0x05de;
  14108. t.menarmenian = 0x0574;
  14109. t.merkhahebrew = 0x05a5;
  14110. t.merkhakefulahebrew = 0x05a6;
  14111. t.merkhakefulalefthebrew = 0x05a6;
  14112. t.merkhalefthebrew = 0x05a5;
  14113. t.mhook = 0x0271;
  14114. t.mhzsquare = 0x3392;
  14115. t.middledotkatakanahalfwidth = 0xff65;
  14116. t.middot = 0x00b7;
  14117. t.mieumacirclekorean = 0x3272;
  14118. t.mieumaparenkorean = 0x3212;
  14119. t.mieumcirclekorean = 0x3264;
  14120. t.mieumkorean = 0x3141;
  14121. t.mieumpansioskorean = 0x3170;
  14122. t.mieumparenkorean = 0x3204;
  14123. t.mieumpieupkorean = 0x316e;
  14124. t.mieumsioskorean = 0x316f;
  14125. t.mihiragana = 0x307f;
  14126. t.mikatakana = 0x30df;
  14127. t.mikatakanahalfwidth = 0xff90;
  14128. t.minus = 0x2212;
  14129. t.minusbelowcmb = 0x0320;
  14130. t.minuscircle = 0x2296;
  14131. t.minusmod = 0x02d7;
  14132. t.minusplus = 0x2213;
  14133. t.minute = 0x2032;
  14134. t.miribaarusquare = 0x334a;
  14135. t.mirisquare = 0x3349;
  14136. t.mlonglegturned = 0x0270;
  14137. t.mlsquare = 0x3396;
  14138. t.mmcubedsquare = 0x33a3;
  14139. t.mmonospace = 0xff4d;
  14140. t.mmsquaredsquare = 0x339f;
  14141. t.mohiragana = 0x3082;
  14142. t.mohmsquare = 0x33c1;
  14143. t.mokatakana = 0x30e2;
  14144. t.mokatakanahalfwidth = 0xff93;
  14145. t.molsquare = 0x33d6;
  14146. t.momathai = 0x0e21;
  14147. t.moverssquare = 0x33a7;
  14148. t.moverssquaredsquare = 0x33a8;
  14149. t.mparen = 0x24a8;
  14150. t.mpasquare = 0x33ab;
  14151. t.mssquare = 0x33b3;
  14152. t.msuperior = 0xf6ef;
  14153. t.mturned = 0x026f;
  14154. t.mu = 0x00b5;
  14155. t.mu1 = 0x00b5;
  14156. t.muasquare = 0x3382;
  14157. t.muchgreater = 0x226b;
  14158. t.muchless = 0x226a;
  14159. t.mufsquare = 0x338c;
  14160. t.mugreek = 0x03bc;
  14161. t.mugsquare = 0x338d;
  14162. t.muhiragana = 0x3080;
  14163. t.mukatakana = 0x30e0;
  14164. t.mukatakanahalfwidth = 0xff91;
  14165. t.mulsquare = 0x3395;
  14166. t.multiply = 0x00d7;
  14167. t.mumsquare = 0x339b;
  14168. t.munahhebrew = 0x05a3;
  14169. t.munahlefthebrew = 0x05a3;
  14170. t.musicalnote = 0x266a;
  14171. t.musicalnotedbl = 0x266b;
  14172. t.musicflatsign = 0x266d;
  14173. t.musicsharpsign = 0x266f;
  14174. t.mussquare = 0x33b2;
  14175. t.muvsquare = 0x33b6;
  14176. t.muwsquare = 0x33bc;
  14177. t.mvmegasquare = 0x33b9;
  14178. t.mvsquare = 0x33b7;
  14179. t.mwmegasquare = 0x33bf;
  14180. t.mwsquare = 0x33bd;
  14181. t.n = 0x006e;
  14182. t.nabengali = 0x09a8;
  14183. t.nabla = 0x2207;
  14184. t.nacute = 0x0144;
  14185. t.nadeva = 0x0928;
  14186. t.nagujarati = 0x0aa8;
  14187. t.nagurmukhi = 0x0a28;
  14188. t.nahiragana = 0x306a;
  14189. t.nakatakana = 0x30ca;
  14190. t.nakatakanahalfwidth = 0xff85;
  14191. t.napostrophe = 0x0149;
  14192. t.nasquare = 0x3381;
  14193. t.nbopomofo = 0x310b;
  14194. t.nbspace = 0x00a0;
  14195. t.ncaron = 0x0148;
  14196. t.ncedilla = 0x0146;
  14197. t.ncircle = 0x24dd;
  14198. t.ncircumflexbelow = 0x1e4b;
  14199. t.ncommaaccent = 0x0146;
  14200. t.ndotaccent = 0x1e45;
  14201. t.ndotbelow = 0x1e47;
  14202. t.nehiragana = 0x306d;
  14203. t.nekatakana = 0x30cd;
  14204. t.nekatakanahalfwidth = 0xff88;
  14205. t.newsheqelsign = 0x20aa;
  14206. t.nfsquare = 0x338b;
  14207. t.ngabengali = 0x0999;
  14208. t.ngadeva = 0x0919;
  14209. t.ngagujarati = 0x0a99;
  14210. t.ngagurmukhi = 0x0a19;
  14211. t.ngonguthai = 0x0e07;
  14212. t.nhiragana = 0x3093;
  14213. t.nhookleft = 0x0272;
  14214. t.nhookretroflex = 0x0273;
  14215. t.nieunacirclekorean = 0x326f;
  14216. t.nieunaparenkorean = 0x320f;
  14217. t.nieuncieuckorean = 0x3135;
  14218. t.nieuncirclekorean = 0x3261;
  14219. t.nieunhieuhkorean = 0x3136;
  14220. t.nieunkorean = 0x3134;
  14221. t.nieunpansioskorean = 0x3168;
  14222. t.nieunparenkorean = 0x3201;
  14223. t.nieunsioskorean = 0x3167;
  14224. t.nieuntikeutkorean = 0x3166;
  14225. t.nihiragana = 0x306b;
  14226. t.nikatakana = 0x30cb;
  14227. t.nikatakanahalfwidth = 0xff86;
  14228. t.nikhahitleftthai = 0xf899;
  14229. t.nikhahitthai = 0x0e4d;
  14230. t.nine = 0x0039;
  14231. t.ninearabic = 0x0669;
  14232. t.ninebengali = 0x09ef;
  14233. t.ninecircle = 0x2468;
  14234. t.ninecircleinversesansserif = 0x2792;
  14235. t.ninedeva = 0x096f;
  14236. t.ninegujarati = 0x0aef;
  14237. t.ninegurmukhi = 0x0a6f;
  14238. t.ninehackarabic = 0x0669;
  14239. t.ninehangzhou = 0x3029;
  14240. t.nineideographicparen = 0x3228;
  14241. t.nineinferior = 0x2089;
  14242. t.ninemonospace = 0xff19;
  14243. t.nineoldstyle = 0xf739;
  14244. t.nineparen = 0x247c;
  14245. t.nineperiod = 0x2490;
  14246. t.ninepersian = 0x06f9;
  14247. t.nineroman = 0x2178;
  14248. t.ninesuperior = 0x2079;
  14249. t.nineteencircle = 0x2472;
  14250. t.nineteenparen = 0x2486;
  14251. t.nineteenperiod = 0x249a;
  14252. t.ninethai = 0x0e59;
  14253. t.nj = 0x01cc;
  14254. t.njecyrillic = 0x045a;
  14255. t.nkatakana = 0x30f3;
  14256. t.nkatakanahalfwidth = 0xff9d;
  14257. t.nlegrightlong = 0x019e;
  14258. t.nlinebelow = 0x1e49;
  14259. t.nmonospace = 0xff4e;
  14260. t.nmsquare = 0x339a;
  14261. t.nnabengali = 0x09a3;
  14262. t.nnadeva = 0x0923;
  14263. t.nnagujarati = 0x0aa3;
  14264. t.nnagurmukhi = 0x0a23;
  14265. t.nnnadeva = 0x0929;
  14266. t.nohiragana = 0x306e;
  14267. t.nokatakana = 0x30ce;
  14268. t.nokatakanahalfwidth = 0xff89;
  14269. t.nonbreakingspace = 0x00a0;
  14270. t.nonenthai = 0x0e13;
  14271. t.nonuthai = 0x0e19;
  14272. t.noonarabic = 0x0646;
  14273. t.noonfinalarabic = 0xfee6;
  14274. t.noonghunnaarabic = 0x06ba;
  14275. t.noonghunnafinalarabic = 0xfb9f;
  14276. t.nooninitialarabic = 0xfee7;
  14277. t.noonjeeminitialarabic = 0xfcd2;
  14278. t.noonjeemisolatedarabic = 0xfc4b;
  14279. t.noonmedialarabic = 0xfee8;
  14280. t.noonmeeminitialarabic = 0xfcd5;
  14281. t.noonmeemisolatedarabic = 0xfc4e;
  14282. t.noonnoonfinalarabic = 0xfc8d;
  14283. t.notcontains = 0x220c;
  14284. t.notelement = 0x2209;
  14285. t.notelementof = 0x2209;
  14286. t.notequal = 0x2260;
  14287. t.notgreater = 0x226f;
  14288. t.notgreaternorequal = 0x2271;
  14289. t.notgreaternorless = 0x2279;
  14290. t.notidentical = 0x2262;
  14291. t.notless = 0x226e;
  14292. t.notlessnorequal = 0x2270;
  14293. t.notparallel = 0x2226;
  14294. t.notprecedes = 0x2280;
  14295. t.notsubset = 0x2284;
  14296. t.notsucceeds = 0x2281;
  14297. t.notsuperset = 0x2285;
  14298. t.nowarmenian = 0x0576;
  14299. t.nparen = 0x24a9;
  14300. t.nssquare = 0x33b1;
  14301. t.nsuperior = 0x207f;
  14302. t.ntilde = 0x00f1;
  14303. t.nu = 0x03bd;
  14304. t.nuhiragana = 0x306c;
  14305. t.nukatakana = 0x30cc;
  14306. t.nukatakanahalfwidth = 0xff87;
  14307. t.nuktabengali = 0x09bc;
  14308. t.nuktadeva = 0x093c;
  14309. t.nuktagujarati = 0x0abc;
  14310. t.nuktagurmukhi = 0x0a3c;
  14311. t.numbersign = 0x0023;
  14312. t.numbersignmonospace = 0xff03;
  14313. t.numbersignsmall = 0xfe5f;
  14314. t.numeralsigngreek = 0x0374;
  14315. t.numeralsignlowergreek = 0x0375;
  14316. t.numero = 0x2116;
  14317. t.nun = 0x05e0;
  14318. t.nundagesh = 0xfb40;
  14319. t.nundageshhebrew = 0xfb40;
  14320. t.nunhebrew = 0x05e0;
  14321. t.nvsquare = 0x33b5;
  14322. t.nwsquare = 0x33bb;
  14323. t.nyabengali = 0x099e;
  14324. t.nyadeva = 0x091e;
  14325. t.nyagujarati = 0x0a9e;
  14326. t.nyagurmukhi = 0x0a1e;
  14327. t.o = 0x006f;
  14328. t.oacute = 0x00f3;
  14329. t.oangthai = 0x0e2d;
  14330. t.obarred = 0x0275;
  14331. t.obarredcyrillic = 0x04e9;
  14332. t.obarreddieresiscyrillic = 0x04eb;
  14333. t.obengali = 0x0993;
  14334. t.obopomofo = 0x311b;
  14335. t.obreve = 0x014f;
  14336. t.ocandradeva = 0x0911;
  14337. t.ocandragujarati = 0x0a91;
  14338. t.ocandravowelsigndeva = 0x0949;
  14339. t.ocandravowelsigngujarati = 0x0ac9;
  14340. t.ocaron = 0x01d2;
  14341. t.ocircle = 0x24de;
  14342. t.ocircumflex = 0x00f4;
  14343. t.ocircumflexacute = 0x1ed1;
  14344. t.ocircumflexdotbelow = 0x1ed9;
  14345. t.ocircumflexgrave = 0x1ed3;
  14346. t.ocircumflexhookabove = 0x1ed5;
  14347. t.ocircumflextilde = 0x1ed7;
  14348. t.ocyrillic = 0x043e;
  14349. t.odblacute = 0x0151;
  14350. t.odblgrave = 0x020d;
  14351. t.odeva = 0x0913;
  14352. t.odieresis = 0x00f6;
  14353. t.odieresiscyrillic = 0x04e7;
  14354. t.odotbelow = 0x1ecd;
  14355. t.oe = 0x0153;
  14356. t.oekorean = 0x315a;
  14357. t.ogonek = 0x02db;
  14358. t.ogonekcmb = 0x0328;
  14359. t.ograve = 0x00f2;
  14360. t.ogujarati = 0x0a93;
  14361. t.oharmenian = 0x0585;
  14362. t.ohiragana = 0x304a;
  14363. t.ohookabove = 0x1ecf;
  14364. t.ohorn = 0x01a1;
  14365. t.ohornacute = 0x1edb;
  14366. t.ohorndotbelow = 0x1ee3;
  14367. t.ohorngrave = 0x1edd;
  14368. t.ohornhookabove = 0x1edf;
  14369. t.ohorntilde = 0x1ee1;
  14370. t.ohungarumlaut = 0x0151;
  14371. t.oi = 0x01a3;
  14372. t.oinvertedbreve = 0x020f;
  14373. t.okatakana = 0x30aa;
  14374. t.okatakanahalfwidth = 0xff75;
  14375. t.okorean = 0x3157;
  14376. t.olehebrew = 0x05ab;
  14377. t.omacron = 0x014d;
  14378. t.omacronacute = 0x1e53;
  14379. t.omacrongrave = 0x1e51;
  14380. t.omdeva = 0x0950;
  14381. t.omega = 0x03c9;
  14382. t.omega1 = 0x03d6;
  14383. t.omegacyrillic = 0x0461;
  14384. t.omegalatinclosed = 0x0277;
  14385. t.omegaroundcyrillic = 0x047b;
  14386. t.omegatitlocyrillic = 0x047d;
  14387. t.omegatonos = 0x03ce;
  14388. t.omgujarati = 0x0ad0;
  14389. t.omicron = 0x03bf;
  14390. t.omicrontonos = 0x03cc;
  14391. t.omonospace = 0xff4f;
  14392. t.one = 0x0031;
  14393. t.onearabic = 0x0661;
  14394. t.onebengali = 0x09e7;
  14395. t.onecircle = 0x2460;
  14396. t.onecircleinversesansserif = 0x278a;
  14397. t.onedeva = 0x0967;
  14398. t.onedotenleader = 0x2024;
  14399. t.oneeighth = 0x215b;
  14400. t.onefitted = 0xf6dc;
  14401. t.onegujarati = 0x0ae7;
  14402. t.onegurmukhi = 0x0a67;
  14403. t.onehackarabic = 0x0661;
  14404. t.onehalf = 0x00bd;
  14405. t.onehangzhou = 0x3021;
  14406. t.oneideographicparen = 0x3220;
  14407. t.oneinferior = 0x2081;
  14408. t.onemonospace = 0xff11;
  14409. t.onenumeratorbengali = 0x09f4;
  14410. t.oneoldstyle = 0xf731;
  14411. t.oneparen = 0x2474;
  14412. t.oneperiod = 0x2488;
  14413. t.onepersian = 0x06f1;
  14414. t.onequarter = 0x00bc;
  14415. t.oneroman = 0x2170;
  14416. t.onesuperior = 0x00b9;
  14417. t.onethai = 0x0e51;
  14418. t.onethird = 0x2153;
  14419. t.oogonek = 0x01eb;
  14420. t.oogonekmacron = 0x01ed;
  14421. t.oogurmukhi = 0x0a13;
  14422. t.oomatragurmukhi = 0x0a4b;
  14423. t.oopen = 0x0254;
  14424. t.oparen = 0x24aa;
  14425. t.openbullet = 0x25e6;
  14426. t.option = 0x2325;
  14427. t.ordfeminine = 0x00aa;
  14428. t.ordmasculine = 0x00ba;
  14429. t.orthogonal = 0x221f;
  14430. t.oshortdeva = 0x0912;
  14431. t.oshortvowelsigndeva = 0x094a;
  14432. t.oslash = 0x00f8;
  14433. t.oslashacute = 0x01ff;
  14434. t.osmallhiragana = 0x3049;
  14435. t.osmallkatakana = 0x30a9;
  14436. t.osmallkatakanahalfwidth = 0xff6b;
  14437. t.ostrokeacute = 0x01ff;
  14438. t.osuperior = 0xf6f0;
  14439. t.otcyrillic = 0x047f;
  14440. t.otilde = 0x00f5;
  14441. t.otildeacute = 0x1e4d;
  14442. t.otildedieresis = 0x1e4f;
  14443. t.oubopomofo = 0x3121;
  14444. t.overline = 0x203e;
  14445. t.overlinecenterline = 0xfe4a;
  14446. t.overlinecmb = 0x0305;
  14447. t.overlinedashed = 0xfe49;
  14448. t.overlinedblwavy = 0xfe4c;
  14449. t.overlinewavy = 0xfe4b;
  14450. t.overscore = 0x00af;
  14451. t.ovowelsignbengali = 0x09cb;
  14452. t.ovowelsigndeva = 0x094b;
  14453. t.ovowelsigngujarati = 0x0acb;
  14454. t.p = 0x0070;
  14455. t.paampssquare = 0x3380;
  14456. t.paasentosquare = 0x332b;
  14457. t.pabengali = 0x09aa;
  14458. t.pacute = 0x1e55;
  14459. t.padeva = 0x092a;
  14460. t.pagedown = 0x21df;
  14461. t.pageup = 0x21de;
  14462. t.pagujarati = 0x0aaa;
  14463. t.pagurmukhi = 0x0a2a;
  14464. t.pahiragana = 0x3071;
  14465. t.paiyannoithai = 0x0e2f;
  14466. t.pakatakana = 0x30d1;
  14467. t.palatalizationcyrilliccmb = 0x0484;
  14468. t.palochkacyrillic = 0x04c0;
  14469. t.pansioskorean = 0x317f;
  14470. t.paragraph = 0x00b6;
  14471. t.parallel = 0x2225;
  14472. t.parenleft = 0x0028;
  14473. t.parenleftaltonearabic = 0xfd3e;
  14474. t.parenleftbt = 0xf8ed;
  14475. t.parenleftex = 0xf8ec;
  14476. t.parenleftinferior = 0x208d;
  14477. t.parenleftmonospace = 0xff08;
  14478. t.parenleftsmall = 0xfe59;
  14479. t.parenleftsuperior = 0x207d;
  14480. t.parenlefttp = 0xf8eb;
  14481. t.parenleftvertical = 0xfe35;
  14482. t.parenright = 0x0029;
  14483. t.parenrightaltonearabic = 0xfd3f;
  14484. t.parenrightbt = 0xf8f8;
  14485. t.parenrightex = 0xf8f7;
  14486. t.parenrightinferior = 0x208e;
  14487. t.parenrightmonospace = 0xff09;
  14488. t.parenrightsmall = 0xfe5a;
  14489. t.parenrightsuperior = 0x207e;
  14490. t.parenrighttp = 0xf8f6;
  14491. t.parenrightvertical = 0xfe36;
  14492. t.partialdiff = 0x2202;
  14493. t.paseqhebrew = 0x05c0;
  14494. t.pashtahebrew = 0x0599;
  14495. t.pasquare = 0x33a9;
  14496. t.patah = 0x05b7;
  14497. t.patah11 = 0x05b7;
  14498. t.patah1d = 0x05b7;
  14499. t.patah2a = 0x05b7;
  14500. t.patahhebrew = 0x05b7;
  14501. t.patahnarrowhebrew = 0x05b7;
  14502. t.patahquarterhebrew = 0x05b7;
  14503. t.patahwidehebrew = 0x05b7;
  14504. t.pazerhebrew = 0x05a1;
  14505. t.pbopomofo = 0x3106;
  14506. t.pcircle = 0x24df;
  14507. t.pdotaccent = 0x1e57;
  14508. t.pe = 0x05e4;
  14509. t.pecyrillic = 0x043f;
  14510. t.pedagesh = 0xfb44;
  14511. t.pedageshhebrew = 0xfb44;
  14512. t.peezisquare = 0x333b;
  14513. t.pefinaldageshhebrew = 0xfb43;
  14514. t.peharabic = 0x067e;
  14515. t.peharmenian = 0x057a;
  14516. t.pehebrew = 0x05e4;
  14517. t.pehfinalarabic = 0xfb57;
  14518. t.pehinitialarabic = 0xfb58;
  14519. t.pehiragana = 0x307a;
  14520. t.pehmedialarabic = 0xfb59;
  14521. t.pekatakana = 0x30da;
  14522. t.pemiddlehookcyrillic = 0x04a7;
  14523. t.perafehebrew = 0xfb4e;
  14524. t.percent = 0x0025;
  14525. t.percentarabic = 0x066a;
  14526. t.percentmonospace = 0xff05;
  14527. t.percentsmall = 0xfe6a;
  14528. t.period = 0x002e;
  14529. t.periodarmenian = 0x0589;
  14530. t.periodcentered = 0x00b7;
  14531. t.periodhalfwidth = 0xff61;
  14532. t.periodinferior = 0xf6e7;
  14533. t.periodmonospace = 0xff0e;
  14534. t.periodsmall = 0xfe52;
  14535. t.periodsuperior = 0xf6e8;
  14536. t.perispomenigreekcmb = 0x0342;
  14537. t.perpendicular = 0x22a5;
  14538. t.perthousand = 0x2030;
  14539. t.peseta = 0x20a7;
  14540. t.pfsquare = 0x338a;
  14541. t.phabengali = 0x09ab;
  14542. t.phadeva = 0x092b;
  14543. t.phagujarati = 0x0aab;
  14544. t.phagurmukhi = 0x0a2b;
  14545. t.phi = 0x03c6;
  14546. t.phi1 = 0x03d5;
  14547. t.phieuphacirclekorean = 0x327a;
  14548. t.phieuphaparenkorean = 0x321a;
  14549. t.phieuphcirclekorean = 0x326c;
  14550. t.phieuphkorean = 0x314d;
  14551. t.phieuphparenkorean = 0x320c;
  14552. t.philatin = 0x0278;
  14553. t.phinthuthai = 0x0e3a;
  14554. t.phisymbolgreek = 0x03d5;
  14555. t.phook = 0x01a5;
  14556. t.phophanthai = 0x0e1e;
  14557. t.phophungthai = 0x0e1c;
  14558. t.phosamphaothai = 0x0e20;
  14559. t.pi = 0x03c0;
  14560. t.pieupacirclekorean = 0x3273;
  14561. t.pieupaparenkorean = 0x3213;
  14562. t.pieupcieuckorean = 0x3176;
  14563. t.pieupcirclekorean = 0x3265;
  14564. t.pieupkiyeokkorean = 0x3172;
  14565. t.pieupkorean = 0x3142;
  14566. t.pieupparenkorean = 0x3205;
  14567. t.pieupsioskiyeokkorean = 0x3174;
  14568. t.pieupsioskorean = 0x3144;
  14569. t.pieupsiostikeutkorean = 0x3175;
  14570. t.pieupthieuthkorean = 0x3177;
  14571. t.pieuptikeutkorean = 0x3173;
  14572. t.pihiragana = 0x3074;
  14573. t.pikatakana = 0x30d4;
  14574. t.pisymbolgreek = 0x03d6;
  14575. t.piwrarmenian = 0x0583;
  14576. t.planckover2pi = 0x210f;
  14577. t.planckover2pi1 = 0x210f;
  14578. t.plus = 0x002b;
  14579. t.plusbelowcmb = 0x031f;
  14580. t.pluscircle = 0x2295;
  14581. t.plusminus = 0x00b1;
  14582. t.plusmod = 0x02d6;
  14583. t.plusmonospace = 0xff0b;
  14584. t.plussmall = 0xfe62;
  14585. t.plussuperior = 0x207a;
  14586. t.pmonospace = 0xff50;
  14587. t.pmsquare = 0x33d8;
  14588. t.pohiragana = 0x307d;
  14589. t.pointingindexdownwhite = 0x261f;
  14590. t.pointingindexleftwhite = 0x261c;
  14591. t.pointingindexrightwhite = 0x261e;
  14592. t.pointingindexupwhite = 0x261d;
  14593. t.pokatakana = 0x30dd;
  14594. t.poplathai = 0x0e1b;
  14595. t.postalmark = 0x3012;
  14596. t.postalmarkface = 0x3020;
  14597. t.pparen = 0x24ab;
  14598. t.precedes = 0x227a;
  14599. t.prescription = 0x211e;
  14600. t.primemod = 0x02b9;
  14601. t.primereversed = 0x2035;
  14602. t.product = 0x220f;
  14603. t.projective = 0x2305;
  14604. t.prolongedkana = 0x30fc;
  14605. t.propellor = 0x2318;
  14606. t.propersubset = 0x2282;
  14607. t.propersuperset = 0x2283;
  14608. t.proportion = 0x2237;
  14609. t.proportional = 0x221d;
  14610. t.psi = 0x03c8;
  14611. t.psicyrillic = 0x0471;
  14612. t.psilipneumatacyrilliccmb = 0x0486;
  14613. t.pssquare = 0x33b0;
  14614. t.puhiragana = 0x3077;
  14615. t.pukatakana = 0x30d7;
  14616. t.pvsquare = 0x33b4;
  14617. t.pwsquare = 0x33ba;
  14618. t.q = 0x0071;
  14619. t.qadeva = 0x0958;
  14620. t.qadmahebrew = 0x05a8;
  14621. t.qafarabic = 0x0642;
  14622. t.qaffinalarabic = 0xfed6;
  14623. t.qafinitialarabic = 0xfed7;
  14624. t.qafmedialarabic = 0xfed8;
  14625. t.qamats = 0x05b8;
  14626. t.qamats10 = 0x05b8;
  14627. t.qamats1a = 0x05b8;
  14628. t.qamats1c = 0x05b8;
  14629. t.qamats27 = 0x05b8;
  14630. t.qamats29 = 0x05b8;
  14631. t.qamats33 = 0x05b8;
  14632. t.qamatsde = 0x05b8;
  14633. t.qamatshebrew = 0x05b8;
  14634. t.qamatsnarrowhebrew = 0x05b8;
  14635. t.qamatsqatanhebrew = 0x05b8;
  14636. t.qamatsqatannarrowhebrew = 0x05b8;
  14637. t.qamatsqatanquarterhebrew = 0x05b8;
  14638. t.qamatsqatanwidehebrew = 0x05b8;
  14639. t.qamatsquarterhebrew = 0x05b8;
  14640. t.qamatswidehebrew = 0x05b8;
  14641. t.qarneyparahebrew = 0x059f;
  14642. t.qbopomofo = 0x3111;
  14643. t.qcircle = 0x24e0;
  14644. t.qhook = 0x02a0;
  14645. t.qmonospace = 0xff51;
  14646. t.qof = 0x05e7;
  14647. t.qofdagesh = 0xfb47;
  14648. t.qofdageshhebrew = 0xfb47;
  14649. t.qofhebrew = 0x05e7;
  14650. t.qparen = 0x24ac;
  14651. t.quarternote = 0x2669;
  14652. t.qubuts = 0x05bb;
  14653. t.qubuts18 = 0x05bb;
  14654. t.qubuts25 = 0x05bb;
  14655. t.qubuts31 = 0x05bb;
  14656. t.qubutshebrew = 0x05bb;
  14657. t.qubutsnarrowhebrew = 0x05bb;
  14658. t.qubutsquarterhebrew = 0x05bb;
  14659. t.qubutswidehebrew = 0x05bb;
  14660. t.question = 0x003f;
  14661. t.questionarabic = 0x061f;
  14662. t.questionarmenian = 0x055e;
  14663. t.questiondown = 0x00bf;
  14664. t.questiondownsmall = 0xf7bf;
  14665. t.questiongreek = 0x037e;
  14666. t.questionmonospace = 0xff1f;
  14667. t.questionsmall = 0xf73f;
  14668. t.quotedbl = 0x0022;
  14669. t.quotedblbase = 0x201e;
  14670. t.quotedblleft = 0x201c;
  14671. t.quotedblmonospace = 0xff02;
  14672. t.quotedblprime = 0x301e;
  14673. t.quotedblprimereversed = 0x301d;
  14674. t.quotedblright = 0x201d;
  14675. t.quoteleft = 0x2018;
  14676. t.quoteleftreversed = 0x201b;
  14677. t.quotereversed = 0x201b;
  14678. t.quoteright = 0x2019;
  14679. t.quoterightn = 0x0149;
  14680. t.quotesinglbase = 0x201a;
  14681. t.quotesingle = 0x0027;
  14682. t.quotesinglemonospace = 0xff07;
  14683. t.r = 0x0072;
  14684. t.raarmenian = 0x057c;
  14685. t.rabengali = 0x09b0;
  14686. t.racute = 0x0155;
  14687. t.radeva = 0x0930;
  14688. t.radical = 0x221a;
  14689. t.radicalex = 0xf8e5;
  14690. t.radoverssquare = 0x33ae;
  14691. t.radoverssquaredsquare = 0x33af;
  14692. t.radsquare = 0x33ad;
  14693. t.rafe = 0x05bf;
  14694. t.rafehebrew = 0x05bf;
  14695. t.ragujarati = 0x0ab0;
  14696. t.ragurmukhi = 0x0a30;
  14697. t.rahiragana = 0x3089;
  14698. t.rakatakana = 0x30e9;
  14699. t.rakatakanahalfwidth = 0xff97;
  14700. t.ralowerdiagonalbengali = 0x09f1;
  14701. t.ramiddlediagonalbengali = 0x09f0;
  14702. t.ramshorn = 0x0264;
  14703. t.ratio = 0x2236;
  14704. t.rbopomofo = 0x3116;
  14705. t.rcaron = 0x0159;
  14706. t.rcedilla = 0x0157;
  14707. t.rcircle = 0x24e1;
  14708. t.rcommaaccent = 0x0157;
  14709. t.rdblgrave = 0x0211;
  14710. t.rdotaccent = 0x1e59;
  14711. t.rdotbelow = 0x1e5b;
  14712. t.rdotbelowmacron = 0x1e5d;
  14713. t.referencemark = 0x203b;
  14714. t.reflexsubset = 0x2286;
  14715. t.reflexsuperset = 0x2287;
  14716. t.registered = 0x00ae;
  14717. t.registersans = 0xf8e8;
  14718. t.registerserif = 0xf6da;
  14719. t.reharabic = 0x0631;
  14720. t.reharmenian = 0x0580;
  14721. t.rehfinalarabic = 0xfeae;
  14722. t.rehiragana = 0x308c;
  14723. t.rekatakana = 0x30ec;
  14724. t.rekatakanahalfwidth = 0xff9a;
  14725. t.resh = 0x05e8;
  14726. t.reshdageshhebrew = 0xfb48;
  14727. t.reshhebrew = 0x05e8;
  14728. t.reversedtilde = 0x223d;
  14729. t.reviahebrew = 0x0597;
  14730. t.reviamugrashhebrew = 0x0597;
  14731. t.revlogicalnot = 0x2310;
  14732. t.rfishhook = 0x027e;
  14733. t.rfishhookreversed = 0x027f;
  14734. t.rhabengali = 0x09dd;
  14735. t.rhadeva = 0x095d;
  14736. t.rho = 0x03c1;
  14737. t.rhook = 0x027d;
  14738. t.rhookturned = 0x027b;
  14739. t.rhookturnedsuperior = 0x02b5;
  14740. t.rhosymbolgreek = 0x03f1;
  14741. t.rhotichookmod = 0x02de;
  14742. t.rieulacirclekorean = 0x3271;
  14743. t.rieulaparenkorean = 0x3211;
  14744. t.rieulcirclekorean = 0x3263;
  14745. t.rieulhieuhkorean = 0x3140;
  14746. t.rieulkiyeokkorean = 0x313a;
  14747. t.rieulkiyeoksioskorean = 0x3169;
  14748. t.rieulkorean = 0x3139;
  14749. t.rieulmieumkorean = 0x313b;
  14750. t.rieulpansioskorean = 0x316c;
  14751. t.rieulparenkorean = 0x3203;
  14752. t.rieulphieuphkorean = 0x313f;
  14753. t.rieulpieupkorean = 0x313c;
  14754. t.rieulpieupsioskorean = 0x316b;
  14755. t.rieulsioskorean = 0x313d;
  14756. t.rieulthieuthkorean = 0x313e;
  14757. t.rieultikeutkorean = 0x316a;
  14758. t.rieulyeorinhieuhkorean = 0x316d;
  14759. t.rightangle = 0x221f;
  14760. t.righttackbelowcmb = 0x0319;
  14761. t.righttriangle = 0x22bf;
  14762. t.rihiragana = 0x308a;
  14763. t.rikatakana = 0x30ea;
  14764. t.rikatakanahalfwidth = 0xff98;
  14765. t.ring = 0x02da;
  14766. t.ringbelowcmb = 0x0325;
  14767. t.ringcmb = 0x030a;
  14768. t.ringhalfleft = 0x02bf;
  14769. t.ringhalfleftarmenian = 0x0559;
  14770. t.ringhalfleftbelowcmb = 0x031c;
  14771. t.ringhalfleftcentered = 0x02d3;
  14772. t.ringhalfright = 0x02be;
  14773. t.ringhalfrightbelowcmb = 0x0339;
  14774. t.ringhalfrightcentered = 0x02d2;
  14775. t.rinvertedbreve = 0x0213;
  14776. t.rittorusquare = 0x3351;
  14777. t.rlinebelow = 0x1e5f;
  14778. t.rlongleg = 0x027c;
  14779. t.rlonglegturned = 0x027a;
  14780. t.rmonospace = 0xff52;
  14781. t.rohiragana = 0x308d;
  14782. t.rokatakana = 0x30ed;
  14783. t.rokatakanahalfwidth = 0xff9b;
  14784. t.roruathai = 0x0e23;
  14785. t.rparen = 0x24ad;
  14786. t.rrabengali = 0x09dc;
  14787. t.rradeva = 0x0931;
  14788. t.rragurmukhi = 0x0a5c;
  14789. t.rreharabic = 0x0691;
  14790. t.rrehfinalarabic = 0xfb8d;
  14791. t.rrvocalicbengali = 0x09e0;
  14792. t.rrvocalicdeva = 0x0960;
  14793. t.rrvocalicgujarati = 0x0ae0;
  14794. t.rrvocalicvowelsignbengali = 0x09c4;
  14795. t.rrvocalicvowelsigndeva = 0x0944;
  14796. t.rrvocalicvowelsigngujarati = 0x0ac4;
  14797. t.rsuperior = 0xf6f1;
  14798. t.rtblock = 0x2590;
  14799. t.rturned = 0x0279;
  14800. t.rturnedsuperior = 0x02b4;
  14801. t.ruhiragana = 0x308b;
  14802. t.rukatakana = 0x30eb;
  14803. t.rukatakanahalfwidth = 0xff99;
  14804. t.rupeemarkbengali = 0x09f2;
  14805. t.rupeesignbengali = 0x09f3;
  14806. t.rupiah = 0xf6dd;
  14807. t.ruthai = 0x0e24;
  14808. t.rvocalicbengali = 0x098b;
  14809. t.rvocalicdeva = 0x090b;
  14810. t.rvocalicgujarati = 0x0a8b;
  14811. t.rvocalicvowelsignbengali = 0x09c3;
  14812. t.rvocalicvowelsigndeva = 0x0943;
  14813. t.rvocalicvowelsigngujarati = 0x0ac3;
  14814. t.s = 0x0073;
  14815. t.sabengali = 0x09b8;
  14816. t.sacute = 0x015b;
  14817. t.sacutedotaccent = 0x1e65;
  14818. t.sadarabic = 0x0635;
  14819. t.sadeva = 0x0938;
  14820. t.sadfinalarabic = 0xfeba;
  14821. t.sadinitialarabic = 0xfebb;
  14822. t.sadmedialarabic = 0xfebc;
  14823. t.sagujarati = 0x0ab8;
  14824. t.sagurmukhi = 0x0a38;
  14825. t.sahiragana = 0x3055;
  14826. t.sakatakana = 0x30b5;
  14827. t.sakatakanahalfwidth = 0xff7b;
  14828. t.sallallahoualayhewasallamarabic = 0xfdfa;
  14829. t.samekh = 0x05e1;
  14830. t.samekhdagesh = 0xfb41;
  14831. t.samekhdageshhebrew = 0xfb41;
  14832. t.samekhhebrew = 0x05e1;
  14833. t.saraaathai = 0x0e32;
  14834. t.saraaethai = 0x0e41;
  14835. t.saraaimaimalaithai = 0x0e44;
  14836. t.saraaimaimuanthai = 0x0e43;
  14837. t.saraamthai = 0x0e33;
  14838. t.saraathai = 0x0e30;
  14839. t.saraethai = 0x0e40;
  14840. t.saraiileftthai = 0xf886;
  14841. t.saraiithai = 0x0e35;
  14842. t.saraileftthai = 0xf885;
  14843. t.saraithai = 0x0e34;
  14844. t.saraothai = 0x0e42;
  14845. t.saraueeleftthai = 0xf888;
  14846. t.saraueethai = 0x0e37;
  14847. t.saraueleftthai = 0xf887;
  14848. t.sarauethai = 0x0e36;
  14849. t.sarauthai = 0x0e38;
  14850. t.sarauuthai = 0x0e39;
  14851. t.sbopomofo = 0x3119;
  14852. t.scaron = 0x0161;
  14853. t.scarondotaccent = 0x1e67;
  14854. t.scedilla = 0x015f;
  14855. t.schwa = 0x0259;
  14856. t.schwacyrillic = 0x04d9;
  14857. t.schwadieresiscyrillic = 0x04db;
  14858. t.schwahook = 0x025a;
  14859. t.scircle = 0x24e2;
  14860. t.scircumflex = 0x015d;
  14861. t.scommaaccent = 0x0219;
  14862. t.sdotaccent = 0x1e61;
  14863. t.sdotbelow = 0x1e63;
  14864. t.sdotbelowdotaccent = 0x1e69;
  14865. t.seagullbelowcmb = 0x033c;
  14866. t.second = 0x2033;
  14867. t.secondtonechinese = 0x02ca;
  14868. t.section = 0x00a7;
  14869. t.seenarabic = 0x0633;
  14870. t.seenfinalarabic = 0xfeb2;
  14871. t.seeninitialarabic = 0xfeb3;
  14872. t.seenmedialarabic = 0xfeb4;
  14873. t.segol = 0x05b6;
  14874. t.segol13 = 0x05b6;
  14875. t.segol1f = 0x05b6;
  14876. t.segol2c = 0x05b6;
  14877. t.segolhebrew = 0x05b6;
  14878. t.segolnarrowhebrew = 0x05b6;
  14879. t.segolquarterhebrew = 0x05b6;
  14880. t.segoltahebrew = 0x0592;
  14881. t.segolwidehebrew = 0x05b6;
  14882. t.seharmenian = 0x057d;
  14883. t.sehiragana = 0x305b;
  14884. t.sekatakana = 0x30bb;
  14885. t.sekatakanahalfwidth = 0xff7e;
  14886. t.semicolon = 0x003b;
  14887. t.semicolonarabic = 0x061b;
  14888. t.semicolonmonospace = 0xff1b;
  14889. t.semicolonsmall = 0xfe54;
  14890. t.semivoicedmarkkana = 0x309c;
  14891. t.semivoicedmarkkanahalfwidth = 0xff9f;
  14892. t.sentisquare = 0x3322;
  14893. t.sentosquare = 0x3323;
  14894. t.seven = 0x0037;
  14895. t.sevenarabic = 0x0667;
  14896. t.sevenbengali = 0x09ed;
  14897. t.sevencircle = 0x2466;
  14898. t.sevencircleinversesansserif = 0x2790;
  14899. t.sevendeva = 0x096d;
  14900. t.seveneighths = 0x215e;
  14901. t.sevengujarati = 0x0aed;
  14902. t.sevengurmukhi = 0x0a6d;
  14903. t.sevenhackarabic = 0x0667;
  14904. t.sevenhangzhou = 0x3027;
  14905. t.sevenideographicparen = 0x3226;
  14906. t.seveninferior = 0x2087;
  14907. t.sevenmonospace = 0xff17;
  14908. t.sevenoldstyle = 0xf737;
  14909. t.sevenparen = 0x247a;
  14910. t.sevenperiod = 0x248e;
  14911. t.sevenpersian = 0x06f7;
  14912. t.sevenroman = 0x2176;
  14913. t.sevensuperior = 0x2077;
  14914. t.seventeencircle = 0x2470;
  14915. t.seventeenparen = 0x2484;
  14916. t.seventeenperiod = 0x2498;
  14917. t.seventhai = 0x0e57;
  14918. t.sfthyphen = 0x00ad;
  14919. t.shaarmenian = 0x0577;
  14920. t.shabengali = 0x09b6;
  14921. t.shacyrillic = 0x0448;
  14922. t.shaddaarabic = 0x0651;
  14923. t.shaddadammaarabic = 0xfc61;
  14924. t.shaddadammatanarabic = 0xfc5e;
  14925. t.shaddafathaarabic = 0xfc60;
  14926. t.shaddakasraarabic = 0xfc62;
  14927. t.shaddakasratanarabic = 0xfc5f;
  14928. t.shade = 0x2592;
  14929. t.shadedark = 0x2593;
  14930. t.shadelight = 0x2591;
  14931. t.shademedium = 0x2592;
  14932. t.shadeva = 0x0936;
  14933. t.shagujarati = 0x0ab6;
  14934. t.shagurmukhi = 0x0a36;
  14935. t.shalshelethebrew = 0x0593;
  14936. t.shbopomofo = 0x3115;
  14937. t.shchacyrillic = 0x0449;
  14938. t.sheenarabic = 0x0634;
  14939. t.sheenfinalarabic = 0xfeb6;
  14940. t.sheeninitialarabic = 0xfeb7;
  14941. t.sheenmedialarabic = 0xfeb8;
  14942. t.sheicoptic = 0x03e3;
  14943. t.sheqel = 0x20aa;
  14944. t.sheqelhebrew = 0x20aa;
  14945. t.sheva = 0x05b0;
  14946. t.sheva115 = 0x05b0;
  14947. t.sheva15 = 0x05b0;
  14948. t.sheva22 = 0x05b0;
  14949. t.sheva2e = 0x05b0;
  14950. t.shevahebrew = 0x05b0;
  14951. t.shevanarrowhebrew = 0x05b0;
  14952. t.shevaquarterhebrew = 0x05b0;
  14953. t.shevawidehebrew = 0x05b0;
  14954. t.shhacyrillic = 0x04bb;
  14955. t.shimacoptic = 0x03ed;
  14956. t.shin = 0x05e9;
  14957. t.shindagesh = 0xfb49;
  14958. t.shindageshhebrew = 0xfb49;
  14959. t.shindageshshindot = 0xfb2c;
  14960. t.shindageshshindothebrew = 0xfb2c;
  14961. t.shindageshsindot = 0xfb2d;
  14962. t.shindageshsindothebrew = 0xfb2d;
  14963. t.shindothebrew = 0x05c1;
  14964. t.shinhebrew = 0x05e9;
  14965. t.shinshindot = 0xfb2a;
  14966. t.shinshindothebrew = 0xfb2a;
  14967. t.shinsindot = 0xfb2b;
  14968. t.shinsindothebrew = 0xfb2b;
  14969. t.shook = 0x0282;
  14970. t.sigma = 0x03c3;
  14971. t.sigma1 = 0x03c2;
  14972. t.sigmafinal = 0x03c2;
  14973. t.sigmalunatesymbolgreek = 0x03f2;
  14974. t.sihiragana = 0x3057;
  14975. t.sikatakana = 0x30b7;
  14976. t.sikatakanahalfwidth = 0xff7c;
  14977. t.siluqhebrew = 0x05bd;
  14978. t.siluqlefthebrew = 0x05bd;
  14979. t.similar = 0x223c;
  14980. t.sindothebrew = 0x05c2;
  14981. t.siosacirclekorean = 0x3274;
  14982. t.siosaparenkorean = 0x3214;
  14983. t.sioscieuckorean = 0x317e;
  14984. t.sioscirclekorean = 0x3266;
  14985. t.sioskiyeokkorean = 0x317a;
  14986. t.sioskorean = 0x3145;
  14987. t.siosnieunkorean = 0x317b;
  14988. t.siosparenkorean = 0x3206;
  14989. t.siospieupkorean = 0x317d;
  14990. t.siostikeutkorean = 0x317c;
  14991. t.six = 0x0036;
  14992. t.sixarabic = 0x0666;
  14993. t.sixbengali = 0x09ec;
  14994. t.sixcircle = 0x2465;
  14995. t.sixcircleinversesansserif = 0x278f;
  14996. t.sixdeva = 0x096c;
  14997. t.sixgujarati = 0x0aec;
  14998. t.sixgurmukhi = 0x0a6c;
  14999. t.sixhackarabic = 0x0666;
  15000. t.sixhangzhou = 0x3026;
  15001. t.sixideographicparen = 0x3225;
  15002. t.sixinferior = 0x2086;
  15003. t.sixmonospace = 0xff16;
  15004. t.sixoldstyle = 0xf736;
  15005. t.sixparen = 0x2479;
  15006. t.sixperiod = 0x248d;
  15007. t.sixpersian = 0x06f6;
  15008. t.sixroman = 0x2175;
  15009. t.sixsuperior = 0x2076;
  15010. t.sixteencircle = 0x246f;
  15011. t.sixteencurrencydenominatorbengali = 0x09f9;
  15012. t.sixteenparen = 0x2483;
  15013. t.sixteenperiod = 0x2497;
  15014. t.sixthai = 0x0e56;
  15015. t.slash = 0x002f;
  15016. t.slashmonospace = 0xff0f;
  15017. t.slong = 0x017f;
  15018. t.slongdotaccent = 0x1e9b;
  15019. t.smileface = 0x263a;
  15020. t.smonospace = 0xff53;
  15021. t.sofpasuqhebrew = 0x05c3;
  15022. t.softhyphen = 0x00ad;
  15023. t.softsigncyrillic = 0x044c;
  15024. t.sohiragana = 0x305d;
  15025. t.sokatakana = 0x30bd;
  15026. t.sokatakanahalfwidth = 0xff7f;
  15027. t.soliduslongoverlaycmb = 0x0338;
  15028. t.solidusshortoverlaycmb = 0x0337;
  15029. t.sorusithai = 0x0e29;
  15030. t.sosalathai = 0x0e28;
  15031. t.sosothai = 0x0e0b;
  15032. t.sosuathai = 0x0e2a;
  15033. t.space = 0x0020;
  15034. t.spacehackarabic = 0x0020;
  15035. t.spade = 0x2660;
  15036. t.spadesuitblack = 0x2660;
  15037. t.spadesuitwhite = 0x2664;
  15038. t.sparen = 0x24ae;
  15039. t.squarebelowcmb = 0x033b;
  15040. t.squarecc = 0x33c4;
  15041. t.squarecm = 0x339d;
  15042. t.squarediagonalcrosshatchfill = 0x25a9;
  15043. t.squarehorizontalfill = 0x25a4;
  15044. t.squarekg = 0x338f;
  15045. t.squarekm = 0x339e;
  15046. t.squarekmcapital = 0x33ce;
  15047. t.squareln = 0x33d1;
  15048. t.squarelog = 0x33d2;
  15049. t.squaremg = 0x338e;
  15050. t.squaremil = 0x33d5;
  15051. t.squaremm = 0x339c;
  15052. t.squaremsquared = 0x33a1;
  15053. t.squareorthogonalcrosshatchfill = 0x25a6;
  15054. t.squareupperlefttolowerrightfill = 0x25a7;
  15055. t.squareupperrighttolowerleftfill = 0x25a8;
  15056. t.squareverticalfill = 0x25a5;
  15057. t.squarewhitewithsmallblack = 0x25a3;
  15058. t.srsquare = 0x33db;
  15059. t.ssabengali = 0x09b7;
  15060. t.ssadeva = 0x0937;
  15061. t.ssagujarati = 0x0ab7;
  15062. t.ssangcieuckorean = 0x3149;
  15063. t.ssanghieuhkorean = 0x3185;
  15064. t.ssangieungkorean = 0x3180;
  15065. t.ssangkiyeokkorean = 0x3132;
  15066. t.ssangnieunkorean = 0x3165;
  15067. t.ssangpieupkorean = 0x3143;
  15068. t.ssangsioskorean = 0x3146;
  15069. t.ssangtikeutkorean = 0x3138;
  15070. t.ssuperior = 0xf6f2;
  15071. t.sterling = 0x00a3;
  15072. t.sterlingmonospace = 0xffe1;
  15073. t.strokelongoverlaycmb = 0x0336;
  15074. t.strokeshortoverlaycmb = 0x0335;
  15075. t.subset = 0x2282;
  15076. t.subsetnotequal = 0x228a;
  15077. t.subsetorequal = 0x2286;
  15078. t.succeeds = 0x227b;
  15079. t.suchthat = 0x220b;
  15080. t.suhiragana = 0x3059;
  15081. t.sukatakana = 0x30b9;
  15082. t.sukatakanahalfwidth = 0xff7d;
  15083. t.sukunarabic = 0x0652;
  15084. t.summation = 0x2211;
  15085. t.sun = 0x263c;
  15086. t.superset = 0x2283;
  15087. t.supersetnotequal = 0x228b;
  15088. t.supersetorequal = 0x2287;
  15089. t.svsquare = 0x33dc;
  15090. t.syouwaerasquare = 0x337c;
  15091. t.t = 0x0074;
  15092. t.tabengali = 0x09a4;
  15093. t.tackdown = 0x22a4;
  15094. t.tackleft = 0x22a3;
  15095. t.tadeva = 0x0924;
  15096. t.tagujarati = 0x0aa4;
  15097. t.tagurmukhi = 0x0a24;
  15098. t.taharabic = 0x0637;
  15099. t.tahfinalarabic = 0xfec2;
  15100. t.tahinitialarabic = 0xfec3;
  15101. t.tahiragana = 0x305f;
  15102. t.tahmedialarabic = 0xfec4;
  15103. t.taisyouerasquare = 0x337d;
  15104. t.takatakana = 0x30bf;
  15105. t.takatakanahalfwidth = 0xff80;
  15106. t.tatweelarabic = 0x0640;
  15107. t.tau = 0x03c4;
  15108. t.tav = 0x05ea;
  15109. t.tavdages = 0xfb4a;
  15110. t.tavdagesh = 0xfb4a;
  15111. t.tavdageshhebrew = 0xfb4a;
  15112. t.tavhebrew = 0x05ea;
  15113. t.tbar = 0x0167;
  15114. t.tbopomofo = 0x310a;
  15115. t.tcaron = 0x0165;
  15116. t.tccurl = 0x02a8;
  15117. t.tcedilla = 0x0163;
  15118. t.tcheharabic = 0x0686;
  15119. t.tchehfinalarabic = 0xfb7b;
  15120. t.tchehinitialarabic = 0xfb7c;
  15121. t.tchehmedialarabic = 0xfb7d;
  15122. t.tcircle = 0x24e3;
  15123. t.tcircumflexbelow = 0x1e71;
  15124. t.tcommaaccent = 0x0163;
  15125. t.tdieresis = 0x1e97;
  15126. t.tdotaccent = 0x1e6b;
  15127. t.tdotbelow = 0x1e6d;
  15128. t.tecyrillic = 0x0442;
  15129. t.tedescendercyrillic = 0x04ad;
  15130. t.teharabic = 0x062a;
  15131. t.tehfinalarabic = 0xfe96;
  15132. t.tehhahinitialarabic = 0xfca2;
  15133. t.tehhahisolatedarabic = 0xfc0c;
  15134. t.tehinitialarabic = 0xfe97;
  15135. t.tehiragana = 0x3066;
  15136. t.tehjeeminitialarabic = 0xfca1;
  15137. t.tehjeemisolatedarabic = 0xfc0b;
  15138. t.tehmarbutaarabic = 0x0629;
  15139. t.tehmarbutafinalarabic = 0xfe94;
  15140. t.tehmedialarabic = 0xfe98;
  15141. t.tehmeeminitialarabic = 0xfca4;
  15142. t.tehmeemisolatedarabic = 0xfc0e;
  15143. t.tehnoonfinalarabic = 0xfc73;
  15144. t.tekatakana = 0x30c6;
  15145. t.tekatakanahalfwidth = 0xff83;
  15146. t.telephone = 0x2121;
  15147. t.telephoneblack = 0x260e;
  15148. t.telishagedolahebrew = 0x05a0;
  15149. t.telishaqetanahebrew = 0x05a9;
  15150. t.tencircle = 0x2469;
  15151. t.tenideographicparen = 0x3229;
  15152. t.tenparen = 0x247d;
  15153. t.tenperiod = 0x2491;
  15154. t.tenroman = 0x2179;
  15155. t.tesh = 0x02a7;
  15156. t.tet = 0x05d8;
  15157. t.tetdagesh = 0xfb38;
  15158. t.tetdageshhebrew = 0xfb38;
  15159. t.tethebrew = 0x05d8;
  15160. t.tetsecyrillic = 0x04b5;
  15161. t.tevirhebrew = 0x059b;
  15162. t.tevirlefthebrew = 0x059b;
  15163. t.thabengali = 0x09a5;
  15164. t.thadeva = 0x0925;
  15165. t.thagujarati = 0x0aa5;
  15166. t.thagurmukhi = 0x0a25;
  15167. t.thalarabic = 0x0630;
  15168. t.thalfinalarabic = 0xfeac;
  15169. t.thanthakhatlowleftthai = 0xf898;
  15170. t.thanthakhatlowrightthai = 0xf897;
  15171. t.thanthakhatthai = 0x0e4c;
  15172. t.thanthakhatupperleftthai = 0xf896;
  15173. t.theharabic = 0x062b;
  15174. t.thehfinalarabic = 0xfe9a;
  15175. t.thehinitialarabic = 0xfe9b;
  15176. t.thehmedialarabic = 0xfe9c;
  15177. t.thereexists = 0x2203;
  15178. t.therefore = 0x2234;
  15179. t.theta = 0x03b8;
  15180. t.theta1 = 0x03d1;
  15181. t.thetasymbolgreek = 0x03d1;
  15182. t.thieuthacirclekorean = 0x3279;
  15183. t.thieuthaparenkorean = 0x3219;
  15184. t.thieuthcirclekorean = 0x326b;
  15185. t.thieuthkorean = 0x314c;
  15186. t.thieuthparenkorean = 0x320b;
  15187. t.thirteencircle = 0x246c;
  15188. t.thirteenparen = 0x2480;
  15189. t.thirteenperiod = 0x2494;
  15190. t.thonangmonthothai = 0x0e11;
  15191. t.thook = 0x01ad;
  15192. t.thophuthaothai = 0x0e12;
  15193. t.thorn = 0x00fe;
  15194. t.thothahanthai = 0x0e17;
  15195. t.thothanthai = 0x0e10;
  15196. t.thothongthai = 0x0e18;
  15197. t.thothungthai = 0x0e16;
  15198. t.thousandcyrillic = 0x0482;
  15199. t.thousandsseparatorarabic = 0x066c;
  15200. t.thousandsseparatorpersian = 0x066c;
  15201. t.three = 0x0033;
  15202. t.threearabic = 0x0663;
  15203. t.threebengali = 0x09e9;
  15204. t.threecircle = 0x2462;
  15205. t.threecircleinversesansserif = 0x278c;
  15206. t.threedeva = 0x0969;
  15207. t.threeeighths = 0x215c;
  15208. t.threegujarati = 0x0ae9;
  15209. t.threegurmukhi = 0x0a69;
  15210. t.threehackarabic = 0x0663;
  15211. t.threehangzhou = 0x3023;
  15212. t.threeideographicparen = 0x3222;
  15213. t.threeinferior = 0x2083;
  15214. t.threemonospace = 0xff13;
  15215. t.threenumeratorbengali = 0x09f6;
  15216. t.threeoldstyle = 0xf733;
  15217. t.threeparen = 0x2476;
  15218. t.threeperiod = 0x248a;
  15219. t.threepersian = 0x06f3;
  15220. t.threequarters = 0x00be;
  15221. t.threequartersemdash = 0xf6de;
  15222. t.threeroman = 0x2172;
  15223. t.threesuperior = 0x00b3;
  15224. t.threethai = 0x0e53;
  15225. t.thzsquare = 0x3394;
  15226. t.tihiragana = 0x3061;
  15227. t.tikatakana = 0x30c1;
  15228. t.tikatakanahalfwidth = 0xff81;
  15229. t.tikeutacirclekorean = 0x3270;
  15230. t.tikeutaparenkorean = 0x3210;
  15231. t.tikeutcirclekorean = 0x3262;
  15232. t.tikeutkorean = 0x3137;
  15233. t.tikeutparenkorean = 0x3202;
  15234. t.tilde = 0x02dc;
  15235. t.tildebelowcmb = 0x0330;
  15236. t.tildecmb = 0x0303;
  15237. t.tildecomb = 0x0303;
  15238. t.tildedoublecmb = 0x0360;
  15239. t.tildeoperator = 0x223c;
  15240. t.tildeoverlaycmb = 0x0334;
  15241. t.tildeverticalcmb = 0x033e;
  15242. t.timescircle = 0x2297;
  15243. t.tipehahebrew = 0x0596;
  15244. t.tipehalefthebrew = 0x0596;
  15245. t.tippigurmukhi = 0x0a70;
  15246. t.titlocyrilliccmb = 0x0483;
  15247. t.tiwnarmenian = 0x057f;
  15248. t.tlinebelow = 0x1e6f;
  15249. t.tmonospace = 0xff54;
  15250. t.toarmenian = 0x0569;
  15251. t.tohiragana = 0x3068;
  15252. t.tokatakana = 0x30c8;
  15253. t.tokatakanahalfwidth = 0xff84;
  15254. t.tonebarextrahighmod = 0x02e5;
  15255. t.tonebarextralowmod = 0x02e9;
  15256. t.tonebarhighmod = 0x02e6;
  15257. t.tonebarlowmod = 0x02e8;
  15258. t.tonebarmidmod = 0x02e7;
  15259. t.tonefive = 0x01bd;
  15260. t.tonesix = 0x0185;
  15261. t.tonetwo = 0x01a8;
  15262. t.tonos = 0x0384;
  15263. t.tonsquare = 0x3327;
  15264. t.topatakthai = 0x0e0f;
  15265. t.tortoiseshellbracketleft = 0x3014;
  15266. t.tortoiseshellbracketleftsmall = 0xfe5d;
  15267. t.tortoiseshellbracketleftvertical = 0xfe39;
  15268. t.tortoiseshellbracketright = 0x3015;
  15269. t.tortoiseshellbracketrightsmall = 0xfe5e;
  15270. t.tortoiseshellbracketrightvertical = 0xfe3a;
  15271. t.totaothai = 0x0e15;
  15272. t.tpalatalhook = 0x01ab;
  15273. t.tparen = 0x24af;
  15274. t.trademark = 0x2122;
  15275. t.trademarksans = 0xf8ea;
  15276. t.trademarkserif = 0xf6db;
  15277. t.tretroflexhook = 0x0288;
  15278. t.triagdn = 0x25bc;
  15279. t.triaglf = 0x25c4;
  15280. t.triagrt = 0x25ba;
  15281. t.triagup = 0x25b2;
  15282. t.ts = 0x02a6;
  15283. t.tsadi = 0x05e6;
  15284. t.tsadidagesh = 0xfb46;
  15285. t.tsadidageshhebrew = 0xfb46;
  15286. t.tsadihebrew = 0x05e6;
  15287. t.tsecyrillic = 0x0446;
  15288. t.tsere = 0x05b5;
  15289. t.tsere12 = 0x05b5;
  15290. t.tsere1e = 0x05b5;
  15291. t.tsere2b = 0x05b5;
  15292. t.tserehebrew = 0x05b5;
  15293. t.tserenarrowhebrew = 0x05b5;
  15294. t.tserequarterhebrew = 0x05b5;
  15295. t.tserewidehebrew = 0x05b5;
  15296. t.tshecyrillic = 0x045b;
  15297. t.tsuperior = 0xf6f3;
  15298. t.ttabengali = 0x099f;
  15299. t.ttadeva = 0x091f;
  15300. t.ttagujarati = 0x0a9f;
  15301. t.ttagurmukhi = 0x0a1f;
  15302. t.tteharabic = 0x0679;
  15303. t.ttehfinalarabic = 0xfb67;
  15304. t.ttehinitialarabic = 0xfb68;
  15305. t.ttehmedialarabic = 0xfb69;
  15306. t.tthabengali = 0x09a0;
  15307. t.tthadeva = 0x0920;
  15308. t.tthagujarati = 0x0aa0;
  15309. t.tthagurmukhi = 0x0a20;
  15310. t.tturned = 0x0287;
  15311. t.tuhiragana = 0x3064;
  15312. t.tukatakana = 0x30c4;
  15313. t.tukatakanahalfwidth = 0xff82;
  15314. t.tusmallhiragana = 0x3063;
  15315. t.tusmallkatakana = 0x30c3;
  15316. t.tusmallkatakanahalfwidth = 0xff6f;
  15317. t.twelvecircle = 0x246b;
  15318. t.twelveparen = 0x247f;
  15319. t.twelveperiod = 0x2493;
  15320. t.twelveroman = 0x217b;
  15321. t.twentycircle = 0x2473;
  15322. t.twentyhangzhou = 0x5344;
  15323. t.twentyparen = 0x2487;
  15324. t.twentyperiod = 0x249b;
  15325. t.two = 0x0032;
  15326. t.twoarabic = 0x0662;
  15327. t.twobengali = 0x09e8;
  15328. t.twocircle = 0x2461;
  15329. t.twocircleinversesansserif = 0x278b;
  15330. t.twodeva = 0x0968;
  15331. t.twodotenleader = 0x2025;
  15332. t.twodotleader = 0x2025;
  15333. t.twodotleadervertical = 0xfe30;
  15334. t.twogujarati = 0x0ae8;
  15335. t.twogurmukhi = 0x0a68;
  15336. t.twohackarabic = 0x0662;
  15337. t.twohangzhou = 0x3022;
  15338. t.twoideographicparen = 0x3221;
  15339. t.twoinferior = 0x2082;
  15340. t.twomonospace = 0xff12;
  15341. t.twonumeratorbengali = 0x09f5;
  15342. t.twooldstyle = 0xf732;
  15343. t.twoparen = 0x2475;
  15344. t.twoperiod = 0x2489;
  15345. t.twopersian = 0x06f2;
  15346. t.tworoman = 0x2171;
  15347. t.twostroke = 0x01bb;
  15348. t.twosuperior = 0x00b2;
  15349. t.twothai = 0x0e52;
  15350. t.twothirds = 0x2154;
  15351. t.u = 0x0075;
  15352. t.uacute = 0x00fa;
  15353. t.ubar = 0x0289;
  15354. t.ubengali = 0x0989;
  15355. t.ubopomofo = 0x3128;
  15356. t.ubreve = 0x016d;
  15357. t.ucaron = 0x01d4;
  15358. t.ucircle = 0x24e4;
  15359. t.ucircumflex = 0x00fb;
  15360. t.ucircumflexbelow = 0x1e77;
  15361. t.ucyrillic = 0x0443;
  15362. t.udattadeva = 0x0951;
  15363. t.udblacute = 0x0171;
  15364. t.udblgrave = 0x0215;
  15365. t.udeva = 0x0909;
  15366. t.udieresis = 0x00fc;
  15367. t.udieresisacute = 0x01d8;
  15368. t.udieresisbelow = 0x1e73;
  15369. t.udieresiscaron = 0x01da;
  15370. t.udieresiscyrillic = 0x04f1;
  15371. t.udieresisgrave = 0x01dc;
  15372. t.udieresismacron = 0x01d6;
  15373. t.udotbelow = 0x1ee5;
  15374. t.ugrave = 0x00f9;
  15375. t.ugujarati = 0x0a89;
  15376. t.ugurmukhi = 0x0a09;
  15377. t.uhiragana = 0x3046;
  15378. t.uhookabove = 0x1ee7;
  15379. t.uhorn = 0x01b0;
  15380. t.uhornacute = 0x1ee9;
  15381. t.uhorndotbelow = 0x1ef1;
  15382. t.uhorngrave = 0x1eeb;
  15383. t.uhornhookabove = 0x1eed;
  15384. t.uhorntilde = 0x1eef;
  15385. t.uhungarumlaut = 0x0171;
  15386. t.uhungarumlautcyrillic = 0x04f3;
  15387. t.uinvertedbreve = 0x0217;
  15388. t.ukatakana = 0x30a6;
  15389. t.ukatakanahalfwidth = 0xff73;
  15390. t.ukcyrillic = 0x0479;
  15391. t.ukorean = 0x315c;
  15392. t.umacron = 0x016b;
  15393. t.umacroncyrillic = 0x04ef;
  15394. t.umacrondieresis = 0x1e7b;
  15395. t.umatragurmukhi = 0x0a41;
  15396. t.umonospace = 0xff55;
  15397. t.underscore = 0x005f;
  15398. t.underscoredbl = 0x2017;
  15399. t.underscoremonospace = 0xff3f;
  15400. t.underscorevertical = 0xfe33;
  15401. t.underscorewavy = 0xfe4f;
  15402. t.union = 0x222a;
  15403. t.universal = 0x2200;
  15404. t.uogonek = 0x0173;
  15405. t.uparen = 0x24b0;
  15406. t.upblock = 0x2580;
  15407. t.upperdothebrew = 0x05c4;
  15408. t.upsilon = 0x03c5;
  15409. t.upsilondieresis = 0x03cb;
  15410. t.upsilondieresistonos = 0x03b0;
  15411. t.upsilonlatin = 0x028a;
  15412. t.upsilontonos = 0x03cd;
  15413. t.uptackbelowcmb = 0x031d;
  15414. t.uptackmod = 0x02d4;
  15415. t.uragurmukhi = 0x0a73;
  15416. t.uring = 0x016f;
  15417. t.ushortcyrillic = 0x045e;
  15418. t.usmallhiragana = 0x3045;
  15419. t.usmallkatakana = 0x30a5;
  15420. t.usmallkatakanahalfwidth = 0xff69;
  15421. t.ustraightcyrillic = 0x04af;
  15422. t.ustraightstrokecyrillic = 0x04b1;
  15423. t.utilde = 0x0169;
  15424. t.utildeacute = 0x1e79;
  15425. t.utildebelow = 0x1e75;
  15426. t.uubengali = 0x098a;
  15427. t.uudeva = 0x090a;
  15428. t.uugujarati = 0x0a8a;
  15429. t.uugurmukhi = 0x0a0a;
  15430. t.uumatragurmukhi = 0x0a42;
  15431. t.uuvowelsignbengali = 0x09c2;
  15432. t.uuvowelsigndeva = 0x0942;
  15433. t.uuvowelsigngujarati = 0x0ac2;
  15434. t.uvowelsignbengali = 0x09c1;
  15435. t.uvowelsigndeva = 0x0941;
  15436. t.uvowelsigngujarati = 0x0ac1;
  15437. t.v = 0x0076;
  15438. t.vadeva = 0x0935;
  15439. t.vagujarati = 0x0ab5;
  15440. t.vagurmukhi = 0x0a35;
  15441. t.vakatakana = 0x30f7;
  15442. t.vav = 0x05d5;
  15443. t.vavdagesh = 0xfb35;
  15444. t.vavdagesh65 = 0xfb35;
  15445. t.vavdageshhebrew = 0xfb35;
  15446. t.vavhebrew = 0x05d5;
  15447. t.vavholam = 0xfb4b;
  15448. t.vavholamhebrew = 0xfb4b;
  15449. t.vavvavhebrew = 0x05f0;
  15450. t.vavyodhebrew = 0x05f1;
  15451. t.vcircle = 0x24e5;
  15452. t.vdotbelow = 0x1e7f;
  15453. t.vecyrillic = 0x0432;
  15454. t.veharabic = 0x06a4;
  15455. t.vehfinalarabic = 0xfb6b;
  15456. t.vehinitialarabic = 0xfb6c;
  15457. t.vehmedialarabic = 0xfb6d;
  15458. t.vekatakana = 0x30f9;
  15459. t.venus = 0x2640;
  15460. t.verticalbar = 0x007c;
  15461. t.verticallineabovecmb = 0x030d;
  15462. t.verticallinebelowcmb = 0x0329;
  15463. t.verticallinelowmod = 0x02cc;
  15464. t.verticallinemod = 0x02c8;
  15465. t.vewarmenian = 0x057e;
  15466. t.vhook = 0x028b;
  15467. t.vikatakana = 0x30f8;
  15468. t.viramabengali = 0x09cd;
  15469. t.viramadeva = 0x094d;
  15470. t.viramagujarati = 0x0acd;
  15471. t.visargabengali = 0x0983;
  15472. t.visargadeva = 0x0903;
  15473. t.visargagujarati = 0x0a83;
  15474. t.vmonospace = 0xff56;
  15475. t.voarmenian = 0x0578;
  15476. t.voicediterationhiragana = 0x309e;
  15477. t.voicediterationkatakana = 0x30fe;
  15478. t.voicedmarkkana = 0x309b;
  15479. t.voicedmarkkanahalfwidth = 0xff9e;
  15480. t.vokatakana = 0x30fa;
  15481. t.vparen = 0x24b1;
  15482. t.vtilde = 0x1e7d;
  15483. t.vturned = 0x028c;
  15484. t.vuhiragana = 0x3094;
  15485. t.vukatakana = 0x30f4;
  15486. t.w = 0x0077;
  15487. t.wacute = 0x1e83;
  15488. t.waekorean = 0x3159;
  15489. t.wahiragana = 0x308f;
  15490. t.wakatakana = 0x30ef;
  15491. t.wakatakanahalfwidth = 0xff9c;
  15492. t.wakorean = 0x3158;
  15493. t.wasmallhiragana = 0x308e;
  15494. t.wasmallkatakana = 0x30ee;
  15495. t.wattosquare = 0x3357;
  15496. t.wavedash = 0x301c;
  15497. t.wavyunderscorevertical = 0xfe34;
  15498. t.wawarabic = 0x0648;
  15499. t.wawfinalarabic = 0xfeee;
  15500. t.wawhamzaabovearabic = 0x0624;
  15501. t.wawhamzaabovefinalarabic = 0xfe86;
  15502. t.wbsquare = 0x33dd;
  15503. t.wcircle = 0x24e6;
  15504. t.wcircumflex = 0x0175;
  15505. t.wdieresis = 0x1e85;
  15506. t.wdotaccent = 0x1e87;
  15507. t.wdotbelow = 0x1e89;
  15508. t.wehiragana = 0x3091;
  15509. t.weierstrass = 0x2118;
  15510. t.wekatakana = 0x30f1;
  15511. t.wekorean = 0x315e;
  15512. t.weokorean = 0x315d;
  15513. t.wgrave = 0x1e81;
  15514. t.whitebullet = 0x25e6;
  15515. t.whitecircle = 0x25cb;
  15516. t.whitecircleinverse = 0x25d9;
  15517. t.whitecornerbracketleft = 0x300e;
  15518. t.whitecornerbracketleftvertical = 0xfe43;
  15519. t.whitecornerbracketright = 0x300f;
  15520. t.whitecornerbracketrightvertical = 0xfe44;
  15521. t.whitediamond = 0x25c7;
  15522. t.whitediamondcontainingblacksmalldiamond = 0x25c8;
  15523. t.whitedownpointingsmalltriangle = 0x25bf;
  15524. t.whitedownpointingtriangle = 0x25bd;
  15525. t.whiteleftpointingsmalltriangle = 0x25c3;
  15526. t.whiteleftpointingtriangle = 0x25c1;
  15527. t.whitelenticularbracketleft = 0x3016;
  15528. t.whitelenticularbracketright = 0x3017;
  15529. t.whiterightpointingsmalltriangle = 0x25b9;
  15530. t.whiterightpointingtriangle = 0x25b7;
  15531. t.whitesmallsquare = 0x25ab;
  15532. t.whitesmilingface = 0x263a;
  15533. t.whitesquare = 0x25a1;
  15534. t.whitestar = 0x2606;
  15535. t.whitetelephone = 0x260f;
  15536. t.whitetortoiseshellbracketleft = 0x3018;
  15537. t.whitetortoiseshellbracketright = 0x3019;
  15538. t.whiteuppointingsmalltriangle = 0x25b5;
  15539. t.whiteuppointingtriangle = 0x25b3;
  15540. t.wihiragana = 0x3090;
  15541. t.wikatakana = 0x30f0;
  15542. t.wikorean = 0x315f;
  15543. t.wmonospace = 0xff57;
  15544. t.wohiragana = 0x3092;
  15545. t.wokatakana = 0x30f2;
  15546. t.wokatakanahalfwidth = 0xff66;
  15547. t.won = 0x20a9;
  15548. t.wonmonospace = 0xffe6;
  15549. t.wowaenthai = 0x0e27;
  15550. t.wparen = 0x24b2;
  15551. t.wring = 0x1e98;
  15552. t.wsuperior = 0x02b7;
  15553. t.wturned = 0x028d;
  15554. t.wynn = 0x01bf;
  15555. t.x = 0x0078;
  15556. t.xabovecmb = 0x033d;
  15557. t.xbopomofo = 0x3112;
  15558. t.xcircle = 0x24e7;
  15559. t.xdieresis = 0x1e8d;
  15560. t.xdotaccent = 0x1e8b;
  15561. t.xeharmenian = 0x056d;
  15562. t.xi = 0x03be;
  15563. t.xmonospace = 0xff58;
  15564. t.xparen = 0x24b3;
  15565. t.xsuperior = 0x02e3;
  15566. t.y = 0x0079;
  15567. t.yaadosquare = 0x334e;
  15568. t.yabengali = 0x09af;
  15569. t.yacute = 0x00fd;
  15570. t.yadeva = 0x092f;
  15571. t.yaekorean = 0x3152;
  15572. t.yagujarati = 0x0aaf;
  15573. t.yagurmukhi = 0x0a2f;
  15574. t.yahiragana = 0x3084;
  15575. t.yakatakana = 0x30e4;
  15576. t.yakatakanahalfwidth = 0xff94;
  15577. t.yakorean = 0x3151;
  15578. t.yamakkanthai = 0x0e4e;
  15579. t.yasmallhiragana = 0x3083;
  15580. t.yasmallkatakana = 0x30e3;
  15581. t.yasmallkatakanahalfwidth = 0xff6c;
  15582. t.yatcyrillic = 0x0463;
  15583. t.ycircle = 0x24e8;
  15584. t.ycircumflex = 0x0177;
  15585. t.ydieresis = 0x00ff;
  15586. t.ydotaccent = 0x1e8f;
  15587. t.ydotbelow = 0x1ef5;
  15588. t.yeharabic = 0x064a;
  15589. t.yehbarreearabic = 0x06d2;
  15590. t.yehbarreefinalarabic = 0xfbaf;
  15591. t.yehfinalarabic = 0xfef2;
  15592. t.yehhamzaabovearabic = 0x0626;
  15593. t.yehhamzaabovefinalarabic = 0xfe8a;
  15594. t.yehhamzaaboveinitialarabic = 0xfe8b;
  15595. t.yehhamzaabovemedialarabic = 0xfe8c;
  15596. t.yehinitialarabic = 0xfef3;
  15597. t.yehmedialarabic = 0xfef4;
  15598. t.yehmeeminitialarabic = 0xfcdd;
  15599. t.yehmeemisolatedarabic = 0xfc58;
  15600. t.yehnoonfinalarabic = 0xfc94;
  15601. t.yehthreedotsbelowarabic = 0x06d1;
  15602. t.yekorean = 0x3156;
  15603. t.yen = 0x00a5;
  15604. t.yenmonospace = 0xffe5;
  15605. t.yeokorean = 0x3155;
  15606. t.yeorinhieuhkorean = 0x3186;
  15607. t.yerahbenyomohebrew = 0x05aa;
  15608. t.yerahbenyomolefthebrew = 0x05aa;
  15609. t.yericyrillic = 0x044b;
  15610. t.yerudieresiscyrillic = 0x04f9;
  15611. t.yesieungkorean = 0x3181;
  15612. t.yesieungpansioskorean = 0x3183;
  15613. t.yesieungsioskorean = 0x3182;
  15614. t.yetivhebrew = 0x059a;
  15615. t.ygrave = 0x1ef3;
  15616. t.yhook = 0x01b4;
  15617. t.yhookabove = 0x1ef7;
  15618. t.yiarmenian = 0x0575;
  15619. t.yicyrillic = 0x0457;
  15620. t.yikorean = 0x3162;
  15621. t.yinyang = 0x262f;
  15622. t.yiwnarmenian = 0x0582;
  15623. t.ymonospace = 0xff59;
  15624. t.yod = 0x05d9;
  15625. t.yoddagesh = 0xfb39;
  15626. t.yoddageshhebrew = 0xfb39;
  15627. t.yodhebrew = 0x05d9;
  15628. t.yodyodhebrew = 0x05f2;
  15629. t.yodyodpatahhebrew = 0xfb1f;
  15630. t.yohiragana = 0x3088;
  15631. t.yoikorean = 0x3189;
  15632. t.yokatakana = 0x30e8;
  15633. t.yokatakanahalfwidth = 0xff96;
  15634. t.yokorean = 0x315b;
  15635. t.yosmallhiragana = 0x3087;
  15636. t.yosmallkatakana = 0x30e7;
  15637. t.yosmallkatakanahalfwidth = 0xff6e;
  15638. t.yotgreek = 0x03f3;
  15639. t.yoyaekorean = 0x3188;
  15640. t.yoyakorean = 0x3187;
  15641. t.yoyakthai = 0x0e22;
  15642. t.yoyingthai = 0x0e0d;
  15643. t.yparen = 0x24b4;
  15644. t.ypogegrammeni = 0x037a;
  15645. t.ypogegrammenigreekcmb = 0x0345;
  15646. t.yr = 0x01a6;
  15647. t.yring = 0x1e99;
  15648. t.ysuperior = 0x02b8;
  15649. t.ytilde = 0x1ef9;
  15650. t.yturned = 0x028e;
  15651. t.yuhiragana = 0x3086;
  15652. t.yuikorean = 0x318c;
  15653. t.yukatakana = 0x30e6;
  15654. t.yukatakanahalfwidth = 0xff95;
  15655. t.yukorean = 0x3160;
  15656. t.yusbigcyrillic = 0x046b;
  15657. t.yusbigiotifiedcyrillic = 0x046d;
  15658. t.yuslittlecyrillic = 0x0467;
  15659. t.yuslittleiotifiedcyrillic = 0x0469;
  15660. t.yusmallhiragana = 0x3085;
  15661. t.yusmallkatakana = 0x30e5;
  15662. t.yusmallkatakanahalfwidth = 0xff6d;
  15663. t.yuyekorean = 0x318b;
  15664. t.yuyeokorean = 0x318a;
  15665. t.yyabengali = 0x09df;
  15666. t.yyadeva = 0x095f;
  15667. t.z = 0x007a;
  15668. t.zaarmenian = 0x0566;
  15669. t.zacute = 0x017a;
  15670. t.zadeva = 0x095b;
  15671. t.zagurmukhi = 0x0a5b;
  15672. t.zaharabic = 0x0638;
  15673. t.zahfinalarabic = 0xfec6;
  15674. t.zahinitialarabic = 0xfec7;
  15675. t.zahiragana = 0x3056;
  15676. t.zahmedialarabic = 0xfec8;
  15677. t.zainarabic = 0x0632;
  15678. t.zainfinalarabic = 0xfeb0;
  15679. t.zakatakana = 0x30b6;
  15680. t.zaqefgadolhebrew = 0x0595;
  15681. t.zaqefqatanhebrew = 0x0594;
  15682. t.zarqahebrew = 0x0598;
  15683. t.zayin = 0x05d6;
  15684. t.zayindagesh = 0xfb36;
  15685. t.zayindageshhebrew = 0xfb36;
  15686. t.zayinhebrew = 0x05d6;
  15687. t.zbopomofo = 0x3117;
  15688. t.zcaron = 0x017e;
  15689. t.zcircle = 0x24e9;
  15690. t.zcircumflex = 0x1e91;
  15691. t.zcurl = 0x0291;
  15692. t.zdot = 0x017c;
  15693. t.zdotaccent = 0x017c;
  15694. t.zdotbelow = 0x1e93;
  15695. t.zecyrillic = 0x0437;
  15696. t.zedescendercyrillic = 0x0499;
  15697. t.zedieresiscyrillic = 0x04df;
  15698. t.zehiragana = 0x305c;
  15699. t.zekatakana = 0x30bc;
  15700. t.zero = 0x0030;
  15701. t.zeroarabic = 0x0660;
  15702. t.zerobengali = 0x09e6;
  15703. t.zerodeva = 0x0966;
  15704. t.zerogujarati = 0x0ae6;
  15705. t.zerogurmukhi = 0x0a66;
  15706. t.zerohackarabic = 0x0660;
  15707. t.zeroinferior = 0x2080;
  15708. t.zeromonospace = 0xff10;
  15709. t.zerooldstyle = 0xf730;
  15710. t.zeropersian = 0x06f0;
  15711. t.zerosuperior = 0x2070;
  15712. t.zerothai = 0x0e50;
  15713. t.zerowidthjoiner = 0xfeff;
  15714. t.zerowidthnonjoiner = 0x200c;
  15715. t.zerowidthspace = 0x200b;
  15716. t.zeta = 0x03b6;
  15717. t.zhbopomofo = 0x3113;
  15718. t.zhearmenian = 0x056a;
  15719. t.zhebrevecyrillic = 0x04c2;
  15720. t.zhecyrillic = 0x0436;
  15721. t.zhedescendercyrillic = 0x0497;
  15722. t.zhedieresiscyrillic = 0x04dd;
  15723. t.zihiragana = 0x3058;
  15724. t.zikatakana = 0x30b8;
  15725. t.zinorhebrew = 0x05ae;
  15726. t.zlinebelow = 0x1e95;
  15727. t.zmonospace = 0xff5a;
  15728. t.zohiragana = 0x305e;
  15729. t.zokatakana = 0x30be;
  15730. t.zparen = 0x24b5;
  15731. t.zretroflexhook = 0x0290;
  15732. t.zstroke = 0x01b6;
  15733. t.zuhiragana = 0x305a;
  15734. t.zukatakana = 0x30ba;
  15735. t[".notdef"] = 0x0000;
  15736. t.angbracketleftbig = 0x2329;
  15737. t.angbracketleftBig = 0x2329;
  15738. t.angbracketleftbigg = 0x2329;
  15739. t.angbracketleftBigg = 0x2329;
  15740. t.angbracketrightBig = 0x232a;
  15741. t.angbracketrightbig = 0x232a;
  15742. t.angbracketrightBigg = 0x232a;
  15743. t.angbracketrightbigg = 0x232a;
  15744. t.arrowhookleft = 0x21aa;
  15745. t.arrowhookright = 0x21a9;
  15746. t.arrowlefttophalf = 0x21bc;
  15747. t.arrowleftbothalf = 0x21bd;
  15748. t.arrownortheast = 0x2197;
  15749. t.arrownorthwest = 0x2196;
  15750. t.arrowrighttophalf = 0x21c0;
  15751. t.arrowrightbothalf = 0x21c1;
  15752. t.arrowsoutheast = 0x2198;
  15753. t.arrowsouthwest = 0x2199;
  15754. t.backslashbig = 0x2216;
  15755. t.backslashBig = 0x2216;
  15756. t.backslashBigg = 0x2216;
  15757. t.backslashbigg = 0x2216;
  15758. t.bardbl = 0x2016;
  15759. t.bracehtipdownleft = 0xfe37;
  15760. t.bracehtipdownright = 0xfe37;
  15761. t.bracehtipupleft = 0xfe38;
  15762. t.bracehtipupright = 0xfe38;
  15763. t.braceleftBig = 0x007b;
  15764. t.braceleftbig = 0x007b;
  15765. t.braceleftbigg = 0x007b;
  15766. t.braceleftBigg = 0x007b;
  15767. t.bracerightBig = 0x007d;
  15768. t.bracerightbig = 0x007d;
  15769. t.bracerightbigg = 0x007d;
  15770. t.bracerightBigg = 0x007d;
  15771. t.bracketleftbig = 0x005b;
  15772. t.bracketleftBig = 0x005b;
  15773. t.bracketleftbigg = 0x005b;
  15774. t.bracketleftBigg = 0x005b;
  15775. t.bracketrightBig = 0x005d;
  15776. t.bracketrightbig = 0x005d;
  15777. t.bracketrightbigg = 0x005d;
  15778. t.bracketrightBigg = 0x005d;
  15779. t.ceilingleftbig = 0x2308;
  15780. t.ceilingleftBig = 0x2308;
  15781. t.ceilingleftBigg = 0x2308;
  15782. t.ceilingleftbigg = 0x2308;
  15783. t.ceilingrightbig = 0x2309;
  15784. t.ceilingrightBig = 0x2309;
  15785. t.ceilingrightbigg = 0x2309;
  15786. t.ceilingrightBigg = 0x2309;
  15787. t.circledotdisplay = 0x2299;
  15788. t.circledottext = 0x2299;
  15789. t.circlemultiplydisplay = 0x2297;
  15790. t.circlemultiplytext = 0x2297;
  15791. t.circleplusdisplay = 0x2295;
  15792. t.circleplustext = 0x2295;
  15793. t.contintegraldisplay = 0x222e;
  15794. t.contintegraltext = 0x222e;
  15795. t.coproductdisplay = 0x2210;
  15796. t.coproducttext = 0x2210;
  15797. t.floorleftBig = 0x230a;
  15798. t.floorleftbig = 0x230a;
  15799. t.floorleftbigg = 0x230a;
  15800. t.floorleftBigg = 0x230a;
  15801. t.floorrightbig = 0x230b;
  15802. t.floorrightBig = 0x230b;
  15803. t.floorrightBigg = 0x230b;
  15804. t.floorrightbigg = 0x230b;
  15805. t.hatwide = 0x0302;
  15806. t.hatwider = 0x0302;
  15807. t.hatwidest = 0x0302;
  15808. t.intercal = 0x1d40;
  15809. t.integraldisplay = 0x222b;
  15810. t.integraltext = 0x222b;
  15811. t.intersectiondisplay = 0x22c2;
  15812. t.intersectiontext = 0x22c2;
  15813. t.logicalanddisplay = 0x2227;
  15814. t.logicalandtext = 0x2227;
  15815. t.logicalordisplay = 0x2228;
  15816. t.logicalortext = 0x2228;
  15817. t.parenleftBig = 0x0028;
  15818. t.parenleftbig = 0x0028;
  15819. t.parenleftBigg = 0x0028;
  15820. t.parenleftbigg = 0x0028;
  15821. t.parenrightBig = 0x0029;
  15822. t.parenrightbig = 0x0029;
  15823. t.parenrightBigg = 0x0029;
  15824. t.parenrightbigg = 0x0029;
  15825. t.prime = 0x2032;
  15826. t.productdisplay = 0x220f;
  15827. t.producttext = 0x220f;
  15828. t.radicalbig = 0x221a;
  15829. t.radicalBig = 0x221a;
  15830. t.radicalBigg = 0x221a;
  15831. t.radicalbigg = 0x221a;
  15832. t.radicalbt = 0x221a;
  15833. t.radicaltp = 0x221a;
  15834. t.radicalvertex = 0x221a;
  15835. t.slashbig = 0x002f;
  15836. t.slashBig = 0x002f;
  15837. t.slashBigg = 0x002f;
  15838. t.slashbigg = 0x002f;
  15839. t.summationdisplay = 0x2211;
  15840. t.summationtext = 0x2211;
  15841. t.tildewide = 0x02dc;
  15842. t.tildewider = 0x02dc;
  15843. t.tildewidest = 0x02dc;
  15844. t.uniondisplay = 0x22c3;
  15845. t.unionmultidisplay = 0x228e;
  15846. t.unionmultitext = 0x228e;
  15847. t.unionsqdisplay = 0x2294;
  15848. t.unionsqtext = 0x2294;
  15849. t.uniontext = 0x22c3;
  15850. t.vextenddouble = 0x2225;
  15851. t.vextendsingle = 0x2223;
  15852. });
  15853. const getDingbatsGlyphsUnicode = getLookupTableFactory(function (t) {
  15854. t.space = 0x0020;
  15855. t.a1 = 0x2701;
  15856. t.a2 = 0x2702;
  15857. t.a202 = 0x2703;
  15858. t.a3 = 0x2704;
  15859. t.a4 = 0x260e;
  15860. t.a5 = 0x2706;
  15861. t.a119 = 0x2707;
  15862. t.a118 = 0x2708;
  15863. t.a117 = 0x2709;
  15864. t.a11 = 0x261b;
  15865. t.a12 = 0x261e;
  15866. t.a13 = 0x270c;
  15867. t.a14 = 0x270d;
  15868. t.a15 = 0x270e;
  15869. t.a16 = 0x270f;
  15870. t.a105 = 0x2710;
  15871. t.a17 = 0x2711;
  15872. t.a18 = 0x2712;
  15873. t.a19 = 0x2713;
  15874. t.a20 = 0x2714;
  15875. t.a21 = 0x2715;
  15876. t.a22 = 0x2716;
  15877. t.a23 = 0x2717;
  15878. t.a24 = 0x2718;
  15879. t.a25 = 0x2719;
  15880. t.a26 = 0x271a;
  15881. t.a27 = 0x271b;
  15882. t.a28 = 0x271c;
  15883. t.a6 = 0x271d;
  15884. t.a7 = 0x271e;
  15885. t.a8 = 0x271f;
  15886. t.a9 = 0x2720;
  15887. t.a10 = 0x2721;
  15888. t.a29 = 0x2722;
  15889. t.a30 = 0x2723;
  15890. t.a31 = 0x2724;
  15891. t.a32 = 0x2725;
  15892. t.a33 = 0x2726;
  15893. t.a34 = 0x2727;
  15894. t.a35 = 0x2605;
  15895. t.a36 = 0x2729;
  15896. t.a37 = 0x272a;
  15897. t.a38 = 0x272b;
  15898. t.a39 = 0x272c;
  15899. t.a40 = 0x272d;
  15900. t.a41 = 0x272e;
  15901. t.a42 = 0x272f;
  15902. t.a43 = 0x2730;
  15903. t.a44 = 0x2731;
  15904. t.a45 = 0x2732;
  15905. t.a46 = 0x2733;
  15906. t.a47 = 0x2734;
  15907. t.a48 = 0x2735;
  15908. t.a49 = 0x2736;
  15909. t.a50 = 0x2737;
  15910. t.a51 = 0x2738;
  15911. t.a52 = 0x2739;
  15912. t.a53 = 0x273a;
  15913. t.a54 = 0x273b;
  15914. t.a55 = 0x273c;
  15915. t.a56 = 0x273d;
  15916. t.a57 = 0x273e;
  15917. t.a58 = 0x273f;
  15918. t.a59 = 0x2740;
  15919. t.a60 = 0x2741;
  15920. t.a61 = 0x2742;
  15921. t.a62 = 0x2743;
  15922. t.a63 = 0x2744;
  15923. t.a64 = 0x2745;
  15924. t.a65 = 0x2746;
  15925. t.a66 = 0x2747;
  15926. t.a67 = 0x2748;
  15927. t.a68 = 0x2749;
  15928. t.a69 = 0x274a;
  15929. t.a70 = 0x274b;
  15930. t.a71 = 0x25cf;
  15931. t.a72 = 0x274d;
  15932. t.a73 = 0x25a0;
  15933. t.a74 = 0x274f;
  15934. t.a203 = 0x2750;
  15935. t.a75 = 0x2751;
  15936. t.a204 = 0x2752;
  15937. t.a76 = 0x25b2;
  15938. t.a77 = 0x25bc;
  15939. t.a78 = 0x25c6;
  15940. t.a79 = 0x2756;
  15941. t.a81 = 0x25d7;
  15942. t.a82 = 0x2758;
  15943. t.a83 = 0x2759;
  15944. t.a84 = 0x275a;
  15945. t.a97 = 0x275b;
  15946. t.a98 = 0x275c;
  15947. t.a99 = 0x275d;
  15948. t.a100 = 0x275e;
  15949. t.a101 = 0x2761;
  15950. t.a102 = 0x2762;
  15951. t.a103 = 0x2763;
  15952. t.a104 = 0x2764;
  15953. t.a106 = 0x2765;
  15954. t.a107 = 0x2766;
  15955. t.a108 = 0x2767;
  15956. t.a112 = 0x2663;
  15957. t.a111 = 0x2666;
  15958. t.a110 = 0x2665;
  15959. t.a109 = 0x2660;
  15960. t.a120 = 0x2460;
  15961. t.a121 = 0x2461;
  15962. t.a122 = 0x2462;
  15963. t.a123 = 0x2463;
  15964. t.a124 = 0x2464;
  15965. t.a125 = 0x2465;
  15966. t.a126 = 0x2466;
  15967. t.a127 = 0x2467;
  15968. t.a128 = 0x2468;
  15969. t.a129 = 0x2469;
  15970. t.a130 = 0x2776;
  15971. t.a131 = 0x2777;
  15972. t.a132 = 0x2778;
  15973. t.a133 = 0x2779;
  15974. t.a134 = 0x277a;
  15975. t.a135 = 0x277b;
  15976. t.a136 = 0x277c;
  15977. t.a137 = 0x277d;
  15978. t.a138 = 0x277e;
  15979. t.a139 = 0x277f;
  15980. t.a140 = 0x2780;
  15981. t.a141 = 0x2781;
  15982. t.a142 = 0x2782;
  15983. t.a143 = 0x2783;
  15984. t.a144 = 0x2784;
  15985. t.a145 = 0x2785;
  15986. t.a146 = 0x2786;
  15987. t.a147 = 0x2787;
  15988. t.a148 = 0x2788;
  15989. t.a149 = 0x2789;
  15990. t.a150 = 0x278a;
  15991. t.a151 = 0x278b;
  15992. t.a152 = 0x278c;
  15993. t.a153 = 0x278d;
  15994. t.a154 = 0x278e;
  15995. t.a155 = 0x278f;
  15996. t.a156 = 0x2790;
  15997. t.a157 = 0x2791;
  15998. t.a158 = 0x2792;
  15999. t.a159 = 0x2793;
  16000. t.a160 = 0x2794;
  16001. t.a161 = 0x2192;
  16002. t.a163 = 0x2194;
  16003. t.a164 = 0x2195;
  16004. t.a196 = 0x2798;
  16005. t.a165 = 0x2799;
  16006. t.a192 = 0x279a;
  16007. t.a166 = 0x279b;
  16008. t.a167 = 0x279c;
  16009. t.a168 = 0x279d;
  16010. t.a169 = 0x279e;
  16011. t.a170 = 0x279f;
  16012. t.a171 = 0x27a0;
  16013. t.a172 = 0x27a1;
  16014. t.a173 = 0x27a2;
  16015. t.a162 = 0x27a3;
  16016. t.a174 = 0x27a4;
  16017. t.a175 = 0x27a5;
  16018. t.a176 = 0x27a6;
  16019. t.a177 = 0x27a7;
  16020. t.a178 = 0x27a8;
  16021. t.a179 = 0x27a9;
  16022. t.a193 = 0x27aa;
  16023. t.a180 = 0x27ab;
  16024. t.a199 = 0x27ac;
  16025. t.a181 = 0x27ad;
  16026. t.a200 = 0x27ae;
  16027. t.a182 = 0x27af;
  16028. t.a201 = 0x27b1;
  16029. t.a183 = 0x27b2;
  16030. t.a184 = 0x27b3;
  16031. t.a197 = 0x27b4;
  16032. t.a185 = 0x27b5;
  16033. t.a194 = 0x27b6;
  16034. t.a198 = 0x27b7;
  16035. t.a186 = 0x27b8;
  16036. t.a195 = 0x27b9;
  16037. t.a187 = 0x27ba;
  16038. t.a188 = 0x27bb;
  16039. t.a189 = 0x27bc;
  16040. t.a190 = 0x27bd;
  16041. t.a191 = 0x27be;
  16042. t.a89 = 0x2768;
  16043. t.a90 = 0x2769;
  16044. t.a93 = 0x276a;
  16045. t.a94 = 0x276b;
  16046. t.a91 = 0x276c;
  16047. t.a92 = 0x276d;
  16048. t.a205 = 0x276e;
  16049. t.a85 = 0x276f;
  16050. t.a206 = 0x2770;
  16051. t.a86 = 0x2771;
  16052. t.a87 = 0x2772;
  16053. t.a88 = 0x2773;
  16054. t.a95 = 0x2774;
  16055. t.a96 = 0x2775;
  16056. t[".notdef"] = 0x0000;
  16057. });
  16058. ;// CONCATENATED MODULE: ./src/core/unicode.js
  16059. const getSpecialPUASymbols = getLookupTableFactory(function (t) {
  16060. t[63721] = 0x00a9;
  16061. t[63193] = 0x00a9;
  16062. t[63720] = 0x00ae;
  16063. t[63194] = 0x00ae;
  16064. t[63722] = 0x2122;
  16065. t[63195] = 0x2122;
  16066. t[63729] = 0x23a7;
  16067. t[63730] = 0x23a8;
  16068. t[63731] = 0x23a9;
  16069. t[63740] = 0x23ab;
  16070. t[63741] = 0x23ac;
  16071. t[63742] = 0x23ad;
  16072. t[63726] = 0x23a1;
  16073. t[63727] = 0x23a2;
  16074. t[63728] = 0x23a3;
  16075. t[63737] = 0x23a4;
  16076. t[63738] = 0x23a5;
  16077. t[63739] = 0x23a6;
  16078. t[63723] = 0x239b;
  16079. t[63724] = 0x239c;
  16080. t[63725] = 0x239d;
  16081. t[63734] = 0x239e;
  16082. t[63735] = 0x239f;
  16083. t[63736] = 0x23a0;
  16084. });
  16085. function mapSpecialUnicodeValues(code) {
  16086. if (code >= 0xfff0 && code <= 0xffff) {
  16087. return 0;
  16088. } else if (code >= 0xf600 && code <= 0xf8ff) {
  16089. return getSpecialPUASymbols()[code] || code;
  16090. } else if (code === 0x00ad) {
  16091. return 0x002d;
  16092. }
  16093. return code;
  16094. }
  16095. function getUnicodeForGlyph(name, glyphsUnicodeMap) {
  16096. let unicode = glyphsUnicodeMap[name];
  16097. if (unicode !== undefined) {
  16098. return unicode;
  16099. }
  16100. if (!name) {
  16101. return -1;
  16102. }
  16103. if (name[0] === "u") {
  16104. const nameLen = name.length;
  16105. let hexStr;
  16106. if (nameLen === 7 && name[1] === "n" && name[2] === "i") {
  16107. hexStr = name.substring(3);
  16108. } else if (nameLen >= 5 && nameLen <= 7) {
  16109. hexStr = name.substring(1);
  16110. } else {
  16111. return -1;
  16112. }
  16113. if (hexStr === hexStr.toUpperCase()) {
  16114. unicode = parseInt(hexStr, 16);
  16115. if (unicode >= 0) {
  16116. return unicode;
  16117. }
  16118. }
  16119. }
  16120. return -1;
  16121. }
  16122. 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]];
  16123. function getUnicodeRangeFor(value, lastPosition = -1) {
  16124. if (lastPosition !== -1) {
  16125. const range = UnicodeRanges[lastPosition];
  16126. for (let i = 0, ii = range.length; i < ii; i += 2) {
  16127. if (value >= range[i] && value <= range[i + 1]) {
  16128. return lastPosition;
  16129. }
  16130. }
  16131. }
  16132. for (let i = 0, ii = UnicodeRanges.length; i < ii; i++) {
  16133. const range = UnicodeRanges[i];
  16134. for (let j = 0, jj = range.length; j < jj; j += 2) {
  16135. if (value >= range[j] && value <= range[j + 1]) {
  16136. return i;
  16137. }
  16138. }
  16139. }
  16140. return -1;
  16141. }
  16142. const SpecialCharRegExp = new RegExp("^(\\s)|(\\p{Mn})|(\\p{Cf})$", "u");
  16143. const CategoryCache = new Map();
  16144. function getCharUnicodeCategory(char) {
  16145. const cachedCategory = CategoryCache.get(char);
  16146. if (cachedCategory) {
  16147. return cachedCategory;
  16148. }
  16149. const groups = char.match(SpecialCharRegExp);
  16150. const category = {
  16151. isWhitespace: !!groups?.[1],
  16152. isZeroWidthDiacritic: !!groups?.[2],
  16153. isInvisibleFormatMark: !!groups?.[3]
  16154. };
  16155. CategoryCache.set(char, category);
  16156. return category;
  16157. }
  16158. function clearUnicodeCaches() {
  16159. CategoryCache.clear();
  16160. }
  16161. ;// CONCATENATED MODULE: ./src/core/fonts_utils.js
  16162. const SEAC_ANALYSIS_ENABLED = true;
  16163. const FontFlags = {
  16164. FixedPitch: 1,
  16165. Serif: 2,
  16166. Symbolic: 4,
  16167. Script: 8,
  16168. Nonsymbolic: 32,
  16169. Italic: 64,
  16170. AllCap: 65536,
  16171. SmallCap: 131072,
  16172. ForceBold: 262144
  16173. };
  16174. 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"];
  16175. function recoverGlyphName(name, glyphsUnicodeMap) {
  16176. if (glyphsUnicodeMap[name] !== undefined) {
  16177. return name;
  16178. }
  16179. const unicode = getUnicodeForGlyph(name, glyphsUnicodeMap);
  16180. if (unicode !== -1) {
  16181. for (const key in glyphsUnicodeMap) {
  16182. if (glyphsUnicodeMap[key] === unicode) {
  16183. return key;
  16184. }
  16185. }
  16186. }
  16187. info("Unable to recover a standard glyph name for: " + name);
  16188. return name;
  16189. }
  16190. function type1FontGlyphMapping(properties, builtInEncoding, glyphNames) {
  16191. const charCodeToGlyphId = Object.create(null);
  16192. let glyphId, charCode, baseEncoding;
  16193. const isSymbolicFont = !!(properties.flags & FontFlags.Symbolic);
  16194. if (properties.isInternalFont) {
  16195. baseEncoding = builtInEncoding;
  16196. for (charCode = 0; charCode < baseEncoding.length; charCode++) {
  16197. glyphId = glyphNames.indexOf(baseEncoding[charCode]);
  16198. charCodeToGlyphId[charCode] = glyphId >= 0 ? glyphId : 0;
  16199. }
  16200. } else if (properties.baseEncodingName) {
  16201. baseEncoding = getEncoding(properties.baseEncodingName);
  16202. for (charCode = 0; charCode < baseEncoding.length; charCode++) {
  16203. glyphId = glyphNames.indexOf(baseEncoding[charCode]);
  16204. charCodeToGlyphId[charCode] = glyphId >= 0 ? glyphId : 0;
  16205. }
  16206. } else if (isSymbolicFont) {
  16207. for (charCode in builtInEncoding) {
  16208. charCodeToGlyphId[charCode] = builtInEncoding[charCode];
  16209. }
  16210. } else {
  16211. baseEncoding = StandardEncoding;
  16212. for (charCode = 0; charCode < baseEncoding.length; charCode++) {
  16213. glyphId = glyphNames.indexOf(baseEncoding[charCode]);
  16214. charCodeToGlyphId[charCode] = glyphId >= 0 ? glyphId : 0;
  16215. }
  16216. }
  16217. const differences = properties.differences;
  16218. let glyphsUnicodeMap;
  16219. if (differences) {
  16220. for (charCode in differences) {
  16221. const glyphName = differences[charCode];
  16222. glyphId = glyphNames.indexOf(glyphName);
  16223. if (glyphId === -1) {
  16224. if (!glyphsUnicodeMap) {
  16225. glyphsUnicodeMap = getGlyphsUnicode();
  16226. }
  16227. const standardGlyphName = recoverGlyphName(glyphName, glyphsUnicodeMap);
  16228. if (standardGlyphName !== glyphName) {
  16229. glyphId = glyphNames.indexOf(standardGlyphName);
  16230. }
  16231. }
  16232. charCodeToGlyphId[charCode] = glyphId >= 0 ? glyphId : 0;
  16233. }
  16234. }
  16235. return charCodeToGlyphId;
  16236. }
  16237. function normalizeFontName(name) {
  16238. return name.replaceAll(/[,_]/g, "-").replaceAll(/\s/g, "");
  16239. }
  16240. const getVerticalPresentationForm = getLookupTableFactory(t => {
  16241. t[0x2013] = 0xfe32;
  16242. t[0x2014] = 0xfe31;
  16243. t[0x2025] = 0xfe30;
  16244. t[0x2026] = 0xfe19;
  16245. t[0x3001] = 0xfe11;
  16246. t[0x3002] = 0xfe12;
  16247. t[0x3008] = 0xfe3f;
  16248. t[0x3009] = 0xfe40;
  16249. t[0x300a] = 0xfe3d;
  16250. t[0x300b] = 0xfe3e;
  16251. t[0x300c] = 0xfe41;
  16252. t[0x300d] = 0xfe42;
  16253. t[0x300e] = 0xfe43;
  16254. t[0x300f] = 0xfe44;
  16255. t[0x3010] = 0xfe3b;
  16256. t[0x3011] = 0xfe3c;
  16257. t[0x3014] = 0xfe39;
  16258. t[0x3015] = 0xfe3a;
  16259. t[0x3016] = 0xfe17;
  16260. t[0x3017] = 0xfe18;
  16261. t[0xfe4f] = 0xfe34;
  16262. t[0xff01] = 0xfe15;
  16263. t[0xff08] = 0xfe35;
  16264. t[0xff09] = 0xfe36;
  16265. t[0xff0c] = 0xfe10;
  16266. t[0xff1a] = 0xfe13;
  16267. t[0xff1b] = 0xfe14;
  16268. t[0xff1f] = 0xfe16;
  16269. t[0xff3b] = 0xfe47;
  16270. t[0xff3d] = 0xfe48;
  16271. t[0xff3f] = 0xfe33;
  16272. t[0xff5b] = 0xfe37;
  16273. t[0xff5d] = 0xfe38;
  16274. });
  16275. ;// CONCATENATED MODULE: ./src/core/standard_fonts.js
  16276. const getStdFontMap = getLookupTableFactory(function (t) {
  16277. t["Times-Roman"] = "Times-Roman";
  16278. t.Helvetica = "Helvetica";
  16279. t.Courier = "Courier";
  16280. t.Symbol = "Symbol";
  16281. t["Times-Bold"] = "Times-Bold";
  16282. t["Helvetica-Bold"] = "Helvetica-Bold";
  16283. t["Courier-Bold"] = "Courier-Bold";
  16284. t.ZapfDingbats = "ZapfDingbats";
  16285. t["Times-Italic"] = "Times-Italic";
  16286. t["Helvetica-Oblique"] = "Helvetica-Oblique";
  16287. t["Courier-Oblique"] = "Courier-Oblique";
  16288. t["Times-BoldItalic"] = "Times-BoldItalic";
  16289. t["Helvetica-BoldOblique"] = "Helvetica-BoldOblique";
  16290. t["Courier-BoldOblique"] = "Courier-BoldOblique";
  16291. t.ArialNarrow = "Helvetica";
  16292. t["ArialNarrow-Bold"] = "Helvetica-Bold";
  16293. t["ArialNarrow-BoldItalic"] = "Helvetica-BoldOblique";
  16294. t["ArialNarrow-Italic"] = "Helvetica-Oblique";
  16295. t.ArialBlack = "Helvetica";
  16296. t["ArialBlack-Bold"] = "Helvetica-Bold";
  16297. t["ArialBlack-BoldItalic"] = "Helvetica-BoldOblique";
  16298. t["ArialBlack-Italic"] = "Helvetica-Oblique";
  16299. t["Arial-Black"] = "Helvetica";
  16300. t["Arial-Black-Bold"] = "Helvetica-Bold";
  16301. t["Arial-Black-BoldItalic"] = "Helvetica-BoldOblique";
  16302. t["Arial-Black-Italic"] = "Helvetica-Oblique";
  16303. t.Arial = "Helvetica";
  16304. t["Arial-Bold"] = "Helvetica-Bold";
  16305. t["Arial-BoldItalic"] = "Helvetica-BoldOblique";
  16306. t["Arial-Italic"] = "Helvetica-Oblique";
  16307. t.ArialMT = "Helvetica";
  16308. t["Arial-BoldItalicMT"] = "Helvetica-BoldOblique";
  16309. t["Arial-BoldMT"] = "Helvetica-Bold";
  16310. t["Arial-ItalicMT"] = "Helvetica-Oblique";
  16311. t["Arial-BoldItalicMT-BoldItalic"] = "Helvetica-BoldOblique";
  16312. t["Arial-BoldMT-Bold"] = "Helvetica-Bold";
  16313. t["Arial-ItalicMT-Italic"] = "Helvetica-Oblique";
  16314. t.ArialUnicodeMS = "Helvetica";
  16315. t["ArialUnicodeMS-Bold"] = "Helvetica-Bold";
  16316. t["ArialUnicodeMS-BoldItalic"] = "Helvetica-BoldOblique";
  16317. t["ArialUnicodeMS-Italic"] = "Helvetica-Oblique";
  16318. t["Courier-BoldItalic"] = "Courier-BoldOblique";
  16319. t["Courier-Italic"] = "Courier-Oblique";
  16320. t.CourierNew = "Courier";
  16321. t["CourierNew-Bold"] = "Courier-Bold";
  16322. t["CourierNew-BoldItalic"] = "Courier-BoldOblique";
  16323. t["CourierNew-Italic"] = "Courier-Oblique";
  16324. t["CourierNewPS-BoldItalicMT"] = "Courier-BoldOblique";
  16325. t["CourierNewPS-BoldMT"] = "Courier-Bold";
  16326. t["CourierNewPS-ItalicMT"] = "Courier-Oblique";
  16327. t.CourierNewPSMT = "Courier";
  16328. t["Helvetica-BoldItalic"] = "Helvetica-BoldOblique";
  16329. t["Helvetica-Italic"] = "Helvetica-Oblique";
  16330. t["Symbol-Bold"] = "Symbol";
  16331. t["Symbol-BoldItalic"] = "Symbol";
  16332. t["Symbol-Italic"] = "Symbol";
  16333. t.TimesNewRoman = "Times-Roman";
  16334. t["TimesNewRoman-Bold"] = "Times-Bold";
  16335. t["TimesNewRoman-BoldItalic"] = "Times-BoldItalic";
  16336. t["TimesNewRoman-Italic"] = "Times-Italic";
  16337. t.TimesNewRomanPS = "Times-Roman";
  16338. t["TimesNewRomanPS-Bold"] = "Times-Bold";
  16339. t["TimesNewRomanPS-BoldItalic"] = "Times-BoldItalic";
  16340. t["TimesNewRomanPS-BoldItalicMT"] = "Times-BoldItalic";
  16341. t["TimesNewRomanPS-BoldMT"] = "Times-Bold";
  16342. t["TimesNewRomanPS-Italic"] = "Times-Italic";
  16343. t["TimesNewRomanPS-ItalicMT"] = "Times-Italic";
  16344. t.TimesNewRomanPSMT = "Times-Roman";
  16345. t["TimesNewRomanPSMT-Bold"] = "Times-Bold";
  16346. t["TimesNewRomanPSMT-BoldItalic"] = "Times-BoldItalic";
  16347. t["TimesNewRomanPSMT-Italic"] = "Times-Italic";
  16348. });
  16349. const getFontNameToFileMap = getLookupTableFactory(function (t) {
  16350. t.Courier = "FoxitFixed.pfb";
  16351. t["Courier-Bold"] = "FoxitFixedBold.pfb";
  16352. t["Courier-BoldOblique"] = "FoxitFixedBoldItalic.pfb";
  16353. t["Courier-Oblique"] = "FoxitFixedItalic.pfb";
  16354. t.Helvetica = "LiberationSans-Regular.ttf";
  16355. t["Helvetica-Bold"] = "LiberationSans-Bold.ttf";
  16356. t["Helvetica-BoldOblique"] = "LiberationSans-BoldItalic.ttf";
  16357. t["Helvetica-Oblique"] = "LiberationSans-Italic.ttf";
  16358. t["Times-Roman"] = "FoxitSerif.pfb";
  16359. t["Times-Bold"] = "FoxitSerifBold.pfb";
  16360. t["Times-BoldItalic"] = "FoxitSerifBoldItalic.pfb";
  16361. t["Times-Italic"] = "FoxitSerifItalic.pfb";
  16362. t.Symbol = "FoxitSymbol.pfb";
  16363. t.ZapfDingbats = "FoxitDingbats.pfb";
  16364. t["LiberationSans-Regular"] = "LiberationSans-Regular.ttf";
  16365. t["LiberationSans-Bold"] = "LiberationSans-Bold.ttf";
  16366. t["LiberationSans-Italic"] = "LiberationSans-Italic.ttf";
  16367. t["LiberationSans-BoldItalic"] = "LiberationSans-BoldItalic.ttf";
  16368. });
  16369. const getNonStdFontMap = getLookupTableFactory(function (t) {
  16370. t.Calibri = "Helvetica";
  16371. t["Calibri-Bold"] = "Helvetica-Bold";
  16372. t["Calibri-BoldItalic"] = "Helvetica-BoldOblique";
  16373. t["Calibri-Italic"] = "Helvetica-Oblique";
  16374. t.CenturyGothic = "Helvetica";
  16375. t["CenturyGothic-Bold"] = "Helvetica-Bold";
  16376. t["CenturyGothic-BoldItalic"] = "Helvetica-BoldOblique";
  16377. t["CenturyGothic-Italic"] = "Helvetica-Oblique";
  16378. t.ComicSansMS = "Comic Sans MS";
  16379. t["ComicSansMS-Bold"] = "Comic Sans MS-Bold";
  16380. t["ComicSansMS-BoldItalic"] = "Comic Sans MS-BoldItalic";
  16381. t["ComicSansMS-Italic"] = "Comic Sans MS-Italic";
  16382. t.Impact = "Helvetica";
  16383. t["ItcSymbol-Bold"] = "Helvetica-Bold";
  16384. t["ItcSymbol-BoldItalic"] = "Helvetica-BoldOblique";
  16385. t["ItcSymbol-Book"] = "Helvetica";
  16386. t["ItcSymbol-BookItalic"] = "Helvetica-Oblique";
  16387. t["ItcSymbol-Medium"] = "Helvetica";
  16388. t["ItcSymbol-MediumItalic"] = "Helvetica-Oblique";
  16389. t.LucidaConsole = "Courier";
  16390. t["LucidaConsole-Bold"] = "Courier-Bold";
  16391. t["LucidaConsole-BoldItalic"] = "Courier-BoldOblique";
  16392. t["LucidaConsole-Italic"] = "Courier-Oblique";
  16393. t["LucidaSans-Demi"] = "Helvetica-Bold";
  16394. t["MS-Gothic"] = "MS Gothic";
  16395. t["MS-Gothic-Bold"] = "MS Gothic-Bold";
  16396. t["MS-Gothic-BoldItalic"] = "MS Gothic-BoldItalic";
  16397. t["MS-Gothic-Italic"] = "MS Gothic-Italic";
  16398. t["MS-Mincho"] = "MS Mincho";
  16399. t["MS-Mincho-Bold"] = "MS Mincho-Bold";
  16400. t["MS-Mincho-BoldItalic"] = "MS Mincho-BoldItalic";
  16401. t["MS-Mincho-Italic"] = "MS Mincho-Italic";
  16402. t["MS-PGothic"] = "MS PGothic";
  16403. t["MS-PGothic-Bold"] = "MS PGothic-Bold";
  16404. t["MS-PGothic-BoldItalic"] = "MS PGothic-BoldItalic";
  16405. t["MS-PGothic-Italic"] = "MS PGothic-Italic";
  16406. t["MS-PMincho"] = "MS PMincho";
  16407. t["MS-PMincho-Bold"] = "MS PMincho-Bold";
  16408. t["MS-PMincho-BoldItalic"] = "MS PMincho-BoldItalic";
  16409. t["MS-PMincho-Italic"] = "MS PMincho-Italic";
  16410. t.NuptialScript = "Times-Italic";
  16411. t.SegoeUISymbol = "Helvetica";
  16412. });
  16413. const getSerifFonts = getLookupTableFactory(function (t) {
  16414. t["Adobe Jenson"] = true;
  16415. t["Adobe Text"] = true;
  16416. t.Albertus = true;
  16417. t.Aldus = true;
  16418. t.Alexandria = true;
  16419. t.Algerian = true;
  16420. t["American Typewriter"] = true;
  16421. t.Antiqua = true;
  16422. t.Apex = true;
  16423. t.Arno = true;
  16424. t.Aster = true;
  16425. t.Aurora = true;
  16426. t.Baskerville = true;
  16427. t.Bell = true;
  16428. t.Bembo = true;
  16429. t["Bembo Schoolbook"] = true;
  16430. t.Benguiat = true;
  16431. t["Berkeley Old Style"] = true;
  16432. t["Bernhard Modern"] = true;
  16433. t["Berthold City"] = true;
  16434. t.Bodoni = true;
  16435. t["Bauer Bodoni"] = true;
  16436. t["Book Antiqua"] = true;
  16437. t.Bookman = true;
  16438. t["Bordeaux Roman"] = true;
  16439. t["Californian FB"] = true;
  16440. t.Calisto = true;
  16441. t.Calvert = true;
  16442. t.Capitals = true;
  16443. t.Cambria = true;
  16444. t.Cartier = true;
  16445. t.Caslon = true;
  16446. t.Catull = true;
  16447. t.Centaur = true;
  16448. t["Century Old Style"] = true;
  16449. t["Century Schoolbook"] = true;
  16450. t.Chaparral = true;
  16451. t["Charis SIL"] = true;
  16452. t.Cheltenham = true;
  16453. t["Cholla Slab"] = true;
  16454. t.Clarendon = true;
  16455. t.Clearface = true;
  16456. t.Cochin = true;
  16457. t.Colonna = true;
  16458. t["Computer Modern"] = true;
  16459. t["Concrete Roman"] = true;
  16460. t.Constantia = true;
  16461. t["Cooper Black"] = true;
  16462. t.Corona = true;
  16463. t.Ecotype = true;
  16464. t.Egyptienne = true;
  16465. t.Elephant = true;
  16466. t.Excelsior = true;
  16467. t.Fairfield = true;
  16468. t["FF Scala"] = true;
  16469. t.Folkard = true;
  16470. t.Footlight = true;
  16471. t.FreeSerif = true;
  16472. t["Friz Quadrata"] = true;
  16473. t.Garamond = true;
  16474. t.Gentium = true;
  16475. t.Georgia = true;
  16476. t.Gloucester = true;
  16477. t["Goudy Old Style"] = true;
  16478. t["Goudy Schoolbook"] = true;
  16479. t["Goudy Pro Font"] = true;
  16480. t.Granjon = true;
  16481. t["Guardian Egyptian"] = true;
  16482. t.Heather = true;
  16483. t.Hercules = true;
  16484. t["High Tower Text"] = true;
  16485. t.Hiroshige = true;
  16486. t["Hoefler Text"] = true;
  16487. t["Humana Serif"] = true;
  16488. t.Imprint = true;
  16489. t["Ionic No. 5"] = true;
  16490. t.Janson = true;
  16491. t.Joanna = true;
  16492. t.Korinna = true;
  16493. t.Lexicon = true;
  16494. t.LiberationSerif = true;
  16495. t["Liberation Serif"] = true;
  16496. t["Linux Libertine"] = true;
  16497. t.Literaturnaya = true;
  16498. t.Lucida = true;
  16499. t["Lucida Bright"] = true;
  16500. t.Melior = true;
  16501. t.Memphis = true;
  16502. t.Miller = true;
  16503. t.Minion = true;
  16504. t.Modern = true;
  16505. t["Mona Lisa"] = true;
  16506. t["Mrs Eaves"] = true;
  16507. t["MS Serif"] = true;
  16508. t["Museo Slab"] = true;
  16509. t["New York"] = true;
  16510. t["Nimbus Roman"] = true;
  16511. t["NPS Rawlinson Roadway"] = true;
  16512. t.NuptialScript = true;
  16513. t.Palatino = true;
  16514. t.Perpetua = true;
  16515. t.Plantin = true;
  16516. t["Plantin Schoolbook"] = true;
  16517. t.Playbill = true;
  16518. t["Poor Richard"] = true;
  16519. t["Rawlinson Roadway"] = true;
  16520. t.Renault = true;
  16521. t.Requiem = true;
  16522. t.Rockwell = true;
  16523. t.Roman = true;
  16524. t["Rotis Serif"] = true;
  16525. t.Sabon = true;
  16526. t.Scala = true;
  16527. t.Seagull = true;
  16528. t.Sistina = true;
  16529. t.Souvenir = true;
  16530. t.STIX = true;
  16531. t["Stone Informal"] = true;
  16532. t["Stone Serif"] = true;
  16533. t.Sylfaen = true;
  16534. t.Times = true;
  16535. t.Trajan = true;
  16536. t["Trinité"] = true;
  16537. t["Trump Mediaeval"] = true;
  16538. t.Utopia = true;
  16539. t["Vale Type"] = true;
  16540. t["Bitstream Vera"] = true;
  16541. t["Vera Serif"] = true;
  16542. t.Versailles = true;
  16543. t.Wanted = true;
  16544. t.Weiss = true;
  16545. t["Wide Latin"] = true;
  16546. t.Windsor = true;
  16547. t.XITS = true;
  16548. });
  16549. const getSymbolsFonts = getLookupTableFactory(function (t) {
  16550. t.Dingbats = true;
  16551. t.Symbol = true;
  16552. t.ZapfDingbats = true;
  16553. t.Wingdings = true;
  16554. t["Wingdings-Bold"] = true;
  16555. t["Wingdings-Regular"] = true;
  16556. });
  16557. const getGlyphMapForStandardFonts = getLookupTableFactory(function (t) {
  16558. t[2] = 10;
  16559. t[3] = 32;
  16560. t[4] = 33;
  16561. t[5] = 34;
  16562. t[6] = 35;
  16563. t[7] = 36;
  16564. t[8] = 37;
  16565. t[9] = 38;
  16566. t[10] = 39;
  16567. t[11] = 40;
  16568. t[12] = 41;
  16569. t[13] = 42;
  16570. t[14] = 43;
  16571. t[15] = 44;
  16572. t[16] = 45;
  16573. t[17] = 46;
  16574. t[18] = 47;
  16575. t[19] = 48;
  16576. t[20] = 49;
  16577. t[21] = 50;
  16578. t[22] = 51;
  16579. t[23] = 52;
  16580. t[24] = 53;
  16581. t[25] = 54;
  16582. t[26] = 55;
  16583. t[27] = 56;
  16584. t[28] = 57;
  16585. t[29] = 58;
  16586. t[30] = 894;
  16587. t[31] = 60;
  16588. t[32] = 61;
  16589. t[33] = 62;
  16590. t[34] = 63;
  16591. t[35] = 64;
  16592. t[36] = 65;
  16593. t[37] = 66;
  16594. t[38] = 67;
  16595. t[39] = 68;
  16596. t[40] = 69;
  16597. t[41] = 70;
  16598. t[42] = 71;
  16599. t[43] = 72;
  16600. t[44] = 73;
  16601. t[45] = 74;
  16602. t[46] = 75;
  16603. t[47] = 76;
  16604. t[48] = 77;
  16605. t[49] = 78;
  16606. t[50] = 79;
  16607. t[51] = 80;
  16608. t[52] = 81;
  16609. t[53] = 82;
  16610. t[54] = 83;
  16611. t[55] = 84;
  16612. t[56] = 85;
  16613. t[57] = 86;
  16614. t[58] = 87;
  16615. t[59] = 88;
  16616. t[60] = 89;
  16617. t[61] = 90;
  16618. t[62] = 91;
  16619. t[63] = 92;
  16620. t[64] = 93;
  16621. t[65] = 94;
  16622. t[66] = 95;
  16623. t[67] = 96;
  16624. t[68] = 97;
  16625. t[69] = 98;
  16626. t[70] = 99;
  16627. t[71] = 100;
  16628. t[72] = 101;
  16629. t[73] = 102;
  16630. t[74] = 103;
  16631. t[75] = 104;
  16632. t[76] = 105;
  16633. t[77] = 106;
  16634. t[78] = 107;
  16635. t[79] = 108;
  16636. t[80] = 109;
  16637. t[81] = 110;
  16638. t[82] = 111;
  16639. t[83] = 112;
  16640. t[84] = 113;
  16641. t[85] = 114;
  16642. t[86] = 115;
  16643. t[87] = 116;
  16644. t[88] = 117;
  16645. t[89] = 118;
  16646. t[90] = 119;
  16647. t[91] = 120;
  16648. t[92] = 121;
  16649. t[93] = 122;
  16650. t[94] = 123;
  16651. t[95] = 124;
  16652. t[96] = 125;
  16653. t[97] = 126;
  16654. t[98] = 196;
  16655. t[99] = 197;
  16656. t[100] = 199;
  16657. t[101] = 201;
  16658. t[102] = 209;
  16659. t[103] = 214;
  16660. t[104] = 220;
  16661. t[105] = 225;
  16662. t[106] = 224;
  16663. t[107] = 226;
  16664. t[108] = 228;
  16665. t[109] = 227;
  16666. t[110] = 229;
  16667. t[111] = 231;
  16668. t[112] = 233;
  16669. t[113] = 232;
  16670. t[114] = 234;
  16671. t[115] = 235;
  16672. t[116] = 237;
  16673. t[117] = 236;
  16674. t[118] = 238;
  16675. t[119] = 239;
  16676. t[120] = 241;
  16677. t[121] = 243;
  16678. t[122] = 242;
  16679. t[123] = 244;
  16680. t[124] = 246;
  16681. t[125] = 245;
  16682. t[126] = 250;
  16683. t[127] = 249;
  16684. t[128] = 251;
  16685. t[129] = 252;
  16686. t[130] = 8224;
  16687. t[131] = 176;
  16688. t[132] = 162;
  16689. t[133] = 163;
  16690. t[134] = 167;
  16691. t[135] = 8226;
  16692. t[136] = 182;
  16693. t[137] = 223;
  16694. t[138] = 174;
  16695. t[139] = 169;
  16696. t[140] = 8482;
  16697. t[141] = 180;
  16698. t[142] = 168;
  16699. t[143] = 8800;
  16700. t[144] = 198;
  16701. t[145] = 216;
  16702. t[146] = 8734;
  16703. t[147] = 177;
  16704. t[148] = 8804;
  16705. t[149] = 8805;
  16706. t[150] = 165;
  16707. t[151] = 181;
  16708. t[152] = 8706;
  16709. t[153] = 8721;
  16710. t[154] = 8719;
  16711. t[156] = 8747;
  16712. t[157] = 170;
  16713. t[158] = 186;
  16714. t[159] = 8486;
  16715. t[160] = 230;
  16716. t[161] = 248;
  16717. t[162] = 191;
  16718. t[163] = 161;
  16719. t[164] = 172;
  16720. t[165] = 8730;
  16721. t[166] = 402;
  16722. t[167] = 8776;
  16723. t[168] = 8710;
  16724. t[169] = 171;
  16725. t[170] = 187;
  16726. t[171] = 8230;
  16727. t[179] = 8220;
  16728. t[180] = 8221;
  16729. t[181] = 8216;
  16730. t[182] = 8217;
  16731. t[200] = 193;
  16732. t[203] = 205;
  16733. t[207] = 211;
  16734. t[210] = 218;
  16735. t[223] = 711;
  16736. t[224] = 321;
  16737. t[225] = 322;
  16738. t[226] = 352;
  16739. t[227] = 353;
  16740. t[228] = 381;
  16741. t[229] = 382;
  16742. t[233] = 221;
  16743. t[234] = 253;
  16744. t[252] = 263;
  16745. t[253] = 268;
  16746. t[254] = 269;
  16747. t[258] = 258;
  16748. t[260] = 260;
  16749. t[261] = 261;
  16750. t[265] = 280;
  16751. t[266] = 281;
  16752. t[267] = 282;
  16753. t[268] = 283;
  16754. t[269] = 313;
  16755. t[275] = 323;
  16756. t[276] = 324;
  16757. t[278] = 328;
  16758. t[283] = 344;
  16759. t[284] = 345;
  16760. t[285] = 346;
  16761. t[286] = 347;
  16762. t[292] = 367;
  16763. t[295] = 377;
  16764. t[296] = 378;
  16765. t[298] = 380;
  16766. t[305] = 963;
  16767. t[306] = 964;
  16768. t[307] = 966;
  16769. t[308] = 8215;
  16770. t[309] = 8252;
  16771. t[310] = 8319;
  16772. t[311] = 8359;
  16773. t[312] = 8592;
  16774. t[313] = 8593;
  16775. t[337] = 9552;
  16776. t[493] = 1039;
  16777. t[494] = 1040;
  16778. t[672] = 1488;
  16779. t[673] = 1489;
  16780. t[674] = 1490;
  16781. t[675] = 1491;
  16782. t[676] = 1492;
  16783. t[677] = 1493;
  16784. t[678] = 1494;
  16785. t[679] = 1495;
  16786. t[680] = 1496;
  16787. t[681] = 1497;
  16788. t[682] = 1498;
  16789. t[683] = 1499;
  16790. t[684] = 1500;
  16791. t[685] = 1501;
  16792. t[686] = 1502;
  16793. t[687] = 1503;
  16794. t[688] = 1504;
  16795. t[689] = 1505;
  16796. t[690] = 1506;
  16797. t[691] = 1507;
  16798. t[692] = 1508;
  16799. t[693] = 1509;
  16800. t[694] = 1510;
  16801. t[695] = 1511;
  16802. t[696] = 1512;
  16803. t[697] = 1513;
  16804. t[698] = 1514;
  16805. t[705] = 1524;
  16806. t[706] = 8362;
  16807. t[710] = 64288;
  16808. t[711] = 64298;
  16809. t[759] = 1617;
  16810. t[761] = 1776;
  16811. t[763] = 1778;
  16812. t[775] = 1652;
  16813. t[777] = 1764;
  16814. t[778] = 1780;
  16815. t[779] = 1781;
  16816. t[780] = 1782;
  16817. t[782] = 771;
  16818. t[783] = 64726;
  16819. t[786] = 8363;
  16820. t[788] = 8532;
  16821. t[790] = 768;
  16822. t[791] = 769;
  16823. t[792] = 768;
  16824. t[795] = 803;
  16825. t[797] = 64336;
  16826. t[798] = 64337;
  16827. t[799] = 64342;
  16828. t[800] = 64343;
  16829. t[801] = 64344;
  16830. t[802] = 64345;
  16831. t[803] = 64362;
  16832. t[804] = 64363;
  16833. t[805] = 64364;
  16834. t[2424] = 7821;
  16835. t[2425] = 7822;
  16836. t[2426] = 7823;
  16837. t[2427] = 7824;
  16838. t[2428] = 7825;
  16839. t[2429] = 7826;
  16840. t[2430] = 7827;
  16841. t[2433] = 7682;
  16842. t[2678] = 8045;
  16843. t[2679] = 8046;
  16844. t[2830] = 1552;
  16845. t[2838] = 686;
  16846. t[2840] = 751;
  16847. t[2842] = 753;
  16848. t[2843] = 754;
  16849. t[2844] = 755;
  16850. t[2846] = 757;
  16851. t[2856] = 767;
  16852. t[2857] = 848;
  16853. t[2858] = 849;
  16854. t[2862] = 853;
  16855. t[2863] = 854;
  16856. t[2864] = 855;
  16857. t[2865] = 861;
  16858. t[2866] = 862;
  16859. t[2906] = 7460;
  16860. t[2908] = 7462;
  16861. t[2909] = 7463;
  16862. t[2910] = 7464;
  16863. t[2912] = 7466;
  16864. t[2913] = 7467;
  16865. t[2914] = 7468;
  16866. t[2916] = 7470;
  16867. t[2917] = 7471;
  16868. t[2918] = 7472;
  16869. t[2920] = 7474;
  16870. t[2921] = 7475;
  16871. t[2922] = 7476;
  16872. t[2924] = 7478;
  16873. t[2925] = 7479;
  16874. t[2926] = 7480;
  16875. t[2928] = 7482;
  16876. t[2929] = 7483;
  16877. t[2930] = 7484;
  16878. t[2932] = 7486;
  16879. t[2933] = 7487;
  16880. t[2934] = 7488;
  16881. t[2936] = 7490;
  16882. t[2937] = 7491;
  16883. t[2938] = 7492;
  16884. t[2940] = 7494;
  16885. t[2941] = 7495;
  16886. t[2942] = 7496;
  16887. t[2944] = 7498;
  16888. t[2946] = 7500;
  16889. t[2948] = 7502;
  16890. t[2950] = 7504;
  16891. t[2951] = 7505;
  16892. t[2952] = 7506;
  16893. t[2954] = 7508;
  16894. t[2955] = 7509;
  16895. t[2956] = 7510;
  16896. t[2958] = 7512;
  16897. t[2959] = 7513;
  16898. t[2960] = 7514;
  16899. t[2962] = 7516;
  16900. t[2963] = 7517;
  16901. t[2964] = 7518;
  16902. t[2966] = 7520;
  16903. t[2967] = 7521;
  16904. t[2968] = 7522;
  16905. t[2970] = 7524;
  16906. t[2971] = 7525;
  16907. t[2972] = 7526;
  16908. t[2974] = 7528;
  16909. t[2975] = 7529;
  16910. t[2976] = 7530;
  16911. t[2978] = 1537;
  16912. t[2979] = 1538;
  16913. t[2980] = 1539;
  16914. t[2982] = 1549;
  16915. t[2983] = 1551;
  16916. t[2984] = 1552;
  16917. t[2986] = 1554;
  16918. t[2987] = 1555;
  16919. t[2988] = 1556;
  16920. t[2990] = 1623;
  16921. t[2991] = 1624;
  16922. t[2995] = 1775;
  16923. t[2999] = 1791;
  16924. t[3002] = 64290;
  16925. t[3003] = 64291;
  16926. t[3004] = 64292;
  16927. t[3006] = 64294;
  16928. t[3007] = 64295;
  16929. t[3008] = 64296;
  16930. t[3011] = 1900;
  16931. t[3014] = 8223;
  16932. t[3015] = 8244;
  16933. t[3017] = 7532;
  16934. t[3018] = 7533;
  16935. t[3019] = 7534;
  16936. t[3075] = 7590;
  16937. t[3076] = 7591;
  16938. t[3079] = 7594;
  16939. t[3080] = 7595;
  16940. t[3083] = 7598;
  16941. t[3084] = 7599;
  16942. t[3087] = 7602;
  16943. t[3088] = 7603;
  16944. t[3091] = 7606;
  16945. t[3092] = 7607;
  16946. t[3095] = 7610;
  16947. t[3096] = 7611;
  16948. t[3099] = 7614;
  16949. t[3100] = 7615;
  16950. t[3103] = 7618;
  16951. t[3104] = 7619;
  16952. t[3107] = 8337;
  16953. t[3108] = 8338;
  16954. t[3116] = 1884;
  16955. t[3119] = 1885;
  16956. t[3120] = 1885;
  16957. t[3123] = 1886;
  16958. t[3124] = 1886;
  16959. t[3127] = 1887;
  16960. t[3128] = 1887;
  16961. t[3131] = 1888;
  16962. t[3132] = 1888;
  16963. t[3135] = 1889;
  16964. t[3136] = 1889;
  16965. t[3139] = 1890;
  16966. t[3140] = 1890;
  16967. t[3143] = 1891;
  16968. t[3144] = 1891;
  16969. t[3147] = 1892;
  16970. t[3148] = 1892;
  16971. t[3153] = 580;
  16972. t[3154] = 581;
  16973. t[3157] = 584;
  16974. t[3158] = 585;
  16975. t[3161] = 588;
  16976. t[3162] = 589;
  16977. t[3165] = 891;
  16978. t[3166] = 892;
  16979. t[3169] = 1274;
  16980. t[3170] = 1275;
  16981. t[3173] = 1278;
  16982. t[3174] = 1279;
  16983. t[3181] = 7622;
  16984. t[3182] = 7623;
  16985. t[3282] = 11799;
  16986. t[3316] = 578;
  16987. t[3379] = 42785;
  16988. t[3393] = 1159;
  16989. t[3416] = 8377;
  16990. });
  16991. const getSupplementalGlyphMapForArialBlack = getLookupTableFactory(function (t) {
  16992. t[227] = 322;
  16993. t[264] = 261;
  16994. t[291] = 346;
  16995. });
  16996. const getSupplementalGlyphMapForCalibri = getLookupTableFactory(function (t) {
  16997. t[1] = 32;
  16998. t[4] = 65;
  16999. t[5] = 192;
  17000. t[6] = 193;
  17001. t[9] = 196;
  17002. t[17] = 66;
  17003. t[18] = 67;
  17004. t[21] = 268;
  17005. t[24] = 68;
  17006. t[28] = 69;
  17007. t[29] = 200;
  17008. t[30] = 201;
  17009. t[32] = 282;
  17010. t[38] = 70;
  17011. t[39] = 71;
  17012. t[44] = 72;
  17013. t[47] = 73;
  17014. t[48] = 204;
  17015. t[49] = 205;
  17016. t[58] = 74;
  17017. t[60] = 75;
  17018. t[62] = 76;
  17019. t[68] = 77;
  17020. t[69] = 78;
  17021. t[75] = 79;
  17022. t[76] = 210;
  17023. t[80] = 214;
  17024. t[87] = 80;
  17025. t[89] = 81;
  17026. t[90] = 82;
  17027. t[92] = 344;
  17028. t[94] = 83;
  17029. t[97] = 352;
  17030. t[100] = 84;
  17031. t[104] = 85;
  17032. t[109] = 220;
  17033. t[115] = 86;
  17034. t[116] = 87;
  17035. t[121] = 88;
  17036. t[122] = 89;
  17037. t[124] = 221;
  17038. t[127] = 90;
  17039. t[129] = 381;
  17040. t[258] = 97;
  17041. t[259] = 224;
  17042. t[260] = 225;
  17043. t[263] = 228;
  17044. t[268] = 261;
  17045. t[271] = 98;
  17046. t[272] = 99;
  17047. t[273] = 263;
  17048. t[275] = 269;
  17049. t[282] = 100;
  17050. t[286] = 101;
  17051. t[287] = 232;
  17052. t[288] = 233;
  17053. t[290] = 283;
  17054. t[295] = 281;
  17055. t[296] = 102;
  17056. t[336] = 103;
  17057. t[346] = 104;
  17058. t[349] = 105;
  17059. t[350] = 236;
  17060. t[351] = 237;
  17061. t[361] = 106;
  17062. t[364] = 107;
  17063. t[367] = 108;
  17064. t[371] = 322;
  17065. t[373] = 109;
  17066. t[374] = 110;
  17067. t[381] = 111;
  17068. t[382] = 242;
  17069. t[383] = 243;
  17070. t[386] = 246;
  17071. t[393] = 112;
  17072. t[395] = 113;
  17073. t[396] = 114;
  17074. t[398] = 345;
  17075. t[400] = 115;
  17076. t[401] = 347;
  17077. t[403] = 353;
  17078. t[410] = 116;
  17079. t[437] = 117;
  17080. t[442] = 252;
  17081. t[448] = 118;
  17082. t[449] = 119;
  17083. t[454] = 120;
  17084. t[455] = 121;
  17085. t[457] = 253;
  17086. t[460] = 122;
  17087. t[462] = 382;
  17088. t[463] = 380;
  17089. t[853] = 44;
  17090. t[855] = 58;
  17091. t[856] = 46;
  17092. t[876] = 47;
  17093. t[878] = 45;
  17094. t[882] = 45;
  17095. t[894] = 40;
  17096. t[895] = 41;
  17097. t[896] = 91;
  17098. t[897] = 93;
  17099. t[923] = 64;
  17100. t[1004] = 48;
  17101. t[1005] = 49;
  17102. t[1006] = 50;
  17103. t[1007] = 51;
  17104. t[1008] = 52;
  17105. t[1009] = 53;
  17106. t[1010] = 54;
  17107. t[1011] = 55;
  17108. t[1012] = 56;
  17109. t[1013] = 57;
  17110. t[1081] = 37;
  17111. t[1085] = 43;
  17112. t[1086] = 45;
  17113. });
  17114. function getStandardFontName(name) {
  17115. const fontName = normalizeFontName(name);
  17116. const stdFontMap = getStdFontMap();
  17117. return stdFontMap[fontName];
  17118. }
  17119. function isKnownFontName(name) {
  17120. const fontName = normalizeFontName(name);
  17121. return !!(getStdFontMap()[fontName] || getNonStdFontMap()[fontName] || getSerifFonts()[fontName] || getSymbolsFonts()[fontName]);
  17122. }
  17123. ;// CONCATENATED MODULE: ./src/core/to_unicode_map.js
  17124. class ToUnicodeMap {
  17125. constructor(cmap = []) {
  17126. this._map = cmap;
  17127. }
  17128. get length() {
  17129. return this._map.length;
  17130. }
  17131. forEach(callback) {
  17132. for (const charCode in this._map) {
  17133. callback(charCode, this._map[charCode].charCodeAt(0));
  17134. }
  17135. }
  17136. has(i) {
  17137. return this._map[i] !== undefined;
  17138. }
  17139. get(i) {
  17140. return this._map[i];
  17141. }
  17142. charCodeOf(value) {
  17143. const map = this._map;
  17144. if (map.length <= 0x10000) {
  17145. return map.indexOf(value);
  17146. }
  17147. for (const charCode in map) {
  17148. if (map[charCode] === value) {
  17149. return charCode | 0;
  17150. }
  17151. }
  17152. return -1;
  17153. }
  17154. amend(map) {
  17155. for (const charCode in map) {
  17156. this._map[charCode] = map[charCode];
  17157. }
  17158. }
  17159. }
  17160. class IdentityToUnicodeMap {
  17161. constructor(firstChar, lastChar) {
  17162. this.firstChar = firstChar;
  17163. this.lastChar = lastChar;
  17164. }
  17165. get length() {
  17166. return this.lastChar + 1 - this.firstChar;
  17167. }
  17168. forEach(callback) {
  17169. for (let i = this.firstChar, ii = this.lastChar; i <= ii; i++) {
  17170. callback(i, i);
  17171. }
  17172. }
  17173. has(i) {
  17174. return this.firstChar <= i && i <= this.lastChar;
  17175. }
  17176. get(i) {
  17177. if (this.firstChar <= i && i <= this.lastChar) {
  17178. return String.fromCharCode(i);
  17179. }
  17180. return undefined;
  17181. }
  17182. charCodeOf(v) {
  17183. return Number.isInteger(v) && v >= this.firstChar && v <= this.lastChar ? v : -1;
  17184. }
  17185. amend(map) {
  17186. unreachable("Should not call amend()");
  17187. }
  17188. }
  17189. ;// CONCATENATED MODULE: ./src/core/cff_font.js
  17190. class CFFFont {
  17191. constructor(file, properties) {
  17192. this.properties = properties;
  17193. const parser = new CFFParser(file, properties, SEAC_ANALYSIS_ENABLED);
  17194. this.cff = parser.parse();
  17195. this.cff.duplicateFirstGlyph();
  17196. const compiler = new CFFCompiler(this.cff);
  17197. this.seacs = this.cff.seacs;
  17198. try {
  17199. this.data = compiler.compile();
  17200. } catch {
  17201. warn("Failed to compile font " + properties.loadedName);
  17202. this.data = file;
  17203. }
  17204. this._createBuiltInEncoding();
  17205. }
  17206. get numGlyphs() {
  17207. return this.cff.charStrings.count;
  17208. }
  17209. getCharset() {
  17210. return this.cff.charset.charset;
  17211. }
  17212. getGlyphMapping() {
  17213. const cff = this.cff;
  17214. const properties = this.properties;
  17215. const {
  17216. cidToGidMap,
  17217. cMap
  17218. } = properties;
  17219. const charsets = cff.charset.charset;
  17220. let charCodeToGlyphId;
  17221. let glyphId;
  17222. if (properties.composite) {
  17223. let invCidToGidMap;
  17224. if (cidToGidMap?.length > 0) {
  17225. invCidToGidMap = Object.create(null);
  17226. for (let i = 0, ii = cidToGidMap.length; i < ii; i++) {
  17227. const gid = cidToGidMap[i];
  17228. if (gid !== undefined) {
  17229. invCidToGidMap[gid] = i;
  17230. }
  17231. }
  17232. }
  17233. charCodeToGlyphId = Object.create(null);
  17234. let charCode;
  17235. if (cff.isCIDFont) {
  17236. for (glyphId = 0; glyphId < charsets.length; glyphId++) {
  17237. const cid = charsets[glyphId];
  17238. charCode = cMap.charCodeOf(cid);
  17239. if (invCidToGidMap?.[charCode] !== undefined) {
  17240. charCode = invCidToGidMap[charCode];
  17241. }
  17242. charCodeToGlyphId[charCode] = glyphId;
  17243. }
  17244. } else {
  17245. for (glyphId = 0; glyphId < cff.charStrings.count; glyphId++) {
  17246. charCode = cMap.charCodeOf(glyphId);
  17247. charCodeToGlyphId[charCode] = glyphId;
  17248. }
  17249. }
  17250. return charCodeToGlyphId;
  17251. }
  17252. let encoding = cff.encoding ? cff.encoding.encoding : null;
  17253. if (properties.isInternalFont) {
  17254. encoding = properties.defaultEncoding;
  17255. }
  17256. charCodeToGlyphId = type1FontGlyphMapping(properties, encoding, charsets);
  17257. return charCodeToGlyphId;
  17258. }
  17259. hasGlyphId(id) {
  17260. return this.cff.hasGlyphId(id);
  17261. }
  17262. _createBuiltInEncoding() {
  17263. const {
  17264. charset,
  17265. encoding
  17266. } = this.cff;
  17267. if (!charset || !encoding) {
  17268. return;
  17269. }
  17270. const charsets = charset.charset,
  17271. encodings = encoding.encoding;
  17272. const map = [];
  17273. for (const charCode in encodings) {
  17274. const glyphId = encodings[charCode];
  17275. if (glyphId >= 0) {
  17276. const glyphName = charsets[glyphId];
  17277. if (glyphName) {
  17278. map[charCode] = glyphName;
  17279. }
  17280. }
  17281. }
  17282. if (map.length > 0) {
  17283. this.properties.builtInEncoding = map;
  17284. }
  17285. }
  17286. }
  17287. ;// CONCATENATED MODULE: ./src/core/font_renderer.js
  17288. function getUint32(data, offset) {
  17289. return (data[offset] << 24 | data[offset + 1] << 16 | data[offset + 2] << 8 | data[offset + 3]) >>> 0;
  17290. }
  17291. function getUint16(data, offset) {
  17292. return data[offset] << 8 | data[offset + 1];
  17293. }
  17294. function getInt16(data, offset) {
  17295. return (data[offset] << 24 | data[offset + 1] << 16) >> 16;
  17296. }
  17297. function getInt8(data, offset) {
  17298. return data[offset] << 24 >> 24;
  17299. }
  17300. function getFloat214(data, offset) {
  17301. return getInt16(data, offset) / 16384;
  17302. }
  17303. function getSubroutineBias(subrs) {
  17304. const numSubrs = subrs.length;
  17305. let bias = 32768;
  17306. if (numSubrs < 1240) {
  17307. bias = 107;
  17308. } else if (numSubrs < 33900) {
  17309. bias = 1131;
  17310. }
  17311. return bias;
  17312. }
  17313. function parseCmap(data, start, end) {
  17314. const offset = getUint16(data, start + 2) === 1 ? getUint32(data, start + 8) : getUint32(data, start + 16);
  17315. const format = getUint16(data, start + offset);
  17316. let ranges, p, i;
  17317. if (format === 4) {
  17318. getUint16(data, start + offset + 2);
  17319. const segCount = getUint16(data, start + offset + 6) >> 1;
  17320. p = start + offset + 14;
  17321. ranges = [];
  17322. for (i = 0; i < segCount; i++, p += 2) {
  17323. ranges[i] = {
  17324. end: getUint16(data, p)
  17325. };
  17326. }
  17327. p += 2;
  17328. for (i = 0; i < segCount; i++, p += 2) {
  17329. ranges[i].start = getUint16(data, p);
  17330. }
  17331. for (i = 0; i < segCount; i++, p += 2) {
  17332. ranges[i].idDelta = getUint16(data, p);
  17333. }
  17334. for (i = 0; i < segCount; i++, p += 2) {
  17335. let idOffset = getUint16(data, p);
  17336. if (idOffset === 0) {
  17337. continue;
  17338. }
  17339. ranges[i].ids = [];
  17340. for (let j = 0, jj = ranges[i].end - ranges[i].start + 1; j < jj; j++) {
  17341. ranges[i].ids[j] = getUint16(data, p + idOffset);
  17342. idOffset += 2;
  17343. }
  17344. }
  17345. return ranges;
  17346. } else if (format === 12) {
  17347. const groups = getUint32(data, start + offset + 12);
  17348. p = start + offset + 16;
  17349. ranges = [];
  17350. for (i = 0; i < groups; i++) {
  17351. start = getUint32(data, p);
  17352. ranges.push({
  17353. start,
  17354. end: getUint32(data, p + 4),
  17355. idDelta: getUint32(data, p + 8) - start
  17356. });
  17357. p += 12;
  17358. }
  17359. return ranges;
  17360. }
  17361. throw new FormatError(`unsupported cmap: ${format}`);
  17362. }
  17363. function parseCff(data, start, end, seacAnalysisEnabled) {
  17364. const properties = {};
  17365. const parser = new CFFParser(new Stream(data, start, end - start), properties, seacAnalysisEnabled);
  17366. const cff = parser.parse();
  17367. return {
  17368. glyphs: cff.charStrings.objects,
  17369. subrs: cff.topDict.privateDict?.subrsIndex?.objects,
  17370. gsubrs: cff.globalSubrIndex?.objects,
  17371. isCFFCIDFont: cff.isCIDFont,
  17372. fdSelect: cff.fdSelect,
  17373. fdArray: cff.fdArray
  17374. };
  17375. }
  17376. function parseGlyfTable(glyf, loca, isGlyphLocationsLong) {
  17377. let itemSize, itemDecode;
  17378. if (isGlyphLocationsLong) {
  17379. itemSize = 4;
  17380. itemDecode = getUint32;
  17381. } else {
  17382. itemSize = 2;
  17383. itemDecode = (data, offset) => 2 * getUint16(data, offset);
  17384. }
  17385. const glyphs = [];
  17386. let startOffset = itemDecode(loca, 0);
  17387. for (let j = itemSize; j < loca.length; j += itemSize) {
  17388. const endOffset = itemDecode(loca, j);
  17389. glyphs.push(glyf.subarray(startOffset, endOffset));
  17390. startOffset = endOffset;
  17391. }
  17392. return glyphs;
  17393. }
  17394. function lookupCmap(ranges, unicode) {
  17395. const code = unicode.codePointAt(0);
  17396. let gid = 0,
  17397. l = 0,
  17398. r = ranges.length - 1;
  17399. while (l < r) {
  17400. const c = l + r + 1 >> 1;
  17401. if (code < ranges[c].start) {
  17402. r = c - 1;
  17403. } else {
  17404. l = c;
  17405. }
  17406. }
  17407. if (ranges[l].start <= code && code <= ranges[l].end) {
  17408. gid = ranges[l].idDelta + (ranges[l].ids ? ranges[l].ids[code - ranges[l].start] : code) & 0xffff;
  17409. }
  17410. return {
  17411. charCode: code,
  17412. glyphId: gid
  17413. };
  17414. }
  17415. function compileGlyf(code, cmds, font) {
  17416. function moveTo(x, y) {
  17417. cmds.add(FontRenderOps.MOVE_TO, [x, y]);
  17418. }
  17419. function lineTo(x, y) {
  17420. cmds.add(FontRenderOps.LINE_TO, [x, y]);
  17421. }
  17422. function quadraticCurveTo(xa, ya, x, y) {
  17423. cmds.add(FontRenderOps.QUADRATIC_CURVE_TO, [xa, ya, x, y]);
  17424. }
  17425. let i = 0;
  17426. const numberOfContours = getInt16(code, i);
  17427. let flags;
  17428. let x = 0,
  17429. y = 0;
  17430. i += 10;
  17431. if (numberOfContours < 0) {
  17432. do {
  17433. flags = getUint16(code, i);
  17434. const glyphIndex = getUint16(code, i + 2);
  17435. i += 4;
  17436. let arg1, arg2;
  17437. if (flags & 0x01) {
  17438. if (flags & 0x02) {
  17439. arg1 = getInt16(code, i);
  17440. arg2 = getInt16(code, i + 2);
  17441. } else {
  17442. arg1 = getUint16(code, i);
  17443. arg2 = getUint16(code, i + 2);
  17444. }
  17445. i += 4;
  17446. } else if (flags & 0x02) {
  17447. arg1 = getInt8(code, i++);
  17448. arg2 = getInt8(code, i++);
  17449. } else {
  17450. arg1 = code[i++];
  17451. arg2 = code[i++];
  17452. }
  17453. if (flags & 0x02) {
  17454. x = arg1;
  17455. y = arg2;
  17456. } else {
  17457. x = 0;
  17458. y = 0;
  17459. }
  17460. let scaleX = 1,
  17461. scaleY = 1,
  17462. scale01 = 0,
  17463. scale10 = 0;
  17464. if (flags & 0x08) {
  17465. scaleX = scaleY = getFloat214(code, i);
  17466. i += 2;
  17467. } else if (flags & 0x40) {
  17468. scaleX = getFloat214(code, i);
  17469. scaleY = getFloat214(code, i + 2);
  17470. i += 4;
  17471. } else if (flags & 0x80) {
  17472. scaleX = getFloat214(code, i);
  17473. scale01 = getFloat214(code, i + 2);
  17474. scale10 = getFloat214(code, i + 4);
  17475. scaleY = getFloat214(code, i + 6);
  17476. i += 8;
  17477. }
  17478. const subglyph = font.glyphs[glyphIndex];
  17479. if (subglyph) {
  17480. cmds.add(FontRenderOps.SAVE);
  17481. cmds.add(FontRenderOps.TRANSFORM, [scaleX, scale01, scale10, scaleY, x, y]);
  17482. if (!(flags & 0x02)) {}
  17483. compileGlyf(subglyph, cmds, font);
  17484. cmds.add(FontRenderOps.RESTORE);
  17485. }
  17486. } while (flags & 0x20);
  17487. } else {
  17488. const endPtsOfContours = [];
  17489. let j, jj;
  17490. for (j = 0; j < numberOfContours; j++) {
  17491. endPtsOfContours.push(getUint16(code, i));
  17492. i += 2;
  17493. }
  17494. const instructionLength = getUint16(code, i);
  17495. i += 2 + instructionLength;
  17496. const numberOfPoints = endPtsOfContours.at(-1) + 1;
  17497. const points = [];
  17498. while (points.length < numberOfPoints) {
  17499. flags = code[i++];
  17500. let repeat = 1;
  17501. if (flags & 0x08) {
  17502. repeat += code[i++];
  17503. }
  17504. while (repeat-- > 0) {
  17505. points.push({
  17506. flags
  17507. });
  17508. }
  17509. }
  17510. for (j = 0; j < numberOfPoints; j++) {
  17511. switch (points[j].flags & 0x12) {
  17512. case 0x00:
  17513. x += getInt16(code, i);
  17514. i += 2;
  17515. break;
  17516. case 0x02:
  17517. x -= code[i++];
  17518. break;
  17519. case 0x12:
  17520. x += code[i++];
  17521. break;
  17522. }
  17523. points[j].x = x;
  17524. }
  17525. for (j = 0; j < numberOfPoints; j++) {
  17526. switch (points[j].flags & 0x24) {
  17527. case 0x00:
  17528. y += getInt16(code, i);
  17529. i += 2;
  17530. break;
  17531. case 0x04:
  17532. y -= code[i++];
  17533. break;
  17534. case 0x24:
  17535. y += code[i++];
  17536. break;
  17537. }
  17538. points[j].y = y;
  17539. }
  17540. let startPoint = 0;
  17541. for (i = 0; i < numberOfContours; i++) {
  17542. const endPoint = endPtsOfContours[i];
  17543. const contour = points.slice(startPoint, endPoint + 1);
  17544. if (contour[0].flags & 1) {
  17545. contour.push(contour[0]);
  17546. } else if (contour.at(-1).flags & 1) {
  17547. contour.unshift(contour.at(-1));
  17548. } else {
  17549. const p = {
  17550. flags: 1,
  17551. x: (contour[0].x + contour.at(-1).x) / 2,
  17552. y: (contour[0].y + contour.at(-1).y) / 2
  17553. };
  17554. contour.unshift(p);
  17555. contour.push(p);
  17556. }
  17557. moveTo(contour[0].x, contour[0].y);
  17558. for (j = 1, jj = contour.length; j < jj; j++) {
  17559. if (contour[j].flags & 1) {
  17560. lineTo(contour[j].x, contour[j].y);
  17561. } else if (contour[j + 1].flags & 1) {
  17562. quadraticCurveTo(contour[j].x, contour[j].y, contour[j + 1].x, contour[j + 1].y);
  17563. j++;
  17564. } else {
  17565. quadraticCurveTo(contour[j].x, contour[j].y, (contour[j].x + contour[j + 1].x) / 2, (contour[j].y + contour[j + 1].y) / 2);
  17566. }
  17567. }
  17568. startPoint = endPoint + 1;
  17569. }
  17570. }
  17571. }
  17572. function compileCharString(charStringCode, cmds, font, glyphId) {
  17573. function moveTo(x, y) {
  17574. cmds.add(FontRenderOps.MOVE_TO, [x, y]);
  17575. }
  17576. function lineTo(x, y) {
  17577. cmds.add(FontRenderOps.LINE_TO, [x, y]);
  17578. }
  17579. function bezierCurveTo(x1, y1, x2, y2, x, y) {
  17580. cmds.add(FontRenderOps.BEZIER_CURVE_TO, [x1, y1, x2, y2, x, y]);
  17581. }
  17582. const stack = [];
  17583. let x = 0,
  17584. y = 0;
  17585. let stems = 0;
  17586. function parse(code) {
  17587. let i = 0;
  17588. while (i < code.length) {
  17589. let stackClean = false;
  17590. let v = code[i++];
  17591. let xa, xb, ya, yb, y1, y2, y3, n, subrCode;
  17592. switch (v) {
  17593. case 1:
  17594. stems += stack.length >> 1;
  17595. stackClean = true;
  17596. break;
  17597. case 3:
  17598. stems += stack.length >> 1;
  17599. stackClean = true;
  17600. break;
  17601. case 4:
  17602. y += stack.pop();
  17603. moveTo(x, y);
  17604. stackClean = true;
  17605. break;
  17606. case 5:
  17607. while (stack.length > 0) {
  17608. x += stack.shift();
  17609. y += stack.shift();
  17610. lineTo(x, y);
  17611. }
  17612. break;
  17613. case 6:
  17614. while (stack.length > 0) {
  17615. x += stack.shift();
  17616. lineTo(x, y);
  17617. if (stack.length === 0) {
  17618. break;
  17619. }
  17620. y += stack.shift();
  17621. lineTo(x, y);
  17622. }
  17623. break;
  17624. case 7:
  17625. while (stack.length > 0) {
  17626. y += stack.shift();
  17627. lineTo(x, y);
  17628. if (stack.length === 0) {
  17629. break;
  17630. }
  17631. x += stack.shift();
  17632. lineTo(x, y);
  17633. }
  17634. break;
  17635. case 8:
  17636. while (stack.length > 0) {
  17637. xa = x + stack.shift();
  17638. ya = y + stack.shift();
  17639. xb = xa + stack.shift();
  17640. yb = ya + stack.shift();
  17641. x = xb + stack.shift();
  17642. y = yb + stack.shift();
  17643. bezierCurveTo(xa, ya, xb, yb, x, y);
  17644. }
  17645. break;
  17646. case 10:
  17647. n = stack.pop();
  17648. subrCode = null;
  17649. if (font.isCFFCIDFont) {
  17650. const fdIndex = font.fdSelect.getFDIndex(glyphId);
  17651. if (fdIndex >= 0 && fdIndex < font.fdArray.length) {
  17652. const fontDict = font.fdArray[fdIndex];
  17653. let subrs;
  17654. if (fontDict.privateDict?.subrsIndex) {
  17655. subrs = fontDict.privateDict.subrsIndex.objects;
  17656. }
  17657. if (subrs) {
  17658. n += getSubroutineBias(subrs);
  17659. subrCode = subrs[n];
  17660. }
  17661. } else {
  17662. warn("Invalid fd index for glyph index.");
  17663. }
  17664. } else {
  17665. subrCode = font.subrs[n + font.subrsBias];
  17666. }
  17667. if (subrCode) {
  17668. parse(subrCode);
  17669. }
  17670. break;
  17671. case 11:
  17672. return;
  17673. case 12:
  17674. v = code[i++];
  17675. switch (v) {
  17676. case 34:
  17677. xa = x + stack.shift();
  17678. xb = xa + stack.shift();
  17679. y1 = y + stack.shift();
  17680. x = xb + stack.shift();
  17681. bezierCurveTo(xa, y, xb, y1, x, y1);
  17682. xa = x + stack.shift();
  17683. xb = xa + stack.shift();
  17684. x = xb + stack.shift();
  17685. bezierCurveTo(xa, y1, xb, y, x, y);
  17686. break;
  17687. case 35:
  17688. xa = x + stack.shift();
  17689. ya = y + stack.shift();
  17690. xb = xa + stack.shift();
  17691. yb = ya + stack.shift();
  17692. x = xb + stack.shift();
  17693. y = yb + stack.shift();
  17694. bezierCurveTo(xa, ya, xb, yb, x, y);
  17695. xa = x + stack.shift();
  17696. ya = y + stack.shift();
  17697. xb = xa + stack.shift();
  17698. yb = ya + stack.shift();
  17699. x = xb + stack.shift();
  17700. y = yb + stack.shift();
  17701. bezierCurveTo(xa, ya, xb, yb, x, y);
  17702. stack.pop();
  17703. break;
  17704. case 36:
  17705. xa = x + stack.shift();
  17706. y1 = y + stack.shift();
  17707. xb = xa + stack.shift();
  17708. y2 = y1 + stack.shift();
  17709. x = xb + stack.shift();
  17710. bezierCurveTo(xa, y1, xb, y2, x, y2);
  17711. xa = x + stack.shift();
  17712. xb = xa + stack.shift();
  17713. y3 = y2 + stack.shift();
  17714. x = xb + stack.shift();
  17715. bezierCurveTo(xa, y2, xb, y3, x, y);
  17716. break;
  17717. case 37:
  17718. const x0 = x,
  17719. y0 = y;
  17720. xa = x + stack.shift();
  17721. ya = y + stack.shift();
  17722. xb = xa + stack.shift();
  17723. yb = ya + stack.shift();
  17724. x = xb + stack.shift();
  17725. y = yb + stack.shift();
  17726. bezierCurveTo(xa, ya, xb, yb, x, y);
  17727. xa = x + stack.shift();
  17728. ya = y + stack.shift();
  17729. xb = xa + stack.shift();
  17730. yb = ya + stack.shift();
  17731. x = xb;
  17732. y = yb;
  17733. if (Math.abs(x - x0) > Math.abs(y - y0)) {
  17734. x += stack.shift();
  17735. } else {
  17736. y += stack.shift();
  17737. }
  17738. bezierCurveTo(xa, ya, xb, yb, x, y);
  17739. break;
  17740. default:
  17741. throw new FormatError(`unknown operator: 12 ${v}`);
  17742. }
  17743. break;
  17744. case 14:
  17745. if (stack.length >= 4) {
  17746. const achar = stack.pop();
  17747. const bchar = stack.pop();
  17748. y = stack.pop();
  17749. x = stack.pop();
  17750. cmds.add(FontRenderOps.SAVE);
  17751. cmds.add(FontRenderOps.TRANSLATE, [x, y]);
  17752. let cmap = lookupCmap(font.cmap, String.fromCharCode(font.glyphNameMap[StandardEncoding[achar]]));
  17753. compileCharString(font.glyphs[cmap.glyphId], cmds, font, cmap.glyphId);
  17754. cmds.add(FontRenderOps.RESTORE);
  17755. cmap = lookupCmap(font.cmap, String.fromCharCode(font.glyphNameMap[StandardEncoding[bchar]]));
  17756. compileCharString(font.glyphs[cmap.glyphId], cmds, font, cmap.glyphId);
  17757. }
  17758. return;
  17759. case 18:
  17760. stems += stack.length >> 1;
  17761. stackClean = true;
  17762. break;
  17763. case 19:
  17764. stems += stack.length >> 1;
  17765. i += stems + 7 >> 3;
  17766. stackClean = true;
  17767. break;
  17768. case 20:
  17769. stems += stack.length >> 1;
  17770. i += stems + 7 >> 3;
  17771. stackClean = true;
  17772. break;
  17773. case 21:
  17774. y += stack.pop();
  17775. x += stack.pop();
  17776. moveTo(x, y);
  17777. stackClean = true;
  17778. break;
  17779. case 22:
  17780. x += stack.pop();
  17781. moveTo(x, y);
  17782. stackClean = true;
  17783. break;
  17784. case 23:
  17785. stems += stack.length >> 1;
  17786. stackClean = true;
  17787. break;
  17788. case 24:
  17789. while (stack.length > 2) {
  17790. xa = x + stack.shift();
  17791. ya = y + stack.shift();
  17792. xb = xa + stack.shift();
  17793. yb = ya + stack.shift();
  17794. x = xb + stack.shift();
  17795. y = yb + stack.shift();
  17796. bezierCurveTo(xa, ya, xb, yb, x, y);
  17797. }
  17798. x += stack.shift();
  17799. y += stack.shift();
  17800. lineTo(x, y);
  17801. break;
  17802. case 25:
  17803. while (stack.length > 6) {
  17804. x += stack.shift();
  17805. y += stack.shift();
  17806. lineTo(x, y);
  17807. }
  17808. xa = x + stack.shift();
  17809. ya = y + stack.shift();
  17810. xb = xa + stack.shift();
  17811. yb = ya + stack.shift();
  17812. x = xb + stack.shift();
  17813. y = yb + stack.shift();
  17814. bezierCurveTo(xa, ya, xb, yb, x, y);
  17815. break;
  17816. case 26:
  17817. if (stack.length % 2) {
  17818. x += stack.shift();
  17819. }
  17820. while (stack.length > 0) {
  17821. xa = x;
  17822. ya = y + stack.shift();
  17823. xb = xa + stack.shift();
  17824. yb = ya + stack.shift();
  17825. x = xb;
  17826. y = yb + stack.shift();
  17827. bezierCurveTo(xa, ya, xb, yb, x, y);
  17828. }
  17829. break;
  17830. case 27:
  17831. if (stack.length % 2) {
  17832. y += stack.shift();
  17833. }
  17834. while (stack.length > 0) {
  17835. xa = x + stack.shift();
  17836. ya = y;
  17837. xb = xa + stack.shift();
  17838. yb = ya + stack.shift();
  17839. x = xb + stack.shift();
  17840. y = yb;
  17841. bezierCurveTo(xa, ya, xb, yb, x, y);
  17842. }
  17843. break;
  17844. case 28:
  17845. stack.push((code[i] << 24 | code[i + 1] << 16) >> 16);
  17846. i += 2;
  17847. break;
  17848. case 29:
  17849. n = stack.pop() + font.gsubrsBias;
  17850. subrCode = font.gsubrs[n];
  17851. if (subrCode) {
  17852. parse(subrCode);
  17853. }
  17854. break;
  17855. case 30:
  17856. while (stack.length > 0) {
  17857. xa = x;
  17858. ya = y + stack.shift();
  17859. xb = xa + stack.shift();
  17860. yb = ya + stack.shift();
  17861. x = xb + stack.shift();
  17862. y = yb + (stack.length === 1 ? stack.shift() : 0);
  17863. bezierCurveTo(xa, ya, xb, yb, x, y);
  17864. if (stack.length === 0) {
  17865. break;
  17866. }
  17867. xa = x + stack.shift();
  17868. ya = y;
  17869. xb = xa + stack.shift();
  17870. yb = ya + stack.shift();
  17871. y = yb + stack.shift();
  17872. x = xb + (stack.length === 1 ? stack.shift() : 0);
  17873. bezierCurveTo(xa, ya, xb, yb, x, y);
  17874. }
  17875. break;
  17876. case 31:
  17877. while (stack.length > 0) {
  17878. xa = x + stack.shift();
  17879. ya = y;
  17880. xb = xa + stack.shift();
  17881. yb = ya + stack.shift();
  17882. y = yb + stack.shift();
  17883. x = xb + (stack.length === 1 ? stack.shift() : 0);
  17884. bezierCurveTo(xa, ya, xb, yb, x, y);
  17885. if (stack.length === 0) {
  17886. break;
  17887. }
  17888. xa = x;
  17889. ya = y + stack.shift();
  17890. xb = xa + stack.shift();
  17891. yb = ya + stack.shift();
  17892. x = xb + stack.shift();
  17893. y = yb + (stack.length === 1 ? stack.shift() : 0);
  17894. bezierCurveTo(xa, ya, xb, yb, x, y);
  17895. }
  17896. break;
  17897. default:
  17898. if (v < 32) {
  17899. throw new FormatError(`unknown operator: ${v}`);
  17900. }
  17901. if (v < 247) {
  17902. stack.push(v - 139);
  17903. } else if (v < 251) {
  17904. stack.push((v - 247) * 256 + code[i++] + 108);
  17905. } else if (v < 255) {
  17906. stack.push(-(v - 251) * 256 - code[i++] - 108);
  17907. } else {
  17908. stack.push((code[i] << 24 | code[i + 1] << 16 | code[i + 2] << 8 | code[i + 3]) / 65536);
  17909. i += 4;
  17910. }
  17911. break;
  17912. }
  17913. if (stackClean) {
  17914. stack.length = 0;
  17915. }
  17916. }
  17917. }
  17918. parse(charStringCode);
  17919. }
  17920. const NOOP = [];
  17921. class Commands {
  17922. cmds = [];
  17923. add(cmd, args) {
  17924. if (args) {
  17925. if (!isNumberArray(args, null)) {
  17926. warn(`Commands.add - "${cmd}" has at least one non-number arg: "${args}".`);
  17927. const newArgs = args.map(arg => typeof arg === "number" ? arg : 0);
  17928. this.cmds.push(cmd, ...newArgs);
  17929. } else {
  17930. this.cmds.push(cmd, ...args);
  17931. }
  17932. } else {
  17933. this.cmds.push(cmd);
  17934. }
  17935. }
  17936. }
  17937. class CompiledFont {
  17938. constructor(fontMatrix) {
  17939. if (this.constructor === CompiledFont) {
  17940. unreachable("Cannot initialize CompiledFont.");
  17941. }
  17942. this.fontMatrix = fontMatrix;
  17943. this.compiledGlyphs = Object.create(null);
  17944. this.compiledCharCodeToGlyphId = Object.create(null);
  17945. }
  17946. getPathJs(unicode) {
  17947. const {
  17948. charCode,
  17949. glyphId
  17950. } = lookupCmap(this.cmap, unicode);
  17951. let fn = this.compiledGlyphs[glyphId],
  17952. compileEx;
  17953. if (!fn) {
  17954. try {
  17955. fn = this.compileGlyph(this.glyphs[glyphId], glyphId);
  17956. } catch (ex) {
  17957. fn = NOOP;
  17958. compileEx = ex;
  17959. }
  17960. this.compiledGlyphs[glyphId] = fn;
  17961. }
  17962. this.compiledCharCodeToGlyphId[charCode] ??= glyphId;
  17963. if (compileEx) {
  17964. throw compileEx;
  17965. }
  17966. return fn;
  17967. }
  17968. compileGlyph(code, glyphId) {
  17969. if (!code || code.length === 0 || code[0] === 14) {
  17970. return NOOP;
  17971. }
  17972. let fontMatrix = this.fontMatrix;
  17973. if (this.isCFFCIDFont) {
  17974. const fdIndex = this.fdSelect.getFDIndex(glyphId);
  17975. if (fdIndex >= 0 && fdIndex < this.fdArray.length) {
  17976. const fontDict = this.fdArray[fdIndex];
  17977. fontMatrix = fontDict.getByName("FontMatrix") || FONT_IDENTITY_MATRIX;
  17978. } else {
  17979. warn("Invalid fd index for glyph index.");
  17980. }
  17981. }
  17982. const cmds = new Commands();
  17983. cmds.add(FontRenderOps.SAVE);
  17984. cmds.add(FontRenderOps.TRANSFORM, fontMatrix.slice());
  17985. cmds.add(FontRenderOps.SCALE);
  17986. this.compileGlyphImpl(code, cmds, glyphId);
  17987. cmds.add(FontRenderOps.RESTORE);
  17988. return cmds.cmds;
  17989. }
  17990. compileGlyphImpl() {
  17991. unreachable("Children classes should implement this.");
  17992. }
  17993. hasBuiltPath(unicode) {
  17994. const {
  17995. charCode,
  17996. glyphId
  17997. } = lookupCmap(this.cmap, unicode);
  17998. return this.compiledGlyphs[glyphId] !== undefined && this.compiledCharCodeToGlyphId[charCode] !== undefined;
  17999. }
  18000. }
  18001. class TrueTypeCompiled extends CompiledFont {
  18002. constructor(glyphs, cmap, fontMatrix) {
  18003. super(fontMatrix || [0.000488, 0, 0, 0.000488, 0, 0]);
  18004. this.glyphs = glyphs;
  18005. this.cmap = cmap;
  18006. }
  18007. compileGlyphImpl(code, cmds) {
  18008. compileGlyf(code, cmds, this);
  18009. }
  18010. }
  18011. class Type2Compiled extends CompiledFont {
  18012. constructor(cffInfo, cmap, fontMatrix, glyphNameMap) {
  18013. super(fontMatrix || [0.001, 0, 0, 0.001, 0, 0]);
  18014. this.glyphs = cffInfo.glyphs;
  18015. this.gsubrs = cffInfo.gsubrs || [];
  18016. this.subrs = cffInfo.subrs || [];
  18017. this.cmap = cmap;
  18018. this.glyphNameMap = glyphNameMap || getGlyphsUnicode();
  18019. this.gsubrsBias = getSubroutineBias(this.gsubrs);
  18020. this.subrsBias = getSubroutineBias(this.subrs);
  18021. this.isCFFCIDFont = cffInfo.isCFFCIDFont;
  18022. this.fdSelect = cffInfo.fdSelect;
  18023. this.fdArray = cffInfo.fdArray;
  18024. }
  18025. compileGlyphImpl(code, cmds, glyphId) {
  18026. compileCharString(code, cmds, this, glyphId);
  18027. }
  18028. }
  18029. class FontRendererFactory {
  18030. static create(font, seacAnalysisEnabled) {
  18031. const data = new Uint8Array(font.data);
  18032. let cmap, glyf, loca, cff, indexToLocFormat, unitsPerEm;
  18033. const numTables = getUint16(data, 4);
  18034. for (let i = 0, p = 12; i < numTables; i++, p += 16) {
  18035. const tag = bytesToString(data.subarray(p, p + 4));
  18036. const offset = getUint32(data, p + 8);
  18037. const length = getUint32(data, p + 12);
  18038. switch (tag) {
  18039. case "cmap":
  18040. cmap = parseCmap(data, offset, offset + length);
  18041. break;
  18042. case "glyf":
  18043. glyf = data.subarray(offset, offset + length);
  18044. break;
  18045. case "loca":
  18046. loca = data.subarray(offset, offset + length);
  18047. break;
  18048. case "head":
  18049. unitsPerEm = getUint16(data, offset + 18);
  18050. indexToLocFormat = getUint16(data, offset + 50);
  18051. break;
  18052. case "CFF ":
  18053. cff = parseCff(data, offset, offset + length, seacAnalysisEnabled);
  18054. break;
  18055. }
  18056. }
  18057. if (glyf) {
  18058. const fontMatrix = !unitsPerEm ? font.fontMatrix : [1 / unitsPerEm, 0, 0, 1 / unitsPerEm, 0, 0];
  18059. return new TrueTypeCompiled(parseGlyfTable(glyf, loca, indexToLocFormat), cmap, fontMatrix);
  18060. }
  18061. return new Type2Compiled(cff, cmap, font.fontMatrix, font.glyphNameMap);
  18062. }
  18063. }
  18064. ;// CONCATENATED MODULE: ./src/core/metrics.js
  18065. const getMetrics = getLookupTableFactory(function (t) {
  18066. t.Courier = 600;
  18067. t["Courier-Bold"] = 600;
  18068. t["Courier-BoldOblique"] = 600;
  18069. t["Courier-Oblique"] = 600;
  18070. t.Helvetica = getLookupTableFactory(function (t) {
  18071. t.space = 278;
  18072. t.exclam = 278;
  18073. t.quotedbl = 355;
  18074. t.numbersign = 556;
  18075. t.dollar = 556;
  18076. t.percent = 889;
  18077. t.ampersand = 667;
  18078. t.quoteright = 222;
  18079. t.parenleft = 333;
  18080. t.parenright = 333;
  18081. t.asterisk = 389;
  18082. t.plus = 584;
  18083. t.comma = 278;
  18084. t.hyphen = 333;
  18085. t.period = 278;
  18086. t.slash = 278;
  18087. t.zero = 556;
  18088. t.one = 556;
  18089. t.two = 556;
  18090. t.three = 556;
  18091. t.four = 556;
  18092. t.five = 556;
  18093. t.six = 556;
  18094. t.seven = 556;
  18095. t.eight = 556;
  18096. t.nine = 556;
  18097. t.colon = 278;
  18098. t.semicolon = 278;
  18099. t.less = 584;
  18100. t.equal = 584;
  18101. t.greater = 584;
  18102. t.question = 556;
  18103. t.at = 1015;
  18104. t.A = 667;
  18105. t.B = 667;
  18106. t.C = 722;
  18107. t.D = 722;
  18108. t.E = 667;
  18109. t.F = 611;
  18110. t.G = 778;
  18111. t.H = 722;
  18112. t.I = 278;
  18113. t.J = 500;
  18114. t.K = 667;
  18115. t.L = 556;
  18116. t.M = 833;
  18117. t.N = 722;
  18118. t.O = 778;
  18119. t.P = 667;
  18120. t.Q = 778;
  18121. t.R = 722;
  18122. t.S = 667;
  18123. t.T = 611;
  18124. t.U = 722;
  18125. t.V = 667;
  18126. t.W = 944;
  18127. t.X = 667;
  18128. t.Y = 667;
  18129. t.Z = 611;
  18130. t.bracketleft = 278;
  18131. t.backslash = 278;
  18132. t.bracketright = 278;
  18133. t.asciicircum = 469;
  18134. t.underscore = 556;
  18135. t.quoteleft = 222;
  18136. t.a = 556;
  18137. t.b = 556;
  18138. t.c = 500;
  18139. t.d = 556;
  18140. t.e = 556;
  18141. t.f = 278;
  18142. t.g = 556;
  18143. t.h = 556;
  18144. t.i = 222;
  18145. t.j = 222;
  18146. t.k = 500;
  18147. t.l = 222;
  18148. t.m = 833;
  18149. t.n = 556;
  18150. t.o = 556;
  18151. t.p = 556;
  18152. t.q = 556;
  18153. t.r = 333;
  18154. t.s = 500;
  18155. t.t = 278;
  18156. t.u = 556;
  18157. t.v = 500;
  18158. t.w = 722;
  18159. t.x = 500;
  18160. t.y = 500;
  18161. t.z = 500;
  18162. t.braceleft = 334;
  18163. t.bar = 260;
  18164. t.braceright = 334;
  18165. t.asciitilde = 584;
  18166. t.exclamdown = 333;
  18167. t.cent = 556;
  18168. t.sterling = 556;
  18169. t.fraction = 167;
  18170. t.yen = 556;
  18171. t.florin = 556;
  18172. t.section = 556;
  18173. t.currency = 556;
  18174. t.quotesingle = 191;
  18175. t.quotedblleft = 333;
  18176. t.guillemotleft = 556;
  18177. t.guilsinglleft = 333;
  18178. t.guilsinglright = 333;
  18179. t.fi = 500;
  18180. t.fl = 500;
  18181. t.endash = 556;
  18182. t.dagger = 556;
  18183. t.daggerdbl = 556;
  18184. t.periodcentered = 278;
  18185. t.paragraph = 537;
  18186. t.bullet = 350;
  18187. t.quotesinglbase = 222;
  18188. t.quotedblbase = 333;
  18189. t.quotedblright = 333;
  18190. t.guillemotright = 556;
  18191. t.ellipsis = 1000;
  18192. t.perthousand = 1000;
  18193. t.questiondown = 611;
  18194. t.grave = 333;
  18195. t.acute = 333;
  18196. t.circumflex = 333;
  18197. t.tilde = 333;
  18198. t.macron = 333;
  18199. t.breve = 333;
  18200. t.dotaccent = 333;
  18201. t.dieresis = 333;
  18202. t.ring = 333;
  18203. t.cedilla = 333;
  18204. t.hungarumlaut = 333;
  18205. t.ogonek = 333;
  18206. t.caron = 333;
  18207. t.emdash = 1000;
  18208. t.AE = 1000;
  18209. t.ordfeminine = 370;
  18210. t.Lslash = 556;
  18211. t.Oslash = 778;
  18212. t.OE = 1000;
  18213. t.ordmasculine = 365;
  18214. t.ae = 889;
  18215. t.dotlessi = 278;
  18216. t.lslash = 222;
  18217. t.oslash = 611;
  18218. t.oe = 944;
  18219. t.germandbls = 611;
  18220. t.Idieresis = 278;
  18221. t.eacute = 556;
  18222. t.abreve = 556;
  18223. t.uhungarumlaut = 556;
  18224. t.ecaron = 556;
  18225. t.Ydieresis = 667;
  18226. t.divide = 584;
  18227. t.Yacute = 667;
  18228. t.Acircumflex = 667;
  18229. t.aacute = 556;
  18230. t.Ucircumflex = 722;
  18231. t.yacute = 500;
  18232. t.scommaaccent = 500;
  18233. t.ecircumflex = 556;
  18234. t.Uring = 722;
  18235. t.Udieresis = 722;
  18236. t.aogonek = 556;
  18237. t.Uacute = 722;
  18238. t.uogonek = 556;
  18239. t.Edieresis = 667;
  18240. t.Dcroat = 722;
  18241. t.commaaccent = 250;
  18242. t.copyright = 737;
  18243. t.Emacron = 667;
  18244. t.ccaron = 500;
  18245. t.aring = 556;
  18246. t.Ncommaaccent = 722;
  18247. t.lacute = 222;
  18248. t.agrave = 556;
  18249. t.Tcommaaccent = 611;
  18250. t.Cacute = 722;
  18251. t.atilde = 556;
  18252. t.Edotaccent = 667;
  18253. t.scaron = 500;
  18254. t.scedilla = 500;
  18255. t.iacute = 278;
  18256. t.lozenge = 471;
  18257. t.Rcaron = 722;
  18258. t.Gcommaaccent = 778;
  18259. t.ucircumflex = 556;
  18260. t.acircumflex = 556;
  18261. t.Amacron = 667;
  18262. t.rcaron = 333;
  18263. t.ccedilla = 500;
  18264. t.Zdotaccent = 611;
  18265. t.Thorn = 667;
  18266. t.Omacron = 778;
  18267. t.Racute = 722;
  18268. t.Sacute = 667;
  18269. t.dcaron = 643;
  18270. t.Umacron = 722;
  18271. t.uring = 556;
  18272. t.threesuperior = 333;
  18273. t.Ograve = 778;
  18274. t.Agrave = 667;
  18275. t.Abreve = 667;
  18276. t.multiply = 584;
  18277. t.uacute = 556;
  18278. t.Tcaron = 611;
  18279. t.partialdiff = 476;
  18280. t.ydieresis = 500;
  18281. t.Nacute = 722;
  18282. t.icircumflex = 278;
  18283. t.Ecircumflex = 667;
  18284. t.adieresis = 556;
  18285. t.edieresis = 556;
  18286. t.cacute = 500;
  18287. t.nacute = 556;
  18288. t.umacron = 556;
  18289. t.Ncaron = 722;
  18290. t.Iacute = 278;
  18291. t.plusminus = 584;
  18292. t.brokenbar = 260;
  18293. t.registered = 737;
  18294. t.Gbreve = 778;
  18295. t.Idotaccent = 278;
  18296. t.summation = 600;
  18297. t.Egrave = 667;
  18298. t.racute = 333;
  18299. t.omacron = 556;
  18300. t.Zacute = 611;
  18301. t.Zcaron = 611;
  18302. t.greaterequal = 549;
  18303. t.Eth = 722;
  18304. t.Ccedilla = 722;
  18305. t.lcommaaccent = 222;
  18306. t.tcaron = 317;
  18307. t.eogonek = 556;
  18308. t.Uogonek = 722;
  18309. t.Aacute = 667;
  18310. t.Adieresis = 667;
  18311. t.egrave = 556;
  18312. t.zacute = 500;
  18313. t.iogonek = 222;
  18314. t.Oacute = 778;
  18315. t.oacute = 556;
  18316. t.amacron = 556;
  18317. t.sacute = 500;
  18318. t.idieresis = 278;
  18319. t.Ocircumflex = 778;
  18320. t.Ugrave = 722;
  18321. t.Delta = 612;
  18322. t.thorn = 556;
  18323. t.twosuperior = 333;
  18324. t.Odieresis = 778;
  18325. t.mu = 556;
  18326. t.igrave = 278;
  18327. t.ohungarumlaut = 556;
  18328. t.Eogonek = 667;
  18329. t.dcroat = 556;
  18330. t.threequarters = 834;
  18331. t.Scedilla = 667;
  18332. t.lcaron = 299;
  18333. t.Kcommaaccent = 667;
  18334. t.Lacute = 556;
  18335. t.trademark = 1000;
  18336. t.edotaccent = 556;
  18337. t.Igrave = 278;
  18338. t.Imacron = 278;
  18339. t.Lcaron = 556;
  18340. t.onehalf = 834;
  18341. t.lessequal = 549;
  18342. t.ocircumflex = 556;
  18343. t.ntilde = 556;
  18344. t.Uhungarumlaut = 722;
  18345. t.Eacute = 667;
  18346. t.emacron = 556;
  18347. t.gbreve = 556;
  18348. t.onequarter = 834;
  18349. t.Scaron = 667;
  18350. t.Scommaaccent = 667;
  18351. t.Ohungarumlaut = 778;
  18352. t.degree = 400;
  18353. t.ograve = 556;
  18354. t.Ccaron = 722;
  18355. t.ugrave = 556;
  18356. t.radical = 453;
  18357. t.Dcaron = 722;
  18358. t.rcommaaccent = 333;
  18359. t.Ntilde = 722;
  18360. t.otilde = 556;
  18361. t.Rcommaaccent = 722;
  18362. t.Lcommaaccent = 556;
  18363. t.Atilde = 667;
  18364. t.Aogonek = 667;
  18365. t.Aring = 667;
  18366. t.Otilde = 778;
  18367. t.zdotaccent = 500;
  18368. t.Ecaron = 667;
  18369. t.Iogonek = 278;
  18370. t.kcommaaccent = 500;
  18371. t.minus = 584;
  18372. t.Icircumflex = 278;
  18373. t.ncaron = 556;
  18374. t.tcommaaccent = 278;
  18375. t.logicalnot = 584;
  18376. t.odieresis = 556;
  18377. t.udieresis = 556;
  18378. t.notequal = 549;
  18379. t.gcommaaccent = 556;
  18380. t.eth = 556;
  18381. t.zcaron = 500;
  18382. t.ncommaaccent = 556;
  18383. t.onesuperior = 333;
  18384. t.imacron = 278;
  18385. t.Euro = 556;
  18386. });
  18387. t["Helvetica-Bold"] = getLookupTableFactory(function (t) {
  18388. t.space = 278;
  18389. t.exclam = 333;
  18390. t.quotedbl = 474;
  18391. t.numbersign = 556;
  18392. t.dollar = 556;
  18393. t.percent = 889;
  18394. t.ampersand = 722;
  18395. t.quoteright = 278;
  18396. t.parenleft = 333;
  18397. t.parenright = 333;
  18398. t.asterisk = 389;
  18399. t.plus = 584;
  18400. t.comma = 278;
  18401. t.hyphen = 333;
  18402. t.period = 278;
  18403. t.slash = 278;
  18404. t.zero = 556;
  18405. t.one = 556;
  18406. t.two = 556;
  18407. t.three = 556;
  18408. t.four = 556;
  18409. t.five = 556;
  18410. t.six = 556;
  18411. t.seven = 556;
  18412. t.eight = 556;
  18413. t.nine = 556;
  18414. t.colon = 333;
  18415. t.semicolon = 333;
  18416. t.less = 584;
  18417. t.equal = 584;
  18418. t.greater = 584;
  18419. t.question = 611;
  18420. t.at = 975;
  18421. t.A = 722;
  18422. t.B = 722;
  18423. t.C = 722;
  18424. t.D = 722;
  18425. t.E = 667;
  18426. t.F = 611;
  18427. t.G = 778;
  18428. t.H = 722;
  18429. t.I = 278;
  18430. t.J = 556;
  18431. t.K = 722;
  18432. t.L = 611;
  18433. t.M = 833;
  18434. t.N = 722;
  18435. t.O = 778;
  18436. t.P = 667;
  18437. t.Q = 778;
  18438. t.R = 722;
  18439. t.S = 667;
  18440. t.T = 611;
  18441. t.U = 722;
  18442. t.V = 667;
  18443. t.W = 944;
  18444. t.X = 667;
  18445. t.Y = 667;
  18446. t.Z = 611;
  18447. t.bracketleft = 333;
  18448. t.backslash = 278;
  18449. t.bracketright = 333;
  18450. t.asciicircum = 584;
  18451. t.underscore = 556;
  18452. t.quoteleft = 278;
  18453. t.a = 556;
  18454. t.b = 611;
  18455. t.c = 556;
  18456. t.d = 611;
  18457. t.e = 556;
  18458. t.f = 333;
  18459. t.g = 611;
  18460. t.h = 611;
  18461. t.i = 278;
  18462. t.j = 278;
  18463. t.k = 556;
  18464. t.l = 278;
  18465. t.m = 889;
  18466. t.n = 611;
  18467. t.o = 611;
  18468. t.p = 611;
  18469. t.q = 611;
  18470. t.r = 389;
  18471. t.s = 556;
  18472. t.t = 333;
  18473. t.u = 611;
  18474. t.v = 556;
  18475. t.w = 778;
  18476. t.x = 556;
  18477. t.y = 556;
  18478. t.z = 500;
  18479. t.braceleft = 389;
  18480. t.bar = 280;
  18481. t.braceright = 389;
  18482. t.asciitilde = 584;
  18483. t.exclamdown = 333;
  18484. t.cent = 556;
  18485. t.sterling = 556;
  18486. t.fraction = 167;
  18487. t.yen = 556;
  18488. t.florin = 556;
  18489. t.section = 556;
  18490. t.currency = 556;
  18491. t.quotesingle = 238;
  18492. t.quotedblleft = 500;
  18493. t.guillemotleft = 556;
  18494. t.guilsinglleft = 333;
  18495. t.guilsinglright = 333;
  18496. t.fi = 611;
  18497. t.fl = 611;
  18498. t.endash = 556;
  18499. t.dagger = 556;
  18500. t.daggerdbl = 556;
  18501. t.periodcentered = 278;
  18502. t.paragraph = 556;
  18503. t.bullet = 350;
  18504. t.quotesinglbase = 278;
  18505. t.quotedblbase = 500;
  18506. t.quotedblright = 500;
  18507. t.guillemotright = 556;
  18508. t.ellipsis = 1000;
  18509. t.perthousand = 1000;
  18510. t.questiondown = 611;
  18511. t.grave = 333;
  18512. t.acute = 333;
  18513. t.circumflex = 333;
  18514. t.tilde = 333;
  18515. t.macron = 333;
  18516. t.breve = 333;
  18517. t.dotaccent = 333;
  18518. t.dieresis = 333;
  18519. t.ring = 333;
  18520. t.cedilla = 333;
  18521. t.hungarumlaut = 333;
  18522. t.ogonek = 333;
  18523. t.caron = 333;
  18524. t.emdash = 1000;
  18525. t.AE = 1000;
  18526. t.ordfeminine = 370;
  18527. t.Lslash = 611;
  18528. t.Oslash = 778;
  18529. t.OE = 1000;
  18530. t.ordmasculine = 365;
  18531. t.ae = 889;
  18532. t.dotlessi = 278;
  18533. t.lslash = 278;
  18534. t.oslash = 611;
  18535. t.oe = 944;
  18536. t.germandbls = 611;
  18537. t.Idieresis = 278;
  18538. t.eacute = 556;
  18539. t.abreve = 556;
  18540. t.uhungarumlaut = 611;
  18541. t.ecaron = 556;
  18542. t.Ydieresis = 667;
  18543. t.divide = 584;
  18544. t.Yacute = 667;
  18545. t.Acircumflex = 722;
  18546. t.aacute = 556;
  18547. t.Ucircumflex = 722;
  18548. t.yacute = 556;
  18549. t.scommaaccent = 556;
  18550. t.ecircumflex = 556;
  18551. t.Uring = 722;
  18552. t.Udieresis = 722;
  18553. t.aogonek = 556;
  18554. t.Uacute = 722;
  18555. t.uogonek = 611;
  18556. t.Edieresis = 667;
  18557. t.Dcroat = 722;
  18558. t.commaaccent = 250;
  18559. t.copyright = 737;
  18560. t.Emacron = 667;
  18561. t.ccaron = 556;
  18562. t.aring = 556;
  18563. t.Ncommaaccent = 722;
  18564. t.lacute = 278;
  18565. t.agrave = 556;
  18566. t.Tcommaaccent = 611;
  18567. t.Cacute = 722;
  18568. t.atilde = 556;
  18569. t.Edotaccent = 667;
  18570. t.scaron = 556;
  18571. t.scedilla = 556;
  18572. t.iacute = 278;
  18573. t.lozenge = 494;
  18574. t.Rcaron = 722;
  18575. t.Gcommaaccent = 778;
  18576. t.ucircumflex = 611;
  18577. t.acircumflex = 556;
  18578. t.Amacron = 722;
  18579. t.rcaron = 389;
  18580. t.ccedilla = 556;
  18581. t.Zdotaccent = 611;
  18582. t.Thorn = 667;
  18583. t.Omacron = 778;
  18584. t.Racute = 722;
  18585. t.Sacute = 667;
  18586. t.dcaron = 743;
  18587. t.Umacron = 722;
  18588. t.uring = 611;
  18589. t.threesuperior = 333;
  18590. t.Ograve = 778;
  18591. t.Agrave = 722;
  18592. t.Abreve = 722;
  18593. t.multiply = 584;
  18594. t.uacute = 611;
  18595. t.Tcaron = 611;
  18596. t.partialdiff = 494;
  18597. t.ydieresis = 556;
  18598. t.Nacute = 722;
  18599. t.icircumflex = 278;
  18600. t.Ecircumflex = 667;
  18601. t.adieresis = 556;
  18602. t.edieresis = 556;
  18603. t.cacute = 556;
  18604. t.nacute = 611;
  18605. t.umacron = 611;
  18606. t.Ncaron = 722;
  18607. t.Iacute = 278;
  18608. t.plusminus = 584;
  18609. t.brokenbar = 280;
  18610. t.registered = 737;
  18611. t.Gbreve = 778;
  18612. t.Idotaccent = 278;
  18613. t.summation = 600;
  18614. t.Egrave = 667;
  18615. t.racute = 389;
  18616. t.omacron = 611;
  18617. t.Zacute = 611;
  18618. t.Zcaron = 611;
  18619. t.greaterequal = 549;
  18620. t.Eth = 722;
  18621. t.Ccedilla = 722;
  18622. t.lcommaaccent = 278;
  18623. t.tcaron = 389;
  18624. t.eogonek = 556;
  18625. t.Uogonek = 722;
  18626. t.Aacute = 722;
  18627. t.Adieresis = 722;
  18628. t.egrave = 556;
  18629. t.zacute = 500;
  18630. t.iogonek = 278;
  18631. t.Oacute = 778;
  18632. t.oacute = 611;
  18633. t.amacron = 556;
  18634. t.sacute = 556;
  18635. t.idieresis = 278;
  18636. t.Ocircumflex = 778;
  18637. t.Ugrave = 722;
  18638. t.Delta = 612;
  18639. t.thorn = 611;
  18640. t.twosuperior = 333;
  18641. t.Odieresis = 778;
  18642. t.mu = 611;
  18643. t.igrave = 278;
  18644. t.ohungarumlaut = 611;
  18645. t.Eogonek = 667;
  18646. t.dcroat = 611;
  18647. t.threequarters = 834;
  18648. t.Scedilla = 667;
  18649. t.lcaron = 400;
  18650. t.Kcommaaccent = 722;
  18651. t.Lacute = 611;
  18652. t.trademark = 1000;
  18653. t.edotaccent = 556;
  18654. t.Igrave = 278;
  18655. t.Imacron = 278;
  18656. t.Lcaron = 611;
  18657. t.onehalf = 834;
  18658. t.lessequal = 549;
  18659. t.ocircumflex = 611;
  18660. t.ntilde = 611;
  18661. t.Uhungarumlaut = 722;
  18662. t.Eacute = 667;
  18663. t.emacron = 556;
  18664. t.gbreve = 611;
  18665. t.onequarter = 834;
  18666. t.Scaron = 667;
  18667. t.Scommaaccent = 667;
  18668. t.Ohungarumlaut = 778;
  18669. t.degree = 400;
  18670. t.ograve = 611;
  18671. t.Ccaron = 722;
  18672. t.ugrave = 611;
  18673. t.radical = 549;
  18674. t.Dcaron = 722;
  18675. t.rcommaaccent = 389;
  18676. t.Ntilde = 722;
  18677. t.otilde = 611;
  18678. t.Rcommaaccent = 722;
  18679. t.Lcommaaccent = 611;
  18680. t.Atilde = 722;
  18681. t.Aogonek = 722;
  18682. t.Aring = 722;
  18683. t.Otilde = 778;
  18684. t.zdotaccent = 500;
  18685. t.Ecaron = 667;
  18686. t.Iogonek = 278;
  18687. t.kcommaaccent = 556;
  18688. t.minus = 584;
  18689. t.Icircumflex = 278;
  18690. t.ncaron = 611;
  18691. t.tcommaaccent = 333;
  18692. t.logicalnot = 584;
  18693. t.odieresis = 611;
  18694. t.udieresis = 611;
  18695. t.notequal = 549;
  18696. t.gcommaaccent = 611;
  18697. t.eth = 611;
  18698. t.zcaron = 500;
  18699. t.ncommaaccent = 611;
  18700. t.onesuperior = 333;
  18701. t.imacron = 278;
  18702. t.Euro = 556;
  18703. });
  18704. t["Helvetica-BoldOblique"] = getLookupTableFactory(function (t) {
  18705. t.space = 278;
  18706. t.exclam = 333;
  18707. t.quotedbl = 474;
  18708. t.numbersign = 556;
  18709. t.dollar = 556;
  18710. t.percent = 889;
  18711. t.ampersand = 722;
  18712. t.quoteright = 278;
  18713. t.parenleft = 333;
  18714. t.parenright = 333;
  18715. t.asterisk = 389;
  18716. t.plus = 584;
  18717. t.comma = 278;
  18718. t.hyphen = 333;
  18719. t.period = 278;
  18720. t.slash = 278;
  18721. t.zero = 556;
  18722. t.one = 556;
  18723. t.two = 556;
  18724. t.three = 556;
  18725. t.four = 556;
  18726. t.five = 556;
  18727. t.six = 556;
  18728. t.seven = 556;
  18729. t.eight = 556;
  18730. t.nine = 556;
  18731. t.colon = 333;
  18732. t.semicolon = 333;
  18733. t.less = 584;
  18734. t.equal = 584;
  18735. t.greater = 584;
  18736. t.question = 611;
  18737. t.at = 975;
  18738. t.A = 722;
  18739. t.B = 722;
  18740. t.C = 722;
  18741. t.D = 722;
  18742. t.E = 667;
  18743. t.F = 611;
  18744. t.G = 778;
  18745. t.H = 722;
  18746. t.I = 278;
  18747. t.J = 556;
  18748. t.K = 722;
  18749. t.L = 611;
  18750. t.M = 833;
  18751. t.N = 722;
  18752. t.O = 778;
  18753. t.P = 667;
  18754. t.Q = 778;
  18755. t.R = 722;
  18756. t.S = 667;
  18757. t.T = 611;
  18758. t.U = 722;
  18759. t.V = 667;
  18760. t.W = 944;
  18761. t.X = 667;
  18762. t.Y = 667;
  18763. t.Z = 611;
  18764. t.bracketleft = 333;
  18765. t.backslash = 278;
  18766. t.bracketright = 333;
  18767. t.asciicircum = 584;
  18768. t.underscore = 556;
  18769. t.quoteleft = 278;
  18770. t.a = 556;
  18771. t.b = 611;
  18772. t.c = 556;
  18773. t.d = 611;
  18774. t.e = 556;
  18775. t.f = 333;
  18776. t.g = 611;
  18777. t.h = 611;
  18778. t.i = 278;
  18779. t.j = 278;
  18780. t.k = 556;
  18781. t.l = 278;
  18782. t.m = 889;
  18783. t.n = 611;
  18784. t.o = 611;
  18785. t.p = 611;
  18786. t.q = 611;
  18787. t.r = 389;
  18788. t.s = 556;
  18789. t.t = 333;
  18790. t.u = 611;
  18791. t.v = 556;
  18792. t.w = 778;
  18793. t.x = 556;
  18794. t.y = 556;
  18795. t.z = 500;
  18796. t.braceleft = 389;
  18797. t.bar = 280;
  18798. t.braceright = 389;
  18799. t.asciitilde = 584;
  18800. t.exclamdown = 333;
  18801. t.cent = 556;
  18802. t.sterling = 556;
  18803. t.fraction = 167;
  18804. t.yen = 556;
  18805. t.florin = 556;
  18806. t.section = 556;
  18807. t.currency = 556;
  18808. t.quotesingle = 238;
  18809. t.quotedblleft = 500;
  18810. t.guillemotleft = 556;
  18811. t.guilsinglleft = 333;
  18812. t.guilsinglright = 333;
  18813. t.fi = 611;
  18814. t.fl = 611;
  18815. t.endash = 556;
  18816. t.dagger = 556;
  18817. t.daggerdbl = 556;
  18818. t.periodcentered = 278;
  18819. t.paragraph = 556;
  18820. t.bullet = 350;
  18821. t.quotesinglbase = 278;
  18822. t.quotedblbase = 500;
  18823. t.quotedblright = 500;
  18824. t.guillemotright = 556;
  18825. t.ellipsis = 1000;
  18826. t.perthousand = 1000;
  18827. t.questiondown = 611;
  18828. t.grave = 333;
  18829. t.acute = 333;
  18830. t.circumflex = 333;
  18831. t.tilde = 333;
  18832. t.macron = 333;
  18833. t.breve = 333;
  18834. t.dotaccent = 333;
  18835. t.dieresis = 333;
  18836. t.ring = 333;
  18837. t.cedilla = 333;
  18838. t.hungarumlaut = 333;
  18839. t.ogonek = 333;
  18840. t.caron = 333;
  18841. t.emdash = 1000;
  18842. t.AE = 1000;
  18843. t.ordfeminine = 370;
  18844. t.Lslash = 611;
  18845. t.Oslash = 778;
  18846. t.OE = 1000;
  18847. t.ordmasculine = 365;
  18848. t.ae = 889;
  18849. t.dotlessi = 278;
  18850. t.lslash = 278;
  18851. t.oslash = 611;
  18852. t.oe = 944;
  18853. t.germandbls = 611;
  18854. t.Idieresis = 278;
  18855. t.eacute = 556;
  18856. t.abreve = 556;
  18857. t.uhungarumlaut = 611;
  18858. t.ecaron = 556;
  18859. t.Ydieresis = 667;
  18860. t.divide = 584;
  18861. t.Yacute = 667;
  18862. t.Acircumflex = 722;
  18863. t.aacute = 556;
  18864. t.Ucircumflex = 722;
  18865. t.yacute = 556;
  18866. t.scommaaccent = 556;
  18867. t.ecircumflex = 556;
  18868. t.Uring = 722;
  18869. t.Udieresis = 722;
  18870. t.aogonek = 556;
  18871. t.Uacute = 722;
  18872. t.uogonek = 611;
  18873. t.Edieresis = 667;
  18874. t.Dcroat = 722;
  18875. t.commaaccent = 250;
  18876. t.copyright = 737;
  18877. t.Emacron = 667;
  18878. t.ccaron = 556;
  18879. t.aring = 556;
  18880. t.Ncommaaccent = 722;
  18881. t.lacute = 278;
  18882. t.agrave = 556;
  18883. t.Tcommaaccent = 611;
  18884. t.Cacute = 722;
  18885. t.atilde = 556;
  18886. t.Edotaccent = 667;
  18887. t.scaron = 556;
  18888. t.scedilla = 556;
  18889. t.iacute = 278;
  18890. t.lozenge = 494;
  18891. t.Rcaron = 722;
  18892. t.Gcommaaccent = 778;
  18893. t.ucircumflex = 611;
  18894. t.acircumflex = 556;
  18895. t.Amacron = 722;
  18896. t.rcaron = 389;
  18897. t.ccedilla = 556;
  18898. t.Zdotaccent = 611;
  18899. t.Thorn = 667;
  18900. t.Omacron = 778;
  18901. t.Racute = 722;
  18902. t.Sacute = 667;
  18903. t.dcaron = 743;
  18904. t.Umacron = 722;
  18905. t.uring = 611;
  18906. t.threesuperior = 333;
  18907. t.Ograve = 778;
  18908. t.Agrave = 722;
  18909. t.Abreve = 722;
  18910. t.multiply = 584;
  18911. t.uacute = 611;
  18912. t.Tcaron = 611;
  18913. t.partialdiff = 494;
  18914. t.ydieresis = 556;
  18915. t.Nacute = 722;
  18916. t.icircumflex = 278;
  18917. t.Ecircumflex = 667;
  18918. t.adieresis = 556;
  18919. t.edieresis = 556;
  18920. t.cacute = 556;
  18921. t.nacute = 611;
  18922. t.umacron = 611;
  18923. t.Ncaron = 722;
  18924. t.Iacute = 278;
  18925. t.plusminus = 584;
  18926. t.brokenbar = 280;
  18927. t.registered = 737;
  18928. t.Gbreve = 778;
  18929. t.Idotaccent = 278;
  18930. t.summation = 600;
  18931. t.Egrave = 667;
  18932. t.racute = 389;
  18933. t.omacron = 611;
  18934. t.Zacute = 611;
  18935. t.Zcaron = 611;
  18936. t.greaterequal = 549;
  18937. t.Eth = 722;
  18938. t.Ccedilla = 722;
  18939. t.lcommaaccent = 278;
  18940. t.tcaron = 389;
  18941. t.eogonek = 556;
  18942. t.Uogonek = 722;
  18943. t.Aacute = 722;
  18944. t.Adieresis = 722;
  18945. t.egrave = 556;
  18946. t.zacute = 500;
  18947. t.iogonek = 278;
  18948. t.Oacute = 778;
  18949. t.oacute = 611;
  18950. t.amacron = 556;
  18951. t.sacute = 556;
  18952. t.idieresis = 278;
  18953. t.Ocircumflex = 778;
  18954. t.Ugrave = 722;
  18955. t.Delta = 612;
  18956. t.thorn = 611;
  18957. t.twosuperior = 333;
  18958. t.Odieresis = 778;
  18959. t.mu = 611;
  18960. t.igrave = 278;
  18961. t.ohungarumlaut = 611;
  18962. t.Eogonek = 667;
  18963. t.dcroat = 611;
  18964. t.threequarters = 834;
  18965. t.Scedilla = 667;
  18966. t.lcaron = 400;
  18967. t.Kcommaaccent = 722;
  18968. t.Lacute = 611;
  18969. t.trademark = 1000;
  18970. t.edotaccent = 556;
  18971. t.Igrave = 278;
  18972. t.Imacron = 278;
  18973. t.Lcaron = 611;
  18974. t.onehalf = 834;
  18975. t.lessequal = 549;
  18976. t.ocircumflex = 611;
  18977. t.ntilde = 611;
  18978. t.Uhungarumlaut = 722;
  18979. t.Eacute = 667;
  18980. t.emacron = 556;
  18981. t.gbreve = 611;
  18982. t.onequarter = 834;
  18983. t.Scaron = 667;
  18984. t.Scommaaccent = 667;
  18985. t.Ohungarumlaut = 778;
  18986. t.degree = 400;
  18987. t.ograve = 611;
  18988. t.Ccaron = 722;
  18989. t.ugrave = 611;
  18990. t.radical = 549;
  18991. t.Dcaron = 722;
  18992. t.rcommaaccent = 389;
  18993. t.Ntilde = 722;
  18994. t.otilde = 611;
  18995. t.Rcommaaccent = 722;
  18996. t.Lcommaaccent = 611;
  18997. t.Atilde = 722;
  18998. t.Aogonek = 722;
  18999. t.Aring = 722;
  19000. t.Otilde = 778;
  19001. t.zdotaccent = 500;
  19002. t.Ecaron = 667;
  19003. t.Iogonek = 278;
  19004. t.kcommaaccent = 556;
  19005. t.minus = 584;
  19006. t.Icircumflex = 278;
  19007. t.ncaron = 611;
  19008. t.tcommaaccent = 333;
  19009. t.logicalnot = 584;
  19010. t.odieresis = 611;
  19011. t.udieresis = 611;
  19012. t.notequal = 549;
  19013. t.gcommaaccent = 611;
  19014. t.eth = 611;
  19015. t.zcaron = 500;
  19016. t.ncommaaccent = 611;
  19017. t.onesuperior = 333;
  19018. t.imacron = 278;
  19019. t.Euro = 556;
  19020. });
  19021. t["Helvetica-Oblique"] = getLookupTableFactory(function (t) {
  19022. t.space = 278;
  19023. t.exclam = 278;
  19024. t.quotedbl = 355;
  19025. t.numbersign = 556;
  19026. t.dollar = 556;
  19027. t.percent = 889;
  19028. t.ampersand = 667;
  19029. t.quoteright = 222;
  19030. t.parenleft = 333;
  19031. t.parenright = 333;
  19032. t.asterisk = 389;
  19033. t.plus = 584;
  19034. t.comma = 278;
  19035. t.hyphen = 333;
  19036. t.period = 278;
  19037. t.slash = 278;
  19038. t.zero = 556;
  19039. t.one = 556;
  19040. t.two = 556;
  19041. t.three = 556;
  19042. t.four = 556;
  19043. t.five = 556;
  19044. t.six = 556;
  19045. t.seven = 556;
  19046. t.eight = 556;
  19047. t.nine = 556;
  19048. t.colon = 278;
  19049. t.semicolon = 278;
  19050. t.less = 584;
  19051. t.equal = 584;
  19052. t.greater = 584;
  19053. t.question = 556;
  19054. t.at = 1015;
  19055. t.A = 667;
  19056. t.B = 667;
  19057. t.C = 722;
  19058. t.D = 722;
  19059. t.E = 667;
  19060. t.F = 611;
  19061. t.G = 778;
  19062. t.H = 722;
  19063. t.I = 278;
  19064. t.J = 500;
  19065. t.K = 667;
  19066. t.L = 556;
  19067. t.M = 833;
  19068. t.N = 722;
  19069. t.O = 778;
  19070. t.P = 667;
  19071. t.Q = 778;
  19072. t.R = 722;
  19073. t.S = 667;
  19074. t.T = 611;
  19075. t.U = 722;
  19076. t.V = 667;
  19077. t.W = 944;
  19078. t.X = 667;
  19079. t.Y = 667;
  19080. t.Z = 611;
  19081. t.bracketleft = 278;
  19082. t.backslash = 278;
  19083. t.bracketright = 278;
  19084. t.asciicircum = 469;
  19085. t.underscore = 556;
  19086. t.quoteleft = 222;
  19087. t.a = 556;
  19088. t.b = 556;
  19089. t.c = 500;
  19090. t.d = 556;
  19091. t.e = 556;
  19092. t.f = 278;
  19093. t.g = 556;
  19094. t.h = 556;
  19095. t.i = 222;
  19096. t.j = 222;
  19097. t.k = 500;
  19098. t.l = 222;
  19099. t.m = 833;
  19100. t.n = 556;
  19101. t.o = 556;
  19102. t.p = 556;
  19103. t.q = 556;
  19104. t.r = 333;
  19105. t.s = 500;
  19106. t.t = 278;
  19107. t.u = 556;
  19108. t.v = 500;
  19109. t.w = 722;
  19110. t.x = 500;
  19111. t.y = 500;
  19112. t.z = 500;
  19113. t.braceleft = 334;
  19114. t.bar = 260;
  19115. t.braceright = 334;
  19116. t.asciitilde = 584;
  19117. t.exclamdown = 333;
  19118. t.cent = 556;
  19119. t.sterling = 556;
  19120. t.fraction = 167;
  19121. t.yen = 556;
  19122. t.florin = 556;
  19123. t.section = 556;
  19124. t.currency = 556;
  19125. t.quotesingle = 191;
  19126. t.quotedblleft = 333;
  19127. t.guillemotleft = 556;
  19128. t.guilsinglleft = 333;
  19129. t.guilsinglright = 333;
  19130. t.fi = 500;
  19131. t.fl = 500;
  19132. t.endash = 556;
  19133. t.dagger = 556;
  19134. t.daggerdbl = 556;
  19135. t.periodcentered = 278;
  19136. t.paragraph = 537;
  19137. t.bullet = 350;
  19138. t.quotesinglbase = 222;
  19139. t.quotedblbase = 333;
  19140. t.quotedblright = 333;
  19141. t.guillemotright = 556;
  19142. t.ellipsis = 1000;
  19143. t.perthousand = 1000;
  19144. t.questiondown = 611;
  19145. t.grave = 333;
  19146. t.acute = 333;
  19147. t.circumflex = 333;
  19148. t.tilde = 333;
  19149. t.macron = 333;
  19150. t.breve = 333;
  19151. t.dotaccent = 333;
  19152. t.dieresis = 333;
  19153. t.ring = 333;
  19154. t.cedilla = 333;
  19155. t.hungarumlaut = 333;
  19156. t.ogonek = 333;
  19157. t.caron = 333;
  19158. t.emdash = 1000;
  19159. t.AE = 1000;
  19160. t.ordfeminine = 370;
  19161. t.Lslash = 556;
  19162. t.Oslash = 778;
  19163. t.OE = 1000;
  19164. t.ordmasculine = 365;
  19165. t.ae = 889;
  19166. t.dotlessi = 278;
  19167. t.lslash = 222;
  19168. t.oslash = 611;
  19169. t.oe = 944;
  19170. t.germandbls = 611;
  19171. t.Idieresis = 278;
  19172. t.eacute = 556;
  19173. t.abreve = 556;
  19174. t.uhungarumlaut = 556;
  19175. t.ecaron = 556;
  19176. t.Ydieresis = 667;
  19177. t.divide = 584;
  19178. t.Yacute = 667;
  19179. t.Acircumflex = 667;
  19180. t.aacute = 556;
  19181. t.Ucircumflex = 722;
  19182. t.yacute = 500;
  19183. t.scommaaccent = 500;
  19184. t.ecircumflex = 556;
  19185. t.Uring = 722;
  19186. t.Udieresis = 722;
  19187. t.aogonek = 556;
  19188. t.Uacute = 722;
  19189. t.uogonek = 556;
  19190. t.Edieresis = 667;
  19191. t.Dcroat = 722;
  19192. t.commaaccent = 250;
  19193. t.copyright = 737;
  19194. t.Emacron = 667;
  19195. t.ccaron = 500;
  19196. t.aring = 556;
  19197. t.Ncommaaccent = 722;
  19198. t.lacute = 222;
  19199. t.agrave = 556;
  19200. t.Tcommaaccent = 611;
  19201. t.Cacute = 722;
  19202. t.atilde = 556;
  19203. t.Edotaccent = 667;
  19204. t.scaron = 500;
  19205. t.scedilla = 500;
  19206. t.iacute = 278;
  19207. t.lozenge = 471;
  19208. t.Rcaron = 722;
  19209. t.Gcommaaccent = 778;
  19210. t.ucircumflex = 556;
  19211. t.acircumflex = 556;
  19212. t.Amacron = 667;
  19213. t.rcaron = 333;
  19214. t.ccedilla = 500;
  19215. t.Zdotaccent = 611;
  19216. t.Thorn = 667;
  19217. t.Omacron = 778;
  19218. t.Racute = 722;
  19219. t.Sacute = 667;
  19220. t.dcaron = 643;
  19221. t.Umacron = 722;
  19222. t.uring = 556;
  19223. t.threesuperior = 333;
  19224. t.Ograve = 778;
  19225. t.Agrave = 667;
  19226. t.Abreve = 667;
  19227. t.multiply = 584;
  19228. t.uacute = 556;
  19229. t.Tcaron = 611;
  19230. t.partialdiff = 476;
  19231. t.ydieresis = 500;
  19232. t.Nacute = 722;
  19233. t.icircumflex = 278;
  19234. t.Ecircumflex = 667;
  19235. t.adieresis = 556;
  19236. t.edieresis = 556;
  19237. t.cacute = 500;
  19238. t.nacute = 556;
  19239. t.umacron = 556;
  19240. t.Ncaron = 722;
  19241. t.Iacute = 278;
  19242. t.plusminus = 584;
  19243. t.brokenbar = 260;
  19244. t.registered = 737;
  19245. t.Gbreve = 778;
  19246. t.Idotaccent = 278;
  19247. t.summation = 600;
  19248. t.Egrave = 667;
  19249. t.racute = 333;
  19250. t.omacron = 556;
  19251. t.Zacute = 611;
  19252. t.Zcaron = 611;
  19253. t.greaterequal = 549;
  19254. t.Eth = 722;
  19255. t.Ccedilla = 722;
  19256. t.lcommaaccent = 222;
  19257. t.tcaron = 317;
  19258. t.eogonek = 556;
  19259. t.Uogonek = 722;
  19260. t.Aacute = 667;
  19261. t.Adieresis = 667;
  19262. t.egrave = 556;
  19263. t.zacute = 500;
  19264. t.iogonek = 222;
  19265. t.Oacute = 778;
  19266. t.oacute = 556;
  19267. t.amacron = 556;
  19268. t.sacute = 500;
  19269. t.idieresis = 278;
  19270. t.Ocircumflex = 778;
  19271. t.Ugrave = 722;
  19272. t.Delta = 612;
  19273. t.thorn = 556;
  19274. t.twosuperior = 333;
  19275. t.Odieresis = 778;
  19276. t.mu = 556;
  19277. t.igrave = 278;
  19278. t.ohungarumlaut = 556;
  19279. t.Eogonek = 667;
  19280. t.dcroat = 556;
  19281. t.threequarters = 834;
  19282. t.Scedilla = 667;
  19283. t.lcaron = 299;
  19284. t.Kcommaaccent = 667;
  19285. t.Lacute = 556;
  19286. t.trademark = 1000;
  19287. t.edotaccent = 556;
  19288. t.Igrave = 278;
  19289. t.Imacron = 278;
  19290. t.Lcaron = 556;
  19291. t.onehalf = 834;
  19292. t.lessequal = 549;
  19293. t.ocircumflex = 556;
  19294. t.ntilde = 556;
  19295. t.Uhungarumlaut = 722;
  19296. t.Eacute = 667;
  19297. t.emacron = 556;
  19298. t.gbreve = 556;
  19299. t.onequarter = 834;
  19300. t.Scaron = 667;
  19301. t.Scommaaccent = 667;
  19302. t.Ohungarumlaut = 778;
  19303. t.degree = 400;
  19304. t.ograve = 556;
  19305. t.Ccaron = 722;
  19306. t.ugrave = 556;
  19307. t.radical = 453;
  19308. t.Dcaron = 722;
  19309. t.rcommaaccent = 333;
  19310. t.Ntilde = 722;
  19311. t.otilde = 556;
  19312. t.Rcommaaccent = 722;
  19313. t.Lcommaaccent = 556;
  19314. t.Atilde = 667;
  19315. t.Aogonek = 667;
  19316. t.Aring = 667;
  19317. t.Otilde = 778;
  19318. t.zdotaccent = 500;
  19319. t.Ecaron = 667;
  19320. t.Iogonek = 278;
  19321. t.kcommaaccent = 500;
  19322. t.minus = 584;
  19323. t.Icircumflex = 278;
  19324. t.ncaron = 556;
  19325. t.tcommaaccent = 278;
  19326. t.logicalnot = 584;
  19327. t.odieresis = 556;
  19328. t.udieresis = 556;
  19329. t.notequal = 549;
  19330. t.gcommaaccent = 556;
  19331. t.eth = 556;
  19332. t.zcaron = 500;
  19333. t.ncommaaccent = 556;
  19334. t.onesuperior = 333;
  19335. t.imacron = 278;
  19336. t.Euro = 556;
  19337. });
  19338. t.Symbol = getLookupTableFactory(function (t) {
  19339. t.space = 250;
  19340. t.exclam = 333;
  19341. t.universal = 713;
  19342. t.numbersign = 500;
  19343. t.existential = 549;
  19344. t.percent = 833;
  19345. t.ampersand = 778;
  19346. t.suchthat = 439;
  19347. t.parenleft = 333;
  19348. t.parenright = 333;
  19349. t.asteriskmath = 500;
  19350. t.plus = 549;
  19351. t.comma = 250;
  19352. t.minus = 549;
  19353. t.period = 250;
  19354. t.slash = 278;
  19355. t.zero = 500;
  19356. t.one = 500;
  19357. t.two = 500;
  19358. t.three = 500;
  19359. t.four = 500;
  19360. t.five = 500;
  19361. t.six = 500;
  19362. t.seven = 500;
  19363. t.eight = 500;
  19364. t.nine = 500;
  19365. t.colon = 278;
  19366. t.semicolon = 278;
  19367. t.less = 549;
  19368. t.equal = 549;
  19369. t.greater = 549;
  19370. t.question = 444;
  19371. t.congruent = 549;
  19372. t.Alpha = 722;
  19373. t.Beta = 667;
  19374. t.Chi = 722;
  19375. t.Delta = 612;
  19376. t.Epsilon = 611;
  19377. t.Phi = 763;
  19378. t.Gamma = 603;
  19379. t.Eta = 722;
  19380. t.Iota = 333;
  19381. t.theta1 = 631;
  19382. t.Kappa = 722;
  19383. t.Lambda = 686;
  19384. t.Mu = 889;
  19385. t.Nu = 722;
  19386. t.Omicron = 722;
  19387. t.Pi = 768;
  19388. t.Theta = 741;
  19389. t.Rho = 556;
  19390. t.Sigma = 592;
  19391. t.Tau = 611;
  19392. t.Upsilon = 690;
  19393. t.sigma1 = 439;
  19394. t.Omega = 768;
  19395. t.Xi = 645;
  19396. t.Psi = 795;
  19397. t.Zeta = 611;
  19398. t.bracketleft = 333;
  19399. t.therefore = 863;
  19400. t.bracketright = 333;
  19401. t.perpendicular = 658;
  19402. t.underscore = 500;
  19403. t.radicalex = 500;
  19404. t.alpha = 631;
  19405. t.beta = 549;
  19406. t.chi = 549;
  19407. t.delta = 494;
  19408. t.epsilon = 439;
  19409. t.phi = 521;
  19410. t.gamma = 411;
  19411. t.eta = 603;
  19412. t.iota = 329;
  19413. t.phi1 = 603;
  19414. t.kappa = 549;
  19415. t.lambda = 549;
  19416. t.mu = 576;
  19417. t.nu = 521;
  19418. t.omicron = 549;
  19419. t.pi = 549;
  19420. t.theta = 521;
  19421. t.rho = 549;
  19422. t.sigma = 603;
  19423. t.tau = 439;
  19424. t.upsilon = 576;
  19425. t.omega1 = 713;
  19426. t.omega = 686;
  19427. t.xi = 493;
  19428. t.psi = 686;
  19429. t.zeta = 494;
  19430. t.braceleft = 480;
  19431. t.bar = 200;
  19432. t.braceright = 480;
  19433. t.similar = 549;
  19434. t.Euro = 750;
  19435. t.Upsilon1 = 620;
  19436. t.minute = 247;
  19437. t.lessequal = 549;
  19438. t.fraction = 167;
  19439. t.infinity = 713;
  19440. t.florin = 500;
  19441. t.club = 753;
  19442. t.diamond = 753;
  19443. t.heart = 753;
  19444. t.spade = 753;
  19445. t.arrowboth = 1042;
  19446. t.arrowleft = 987;
  19447. t.arrowup = 603;
  19448. t.arrowright = 987;
  19449. t.arrowdown = 603;
  19450. t.degree = 400;
  19451. t.plusminus = 549;
  19452. t.second = 411;
  19453. t.greaterequal = 549;
  19454. t.multiply = 549;
  19455. t.proportional = 713;
  19456. t.partialdiff = 494;
  19457. t.bullet = 460;
  19458. t.divide = 549;
  19459. t.notequal = 549;
  19460. t.equivalence = 549;
  19461. t.approxequal = 549;
  19462. t.ellipsis = 1000;
  19463. t.arrowvertex = 603;
  19464. t.arrowhorizex = 1000;
  19465. t.carriagereturn = 658;
  19466. t.aleph = 823;
  19467. t.Ifraktur = 686;
  19468. t.Rfraktur = 795;
  19469. t.weierstrass = 987;
  19470. t.circlemultiply = 768;
  19471. t.circleplus = 768;
  19472. t.emptyset = 823;
  19473. t.intersection = 768;
  19474. t.union = 768;
  19475. t.propersuperset = 713;
  19476. t.reflexsuperset = 713;
  19477. t.notsubset = 713;
  19478. t.propersubset = 713;
  19479. t.reflexsubset = 713;
  19480. t.element = 713;
  19481. t.notelement = 713;
  19482. t.angle = 768;
  19483. t.gradient = 713;
  19484. t.registerserif = 790;
  19485. t.copyrightserif = 790;
  19486. t.trademarkserif = 890;
  19487. t.product = 823;
  19488. t.radical = 549;
  19489. t.dotmath = 250;
  19490. t.logicalnot = 713;
  19491. t.logicaland = 603;
  19492. t.logicalor = 603;
  19493. t.arrowdblboth = 1042;
  19494. t.arrowdblleft = 987;
  19495. t.arrowdblup = 603;
  19496. t.arrowdblright = 987;
  19497. t.arrowdbldown = 603;
  19498. t.lozenge = 494;
  19499. t.angleleft = 329;
  19500. t.registersans = 790;
  19501. t.copyrightsans = 790;
  19502. t.trademarksans = 786;
  19503. t.summation = 713;
  19504. t.parenlefttp = 384;
  19505. t.parenleftex = 384;
  19506. t.parenleftbt = 384;
  19507. t.bracketlefttp = 384;
  19508. t.bracketleftex = 384;
  19509. t.bracketleftbt = 384;
  19510. t.bracelefttp = 494;
  19511. t.braceleftmid = 494;
  19512. t.braceleftbt = 494;
  19513. t.braceex = 494;
  19514. t.angleright = 329;
  19515. t.integral = 274;
  19516. t.integraltp = 686;
  19517. t.integralex = 686;
  19518. t.integralbt = 686;
  19519. t.parenrighttp = 384;
  19520. t.parenrightex = 384;
  19521. t.parenrightbt = 384;
  19522. t.bracketrighttp = 384;
  19523. t.bracketrightex = 384;
  19524. t.bracketrightbt = 384;
  19525. t.bracerighttp = 494;
  19526. t.bracerightmid = 494;
  19527. t.bracerightbt = 494;
  19528. t.apple = 790;
  19529. });
  19530. t["Times-Roman"] = getLookupTableFactory(function (t) {
  19531. t.space = 250;
  19532. t.exclam = 333;
  19533. t.quotedbl = 408;
  19534. t.numbersign = 500;
  19535. t.dollar = 500;
  19536. t.percent = 833;
  19537. t.ampersand = 778;
  19538. t.quoteright = 333;
  19539. t.parenleft = 333;
  19540. t.parenright = 333;
  19541. t.asterisk = 500;
  19542. t.plus = 564;
  19543. t.comma = 250;
  19544. t.hyphen = 333;
  19545. t.period = 250;
  19546. t.slash = 278;
  19547. t.zero = 500;
  19548. t.one = 500;
  19549. t.two = 500;
  19550. t.three = 500;
  19551. t.four = 500;
  19552. t.five = 500;
  19553. t.six = 500;
  19554. t.seven = 500;
  19555. t.eight = 500;
  19556. t.nine = 500;
  19557. t.colon = 278;
  19558. t.semicolon = 278;
  19559. t.less = 564;
  19560. t.equal = 564;
  19561. t.greater = 564;
  19562. t.question = 444;
  19563. t.at = 921;
  19564. t.A = 722;
  19565. t.B = 667;
  19566. t.C = 667;
  19567. t.D = 722;
  19568. t.E = 611;
  19569. t.F = 556;
  19570. t.G = 722;
  19571. t.H = 722;
  19572. t.I = 333;
  19573. t.J = 389;
  19574. t.K = 722;
  19575. t.L = 611;
  19576. t.M = 889;
  19577. t.N = 722;
  19578. t.O = 722;
  19579. t.P = 556;
  19580. t.Q = 722;
  19581. t.R = 667;
  19582. t.S = 556;
  19583. t.T = 611;
  19584. t.U = 722;
  19585. t.V = 722;
  19586. t.W = 944;
  19587. t.X = 722;
  19588. t.Y = 722;
  19589. t.Z = 611;
  19590. t.bracketleft = 333;
  19591. t.backslash = 278;
  19592. t.bracketright = 333;
  19593. t.asciicircum = 469;
  19594. t.underscore = 500;
  19595. t.quoteleft = 333;
  19596. t.a = 444;
  19597. t.b = 500;
  19598. t.c = 444;
  19599. t.d = 500;
  19600. t.e = 444;
  19601. t.f = 333;
  19602. t.g = 500;
  19603. t.h = 500;
  19604. t.i = 278;
  19605. t.j = 278;
  19606. t.k = 500;
  19607. t.l = 278;
  19608. t.m = 778;
  19609. t.n = 500;
  19610. t.o = 500;
  19611. t.p = 500;
  19612. t.q = 500;
  19613. t.r = 333;
  19614. t.s = 389;
  19615. t.t = 278;
  19616. t.u = 500;
  19617. t.v = 500;
  19618. t.w = 722;
  19619. t.x = 500;
  19620. t.y = 500;
  19621. t.z = 444;
  19622. t.braceleft = 480;
  19623. t.bar = 200;
  19624. t.braceright = 480;
  19625. t.asciitilde = 541;
  19626. t.exclamdown = 333;
  19627. t.cent = 500;
  19628. t.sterling = 500;
  19629. t.fraction = 167;
  19630. t.yen = 500;
  19631. t.florin = 500;
  19632. t.section = 500;
  19633. t.currency = 500;
  19634. t.quotesingle = 180;
  19635. t.quotedblleft = 444;
  19636. t.guillemotleft = 500;
  19637. t.guilsinglleft = 333;
  19638. t.guilsinglright = 333;
  19639. t.fi = 556;
  19640. t.fl = 556;
  19641. t.endash = 500;
  19642. t.dagger = 500;
  19643. t.daggerdbl = 500;
  19644. t.periodcentered = 250;
  19645. t.paragraph = 453;
  19646. t.bullet = 350;
  19647. t.quotesinglbase = 333;
  19648. t.quotedblbase = 444;
  19649. t.quotedblright = 444;
  19650. t.guillemotright = 500;
  19651. t.ellipsis = 1000;
  19652. t.perthousand = 1000;
  19653. t.questiondown = 444;
  19654. t.grave = 333;
  19655. t.acute = 333;
  19656. t.circumflex = 333;
  19657. t.tilde = 333;
  19658. t.macron = 333;
  19659. t.breve = 333;
  19660. t.dotaccent = 333;
  19661. t.dieresis = 333;
  19662. t.ring = 333;
  19663. t.cedilla = 333;
  19664. t.hungarumlaut = 333;
  19665. t.ogonek = 333;
  19666. t.caron = 333;
  19667. t.emdash = 1000;
  19668. t.AE = 889;
  19669. t.ordfeminine = 276;
  19670. t.Lslash = 611;
  19671. t.Oslash = 722;
  19672. t.OE = 889;
  19673. t.ordmasculine = 310;
  19674. t.ae = 667;
  19675. t.dotlessi = 278;
  19676. t.lslash = 278;
  19677. t.oslash = 500;
  19678. t.oe = 722;
  19679. t.germandbls = 500;
  19680. t.Idieresis = 333;
  19681. t.eacute = 444;
  19682. t.abreve = 444;
  19683. t.uhungarumlaut = 500;
  19684. t.ecaron = 444;
  19685. t.Ydieresis = 722;
  19686. t.divide = 564;
  19687. t.Yacute = 722;
  19688. t.Acircumflex = 722;
  19689. t.aacute = 444;
  19690. t.Ucircumflex = 722;
  19691. t.yacute = 500;
  19692. t.scommaaccent = 389;
  19693. t.ecircumflex = 444;
  19694. t.Uring = 722;
  19695. t.Udieresis = 722;
  19696. t.aogonek = 444;
  19697. t.Uacute = 722;
  19698. t.uogonek = 500;
  19699. t.Edieresis = 611;
  19700. t.Dcroat = 722;
  19701. t.commaaccent = 250;
  19702. t.copyright = 760;
  19703. t.Emacron = 611;
  19704. t.ccaron = 444;
  19705. t.aring = 444;
  19706. t.Ncommaaccent = 722;
  19707. t.lacute = 278;
  19708. t.agrave = 444;
  19709. t.Tcommaaccent = 611;
  19710. t.Cacute = 667;
  19711. t.atilde = 444;
  19712. t.Edotaccent = 611;
  19713. t.scaron = 389;
  19714. t.scedilla = 389;
  19715. t.iacute = 278;
  19716. t.lozenge = 471;
  19717. t.Rcaron = 667;
  19718. t.Gcommaaccent = 722;
  19719. t.ucircumflex = 500;
  19720. t.acircumflex = 444;
  19721. t.Amacron = 722;
  19722. t.rcaron = 333;
  19723. t.ccedilla = 444;
  19724. t.Zdotaccent = 611;
  19725. t.Thorn = 556;
  19726. t.Omacron = 722;
  19727. t.Racute = 667;
  19728. t.Sacute = 556;
  19729. t.dcaron = 588;
  19730. t.Umacron = 722;
  19731. t.uring = 500;
  19732. t.threesuperior = 300;
  19733. t.Ograve = 722;
  19734. t.Agrave = 722;
  19735. t.Abreve = 722;
  19736. t.multiply = 564;
  19737. t.uacute = 500;
  19738. t.Tcaron = 611;
  19739. t.partialdiff = 476;
  19740. t.ydieresis = 500;
  19741. t.Nacute = 722;
  19742. t.icircumflex = 278;
  19743. t.Ecircumflex = 611;
  19744. t.adieresis = 444;
  19745. t.edieresis = 444;
  19746. t.cacute = 444;
  19747. t.nacute = 500;
  19748. t.umacron = 500;
  19749. t.Ncaron = 722;
  19750. t.Iacute = 333;
  19751. t.plusminus = 564;
  19752. t.brokenbar = 200;
  19753. t.registered = 760;
  19754. t.Gbreve = 722;
  19755. t.Idotaccent = 333;
  19756. t.summation = 600;
  19757. t.Egrave = 611;
  19758. t.racute = 333;
  19759. t.omacron = 500;
  19760. t.Zacute = 611;
  19761. t.Zcaron = 611;
  19762. t.greaterequal = 549;
  19763. t.Eth = 722;
  19764. t.Ccedilla = 667;
  19765. t.lcommaaccent = 278;
  19766. t.tcaron = 326;
  19767. t.eogonek = 444;
  19768. t.Uogonek = 722;
  19769. t.Aacute = 722;
  19770. t.Adieresis = 722;
  19771. t.egrave = 444;
  19772. t.zacute = 444;
  19773. t.iogonek = 278;
  19774. t.Oacute = 722;
  19775. t.oacute = 500;
  19776. t.amacron = 444;
  19777. t.sacute = 389;
  19778. t.idieresis = 278;
  19779. t.Ocircumflex = 722;
  19780. t.Ugrave = 722;
  19781. t.Delta = 612;
  19782. t.thorn = 500;
  19783. t.twosuperior = 300;
  19784. t.Odieresis = 722;
  19785. t.mu = 500;
  19786. t.igrave = 278;
  19787. t.ohungarumlaut = 500;
  19788. t.Eogonek = 611;
  19789. t.dcroat = 500;
  19790. t.threequarters = 750;
  19791. t.Scedilla = 556;
  19792. t.lcaron = 344;
  19793. t.Kcommaaccent = 722;
  19794. t.Lacute = 611;
  19795. t.trademark = 980;
  19796. t.edotaccent = 444;
  19797. t.Igrave = 333;
  19798. t.Imacron = 333;
  19799. t.Lcaron = 611;
  19800. t.onehalf = 750;
  19801. t.lessequal = 549;
  19802. t.ocircumflex = 500;
  19803. t.ntilde = 500;
  19804. t.Uhungarumlaut = 722;
  19805. t.Eacute = 611;
  19806. t.emacron = 444;
  19807. t.gbreve = 500;
  19808. t.onequarter = 750;
  19809. t.Scaron = 556;
  19810. t.Scommaaccent = 556;
  19811. t.Ohungarumlaut = 722;
  19812. t.degree = 400;
  19813. t.ograve = 500;
  19814. t.Ccaron = 667;
  19815. t.ugrave = 500;
  19816. t.radical = 453;
  19817. t.Dcaron = 722;
  19818. t.rcommaaccent = 333;
  19819. t.Ntilde = 722;
  19820. t.otilde = 500;
  19821. t.Rcommaaccent = 667;
  19822. t.Lcommaaccent = 611;
  19823. t.Atilde = 722;
  19824. t.Aogonek = 722;
  19825. t.Aring = 722;
  19826. t.Otilde = 722;
  19827. t.zdotaccent = 444;
  19828. t.Ecaron = 611;
  19829. t.Iogonek = 333;
  19830. t.kcommaaccent = 500;
  19831. t.minus = 564;
  19832. t.Icircumflex = 333;
  19833. t.ncaron = 500;
  19834. t.tcommaaccent = 278;
  19835. t.logicalnot = 564;
  19836. t.odieresis = 500;
  19837. t.udieresis = 500;
  19838. t.notequal = 549;
  19839. t.gcommaaccent = 500;
  19840. t.eth = 500;
  19841. t.zcaron = 444;
  19842. t.ncommaaccent = 500;
  19843. t.onesuperior = 300;
  19844. t.imacron = 278;
  19845. t.Euro = 500;
  19846. });
  19847. t["Times-Bold"] = getLookupTableFactory(function (t) {
  19848. t.space = 250;
  19849. t.exclam = 333;
  19850. t.quotedbl = 555;
  19851. t.numbersign = 500;
  19852. t.dollar = 500;
  19853. t.percent = 1000;
  19854. t.ampersand = 833;
  19855. t.quoteright = 333;
  19856. t.parenleft = 333;
  19857. t.parenright = 333;
  19858. t.asterisk = 500;
  19859. t.plus = 570;
  19860. t.comma = 250;
  19861. t.hyphen = 333;
  19862. t.period = 250;
  19863. t.slash = 278;
  19864. t.zero = 500;
  19865. t.one = 500;
  19866. t.two = 500;
  19867. t.three = 500;
  19868. t.four = 500;
  19869. t.five = 500;
  19870. t.six = 500;
  19871. t.seven = 500;
  19872. t.eight = 500;
  19873. t.nine = 500;
  19874. t.colon = 333;
  19875. t.semicolon = 333;
  19876. t.less = 570;
  19877. t.equal = 570;
  19878. t.greater = 570;
  19879. t.question = 500;
  19880. t.at = 930;
  19881. t.A = 722;
  19882. t.B = 667;
  19883. t.C = 722;
  19884. t.D = 722;
  19885. t.E = 667;
  19886. t.F = 611;
  19887. t.G = 778;
  19888. t.H = 778;
  19889. t.I = 389;
  19890. t.J = 500;
  19891. t.K = 778;
  19892. t.L = 667;
  19893. t.M = 944;
  19894. t.N = 722;
  19895. t.O = 778;
  19896. t.P = 611;
  19897. t.Q = 778;
  19898. t.R = 722;
  19899. t.S = 556;
  19900. t.T = 667;
  19901. t.U = 722;
  19902. t.V = 722;
  19903. t.W = 1000;
  19904. t.X = 722;
  19905. t.Y = 722;
  19906. t.Z = 667;
  19907. t.bracketleft = 333;
  19908. t.backslash = 278;
  19909. t.bracketright = 333;
  19910. t.asciicircum = 581;
  19911. t.underscore = 500;
  19912. t.quoteleft = 333;
  19913. t.a = 500;
  19914. t.b = 556;
  19915. t.c = 444;
  19916. t.d = 556;
  19917. t.e = 444;
  19918. t.f = 333;
  19919. t.g = 500;
  19920. t.h = 556;
  19921. t.i = 278;
  19922. t.j = 333;
  19923. t.k = 556;
  19924. t.l = 278;
  19925. t.m = 833;
  19926. t.n = 556;
  19927. t.o = 500;
  19928. t.p = 556;
  19929. t.q = 556;
  19930. t.r = 444;
  19931. t.s = 389;
  19932. t.t = 333;
  19933. t.u = 556;
  19934. t.v = 500;
  19935. t.w = 722;
  19936. t.x = 500;
  19937. t.y = 500;
  19938. t.z = 444;
  19939. t.braceleft = 394;
  19940. t.bar = 220;
  19941. t.braceright = 394;
  19942. t.asciitilde = 520;
  19943. t.exclamdown = 333;
  19944. t.cent = 500;
  19945. t.sterling = 500;
  19946. t.fraction = 167;
  19947. t.yen = 500;
  19948. t.florin = 500;
  19949. t.section = 500;
  19950. t.currency = 500;
  19951. t.quotesingle = 278;
  19952. t.quotedblleft = 500;
  19953. t.guillemotleft = 500;
  19954. t.guilsinglleft = 333;
  19955. t.guilsinglright = 333;
  19956. t.fi = 556;
  19957. t.fl = 556;
  19958. t.endash = 500;
  19959. t.dagger = 500;
  19960. t.daggerdbl = 500;
  19961. t.periodcentered = 250;
  19962. t.paragraph = 540;
  19963. t.bullet = 350;
  19964. t.quotesinglbase = 333;
  19965. t.quotedblbase = 500;
  19966. t.quotedblright = 500;
  19967. t.guillemotright = 500;
  19968. t.ellipsis = 1000;
  19969. t.perthousand = 1000;
  19970. t.questiondown = 500;
  19971. t.grave = 333;
  19972. t.acute = 333;
  19973. t.circumflex = 333;
  19974. t.tilde = 333;
  19975. t.macron = 333;
  19976. t.breve = 333;
  19977. t.dotaccent = 333;
  19978. t.dieresis = 333;
  19979. t.ring = 333;
  19980. t.cedilla = 333;
  19981. t.hungarumlaut = 333;
  19982. t.ogonek = 333;
  19983. t.caron = 333;
  19984. t.emdash = 1000;
  19985. t.AE = 1000;
  19986. t.ordfeminine = 300;
  19987. t.Lslash = 667;
  19988. t.Oslash = 778;
  19989. t.OE = 1000;
  19990. t.ordmasculine = 330;
  19991. t.ae = 722;
  19992. t.dotlessi = 278;
  19993. t.lslash = 278;
  19994. t.oslash = 500;
  19995. t.oe = 722;
  19996. t.germandbls = 556;
  19997. t.Idieresis = 389;
  19998. t.eacute = 444;
  19999. t.abreve = 500;
  20000. t.uhungarumlaut = 556;
  20001. t.ecaron = 444;
  20002. t.Ydieresis = 722;
  20003. t.divide = 570;
  20004. t.Yacute = 722;
  20005. t.Acircumflex = 722;
  20006. t.aacute = 500;
  20007. t.Ucircumflex = 722;
  20008. t.yacute = 500;
  20009. t.scommaaccent = 389;
  20010. t.ecircumflex = 444;
  20011. t.Uring = 722;
  20012. t.Udieresis = 722;
  20013. t.aogonek = 500;
  20014. t.Uacute = 722;
  20015. t.uogonek = 556;
  20016. t.Edieresis = 667;
  20017. t.Dcroat = 722;
  20018. t.commaaccent = 250;
  20019. t.copyright = 747;
  20020. t.Emacron = 667;
  20021. t.ccaron = 444;
  20022. t.aring = 500;
  20023. t.Ncommaaccent = 722;
  20024. t.lacute = 278;
  20025. t.agrave = 500;
  20026. t.Tcommaaccent = 667;
  20027. t.Cacute = 722;
  20028. t.atilde = 500;
  20029. t.Edotaccent = 667;
  20030. t.scaron = 389;
  20031. t.scedilla = 389;
  20032. t.iacute = 278;
  20033. t.lozenge = 494;
  20034. t.Rcaron = 722;
  20035. t.Gcommaaccent = 778;
  20036. t.ucircumflex = 556;
  20037. t.acircumflex = 500;
  20038. t.Amacron = 722;
  20039. t.rcaron = 444;
  20040. t.ccedilla = 444;
  20041. t.Zdotaccent = 667;
  20042. t.Thorn = 611;
  20043. t.Omacron = 778;
  20044. t.Racute = 722;
  20045. t.Sacute = 556;
  20046. t.dcaron = 672;
  20047. t.Umacron = 722;
  20048. t.uring = 556;
  20049. t.threesuperior = 300;
  20050. t.Ograve = 778;
  20051. t.Agrave = 722;
  20052. t.Abreve = 722;
  20053. t.multiply = 570;
  20054. t.uacute = 556;
  20055. t.Tcaron = 667;
  20056. t.partialdiff = 494;
  20057. t.ydieresis = 500;
  20058. t.Nacute = 722;
  20059. t.icircumflex = 278;
  20060. t.Ecircumflex = 667;
  20061. t.adieresis = 500;
  20062. t.edieresis = 444;
  20063. t.cacute = 444;
  20064. t.nacute = 556;
  20065. t.umacron = 556;
  20066. t.Ncaron = 722;
  20067. t.Iacute = 389;
  20068. t.plusminus = 570;
  20069. t.brokenbar = 220;
  20070. t.registered = 747;
  20071. t.Gbreve = 778;
  20072. t.Idotaccent = 389;
  20073. t.summation = 600;
  20074. t.Egrave = 667;
  20075. t.racute = 444;
  20076. t.omacron = 500;
  20077. t.Zacute = 667;
  20078. t.Zcaron = 667;
  20079. t.greaterequal = 549;
  20080. t.Eth = 722;
  20081. t.Ccedilla = 722;
  20082. t.lcommaaccent = 278;
  20083. t.tcaron = 416;
  20084. t.eogonek = 444;
  20085. t.Uogonek = 722;
  20086. t.Aacute = 722;
  20087. t.Adieresis = 722;
  20088. t.egrave = 444;
  20089. t.zacute = 444;
  20090. t.iogonek = 278;
  20091. t.Oacute = 778;
  20092. t.oacute = 500;
  20093. t.amacron = 500;
  20094. t.sacute = 389;
  20095. t.idieresis = 278;
  20096. t.Ocircumflex = 778;
  20097. t.Ugrave = 722;
  20098. t.Delta = 612;
  20099. t.thorn = 556;
  20100. t.twosuperior = 300;
  20101. t.Odieresis = 778;
  20102. t.mu = 556;
  20103. t.igrave = 278;
  20104. t.ohungarumlaut = 500;
  20105. t.Eogonek = 667;
  20106. t.dcroat = 556;
  20107. t.threequarters = 750;
  20108. t.Scedilla = 556;
  20109. t.lcaron = 394;
  20110. t.Kcommaaccent = 778;
  20111. t.Lacute = 667;
  20112. t.trademark = 1000;
  20113. t.edotaccent = 444;
  20114. t.Igrave = 389;
  20115. t.Imacron = 389;
  20116. t.Lcaron = 667;
  20117. t.onehalf = 750;
  20118. t.lessequal = 549;
  20119. t.ocircumflex = 500;
  20120. t.ntilde = 556;
  20121. t.Uhungarumlaut = 722;
  20122. t.Eacute = 667;
  20123. t.emacron = 444;
  20124. t.gbreve = 500;
  20125. t.onequarter = 750;
  20126. t.Scaron = 556;
  20127. t.Scommaaccent = 556;
  20128. t.Ohungarumlaut = 778;
  20129. t.degree = 400;
  20130. t.ograve = 500;
  20131. t.Ccaron = 722;
  20132. t.ugrave = 556;
  20133. t.radical = 549;
  20134. t.Dcaron = 722;
  20135. t.rcommaaccent = 444;
  20136. t.Ntilde = 722;
  20137. t.otilde = 500;
  20138. t.Rcommaaccent = 722;
  20139. t.Lcommaaccent = 667;
  20140. t.Atilde = 722;
  20141. t.Aogonek = 722;
  20142. t.Aring = 722;
  20143. t.Otilde = 778;
  20144. t.zdotaccent = 444;
  20145. t.Ecaron = 667;
  20146. t.Iogonek = 389;
  20147. t.kcommaaccent = 556;
  20148. t.minus = 570;
  20149. t.Icircumflex = 389;
  20150. t.ncaron = 556;
  20151. t.tcommaaccent = 333;
  20152. t.logicalnot = 570;
  20153. t.odieresis = 500;
  20154. t.udieresis = 556;
  20155. t.notequal = 549;
  20156. t.gcommaaccent = 500;
  20157. t.eth = 500;
  20158. t.zcaron = 444;
  20159. t.ncommaaccent = 556;
  20160. t.onesuperior = 300;
  20161. t.imacron = 278;
  20162. t.Euro = 500;
  20163. });
  20164. t["Times-BoldItalic"] = getLookupTableFactory(function (t) {
  20165. t.space = 250;
  20166. t.exclam = 389;
  20167. t.quotedbl = 555;
  20168. t.numbersign = 500;
  20169. t.dollar = 500;
  20170. t.percent = 833;
  20171. t.ampersand = 778;
  20172. t.quoteright = 333;
  20173. t.parenleft = 333;
  20174. t.parenright = 333;
  20175. t.asterisk = 500;
  20176. t.plus = 570;
  20177. t.comma = 250;
  20178. t.hyphen = 333;
  20179. t.period = 250;
  20180. t.slash = 278;
  20181. t.zero = 500;
  20182. t.one = 500;
  20183. t.two = 500;
  20184. t.three = 500;
  20185. t.four = 500;
  20186. t.five = 500;
  20187. t.six = 500;
  20188. t.seven = 500;
  20189. t.eight = 500;
  20190. t.nine = 500;
  20191. t.colon = 333;
  20192. t.semicolon = 333;
  20193. t.less = 570;
  20194. t.equal = 570;
  20195. t.greater = 570;
  20196. t.question = 500;
  20197. t.at = 832;
  20198. t.A = 667;
  20199. t.B = 667;
  20200. t.C = 667;
  20201. t.D = 722;
  20202. t.E = 667;
  20203. t.F = 667;
  20204. t.G = 722;
  20205. t.H = 778;
  20206. t.I = 389;
  20207. t.J = 500;
  20208. t.K = 667;
  20209. t.L = 611;
  20210. t.M = 889;
  20211. t.N = 722;
  20212. t.O = 722;
  20213. t.P = 611;
  20214. t.Q = 722;
  20215. t.R = 667;
  20216. t.S = 556;
  20217. t.T = 611;
  20218. t.U = 722;
  20219. t.V = 667;
  20220. t.W = 889;
  20221. t.X = 667;
  20222. t.Y = 611;
  20223. t.Z = 611;
  20224. t.bracketleft = 333;
  20225. t.backslash = 278;
  20226. t.bracketright = 333;
  20227. t.asciicircum = 570;
  20228. t.underscore = 500;
  20229. t.quoteleft = 333;
  20230. t.a = 500;
  20231. t.b = 500;
  20232. t.c = 444;
  20233. t.d = 500;
  20234. t.e = 444;
  20235. t.f = 333;
  20236. t.g = 500;
  20237. t.h = 556;
  20238. t.i = 278;
  20239. t.j = 278;
  20240. t.k = 500;
  20241. t.l = 278;
  20242. t.m = 778;
  20243. t.n = 556;
  20244. t.o = 500;
  20245. t.p = 500;
  20246. t.q = 500;
  20247. t.r = 389;
  20248. t.s = 389;
  20249. t.t = 278;
  20250. t.u = 556;
  20251. t.v = 444;
  20252. t.w = 667;
  20253. t.x = 500;
  20254. t.y = 444;
  20255. t.z = 389;
  20256. t.braceleft = 348;
  20257. t.bar = 220;
  20258. t.braceright = 348;
  20259. t.asciitilde = 570;
  20260. t.exclamdown = 389;
  20261. t.cent = 500;
  20262. t.sterling = 500;
  20263. t.fraction = 167;
  20264. t.yen = 500;
  20265. t.florin = 500;
  20266. t.section = 500;
  20267. t.currency = 500;
  20268. t.quotesingle = 278;
  20269. t.quotedblleft = 500;
  20270. t.guillemotleft = 500;
  20271. t.guilsinglleft = 333;
  20272. t.guilsinglright = 333;
  20273. t.fi = 556;
  20274. t.fl = 556;
  20275. t.endash = 500;
  20276. t.dagger = 500;
  20277. t.daggerdbl = 500;
  20278. t.periodcentered = 250;
  20279. t.paragraph = 500;
  20280. t.bullet = 350;
  20281. t.quotesinglbase = 333;
  20282. t.quotedblbase = 500;
  20283. t.quotedblright = 500;
  20284. t.guillemotright = 500;
  20285. t.ellipsis = 1000;
  20286. t.perthousand = 1000;
  20287. t.questiondown = 500;
  20288. t.grave = 333;
  20289. t.acute = 333;
  20290. t.circumflex = 333;
  20291. t.tilde = 333;
  20292. t.macron = 333;
  20293. t.breve = 333;
  20294. t.dotaccent = 333;
  20295. t.dieresis = 333;
  20296. t.ring = 333;
  20297. t.cedilla = 333;
  20298. t.hungarumlaut = 333;
  20299. t.ogonek = 333;
  20300. t.caron = 333;
  20301. t.emdash = 1000;
  20302. t.AE = 944;
  20303. t.ordfeminine = 266;
  20304. t.Lslash = 611;
  20305. t.Oslash = 722;
  20306. t.OE = 944;
  20307. t.ordmasculine = 300;
  20308. t.ae = 722;
  20309. t.dotlessi = 278;
  20310. t.lslash = 278;
  20311. t.oslash = 500;
  20312. t.oe = 722;
  20313. t.germandbls = 500;
  20314. t.Idieresis = 389;
  20315. t.eacute = 444;
  20316. t.abreve = 500;
  20317. t.uhungarumlaut = 556;
  20318. t.ecaron = 444;
  20319. t.Ydieresis = 611;
  20320. t.divide = 570;
  20321. t.Yacute = 611;
  20322. t.Acircumflex = 667;
  20323. t.aacute = 500;
  20324. t.Ucircumflex = 722;
  20325. t.yacute = 444;
  20326. t.scommaaccent = 389;
  20327. t.ecircumflex = 444;
  20328. t.Uring = 722;
  20329. t.Udieresis = 722;
  20330. t.aogonek = 500;
  20331. t.Uacute = 722;
  20332. t.uogonek = 556;
  20333. t.Edieresis = 667;
  20334. t.Dcroat = 722;
  20335. t.commaaccent = 250;
  20336. t.copyright = 747;
  20337. t.Emacron = 667;
  20338. t.ccaron = 444;
  20339. t.aring = 500;
  20340. t.Ncommaaccent = 722;
  20341. t.lacute = 278;
  20342. t.agrave = 500;
  20343. t.Tcommaaccent = 611;
  20344. t.Cacute = 667;
  20345. t.atilde = 500;
  20346. t.Edotaccent = 667;
  20347. t.scaron = 389;
  20348. t.scedilla = 389;
  20349. t.iacute = 278;
  20350. t.lozenge = 494;
  20351. t.Rcaron = 667;
  20352. t.Gcommaaccent = 722;
  20353. t.ucircumflex = 556;
  20354. t.acircumflex = 500;
  20355. t.Amacron = 667;
  20356. t.rcaron = 389;
  20357. t.ccedilla = 444;
  20358. t.Zdotaccent = 611;
  20359. t.Thorn = 611;
  20360. t.Omacron = 722;
  20361. t.Racute = 667;
  20362. t.Sacute = 556;
  20363. t.dcaron = 608;
  20364. t.Umacron = 722;
  20365. t.uring = 556;
  20366. t.threesuperior = 300;
  20367. t.Ograve = 722;
  20368. t.Agrave = 667;
  20369. t.Abreve = 667;
  20370. t.multiply = 570;
  20371. t.uacute = 556;
  20372. t.Tcaron = 611;
  20373. t.partialdiff = 494;
  20374. t.ydieresis = 444;
  20375. t.Nacute = 722;
  20376. t.icircumflex = 278;
  20377. t.Ecircumflex = 667;
  20378. t.adieresis = 500;
  20379. t.edieresis = 444;
  20380. t.cacute = 444;
  20381. t.nacute = 556;
  20382. t.umacron = 556;
  20383. t.Ncaron = 722;
  20384. t.Iacute = 389;
  20385. t.plusminus = 570;
  20386. t.brokenbar = 220;
  20387. t.registered = 747;
  20388. t.Gbreve = 722;
  20389. t.Idotaccent = 389;
  20390. t.summation = 600;
  20391. t.Egrave = 667;
  20392. t.racute = 389;
  20393. t.omacron = 500;
  20394. t.Zacute = 611;
  20395. t.Zcaron = 611;
  20396. t.greaterequal = 549;
  20397. t.Eth = 722;
  20398. t.Ccedilla = 667;
  20399. t.lcommaaccent = 278;
  20400. t.tcaron = 366;
  20401. t.eogonek = 444;
  20402. t.Uogonek = 722;
  20403. t.Aacute = 667;
  20404. t.Adieresis = 667;
  20405. t.egrave = 444;
  20406. t.zacute = 389;
  20407. t.iogonek = 278;
  20408. t.Oacute = 722;
  20409. t.oacute = 500;
  20410. t.amacron = 500;
  20411. t.sacute = 389;
  20412. t.idieresis = 278;
  20413. t.Ocircumflex = 722;
  20414. t.Ugrave = 722;
  20415. t.Delta = 612;
  20416. t.thorn = 500;
  20417. t.twosuperior = 300;
  20418. t.Odieresis = 722;
  20419. t.mu = 576;
  20420. t.igrave = 278;
  20421. t.ohungarumlaut = 500;
  20422. t.Eogonek = 667;
  20423. t.dcroat = 500;
  20424. t.threequarters = 750;
  20425. t.Scedilla = 556;
  20426. t.lcaron = 382;
  20427. t.Kcommaaccent = 667;
  20428. t.Lacute = 611;
  20429. t.trademark = 1000;
  20430. t.edotaccent = 444;
  20431. t.Igrave = 389;
  20432. t.Imacron = 389;
  20433. t.Lcaron = 611;
  20434. t.onehalf = 750;
  20435. t.lessequal = 549;
  20436. t.ocircumflex = 500;
  20437. t.ntilde = 556;
  20438. t.Uhungarumlaut = 722;
  20439. t.Eacute = 667;
  20440. t.emacron = 444;
  20441. t.gbreve = 500;
  20442. t.onequarter = 750;
  20443. t.Scaron = 556;
  20444. t.Scommaaccent = 556;
  20445. t.Ohungarumlaut = 722;
  20446. t.degree = 400;
  20447. t.ograve = 500;
  20448. t.Ccaron = 667;
  20449. t.ugrave = 556;
  20450. t.radical = 549;
  20451. t.Dcaron = 722;
  20452. t.rcommaaccent = 389;
  20453. t.Ntilde = 722;
  20454. t.otilde = 500;
  20455. t.Rcommaaccent = 667;
  20456. t.Lcommaaccent = 611;
  20457. t.Atilde = 667;
  20458. t.Aogonek = 667;
  20459. t.Aring = 667;
  20460. t.Otilde = 722;
  20461. t.zdotaccent = 389;
  20462. t.Ecaron = 667;
  20463. t.Iogonek = 389;
  20464. t.kcommaaccent = 500;
  20465. t.minus = 606;
  20466. t.Icircumflex = 389;
  20467. t.ncaron = 556;
  20468. t.tcommaaccent = 278;
  20469. t.logicalnot = 606;
  20470. t.odieresis = 500;
  20471. t.udieresis = 556;
  20472. t.notequal = 549;
  20473. t.gcommaaccent = 500;
  20474. t.eth = 500;
  20475. t.zcaron = 389;
  20476. t.ncommaaccent = 556;
  20477. t.onesuperior = 300;
  20478. t.imacron = 278;
  20479. t.Euro = 500;
  20480. });
  20481. t["Times-Italic"] = getLookupTableFactory(function (t) {
  20482. t.space = 250;
  20483. t.exclam = 333;
  20484. t.quotedbl = 420;
  20485. t.numbersign = 500;
  20486. t.dollar = 500;
  20487. t.percent = 833;
  20488. t.ampersand = 778;
  20489. t.quoteright = 333;
  20490. t.parenleft = 333;
  20491. t.parenright = 333;
  20492. t.asterisk = 500;
  20493. t.plus = 675;
  20494. t.comma = 250;
  20495. t.hyphen = 333;
  20496. t.period = 250;
  20497. t.slash = 278;
  20498. t.zero = 500;
  20499. t.one = 500;
  20500. t.two = 500;
  20501. t.three = 500;
  20502. t.four = 500;
  20503. t.five = 500;
  20504. t.six = 500;
  20505. t.seven = 500;
  20506. t.eight = 500;
  20507. t.nine = 500;
  20508. t.colon = 333;
  20509. t.semicolon = 333;
  20510. t.less = 675;
  20511. t.equal = 675;
  20512. t.greater = 675;
  20513. t.question = 500;
  20514. t.at = 920;
  20515. t.A = 611;
  20516. t.B = 611;
  20517. t.C = 667;
  20518. t.D = 722;
  20519. t.E = 611;
  20520. t.F = 611;
  20521. t.G = 722;
  20522. t.H = 722;
  20523. t.I = 333;
  20524. t.J = 444;
  20525. t.K = 667;
  20526. t.L = 556;
  20527. t.M = 833;
  20528. t.N = 667;
  20529. t.O = 722;
  20530. t.P = 611;
  20531. t.Q = 722;
  20532. t.R = 611;
  20533. t.S = 500;
  20534. t.T = 556;
  20535. t.U = 722;
  20536. t.V = 611;
  20537. t.W = 833;
  20538. t.X = 611;
  20539. t.Y = 556;
  20540. t.Z = 556;
  20541. t.bracketleft = 389;
  20542. t.backslash = 278;
  20543. t.bracketright = 389;
  20544. t.asciicircum = 422;
  20545. t.underscore = 500;
  20546. t.quoteleft = 333;
  20547. t.a = 500;
  20548. t.b = 500;
  20549. t.c = 444;
  20550. t.d = 500;
  20551. t.e = 444;
  20552. t.f = 278;
  20553. t.g = 500;
  20554. t.h = 500;
  20555. t.i = 278;
  20556. t.j = 278;
  20557. t.k = 444;
  20558. t.l = 278;
  20559. t.m = 722;
  20560. t.n = 500;
  20561. t.o = 500;
  20562. t.p = 500;
  20563. t.q = 500;
  20564. t.r = 389;
  20565. t.s = 389;
  20566. t.t = 278;
  20567. t.u = 500;
  20568. t.v = 444;
  20569. t.w = 667;
  20570. t.x = 444;
  20571. t.y = 444;
  20572. t.z = 389;
  20573. t.braceleft = 400;
  20574. t.bar = 275;
  20575. t.braceright = 400;
  20576. t.asciitilde = 541;
  20577. t.exclamdown = 389;
  20578. t.cent = 500;
  20579. t.sterling = 500;
  20580. t.fraction = 167;
  20581. t.yen = 500;
  20582. t.florin = 500;
  20583. t.section = 500;
  20584. t.currency = 500;
  20585. t.quotesingle = 214;
  20586. t.quotedblleft = 556;
  20587. t.guillemotleft = 500;
  20588. t.guilsinglleft = 333;
  20589. t.guilsinglright = 333;
  20590. t.fi = 500;
  20591. t.fl = 500;
  20592. t.endash = 500;
  20593. t.dagger = 500;
  20594. t.daggerdbl = 500;
  20595. t.periodcentered = 250;
  20596. t.paragraph = 523;
  20597. t.bullet = 350;
  20598. t.quotesinglbase = 333;
  20599. t.quotedblbase = 556;
  20600. t.quotedblright = 556;
  20601. t.guillemotright = 500;
  20602. t.ellipsis = 889;
  20603. t.perthousand = 1000;
  20604. t.questiondown = 500;
  20605. t.grave = 333;
  20606. t.acute = 333;
  20607. t.circumflex = 333;
  20608. t.tilde = 333;
  20609. t.macron = 333;
  20610. t.breve = 333;
  20611. t.dotaccent = 333;
  20612. t.dieresis = 333;
  20613. t.ring = 333;
  20614. t.cedilla = 333;
  20615. t.hungarumlaut = 333;
  20616. t.ogonek = 333;
  20617. t.caron = 333;
  20618. t.emdash = 889;
  20619. t.AE = 889;
  20620. t.ordfeminine = 276;
  20621. t.Lslash = 556;
  20622. t.Oslash = 722;
  20623. t.OE = 944;
  20624. t.ordmasculine = 310;
  20625. t.ae = 667;
  20626. t.dotlessi = 278;
  20627. t.lslash = 278;
  20628. t.oslash = 500;
  20629. t.oe = 667;
  20630. t.germandbls = 500;
  20631. t.Idieresis = 333;
  20632. t.eacute = 444;
  20633. t.abreve = 500;
  20634. t.uhungarumlaut = 500;
  20635. t.ecaron = 444;
  20636. t.Ydieresis = 556;
  20637. t.divide = 675;
  20638. t.Yacute = 556;
  20639. t.Acircumflex = 611;
  20640. t.aacute = 500;
  20641. t.Ucircumflex = 722;
  20642. t.yacute = 444;
  20643. t.scommaaccent = 389;
  20644. t.ecircumflex = 444;
  20645. t.Uring = 722;
  20646. t.Udieresis = 722;
  20647. t.aogonek = 500;
  20648. t.Uacute = 722;
  20649. t.uogonek = 500;
  20650. t.Edieresis = 611;
  20651. t.Dcroat = 722;
  20652. t.commaaccent = 250;
  20653. t.copyright = 760;
  20654. t.Emacron = 611;
  20655. t.ccaron = 444;
  20656. t.aring = 500;
  20657. t.Ncommaaccent = 667;
  20658. t.lacute = 278;
  20659. t.agrave = 500;
  20660. t.Tcommaaccent = 556;
  20661. t.Cacute = 667;
  20662. t.atilde = 500;
  20663. t.Edotaccent = 611;
  20664. t.scaron = 389;
  20665. t.scedilla = 389;
  20666. t.iacute = 278;
  20667. t.lozenge = 471;
  20668. t.Rcaron = 611;
  20669. t.Gcommaaccent = 722;
  20670. t.ucircumflex = 500;
  20671. t.acircumflex = 500;
  20672. t.Amacron = 611;
  20673. t.rcaron = 389;
  20674. t.ccedilla = 444;
  20675. t.Zdotaccent = 556;
  20676. t.Thorn = 611;
  20677. t.Omacron = 722;
  20678. t.Racute = 611;
  20679. t.Sacute = 500;
  20680. t.dcaron = 544;
  20681. t.Umacron = 722;
  20682. t.uring = 500;
  20683. t.threesuperior = 300;
  20684. t.Ograve = 722;
  20685. t.Agrave = 611;
  20686. t.Abreve = 611;
  20687. t.multiply = 675;
  20688. t.uacute = 500;
  20689. t.Tcaron = 556;
  20690. t.partialdiff = 476;
  20691. t.ydieresis = 444;
  20692. t.Nacute = 667;
  20693. t.icircumflex = 278;
  20694. t.Ecircumflex = 611;
  20695. t.adieresis = 500;
  20696. t.edieresis = 444;
  20697. t.cacute = 444;
  20698. t.nacute = 500;
  20699. t.umacron = 500;
  20700. t.Ncaron = 667;
  20701. t.Iacute = 333;
  20702. t.plusminus = 675;
  20703. t.brokenbar = 275;
  20704. t.registered = 760;
  20705. t.Gbreve = 722;
  20706. t.Idotaccent = 333;
  20707. t.summation = 600;
  20708. t.Egrave = 611;
  20709. t.racute = 389;
  20710. t.omacron = 500;
  20711. t.Zacute = 556;
  20712. t.Zcaron = 556;
  20713. t.greaterequal = 549;
  20714. t.Eth = 722;
  20715. t.Ccedilla = 667;
  20716. t.lcommaaccent = 278;
  20717. t.tcaron = 300;
  20718. t.eogonek = 444;
  20719. t.Uogonek = 722;
  20720. t.Aacute = 611;
  20721. t.Adieresis = 611;
  20722. t.egrave = 444;
  20723. t.zacute = 389;
  20724. t.iogonek = 278;
  20725. t.Oacute = 722;
  20726. t.oacute = 500;
  20727. t.amacron = 500;
  20728. t.sacute = 389;
  20729. t.idieresis = 278;
  20730. t.Ocircumflex = 722;
  20731. t.Ugrave = 722;
  20732. t.Delta = 612;
  20733. t.thorn = 500;
  20734. t.twosuperior = 300;
  20735. t.Odieresis = 722;
  20736. t.mu = 500;
  20737. t.igrave = 278;
  20738. t.ohungarumlaut = 500;
  20739. t.Eogonek = 611;
  20740. t.dcroat = 500;
  20741. t.threequarters = 750;
  20742. t.Scedilla = 500;
  20743. t.lcaron = 300;
  20744. t.Kcommaaccent = 667;
  20745. t.Lacute = 556;
  20746. t.trademark = 980;
  20747. t.edotaccent = 444;
  20748. t.Igrave = 333;
  20749. t.Imacron = 333;
  20750. t.Lcaron = 611;
  20751. t.onehalf = 750;
  20752. t.lessequal = 549;
  20753. t.ocircumflex = 500;
  20754. t.ntilde = 500;
  20755. t.Uhungarumlaut = 722;
  20756. t.Eacute = 611;
  20757. t.emacron = 444;
  20758. t.gbreve = 500;
  20759. t.onequarter = 750;
  20760. t.Scaron = 500;
  20761. t.Scommaaccent = 500;
  20762. t.Ohungarumlaut = 722;
  20763. t.degree = 400;
  20764. t.ograve = 500;
  20765. t.Ccaron = 667;
  20766. t.ugrave = 500;
  20767. t.radical = 453;
  20768. t.Dcaron = 722;
  20769. t.rcommaaccent = 389;
  20770. t.Ntilde = 667;
  20771. t.otilde = 500;
  20772. t.Rcommaaccent = 611;
  20773. t.Lcommaaccent = 556;
  20774. t.Atilde = 611;
  20775. t.Aogonek = 611;
  20776. t.Aring = 611;
  20777. t.Otilde = 722;
  20778. t.zdotaccent = 389;
  20779. t.Ecaron = 611;
  20780. t.Iogonek = 333;
  20781. t.kcommaaccent = 444;
  20782. t.minus = 675;
  20783. t.Icircumflex = 333;
  20784. t.ncaron = 500;
  20785. t.tcommaaccent = 278;
  20786. t.logicalnot = 675;
  20787. t.odieresis = 500;
  20788. t.udieresis = 500;
  20789. t.notequal = 549;
  20790. t.gcommaaccent = 500;
  20791. t.eth = 500;
  20792. t.zcaron = 389;
  20793. t.ncommaaccent = 500;
  20794. t.onesuperior = 300;
  20795. t.imacron = 278;
  20796. t.Euro = 500;
  20797. });
  20798. t.ZapfDingbats = getLookupTableFactory(function (t) {
  20799. t.space = 278;
  20800. t.a1 = 974;
  20801. t.a2 = 961;
  20802. t.a202 = 974;
  20803. t.a3 = 980;
  20804. t.a4 = 719;
  20805. t.a5 = 789;
  20806. t.a119 = 790;
  20807. t.a118 = 791;
  20808. t.a117 = 690;
  20809. t.a11 = 960;
  20810. t.a12 = 939;
  20811. t.a13 = 549;
  20812. t.a14 = 855;
  20813. t.a15 = 911;
  20814. t.a16 = 933;
  20815. t.a105 = 911;
  20816. t.a17 = 945;
  20817. t.a18 = 974;
  20818. t.a19 = 755;
  20819. t.a20 = 846;
  20820. t.a21 = 762;
  20821. t.a22 = 761;
  20822. t.a23 = 571;
  20823. t.a24 = 677;
  20824. t.a25 = 763;
  20825. t.a26 = 760;
  20826. t.a27 = 759;
  20827. t.a28 = 754;
  20828. t.a6 = 494;
  20829. t.a7 = 552;
  20830. t.a8 = 537;
  20831. t.a9 = 577;
  20832. t.a10 = 692;
  20833. t.a29 = 786;
  20834. t.a30 = 788;
  20835. t.a31 = 788;
  20836. t.a32 = 790;
  20837. t.a33 = 793;
  20838. t.a34 = 794;
  20839. t.a35 = 816;
  20840. t.a36 = 823;
  20841. t.a37 = 789;
  20842. t.a38 = 841;
  20843. t.a39 = 823;
  20844. t.a40 = 833;
  20845. t.a41 = 816;
  20846. t.a42 = 831;
  20847. t.a43 = 923;
  20848. t.a44 = 744;
  20849. t.a45 = 723;
  20850. t.a46 = 749;
  20851. t.a47 = 790;
  20852. t.a48 = 792;
  20853. t.a49 = 695;
  20854. t.a50 = 776;
  20855. t.a51 = 768;
  20856. t.a52 = 792;
  20857. t.a53 = 759;
  20858. t.a54 = 707;
  20859. t.a55 = 708;
  20860. t.a56 = 682;
  20861. t.a57 = 701;
  20862. t.a58 = 826;
  20863. t.a59 = 815;
  20864. t.a60 = 789;
  20865. t.a61 = 789;
  20866. t.a62 = 707;
  20867. t.a63 = 687;
  20868. t.a64 = 696;
  20869. t.a65 = 689;
  20870. t.a66 = 786;
  20871. t.a67 = 787;
  20872. t.a68 = 713;
  20873. t.a69 = 791;
  20874. t.a70 = 785;
  20875. t.a71 = 791;
  20876. t.a72 = 873;
  20877. t.a73 = 761;
  20878. t.a74 = 762;
  20879. t.a203 = 762;
  20880. t.a75 = 759;
  20881. t.a204 = 759;
  20882. t.a76 = 892;
  20883. t.a77 = 892;
  20884. t.a78 = 788;
  20885. t.a79 = 784;
  20886. t.a81 = 438;
  20887. t.a82 = 138;
  20888. t.a83 = 277;
  20889. t.a84 = 415;
  20890. t.a97 = 392;
  20891. t.a98 = 392;
  20892. t.a99 = 668;
  20893. t.a100 = 668;
  20894. t.a89 = 390;
  20895. t.a90 = 390;
  20896. t.a93 = 317;
  20897. t.a94 = 317;
  20898. t.a91 = 276;
  20899. t.a92 = 276;
  20900. t.a205 = 509;
  20901. t.a85 = 509;
  20902. t.a206 = 410;
  20903. t.a86 = 410;
  20904. t.a87 = 234;
  20905. t.a88 = 234;
  20906. t.a95 = 334;
  20907. t.a96 = 334;
  20908. t.a101 = 732;
  20909. t.a102 = 544;
  20910. t.a103 = 544;
  20911. t.a104 = 910;
  20912. t.a106 = 667;
  20913. t.a107 = 760;
  20914. t.a108 = 760;
  20915. t.a112 = 776;
  20916. t.a111 = 595;
  20917. t.a110 = 694;
  20918. t.a109 = 626;
  20919. t.a120 = 788;
  20920. t.a121 = 788;
  20921. t.a122 = 788;
  20922. t.a123 = 788;
  20923. t.a124 = 788;
  20924. t.a125 = 788;
  20925. t.a126 = 788;
  20926. t.a127 = 788;
  20927. t.a128 = 788;
  20928. t.a129 = 788;
  20929. t.a130 = 788;
  20930. t.a131 = 788;
  20931. t.a132 = 788;
  20932. t.a133 = 788;
  20933. t.a134 = 788;
  20934. t.a135 = 788;
  20935. t.a136 = 788;
  20936. t.a137 = 788;
  20937. t.a138 = 788;
  20938. t.a139 = 788;
  20939. t.a140 = 788;
  20940. t.a141 = 788;
  20941. t.a142 = 788;
  20942. t.a143 = 788;
  20943. t.a144 = 788;
  20944. t.a145 = 788;
  20945. t.a146 = 788;
  20946. t.a147 = 788;
  20947. t.a148 = 788;
  20948. t.a149 = 788;
  20949. t.a150 = 788;
  20950. t.a151 = 788;
  20951. t.a152 = 788;
  20952. t.a153 = 788;
  20953. t.a154 = 788;
  20954. t.a155 = 788;
  20955. t.a156 = 788;
  20956. t.a157 = 788;
  20957. t.a158 = 788;
  20958. t.a159 = 788;
  20959. t.a160 = 894;
  20960. t.a161 = 838;
  20961. t.a163 = 1016;
  20962. t.a164 = 458;
  20963. t.a196 = 748;
  20964. t.a165 = 924;
  20965. t.a192 = 748;
  20966. t.a166 = 918;
  20967. t.a167 = 927;
  20968. t.a168 = 928;
  20969. t.a169 = 928;
  20970. t.a170 = 834;
  20971. t.a171 = 873;
  20972. t.a172 = 828;
  20973. t.a173 = 924;
  20974. t.a162 = 924;
  20975. t.a174 = 917;
  20976. t.a175 = 930;
  20977. t.a176 = 931;
  20978. t.a177 = 463;
  20979. t.a178 = 883;
  20980. t.a179 = 836;
  20981. t.a193 = 836;
  20982. t.a180 = 867;
  20983. t.a199 = 867;
  20984. t.a181 = 696;
  20985. t.a200 = 696;
  20986. t.a182 = 874;
  20987. t.a201 = 874;
  20988. t.a183 = 760;
  20989. t.a184 = 946;
  20990. t.a197 = 771;
  20991. t.a185 = 865;
  20992. t.a194 = 771;
  20993. t.a198 = 888;
  20994. t.a186 = 967;
  20995. t.a195 = 888;
  20996. t.a187 = 831;
  20997. t.a188 = 873;
  20998. t.a189 = 927;
  20999. t.a190 = 970;
  21000. t.a191 = 918;
  21001. });
  21002. });
  21003. const getFontBasicMetrics = getLookupTableFactory(function (t) {
  21004. t.Courier = {
  21005. ascent: 629,
  21006. descent: -157,
  21007. capHeight: 562,
  21008. xHeight: -426
  21009. };
  21010. t["Courier-Bold"] = {
  21011. ascent: 629,
  21012. descent: -157,
  21013. capHeight: 562,
  21014. xHeight: 439
  21015. };
  21016. t["Courier-Oblique"] = {
  21017. ascent: 629,
  21018. descent: -157,
  21019. capHeight: 562,
  21020. xHeight: 426
  21021. };
  21022. t["Courier-BoldOblique"] = {
  21023. ascent: 629,
  21024. descent: -157,
  21025. capHeight: 562,
  21026. xHeight: 426
  21027. };
  21028. t.Helvetica = {
  21029. ascent: 718,
  21030. descent: -207,
  21031. capHeight: 718,
  21032. xHeight: 523
  21033. };
  21034. t["Helvetica-Bold"] = {
  21035. ascent: 718,
  21036. descent: -207,
  21037. capHeight: 718,
  21038. xHeight: 532
  21039. };
  21040. t["Helvetica-Oblique"] = {
  21041. ascent: 718,
  21042. descent: -207,
  21043. capHeight: 718,
  21044. xHeight: 523
  21045. };
  21046. t["Helvetica-BoldOblique"] = {
  21047. ascent: 718,
  21048. descent: -207,
  21049. capHeight: 718,
  21050. xHeight: 532
  21051. };
  21052. t["Times-Roman"] = {
  21053. ascent: 683,
  21054. descent: -217,
  21055. capHeight: 662,
  21056. xHeight: 450
  21057. };
  21058. t["Times-Bold"] = {
  21059. ascent: 683,
  21060. descent: -217,
  21061. capHeight: 676,
  21062. xHeight: 461
  21063. };
  21064. t["Times-Italic"] = {
  21065. ascent: 683,
  21066. descent: -217,
  21067. capHeight: 653,
  21068. xHeight: 441
  21069. };
  21070. t["Times-BoldItalic"] = {
  21071. ascent: 683,
  21072. descent: -217,
  21073. capHeight: 669,
  21074. xHeight: 462
  21075. };
  21076. t.Symbol = {
  21077. ascent: Math.NaN,
  21078. descent: Math.NaN,
  21079. capHeight: Math.NaN,
  21080. xHeight: Math.NaN
  21081. };
  21082. t.ZapfDingbats = {
  21083. ascent: Math.NaN,
  21084. descent: Math.NaN,
  21085. capHeight: Math.NaN,
  21086. xHeight: Math.NaN
  21087. };
  21088. });
  21089. ;// CONCATENATED MODULE: ./src/core/glyf.js
  21090. const ON_CURVE_POINT = 1 << 0;
  21091. const X_SHORT_VECTOR = 1 << 1;
  21092. const Y_SHORT_VECTOR = 1 << 2;
  21093. const REPEAT_FLAG = 1 << 3;
  21094. const X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR = 1 << 4;
  21095. const Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR = 1 << 5;
  21096. const OVERLAP_SIMPLE = 1 << 6;
  21097. const ARG_1_AND_2_ARE_WORDS = 1 << 0;
  21098. const ARGS_ARE_XY_VALUES = 1 << 1;
  21099. const WE_HAVE_A_SCALE = 1 << 3;
  21100. const MORE_COMPONENTS = 1 << 5;
  21101. const WE_HAVE_AN_X_AND_Y_SCALE = 1 << 6;
  21102. const WE_HAVE_A_TWO_BY_TWO = 1 << 7;
  21103. const WE_HAVE_INSTRUCTIONS = 1 << 8;
  21104. class GlyfTable {
  21105. constructor({
  21106. glyfTable,
  21107. isGlyphLocationsLong,
  21108. locaTable,
  21109. numGlyphs
  21110. }) {
  21111. this.glyphs = [];
  21112. const loca = new DataView(locaTable.buffer, locaTable.byteOffset, locaTable.byteLength);
  21113. const glyf = new DataView(glyfTable.buffer, glyfTable.byteOffset, glyfTable.byteLength);
  21114. const offsetSize = isGlyphLocationsLong ? 4 : 2;
  21115. let prev = isGlyphLocationsLong ? loca.getUint32(0) : 2 * loca.getUint16(0);
  21116. let pos = 0;
  21117. for (let i = 0; i < numGlyphs; i++) {
  21118. pos += offsetSize;
  21119. const next = isGlyphLocationsLong ? loca.getUint32(pos) : 2 * loca.getUint16(pos);
  21120. if (next === prev) {
  21121. this.glyphs.push(new Glyph({}));
  21122. continue;
  21123. }
  21124. const glyph = Glyph.parse(prev, glyf);
  21125. this.glyphs.push(glyph);
  21126. prev = next;
  21127. }
  21128. }
  21129. getSize() {
  21130. return this.glyphs.reduce((a, g) => {
  21131. const size = g.getSize();
  21132. return a + (size + 3 & ~3);
  21133. }, 0);
  21134. }
  21135. write() {
  21136. const totalSize = this.getSize();
  21137. const glyfTable = new DataView(new ArrayBuffer(totalSize));
  21138. const isLocationLong = totalSize > 0x1fffe;
  21139. const offsetSize = isLocationLong ? 4 : 2;
  21140. const locaTable = new DataView(new ArrayBuffer((this.glyphs.length + 1) * offsetSize));
  21141. if (isLocationLong) {
  21142. locaTable.setUint32(0, 0);
  21143. } else {
  21144. locaTable.setUint16(0, 0);
  21145. }
  21146. let pos = 0;
  21147. let locaIndex = 0;
  21148. for (const glyph of this.glyphs) {
  21149. pos += glyph.write(pos, glyfTable);
  21150. pos = pos + 3 & ~3;
  21151. locaIndex += offsetSize;
  21152. if (isLocationLong) {
  21153. locaTable.setUint32(locaIndex, pos);
  21154. } else {
  21155. locaTable.setUint16(locaIndex, pos >> 1);
  21156. }
  21157. }
  21158. return {
  21159. isLocationLong,
  21160. loca: new Uint8Array(locaTable.buffer),
  21161. glyf: new Uint8Array(glyfTable.buffer)
  21162. };
  21163. }
  21164. scale(factors) {
  21165. for (let i = 0, ii = this.glyphs.length; i < ii; i++) {
  21166. this.glyphs[i].scale(factors[i]);
  21167. }
  21168. }
  21169. }
  21170. class Glyph {
  21171. constructor({
  21172. header = null,
  21173. simple = null,
  21174. composites = null
  21175. }) {
  21176. this.header = header;
  21177. this.simple = simple;
  21178. this.composites = composites;
  21179. }
  21180. static parse(pos, glyf) {
  21181. const [read, header] = GlyphHeader.parse(pos, glyf);
  21182. pos += read;
  21183. if (header.numberOfContours < 0) {
  21184. const composites = [];
  21185. while (true) {
  21186. const [n, composite] = CompositeGlyph.parse(pos, glyf);
  21187. pos += n;
  21188. composites.push(composite);
  21189. if (!(composite.flags & MORE_COMPONENTS)) {
  21190. break;
  21191. }
  21192. }
  21193. return new Glyph({
  21194. header,
  21195. composites
  21196. });
  21197. }
  21198. const simple = SimpleGlyph.parse(pos, glyf, header.numberOfContours);
  21199. return new Glyph({
  21200. header,
  21201. simple
  21202. });
  21203. }
  21204. getSize() {
  21205. if (!this.header) {
  21206. return 0;
  21207. }
  21208. const size = this.simple ? this.simple.getSize() : this.composites.reduce((a, c) => a + c.getSize(), 0);
  21209. return this.header.getSize() + size;
  21210. }
  21211. write(pos, buf) {
  21212. if (!this.header) {
  21213. return 0;
  21214. }
  21215. const spos = pos;
  21216. pos += this.header.write(pos, buf);
  21217. if (this.simple) {
  21218. pos += this.simple.write(pos, buf);
  21219. } else {
  21220. for (const composite of this.composites) {
  21221. pos += composite.write(pos, buf);
  21222. }
  21223. }
  21224. return pos - spos;
  21225. }
  21226. scale(factor) {
  21227. if (!this.header) {
  21228. return;
  21229. }
  21230. const xMiddle = (this.header.xMin + this.header.xMax) / 2;
  21231. this.header.scale(xMiddle, factor);
  21232. if (this.simple) {
  21233. this.simple.scale(xMiddle, factor);
  21234. } else {
  21235. for (const composite of this.composites) {
  21236. composite.scale(xMiddle, factor);
  21237. }
  21238. }
  21239. }
  21240. }
  21241. class GlyphHeader {
  21242. constructor({
  21243. numberOfContours,
  21244. xMin,
  21245. yMin,
  21246. xMax,
  21247. yMax
  21248. }) {
  21249. this.numberOfContours = numberOfContours;
  21250. this.xMin = xMin;
  21251. this.yMin = yMin;
  21252. this.xMax = xMax;
  21253. this.yMax = yMax;
  21254. }
  21255. static parse(pos, glyf) {
  21256. return [10, new GlyphHeader({
  21257. numberOfContours: glyf.getInt16(pos),
  21258. xMin: glyf.getInt16(pos + 2),
  21259. yMin: glyf.getInt16(pos + 4),
  21260. xMax: glyf.getInt16(pos + 6),
  21261. yMax: glyf.getInt16(pos + 8)
  21262. })];
  21263. }
  21264. getSize() {
  21265. return 10;
  21266. }
  21267. write(pos, buf) {
  21268. buf.setInt16(pos, this.numberOfContours);
  21269. buf.setInt16(pos + 2, this.xMin);
  21270. buf.setInt16(pos + 4, this.yMin);
  21271. buf.setInt16(pos + 6, this.xMax);
  21272. buf.setInt16(pos + 8, this.yMax);
  21273. return 10;
  21274. }
  21275. scale(x, factor) {
  21276. this.xMin = Math.round(x + (this.xMin - x) * factor);
  21277. this.xMax = Math.round(x + (this.xMax - x) * factor);
  21278. }
  21279. }
  21280. class Contour {
  21281. constructor({
  21282. flags,
  21283. xCoordinates,
  21284. yCoordinates
  21285. }) {
  21286. this.xCoordinates = xCoordinates;
  21287. this.yCoordinates = yCoordinates;
  21288. this.flags = flags;
  21289. }
  21290. }
  21291. class SimpleGlyph {
  21292. constructor({
  21293. contours,
  21294. instructions
  21295. }) {
  21296. this.contours = contours;
  21297. this.instructions = instructions;
  21298. }
  21299. static parse(pos, glyf, numberOfContours) {
  21300. const endPtsOfContours = [];
  21301. for (let i = 0; i < numberOfContours; i++) {
  21302. const endPt = glyf.getUint16(pos);
  21303. pos += 2;
  21304. endPtsOfContours.push(endPt);
  21305. }
  21306. const numberOfPt = endPtsOfContours[numberOfContours - 1] + 1;
  21307. const instructionLength = glyf.getUint16(pos);
  21308. pos += 2;
  21309. const instructions = new Uint8Array(glyf).slice(pos, pos + instructionLength);
  21310. pos += instructionLength;
  21311. const flags = [];
  21312. for (let i = 0; i < numberOfPt; pos++, i++) {
  21313. let flag = glyf.getUint8(pos);
  21314. flags.push(flag);
  21315. if (flag & REPEAT_FLAG) {
  21316. const count = glyf.getUint8(++pos);
  21317. flag ^= REPEAT_FLAG;
  21318. for (let m = 0; m < count; m++) {
  21319. flags.push(flag);
  21320. }
  21321. i += count;
  21322. }
  21323. }
  21324. const allXCoordinates = [];
  21325. let xCoordinates = [];
  21326. let yCoordinates = [];
  21327. let pointFlags = [];
  21328. const contours = [];
  21329. let endPtsOfContoursIndex = 0;
  21330. let lastCoordinate = 0;
  21331. for (let i = 0; i < numberOfPt; i++) {
  21332. const flag = flags[i];
  21333. if (flag & X_SHORT_VECTOR) {
  21334. const x = glyf.getUint8(pos++);
  21335. lastCoordinate += flag & X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR ? x : -x;
  21336. xCoordinates.push(lastCoordinate);
  21337. } else if (flag & X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR) {
  21338. xCoordinates.push(lastCoordinate);
  21339. } else {
  21340. lastCoordinate += glyf.getInt16(pos);
  21341. pos += 2;
  21342. xCoordinates.push(lastCoordinate);
  21343. }
  21344. if (endPtsOfContours[endPtsOfContoursIndex] === i) {
  21345. endPtsOfContoursIndex++;
  21346. allXCoordinates.push(xCoordinates);
  21347. xCoordinates = [];
  21348. }
  21349. }
  21350. lastCoordinate = 0;
  21351. endPtsOfContoursIndex = 0;
  21352. for (let i = 0; i < numberOfPt; i++) {
  21353. const flag = flags[i];
  21354. if (flag & Y_SHORT_VECTOR) {
  21355. const y = glyf.getUint8(pos++);
  21356. lastCoordinate += flag & Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR ? y : -y;
  21357. yCoordinates.push(lastCoordinate);
  21358. } else if (flag & Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR) {
  21359. yCoordinates.push(lastCoordinate);
  21360. } else {
  21361. lastCoordinate += glyf.getInt16(pos);
  21362. pos += 2;
  21363. yCoordinates.push(lastCoordinate);
  21364. }
  21365. pointFlags.push(flag & ON_CURVE_POINT | flag & OVERLAP_SIMPLE);
  21366. if (endPtsOfContours[endPtsOfContoursIndex] === i) {
  21367. xCoordinates = allXCoordinates[endPtsOfContoursIndex];
  21368. endPtsOfContoursIndex++;
  21369. contours.push(new Contour({
  21370. flags: pointFlags,
  21371. xCoordinates,
  21372. yCoordinates
  21373. }));
  21374. yCoordinates = [];
  21375. pointFlags = [];
  21376. }
  21377. }
  21378. return new SimpleGlyph({
  21379. contours,
  21380. instructions
  21381. });
  21382. }
  21383. getSize() {
  21384. let size = this.contours.length * 2 + 2 + this.instructions.length;
  21385. let lastX = 0;
  21386. let lastY = 0;
  21387. for (const contour of this.contours) {
  21388. size += contour.flags.length;
  21389. for (let i = 0, ii = contour.xCoordinates.length; i < ii; i++) {
  21390. const x = contour.xCoordinates[i];
  21391. const y = contour.yCoordinates[i];
  21392. let abs = Math.abs(x - lastX);
  21393. if (abs > 255) {
  21394. size += 2;
  21395. } else if (abs > 0) {
  21396. size += 1;
  21397. }
  21398. lastX = x;
  21399. abs = Math.abs(y - lastY);
  21400. if (abs > 255) {
  21401. size += 2;
  21402. } else if (abs > 0) {
  21403. size += 1;
  21404. }
  21405. lastY = y;
  21406. }
  21407. }
  21408. return size;
  21409. }
  21410. write(pos, buf) {
  21411. const spos = pos;
  21412. const xCoordinates = [];
  21413. const yCoordinates = [];
  21414. const flags = [];
  21415. let lastX = 0;
  21416. let lastY = 0;
  21417. for (const contour of this.contours) {
  21418. for (let i = 0, ii = contour.xCoordinates.length; i < ii; i++) {
  21419. let flag = contour.flags[i];
  21420. const x = contour.xCoordinates[i];
  21421. let delta = x - lastX;
  21422. if (delta === 0) {
  21423. flag |= X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR;
  21424. xCoordinates.push(0);
  21425. } else {
  21426. const abs = Math.abs(delta);
  21427. if (abs <= 255) {
  21428. flag |= delta >= 0 ? X_SHORT_VECTOR | X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR : X_SHORT_VECTOR;
  21429. xCoordinates.push(abs);
  21430. } else {
  21431. xCoordinates.push(delta);
  21432. }
  21433. }
  21434. lastX = x;
  21435. const y = contour.yCoordinates[i];
  21436. delta = y - lastY;
  21437. if (delta === 0) {
  21438. flag |= Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR;
  21439. yCoordinates.push(0);
  21440. } else {
  21441. const abs = Math.abs(delta);
  21442. if (abs <= 255) {
  21443. flag |= delta >= 0 ? Y_SHORT_VECTOR | Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR : Y_SHORT_VECTOR;
  21444. yCoordinates.push(abs);
  21445. } else {
  21446. yCoordinates.push(delta);
  21447. }
  21448. }
  21449. lastY = y;
  21450. flags.push(flag);
  21451. }
  21452. buf.setUint16(pos, xCoordinates.length - 1);
  21453. pos += 2;
  21454. }
  21455. buf.setUint16(pos, this.instructions.length);
  21456. pos += 2;
  21457. if (this.instructions.length) {
  21458. new Uint8Array(buf.buffer, 0, buf.buffer.byteLength).set(this.instructions, pos);
  21459. pos += this.instructions.length;
  21460. }
  21461. for (const flag of flags) {
  21462. buf.setUint8(pos++, flag);
  21463. }
  21464. for (let i = 0, ii = xCoordinates.length; i < ii; i++) {
  21465. const x = xCoordinates[i];
  21466. const flag = flags[i];
  21467. if (flag & X_SHORT_VECTOR) {
  21468. buf.setUint8(pos++, x);
  21469. } else if (!(flag & X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR)) {
  21470. buf.setInt16(pos, x);
  21471. pos += 2;
  21472. }
  21473. }
  21474. for (let i = 0, ii = yCoordinates.length; i < ii; i++) {
  21475. const y = yCoordinates[i];
  21476. const flag = flags[i];
  21477. if (flag & Y_SHORT_VECTOR) {
  21478. buf.setUint8(pos++, y);
  21479. } else if (!(flag & Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR)) {
  21480. buf.setInt16(pos, y);
  21481. pos += 2;
  21482. }
  21483. }
  21484. return pos - spos;
  21485. }
  21486. scale(x, factor) {
  21487. for (const contour of this.contours) {
  21488. if (contour.xCoordinates.length === 0) {
  21489. continue;
  21490. }
  21491. for (let i = 0, ii = contour.xCoordinates.length; i < ii; i++) {
  21492. contour.xCoordinates[i] = Math.round(x + (contour.xCoordinates[i] - x) * factor);
  21493. }
  21494. }
  21495. }
  21496. }
  21497. class CompositeGlyph {
  21498. constructor({
  21499. flags,
  21500. glyphIndex,
  21501. argument1,
  21502. argument2,
  21503. transf,
  21504. instructions
  21505. }) {
  21506. this.flags = flags;
  21507. this.glyphIndex = glyphIndex;
  21508. this.argument1 = argument1;
  21509. this.argument2 = argument2;
  21510. this.transf = transf;
  21511. this.instructions = instructions;
  21512. }
  21513. static parse(pos, glyf) {
  21514. const spos = pos;
  21515. const transf = [];
  21516. let flags = glyf.getUint16(pos);
  21517. const glyphIndex = glyf.getUint16(pos + 2);
  21518. pos += 4;
  21519. let argument1, argument2;
  21520. if (flags & ARG_1_AND_2_ARE_WORDS) {
  21521. if (flags & ARGS_ARE_XY_VALUES) {
  21522. argument1 = glyf.getInt16(pos);
  21523. argument2 = glyf.getInt16(pos + 2);
  21524. } else {
  21525. argument1 = glyf.getUint16(pos);
  21526. argument2 = glyf.getUint16(pos + 2);
  21527. }
  21528. pos += 4;
  21529. flags ^= ARG_1_AND_2_ARE_WORDS;
  21530. } else {
  21531. if (flags & ARGS_ARE_XY_VALUES) {
  21532. argument1 = glyf.getInt8(pos);
  21533. argument2 = glyf.getInt8(pos + 1);
  21534. } else {
  21535. argument1 = glyf.getUint8(pos);
  21536. argument2 = glyf.getUint8(pos + 1);
  21537. }
  21538. pos += 2;
  21539. }
  21540. if (flags & WE_HAVE_A_SCALE) {
  21541. transf.push(glyf.getUint16(pos));
  21542. pos += 2;
  21543. } else if (flags & WE_HAVE_AN_X_AND_Y_SCALE) {
  21544. transf.push(glyf.getUint16(pos), glyf.getUint16(pos + 2));
  21545. pos += 4;
  21546. } else if (flags & WE_HAVE_A_TWO_BY_TWO) {
  21547. transf.push(glyf.getUint16(pos), glyf.getUint16(pos + 2), glyf.getUint16(pos + 4), glyf.getUint16(pos + 6));
  21548. pos += 8;
  21549. }
  21550. let instructions = null;
  21551. if (flags & WE_HAVE_INSTRUCTIONS) {
  21552. const instructionLength = glyf.getUint16(pos);
  21553. pos += 2;
  21554. instructions = new Uint8Array(glyf).slice(pos, pos + instructionLength);
  21555. pos += instructionLength;
  21556. }
  21557. return [pos - spos, new CompositeGlyph({
  21558. flags,
  21559. glyphIndex,
  21560. argument1,
  21561. argument2,
  21562. transf,
  21563. instructions
  21564. })];
  21565. }
  21566. getSize() {
  21567. let size = 2 + 2 + this.transf.length * 2;
  21568. if (this.flags & WE_HAVE_INSTRUCTIONS) {
  21569. size += 2 + this.instructions.length;
  21570. }
  21571. size += 2;
  21572. if (this.flags & 2) {
  21573. if (!(this.argument1 >= -128 && this.argument1 <= 127 && this.argument2 >= -128 && this.argument2 <= 127)) {
  21574. size += 2;
  21575. }
  21576. } else if (!(this.argument1 >= 0 && this.argument1 <= 255 && this.argument2 >= 0 && this.argument2 <= 255)) {
  21577. size += 2;
  21578. }
  21579. return size;
  21580. }
  21581. write(pos, buf) {
  21582. const spos = pos;
  21583. if (this.flags & ARGS_ARE_XY_VALUES) {
  21584. if (!(this.argument1 >= -128 && this.argument1 <= 127 && this.argument2 >= -128 && this.argument2 <= 127)) {
  21585. this.flags |= ARG_1_AND_2_ARE_WORDS;
  21586. }
  21587. } else if (!(this.argument1 >= 0 && this.argument1 <= 255 && this.argument2 >= 0 && this.argument2 <= 255)) {
  21588. this.flags |= ARG_1_AND_2_ARE_WORDS;
  21589. }
  21590. buf.setUint16(pos, this.flags);
  21591. buf.setUint16(pos + 2, this.glyphIndex);
  21592. pos += 4;
  21593. if (this.flags & ARG_1_AND_2_ARE_WORDS) {
  21594. if (this.flags & ARGS_ARE_XY_VALUES) {
  21595. buf.setInt16(pos, this.argument1);
  21596. buf.setInt16(pos + 2, this.argument2);
  21597. } else {
  21598. buf.setUint16(pos, this.argument1);
  21599. buf.setUint16(pos + 2, this.argument2);
  21600. }
  21601. pos += 4;
  21602. } else {
  21603. buf.setUint8(pos, this.argument1);
  21604. buf.setUint8(pos + 1, this.argument2);
  21605. pos += 2;
  21606. }
  21607. if (this.flags & WE_HAVE_INSTRUCTIONS) {
  21608. buf.setUint16(pos, this.instructions.length);
  21609. pos += 2;
  21610. if (this.instructions.length) {
  21611. new Uint8Array(buf.buffer, 0, buf.buffer.byteLength).set(this.instructions, pos);
  21612. pos += this.instructions.length;
  21613. }
  21614. }
  21615. return pos - spos;
  21616. }
  21617. scale(x, factor) {}
  21618. }
  21619. ;// CONCATENATED MODULE: ./src/core/opentype_file_builder.js
  21620. function writeInt16(dest, offset, num) {
  21621. dest[offset] = num >> 8 & 0xff;
  21622. dest[offset + 1] = num & 0xff;
  21623. }
  21624. function writeInt32(dest, offset, num) {
  21625. dest[offset] = num >> 24 & 0xff;
  21626. dest[offset + 1] = num >> 16 & 0xff;
  21627. dest[offset + 2] = num >> 8 & 0xff;
  21628. dest[offset + 3] = num & 0xff;
  21629. }
  21630. function writeData(dest, offset, data) {
  21631. if (data instanceof Uint8Array) {
  21632. dest.set(data, offset);
  21633. } else if (typeof data === "string") {
  21634. for (let i = 0, ii = data.length; i < ii; i++) {
  21635. dest[offset++] = data.charCodeAt(i) & 0xff;
  21636. }
  21637. } else {
  21638. for (const num of data) {
  21639. dest[offset++] = num & 0xff;
  21640. }
  21641. }
  21642. }
  21643. const OTF_HEADER_SIZE = 12;
  21644. const OTF_TABLE_ENTRY_SIZE = 16;
  21645. class OpenTypeFileBuilder {
  21646. constructor(sfnt) {
  21647. this.sfnt = sfnt;
  21648. this.tables = Object.create(null);
  21649. }
  21650. static getSearchParams(entriesCount, entrySize) {
  21651. let maxPower2 = 1,
  21652. log2 = 0;
  21653. while ((maxPower2 ^ entriesCount) > maxPower2) {
  21654. maxPower2 <<= 1;
  21655. log2++;
  21656. }
  21657. const searchRange = maxPower2 * entrySize;
  21658. return {
  21659. range: searchRange,
  21660. entry: log2,
  21661. rangeShift: entrySize * entriesCount - searchRange
  21662. };
  21663. }
  21664. toArray() {
  21665. let sfnt = this.sfnt;
  21666. const tables = this.tables;
  21667. const tablesNames = Object.keys(tables);
  21668. tablesNames.sort();
  21669. const numTables = tablesNames.length;
  21670. let i, j, jj, table, tableName;
  21671. let offset = OTF_HEADER_SIZE + numTables * OTF_TABLE_ENTRY_SIZE;
  21672. const tableOffsets = [offset];
  21673. for (i = 0; i < numTables; i++) {
  21674. table = tables[tablesNames[i]];
  21675. const paddedLength = (table.length + 3 & ~3) >>> 0;
  21676. offset += paddedLength;
  21677. tableOffsets.push(offset);
  21678. }
  21679. const file = new Uint8Array(offset);
  21680. for (i = 0; i < numTables; i++) {
  21681. table = tables[tablesNames[i]];
  21682. writeData(file, tableOffsets[i], table);
  21683. }
  21684. if (sfnt === "true") {
  21685. sfnt = string32(0x00010000);
  21686. }
  21687. file[0] = sfnt.charCodeAt(0) & 0xff;
  21688. file[1] = sfnt.charCodeAt(1) & 0xff;
  21689. file[2] = sfnt.charCodeAt(2) & 0xff;
  21690. file[3] = sfnt.charCodeAt(3) & 0xff;
  21691. writeInt16(file, 4, numTables);
  21692. const searchParams = OpenTypeFileBuilder.getSearchParams(numTables, 16);
  21693. writeInt16(file, 6, searchParams.range);
  21694. writeInt16(file, 8, searchParams.entry);
  21695. writeInt16(file, 10, searchParams.rangeShift);
  21696. offset = OTF_HEADER_SIZE;
  21697. for (i = 0; i < numTables; i++) {
  21698. tableName = tablesNames[i];
  21699. file[offset] = tableName.charCodeAt(0) & 0xff;
  21700. file[offset + 1] = tableName.charCodeAt(1) & 0xff;
  21701. file[offset + 2] = tableName.charCodeAt(2) & 0xff;
  21702. file[offset + 3] = tableName.charCodeAt(3) & 0xff;
  21703. let checksum = 0;
  21704. for (j = tableOffsets[i], jj = tableOffsets[i + 1]; j < jj; j += 4) {
  21705. const quad = readUint32(file, j);
  21706. checksum = checksum + quad >>> 0;
  21707. }
  21708. writeInt32(file, offset + 4, checksum);
  21709. writeInt32(file, offset + 8, tableOffsets[i]);
  21710. writeInt32(file, offset + 12, tables[tableName].length);
  21711. offset += OTF_TABLE_ENTRY_SIZE;
  21712. }
  21713. return file;
  21714. }
  21715. addTable(tag, data) {
  21716. if (tag in this.tables) {
  21717. throw new Error("Table " + tag + " already exists");
  21718. }
  21719. this.tables[tag] = data;
  21720. }
  21721. }
  21722. ;// CONCATENATED MODULE: ./src/core/type1_parser.js
  21723. const HINTING_ENABLED = false;
  21724. const COMMAND_MAP = {
  21725. hstem: [1],
  21726. vstem: [3],
  21727. vmoveto: [4],
  21728. rlineto: [5],
  21729. hlineto: [6],
  21730. vlineto: [7],
  21731. rrcurveto: [8],
  21732. callsubr: [10],
  21733. flex: [12, 35],
  21734. drop: [12, 18],
  21735. endchar: [14],
  21736. rmoveto: [21],
  21737. hmoveto: [22],
  21738. vhcurveto: [30],
  21739. hvcurveto: [31]
  21740. };
  21741. class Type1CharString {
  21742. constructor() {
  21743. this.width = 0;
  21744. this.lsb = 0;
  21745. this.flexing = false;
  21746. this.output = [];
  21747. this.stack = [];
  21748. }
  21749. convert(encoded, subrs, seacAnalysisEnabled) {
  21750. const count = encoded.length;
  21751. let error = false;
  21752. let wx, sbx, subrNumber;
  21753. for (let i = 0; i < count; i++) {
  21754. let value = encoded[i];
  21755. if (value < 32) {
  21756. if (value === 12) {
  21757. value = (value << 8) + encoded[++i];
  21758. }
  21759. switch (value) {
  21760. case 1:
  21761. if (!HINTING_ENABLED) {
  21762. this.stack = [];
  21763. break;
  21764. }
  21765. error = this.executeCommand(2, COMMAND_MAP.hstem);
  21766. break;
  21767. case 3:
  21768. if (!HINTING_ENABLED) {
  21769. this.stack = [];
  21770. break;
  21771. }
  21772. error = this.executeCommand(2, COMMAND_MAP.vstem);
  21773. break;
  21774. case 4:
  21775. if (this.flexing) {
  21776. if (this.stack.length < 1) {
  21777. error = true;
  21778. break;
  21779. }
  21780. const dy = this.stack.pop();
  21781. this.stack.push(0, dy);
  21782. break;
  21783. }
  21784. error = this.executeCommand(1, COMMAND_MAP.vmoveto);
  21785. break;
  21786. case 5:
  21787. error = this.executeCommand(2, COMMAND_MAP.rlineto);
  21788. break;
  21789. case 6:
  21790. error = this.executeCommand(1, COMMAND_MAP.hlineto);
  21791. break;
  21792. case 7:
  21793. error = this.executeCommand(1, COMMAND_MAP.vlineto);
  21794. break;
  21795. case 8:
  21796. error = this.executeCommand(6, COMMAND_MAP.rrcurveto);
  21797. break;
  21798. case 9:
  21799. this.stack = [];
  21800. break;
  21801. case 10:
  21802. if (this.stack.length < 1) {
  21803. error = true;
  21804. break;
  21805. }
  21806. subrNumber = this.stack.pop();
  21807. if (!subrs[subrNumber]) {
  21808. error = true;
  21809. break;
  21810. }
  21811. error = this.convert(subrs[subrNumber], subrs, seacAnalysisEnabled);
  21812. break;
  21813. case 11:
  21814. return error;
  21815. case 13:
  21816. if (this.stack.length < 2) {
  21817. error = true;
  21818. break;
  21819. }
  21820. wx = this.stack.pop();
  21821. sbx = this.stack.pop();
  21822. this.lsb = sbx;
  21823. this.width = wx;
  21824. this.stack.push(wx, sbx);
  21825. error = this.executeCommand(2, COMMAND_MAP.hmoveto);
  21826. break;
  21827. case 14:
  21828. this.output.push(COMMAND_MAP.endchar[0]);
  21829. break;
  21830. case 21:
  21831. if (this.flexing) {
  21832. break;
  21833. }
  21834. error = this.executeCommand(2, COMMAND_MAP.rmoveto);
  21835. break;
  21836. case 22:
  21837. if (this.flexing) {
  21838. this.stack.push(0);
  21839. break;
  21840. }
  21841. error = this.executeCommand(1, COMMAND_MAP.hmoveto);
  21842. break;
  21843. case 30:
  21844. error = this.executeCommand(4, COMMAND_MAP.vhcurveto);
  21845. break;
  21846. case 31:
  21847. error = this.executeCommand(4, COMMAND_MAP.hvcurveto);
  21848. break;
  21849. case (12 << 8) + 0:
  21850. this.stack = [];
  21851. break;
  21852. case (12 << 8) + 1:
  21853. if (!HINTING_ENABLED) {
  21854. this.stack = [];
  21855. break;
  21856. }
  21857. error = this.executeCommand(2, COMMAND_MAP.vstem);
  21858. break;
  21859. case (12 << 8) + 2:
  21860. if (!HINTING_ENABLED) {
  21861. this.stack = [];
  21862. break;
  21863. }
  21864. error = this.executeCommand(2, COMMAND_MAP.hstem);
  21865. break;
  21866. case (12 << 8) + 6:
  21867. if (seacAnalysisEnabled) {
  21868. const asb = this.stack.at(-5);
  21869. this.seac = this.stack.splice(-4, 4);
  21870. this.seac[0] += this.lsb - asb;
  21871. error = this.executeCommand(0, COMMAND_MAP.endchar);
  21872. } else {
  21873. error = this.executeCommand(4, COMMAND_MAP.endchar);
  21874. }
  21875. break;
  21876. case (12 << 8) + 7:
  21877. if (this.stack.length < 4) {
  21878. error = true;
  21879. break;
  21880. }
  21881. this.stack.pop();
  21882. wx = this.stack.pop();
  21883. const sby = this.stack.pop();
  21884. sbx = this.stack.pop();
  21885. this.lsb = sbx;
  21886. this.width = wx;
  21887. this.stack.push(wx, sbx, sby);
  21888. error = this.executeCommand(3, COMMAND_MAP.rmoveto);
  21889. break;
  21890. case (12 << 8) + 12:
  21891. if (this.stack.length < 2) {
  21892. error = true;
  21893. break;
  21894. }
  21895. const num2 = this.stack.pop();
  21896. const num1 = this.stack.pop();
  21897. this.stack.push(num1 / num2);
  21898. break;
  21899. case (12 << 8) + 16:
  21900. if (this.stack.length < 2) {
  21901. error = true;
  21902. break;
  21903. }
  21904. subrNumber = this.stack.pop();
  21905. const numArgs = this.stack.pop();
  21906. if (subrNumber === 0 && numArgs === 3) {
  21907. const flexArgs = this.stack.splice(-17, 17);
  21908. 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]);
  21909. error = this.executeCommand(13, COMMAND_MAP.flex, true);
  21910. this.flexing = false;
  21911. this.stack.push(flexArgs[15], flexArgs[16]);
  21912. } else if (subrNumber === 1 && numArgs === 0) {
  21913. this.flexing = true;
  21914. }
  21915. break;
  21916. case (12 << 8) + 17:
  21917. break;
  21918. case (12 << 8) + 33:
  21919. this.stack = [];
  21920. break;
  21921. default:
  21922. warn('Unknown type 1 charstring command of "' + value + '"');
  21923. break;
  21924. }
  21925. if (error) {
  21926. break;
  21927. }
  21928. continue;
  21929. } else if (value <= 246) {
  21930. value -= 139;
  21931. } else if (value <= 250) {
  21932. value = (value - 247) * 256 + encoded[++i] + 108;
  21933. } else if (value <= 254) {
  21934. value = -((value - 251) * 256) - encoded[++i] - 108;
  21935. } else {
  21936. value = (encoded[++i] & 0xff) << 24 | (encoded[++i] & 0xff) << 16 | (encoded[++i] & 0xff) << 8 | (encoded[++i] & 0xff) << 0;
  21937. }
  21938. this.stack.push(value);
  21939. }
  21940. return error;
  21941. }
  21942. executeCommand(howManyArgs, command, keepStack) {
  21943. const stackLength = this.stack.length;
  21944. if (howManyArgs > stackLength) {
  21945. return true;
  21946. }
  21947. const start = stackLength - howManyArgs;
  21948. for (let i = start; i < stackLength; i++) {
  21949. let value = this.stack[i];
  21950. if (Number.isInteger(value)) {
  21951. this.output.push(28, value >> 8 & 0xff, value & 0xff);
  21952. } else {
  21953. value = 65536 * value | 0;
  21954. this.output.push(255, value >> 24 & 0xff, value >> 16 & 0xff, value >> 8 & 0xff, value & 0xff);
  21955. }
  21956. }
  21957. this.output.push(...command);
  21958. if (keepStack) {
  21959. this.stack.splice(start, howManyArgs);
  21960. } else {
  21961. this.stack.length = 0;
  21962. }
  21963. return false;
  21964. }
  21965. }
  21966. const EEXEC_ENCRYPT_KEY = 55665;
  21967. const CHAR_STRS_ENCRYPT_KEY = 4330;
  21968. function isHexDigit(code) {
  21969. return code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102;
  21970. }
  21971. function decrypt(data, key, discardNumber) {
  21972. if (discardNumber >= data.length) {
  21973. return new Uint8Array(0);
  21974. }
  21975. const c1 = 52845,
  21976. c2 = 22719;
  21977. let r = key | 0,
  21978. i,
  21979. j;
  21980. for (i = 0; i < discardNumber; i++) {
  21981. r = (data[i] + r) * c1 + c2 & (1 << 16) - 1;
  21982. }
  21983. const count = data.length - discardNumber;
  21984. const decrypted = new Uint8Array(count);
  21985. for (i = discardNumber, j = 0; j < count; i++, j++) {
  21986. const value = data[i];
  21987. decrypted[j] = value ^ r >> 8;
  21988. r = (value + r) * c1 + c2 & (1 << 16) - 1;
  21989. }
  21990. return decrypted;
  21991. }
  21992. function decryptAscii(data, key, discardNumber) {
  21993. const c1 = 52845,
  21994. c2 = 22719;
  21995. let r = key | 0;
  21996. const count = data.length,
  21997. maybeLength = count >>> 1;
  21998. const decrypted = new Uint8Array(maybeLength);
  21999. let i, j;
  22000. for (i = 0, j = 0; i < count; i++) {
  22001. const digit1 = data[i];
  22002. if (!isHexDigit(digit1)) {
  22003. continue;
  22004. }
  22005. i++;
  22006. let digit2;
  22007. while (i < count && !isHexDigit(digit2 = data[i])) {
  22008. i++;
  22009. }
  22010. if (i < count) {
  22011. const value = parseInt(String.fromCharCode(digit1, digit2), 16);
  22012. decrypted[j++] = value ^ r >> 8;
  22013. r = (value + r) * c1 + c2 & (1 << 16) - 1;
  22014. }
  22015. }
  22016. return decrypted.slice(discardNumber, j);
  22017. }
  22018. function isSpecial(c) {
  22019. return c === 0x2f || c === 0x5b || c === 0x5d || c === 0x7b || c === 0x7d || c === 0x28 || c === 0x29;
  22020. }
  22021. class Type1Parser {
  22022. constructor(stream, encrypted, seacAnalysisEnabled) {
  22023. if (encrypted) {
  22024. const data = stream.getBytes();
  22025. 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]));
  22026. stream = new Stream(isBinary ? decrypt(data, EEXEC_ENCRYPT_KEY, 4) : decryptAscii(data, EEXEC_ENCRYPT_KEY, 4));
  22027. }
  22028. this.seacAnalysisEnabled = !!seacAnalysisEnabled;
  22029. this.stream = stream;
  22030. this.nextChar();
  22031. }
  22032. readNumberArray() {
  22033. this.getToken();
  22034. const array = [];
  22035. while (true) {
  22036. const token = this.getToken();
  22037. if (token === null || token === "]" || token === "}") {
  22038. break;
  22039. }
  22040. array.push(parseFloat(token || 0));
  22041. }
  22042. return array;
  22043. }
  22044. readNumber() {
  22045. const token = this.getToken();
  22046. return parseFloat(token || 0);
  22047. }
  22048. readInt() {
  22049. const token = this.getToken();
  22050. return parseInt(token || 0, 10) | 0;
  22051. }
  22052. readBoolean() {
  22053. const token = this.getToken();
  22054. return token === "true" ? 1 : 0;
  22055. }
  22056. nextChar() {
  22057. return this.currentChar = this.stream.getByte();
  22058. }
  22059. prevChar() {
  22060. this.stream.skip(-2);
  22061. return this.currentChar = this.stream.getByte();
  22062. }
  22063. getToken() {
  22064. let comment = false;
  22065. let ch = this.currentChar;
  22066. while (true) {
  22067. if (ch === -1) {
  22068. return null;
  22069. }
  22070. if (comment) {
  22071. if (ch === 0x0a || ch === 0x0d) {
  22072. comment = false;
  22073. }
  22074. } else if (ch === 0x25) {
  22075. comment = true;
  22076. } else if (!isWhiteSpace(ch)) {
  22077. break;
  22078. }
  22079. ch = this.nextChar();
  22080. }
  22081. if (isSpecial(ch)) {
  22082. this.nextChar();
  22083. return String.fromCharCode(ch);
  22084. }
  22085. let token = "";
  22086. do {
  22087. token += String.fromCharCode(ch);
  22088. ch = this.nextChar();
  22089. } while (ch >= 0 && !isWhiteSpace(ch) && !isSpecial(ch));
  22090. return token;
  22091. }
  22092. readCharStrings(bytes, lenIV) {
  22093. if (lenIV === -1) {
  22094. return bytes;
  22095. }
  22096. return decrypt(bytes, CHAR_STRS_ENCRYPT_KEY, lenIV);
  22097. }
  22098. extractFontProgram(properties) {
  22099. const stream = this.stream;
  22100. const subrs = [],
  22101. charstrings = [];
  22102. const privateData = Object.create(null);
  22103. privateData.lenIV = 4;
  22104. const program = {
  22105. subrs: [],
  22106. charstrings: [],
  22107. properties: {
  22108. privateData
  22109. }
  22110. };
  22111. let token, length, data, lenIV;
  22112. while ((token = this.getToken()) !== null) {
  22113. if (token !== "/") {
  22114. continue;
  22115. }
  22116. token = this.getToken();
  22117. switch (token) {
  22118. case "CharStrings":
  22119. this.getToken();
  22120. this.getToken();
  22121. this.getToken();
  22122. this.getToken();
  22123. while (true) {
  22124. token = this.getToken();
  22125. if (token === null || token === "end") {
  22126. break;
  22127. }
  22128. if (token !== "/") {
  22129. continue;
  22130. }
  22131. const glyph = this.getToken();
  22132. length = this.readInt();
  22133. this.getToken();
  22134. data = length > 0 ? stream.getBytes(length) : new Uint8Array(0);
  22135. lenIV = program.properties.privateData.lenIV;
  22136. const encoded = this.readCharStrings(data, lenIV);
  22137. this.nextChar();
  22138. token = this.getToken();
  22139. if (token === "noaccess") {
  22140. this.getToken();
  22141. } else if (token === "/") {
  22142. this.prevChar();
  22143. }
  22144. charstrings.push({
  22145. glyph,
  22146. encoded
  22147. });
  22148. }
  22149. break;
  22150. case "Subrs":
  22151. this.readInt();
  22152. this.getToken();
  22153. while (this.getToken() === "dup") {
  22154. const index = this.readInt();
  22155. length = this.readInt();
  22156. this.getToken();
  22157. data = length > 0 ? stream.getBytes(length) : new Uint8Array(0);
  22158. lenIV = program.properties.privateData.lenIV;
  22159. const encoded = this.readCharStrings(data, lenIV);
  22160. this.nextChar();
  22161. token = this.getToken();
  22162. if (token === "noaccess") {
  22163. this.getToken();
  22164. }
  22165. subrs[index] = encoded;
  22166. }
  22167. break;
  22168. case "BlueValues":
  22169. case "OtherBlues":
  22170. case "FamilyBlues":
  22171. case "FamilyOtherBlues":
  22172. const blueArray = this.readNumberArray();
  22173. if (blueArray.length > 0 && blueArray.length % 2 === 0 && HINTING_ENABLED) {
  22174. program.properties.privateData[token] = blueArray;
  22175. }
  22176. break;
  22177. case "StemSnapH":
  22178. case "StemSnapV":
  22179. program.properties.privateData[token] = this.readNumberArray();
  22180. break;
  22181. case "StdHW":
  22182. case "StdVW":
  22183. program.properties.privateData[token] = this.readNumberArray()[0];
  22184. break;
  22185. case "BlueShift":
  22186. case "lenIV":
  22187. case "BlueFuzz":
  22188. case "BlueScale":
  22189. case "LanguageGroup":
  22190. program.properties.privateData[token] = this.readNumber();
  22191. break;
  22192. case "ExpansionFactor":
  22193. program.properties.privateData[token] = this.readNumber() || 0.06;
  22194. break;
  22195. case "ForceBold":
  22196. program.properties.privateData[token] = this.readBoolean();
  22197. break;
  22198. }
  22199. }
  22200. for (const {
  22201. encoded,
  22202. glyph
  22203. } of charstrings) {
  22204. const charString = new Type1CharString();
  22205. const error = charString.convert(encoded, subrs, this.seacAnalysisEnabled);
  22206. let output = charString.output;
  22207. if (error) {
  22208. output = [14];
  22209. }
  22210. const charStringObject = {
  22211. glyphName: glyph,
  22212. charstring: output,
  22213. width: charString.width,
  22214. lsb: charString.lsb,
  22215. seac: charString.seac
  22216. };
  22217. if (glyph === ".notdef") {
  22218. program.charstrings.unshift(charStringObject);
  22219. } else {
  22220. program.charstrings.push(charStringObject);
  22221. }
  22222. if (properties.builtInEncoding) {
  22223. const index = properties.builtInEncoding.indexOf(glyph);
  22224. if (index > -1 && properties.widths[index] === undefined && index >= properties.firstChar && index <= properties.lastChar) {
  22225. properties.widths[index] = charString.width;
  22226. }
  22227. }
  22228. }
  22229. return program;
  22230. }
  22231. extractFontHeader(properties) {
  22232. let token;
  22233. while ((token = this.getToken()) !== null) {
  22234. if (token !== "/") {
  22235. continue;
  22236. }
  22237. token = this.getToken();
  22238. switch (token) {
  22239. case "FontMatrix":
  22240. const matrix = this.readNumberArray();
  22241. properties.fontMatrix = matrix;
  22242. break;
  22243. case "Encoding":
  22244. const encodingArg = this.getToken();
  22245. let encoding;
  22246. if (!/^\d+$/.test(encodingArg)) {
  22247. encoding = getEncoding(encodingArg);
  22248. } else {
  22249. encoding = [];
  22250. const size = parseInt(encodingArg, 10) | 0;
  22251. this.getToken();
  22252. for (let j = 0; j < size; j++) {
  22253. token = this.getToken();
  22254. while (token !== "dup" && token !== "def") {
  22255. token = this.getToken();
  22256. if (token === null) {
  22257. return;
  22258. }
  22259. }
  22260. if (token === "def") {
  22261. break;
  22262. }
  22263. const index = this.readInt();
  22264. this.getToken();
  22265. const glyph = this.getToken();
  22266. encoding[index] = glyph;
  22267. this.getToken();
  22268. }
  22269. }
  22270. properties.builtInEncoding = encoding;
  22271. break;
  22272. case "FontBBox":
  22273. const fontBBox = this.readNumberArray();
  22274. properties.ascent = Math.max(fontBBox[3], fontBBox[1]);
  22275. properties.descent = Math.min(fontBBox[1], fontBBox[3]);
  22276. properties.ascentScaled = true;
  22277. break;
  22278. }
  22279. }
  22280. }
  22281. }
  22282. ;// CONCATENATED MODULE: ./src/core/type1_font.js
  22283. function findBlock(streamBytes, signature, startIndex) {
  22284. const streamBytesLength = streamBytes.length;
  22285. const signatureLength = signature.length;
  22286. const scanLength = streamBytesLength - signatureLength;
  22287. let i = startIndex,
  22288. found = false;
  22289. while (i < scanLength) {
  22290. let j = 0;
  22291. while (j < signatureLength && streamBytes[i + j] === signature[j]) {
  22292. j++;
  22293. }
  22294. if (j >= signatureLength) {
  22295. i += j;
  22296. while (i < streamBytesLength && isWhiteSpace(streamBytes[i])) {
  22297. i++;
  22298. }
  22299. found = true;
  22300. break;
  22301. }
  22302. i++;
  22303. }
  22304. return {
  22305. found,
  22306. length: i
  22307. };
  22308. }
  22309. function getHeaderBlock(stream, suggestedLength) {
  22310. const EEXEC_SIGNATURE = [0x65, 0x65, 0x78, 0x65, 0x63];
  22311. const streamStartPos = stream.pos;
  22312. let headerBytes, headerBytesLength, block;
  22313. try {
  22314. headerBytes = stream.getBytes(suggestedLength);
  22315. headerBytesLength = headerBytes.length;
  22316. } catch {}
  22317. if (headerBytesLength === suggestedLength) {
  22318. block = findBlock(headerBytes, EEXEC_SIGNATURE, suggestedLength - 2 * EEXEC_SIGNATURE.length);
  22319. if (block.found && block.length === suggestedLength) {
  22320. return {
  22321. stream: new Stream(headerBytes),
  22322. length: suggestedLength
  22323. };
  22324. }
  22325. }
  22326. warn('Invalid "Length1" property in Type1 font -- trying to recover.');
  22327. stream.pos = streamStartPos;
  22328. const SCAN_BLOCK_LENGTH = 2048;
  22329. let actualLength;
  22330. while (true) {
  22331. const scanBytes = stream.peekBytes(SCAN_BLOCK_LENGTH);
  22332. block = findBlock(scanBytes, EEXEC_SIGNATURE, 0);
  22333. if (block.length === 0) {
  22334. break;
  22335. }
  22336. stream.pos += block.length;
  22337. if (block.found) {
  22338. actualLength = stream.pos - streamStartPos;
  22339. break;
  22340. }
  22341. }
  22342. stream.pos = streamStartPos;
  22343. if (actualLength) {
  22344. return {
  22345. stream: new Stream(stream.getBytes(actualLength)),
  22346. length: actualLength
  22347. };
  22348. }
  22349. warn('Unable to recover "Length1" property in Type1 font -- using as is.');
  22350. return {
  22351. stream: new Stream(stream.getBytes(suggestedLength)),
  22352. length: suggestedLength
  22353. };
  22354. }
  22355. function getEexecBlock(stream, suggestedLength) {
  22356. const eexecBytes = stream.getBytes();
  22357. if (eexecBytes.length === 0) {
  22358. throw new FormatError("getEexecBlock - no font program found.");
  22359. }
  22360. return {
  22361. stream: new Stream(eexecBytes),
  22362. length: eexecBytes.length
  22363. };
  22364. }
  22365. class Type1Font {
  22366. constructor(name, file, properties) {
  22367. const PFB_HEADER_SIZE = 6;
  22368. let headerBlockLength = properties.length1;
  22369. let eexecBlockLength = properties.length2;
  22370. let pfbHeader = file.peekBytes(PFB_HEADER_SIZE);
  22371. const pfbHeaderPresent = pfbHeader[0] === 0x80 && pfbHeader[1] === 0x01;
  22372. if (pfbHeaderPresent) {
  22373. file.skip(PFB_HEADER_SIZE);
  22374. headerBlockLength = pfbHeader[5] << 24 | pfbHeader[4] << 16 | pfbHeader[3] << 8 | pfbHeader[2];
  22375. }
  22376. const headerBlock = getHeaderBlock(file, headerBlockLength);
  22377. const headerBlockParser = new Type1Parser(headerBlock.stream, false, SEAC_ANALYSIS_ENABLED);
  22378. headerBlockParser.extractFontHeader(properties);
  22379. if (pfbHeaderPresent) {
  22380. pfbHeader = file.getBytes(PFB_HEADER_SIZE);
  22381. eexecBlockLength = pfbHeader[5] << 24 | pfbHeader[4] << 16 | pfbHeader[3] << 8 | pfbHeader[2];
  22382. }
  22383. const eexecBlock = getEexecBlock(file, eexecBlockLength);
  22384. const eexecBlockParser = new Type1Parser(eexecBlock.stream, true, SEAC_ANALYSIS_ENABLED);
  22385. const data = eexecBlockParser.extractFontProgram(properties);
  22386. for (const key in data.properties) {
  22387. properties[key] = data.properties[key];
  22388. }
  22389. const charstrings = data.charstrings;
  22390. const type2Charstrings = this.getType2Charstrings(charstrings);
  22391. const subrs = this.getType2Subrs(data.subrs);
  22392. this.charstrings = charstrings;
  22393. this.data = this.wrap(name, type2Charstrings, this.charstrings, subrs, properties);
  22394. this.seacs = this.getSeacs(data.charstrings);
  22395. }
  22396. get numGlyphs() {
  22397. return this.charstrings.length + 1;
  22398. }
  22399. getCharset() {
  22400. const charset = [".notdef"];
  22401. for (const {
  22402. glyphName
  22403. } of this.charstrings) {
  22404. charset.push(glyphName);
  22405. }
  22406. return charset;
  22407. }
  22408. getGlyphMapping(properties) {
  22409. const charstrings = this.charstrings;
  22410. if (properties.composite) {
  22411. const charCodeToGlyphId = Object.create(null);
  22412. for (let glyphId = 0, charstringsLen = charstrings.length; glyphId < charstringsLen; glyphId++) {
  22413. const charCode = properties.cMap.charCodeOf(glyphId);
  22414. charCodeToGlyphId[charCode] = glyphId + 1;
  22415. }
  22416. return charCodeToGlyphId;
  22417. }
  22418. const glyphNames = [".notdef"];
  22419. let builtInEncoding, glyphId;
  22420. for (glyphId = 0; glyphId < charstrings.length; glyphId++) {
  22421. glyphNames.push(charstrings[glyphId].glyphName);
  22422. }
  22423. const encoding = properties.builtInEncoding;
  22424. if (encoding) {
  22425. builtInEncoding = Object.create(null);
  22426. for (const charCode in encoding) {
  22427. glyphId = glyphNames.indexOf(encoding[charCode]);
  22428. if (glyphId >= 0) {
  22429. builtInEncoding[charCode] = glyphId;
  22430. }
  22431. }
  22432. }
  22433. return type1FontGlyphMapping(properties, builtInEncoding, glyphNames);
  22434. }
  22435. hasGlyphId(id) {
  22436. if (id < 0 || id >= this.numGlyphs) {
  22437. return false;
  22438. }
  22439. if (id === 0) {
  22440. return true;
  22441. }
  22442. const glyph = this.charstrings[id - 1];
  22443. return glyph.charstring.length > 0;
  22444. }
  22445. getSeacs(charstrings) {
  22446. const seacMap = [];
  22447. for (let i = 0, ii = charstrings.length; i < ii; i++) {
  22448. const charstring = charstrings[i];
  22449. if (charstring.seac) {
  22450. seacMap[i + 1] = charstring.seac;
  22451. }
  22452. }
  22453. return seacMap;
  22454. }
  22455. getType2Charstrings(type1Charstrings) {
  22456. const type2Charstrings = [];
  22457. for (const type1Charstring of type1Charstrings) {
  22458. type2Charstrings.push(type1Charstring.charstring);
  22459. }
  22460. return type2Charstrings;
  22461. }
  22462. getType2Subrs(type1Subrs) {
  22463. let bias = 0;
  22464. const count = type1Subrs.length;
  22465. if (count < 1133) {
  22466. bias = 107;
  22467. } else if (count < 33769) {
  22468. bias = 1131;
  22469. } else {
  22470. bias = 32768;
  22471. }
  22472. const type2Subrs = [];
  22473. let i;
  22474. for (i = 0; i < bias; i++) {
  22475. type2Subrs.push([0x0b]);
  22476. }
  22477. for (i = 0; i < count; i++) {
  22478. type2Subrs.push(type1Subrs[i]);
  22479. }
  22480. return type2Subrs;
  22481. }
  22482. wrap(name, glyphs, charstrings, subrs, properties) {
  22483. const cff = new CFF();
  22484. cff.header = new CFFHeader(1, 0, 4, 4);
  22485. cff.names = [name];
  22486. const topDict = new CFFTopDict();
  22487. topDict.setByName("version", 391);
  22488. topDict.setByName("Notice", 392);
  22489. topDict.setByName("FullName", 393);
  22490. topDict.setByName("FamilyName", 394);
  22491. topDict.setByName("Weight", 395);
  22492. topDict.setByName("Encoding", null);
  22493. topDict.setByName("FontMatrix", properties.fontMatrix);
  22494. topDict.setByName("FontBBox", properties.bbox);
  22495. topDict.setByName("charset", null);
  22496. topDict.setByName("CharStrings", null);
  22497. topDict.setByName("Private", null);
  22498. cff.topDict = topDict;
  22499. const strings = new CFFStrings();
  22500. strings.add("Version 0.11");
  22501. strings.add("See original notice");
  22502. strings.add(name);
  22503. strings.add(name);
  22504. strings.add("Medium");
  22505. cff.strings = strings;
  22506. cff.globalSubrIndex = new CFFIndex();
  22507. const count = glyphs.length;
  22508. const charsetArray = [".notdef"];
  22509. let i, ii;
  22510. for (i = 0; i < count; i++) {
  22511. const glyphName = charstrings[i].glyphName;
  22512. const index = CFFStandardStrings.indexOf(glyphName);
  22513. if (index === -1) {
  22514. strings.add(glyphName);
  22515. }
  22516. charsetArray.push(glyphName);
  22517. }
  22518. cff.charset = new CFFCharset(false, 0, charsetArray);
  22519. const charStringsIndex = new CFFIndex();
  22520. charStringsIndex.add([0x8b, 0x0e]);
  22521. for (i = 0; i < count; i++) {
  22522. charStringsIndex.add(glyphs[i]);
  22523. }
  22524. cff.charStrings = charStringsIndex;
  22525. const privateDict = new CFFPrivateDict();
  22526. privateDict.setByName("Subrs", null);
  22527. const fields = ["BlueValues", "OtherBlues", "FamilyBlues", "FamilyOtherBlues", "StemSnapH", "StemSnapV", "BlueShift", "BlueFuzz", "BlueScale", "LanguageGroup", "ExpansionFactor", "ForceBold", "StdHW", "StdVW"];
  22528. for (i = 0, ii = fields.length; i < ii; i++) {
  22529. const field = fields[i];
  22530. if (!(field in properties.privateData)) {
  22531. continue;
  22532. }
  22533. const value = properties.privateData[field];
  22534. if (Array.isArray(value)) {
  22535. for (let j = value.length - 1; j > 0; j--) {
  22536. value[j] -= value[j - 1];
  22537. }
  22538. }
  22539. privateDict.setByName(field, value);
  22540. }
  22541. cff.topDict.privateDict = privateDict;
  22542. const subrIndex = new CFFIndex();
  22543. for (i = 0, ii = subrs.length; i < ii; i++) {
  22544. subrIndex.add(subrs[i]);
  22545. }
  22546. privateDict.subrsIndex = subrIndex;
  22547. const compiler = new CFFCompiler(cff);
  22548. return compiler.compile();
  22549. }
  22550. }
  22551. ;// CONCATENATED MODULE: ./src/core/fonts.js
  22552. const PRIVATE_USE_AREAS = [[0xe000, 0xf8ff], [0x100000, 0x10fffd]];
  22553. const PDF_GLYPH_SPACE_UNITS = 1000;
  22554. 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"];
  22555. const EXPORT_DATA_EXTRA_PROPERTIES = ["cMap", "defaultEncoding", "differences", "isMonospace", "isSerifFont", "isSymbolicFont", "seacMap", "toFontChar", "toUnicode", "vmetrics", "widths"];
  22556. function adjustWidths(properties) {
  22557. if (!properties.fontMatrix) {
  22558. return;
  22559. }
  22560. if (properties.fontMatrix[0] === FONT_IDENTITY_MATRIX[0]) {
  22561. return;
  22562. }
  22563. const scale = 0.001 / properties.fontMatrix[0];
  22564. const glyphsWidths = properties.widths;
  22565. for (const glyph in glyphsWidths) {
  22566. glyphsWidths[glyph] *= scale;
  22567. }
  22568. properties.defaultWidth *= scale;
  22569. }
  22570. function adjustTrueTypeToUnicode(properties, isSymbolicFont, nameRecords) {
  22571. if (properties.isInternalFont) {
  22572. return;
  22573. }
  22574. if (properties.hasIncludedToUnicodeMap) {
  22575. return;
  22576. }
  22577. if (properties.hasEncoding) {
  22578. return;
  22579. }
  22580. if (properties.toUnicode instanceof IdentityToUnicodeMap) {
  22581. return;
  22582. }
  22583. if (!isSymbolicFont) {
  22584. return;
  22585. }
  22586. if (nameRecords.length === 0) {
  22587. return;
  22588. }
  22589. if (properties.defaultEncoding === WinAnsiEncoding) {
  22590. return;
  22591. }
  22592. for (const r of nameRecords) {
  22593. if (!isWinNameRecord(r)) {
  22594. return;
  22595. }
  22596. }
  22597. const encoding = WinAnsiEncoding;
  22598. const toUnicode = [],
  22599. glyphsUnicodeMap = getGlyphsUnicode();
  22600. for (const charCode in encoding) {
  22601. const glyphName = encoding[charCode];
  22602. if (glyphName === "") {
  22603. continue;
  22604. }
  22605. const unicode = glyphsUnicodeMap[glyphName];
  22606. if (unicode === undefined) {
  22607. continue;
  22608. }
  22609. toUnicode[charCode] = String.fromCharCode(unicode);
  22610. }
  22611. if (toUnicode.length > 0) {
  22612. properties.toUnicode.amend(toUnicode);
  22613. }
  22614. }
  22615. function adjustType1ToUnicode(properties, builtInEncoding) {
  22616. if (properties.isInternalFont) {
  22617. return;
  22618. }
  22619. if (properties.hasIncludedToUnicodeMap) {
  22620. return;
  22621. }
  22622. if (builtInEncoding === properties.defaultEncoding) {
  22623. return;
  22624. }
  22625. if (properties.toUnicode instanceof IdentityToUnicodeMap) {
  22626. return;
  22627. }
  22628. const toUnicode = [],
  22629. glyphsUnicodeMap = getGlyphsUnicode();
  22630. for (const charCode in builtInEncoding) {
  22631. if (properties.hasEncoding) {
  22632. if (properties.baseEncodingName || properties.differences[charCode] !== undefined) {
  22633. continue;
  22634. }
  22635. }
  22636. const glyphName = builtInEncoding[charCode];
  22637. const unicode = getUnicodeForGlyph(glyphName, glyphsUnicodeMap);
  22638. if (unicode !== -1) {
  22639. toUnicode[charCode] = String.fromCharCode(unicode);
  22640. }
  22641. }
  22642. if (toUnicode.length > 0) {
  22643. properties.toUnicode.amend(toUnicode);
  22644. }
  22645. }
  22646. function amendFallbackToUnicode(properties) {
  22647. if (!properties.fallbackToUnicode) {
  22648. return;
  22649. }
  22650. if (properties.toUnicode instanceof IdentityToUnicodeMap) {
  22651. return;
  22652. }
  22653. const toUnicode = [];
  22654. for (const charCode in properties.fallbackToUnicode) {
  22655. if (properties.toUnicode.has(charCode)) {
  22656. continue;
  22657. }
  22658. toUnicode[charCode] = properties.fallbackToUnicode[charCode];
  22659. }
  22660. if (toUnicode.length > 0) {
  22661. properties.toUnicode.amend(toUnicode);
  22662. }
  22663. }
  22664. class fonts_Glyph {
  22665. constructor(originalCharCode, fontChar, unicode, accent, width, vmetric, operatorListId, isSpace, isInFont) {
  22666. this.originalCharCode = originalCharCode;
  22667. this.fontChar = fontChar;
  22668. this.unicode = unicode;
  22669. this.accent = accent;
  22670. this.width = width;
  22671. this.vmetric = vmetric;
  22672. this.operatorListId = operatorListId;
  22673. this.isSpace = isSpace;
  22674. this.isInFont = isInFont;
  22675. }
  22676. get category() {
  22677. return shadow(this, "category", getCharUnicodeCategory(this.unicode), true);
  22678. }
  22679. }
  22680. function int16(b0, b1) {
  22681. return (b0 << 8) + b1;
  22682. }
  22683. function writeSignedInt16(bytes, index, value) {
  22684. bytes[index + 1] = value;
  22685. bytes[index] = value >>> 8;
  22686. }
  22687. function signedInt16(b0, b1) {
  22688. const value = (b0 << 8) + b1;
  22689. return value & 1 << 15 ? value - 0x10000 : value;
  22690. }
  22691. function writeUint32(bytes, index, value) {
  22692. bytes[index + 3] = value & 0xff;
  22693. bytes[index + 2] = value >>> 8;
  22694. bytes[index + 1] = value >>> 16;
  22695. bytes[index] = value >>> 24;
  22696. }
  22697. function int32(b0, b1, b2, b3) {
  22698. return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3;
  22699. }
  22700. function string16(value) {
  22701. return String.fromCharCode(value >> 8 & 0xff, value & 0xff);
  22702. }
  22703. function safeString16(value) {
  22704. if (value > 0x7fff) {
  22705. value = 0x7fff;
  22706. } else if (value < -0x8000) {
  22707. value = -0x8000;
  22708. }
  22709. return String.fromCharCode(value >> 8 & 0xff, value & 0xff);
  22710. }
  22711. function isTrueTypeFile(file) {
  22712. const header = file.peekBytes(4);
  22713. return readUint32(header, 0) === 0x00010000 || bytesToString(header) === "true";
  22714. }
  22715. function isTrueTypeCollectionFile(file) {
  22716. const header = file.peekBytes(4);
  22717. return bytesToString(header) === "ttcf";
  22718. }
  22719. function isOpenTypeFile(file) {
  22720. const header = file.peekBytes(4);
  22721. return bytesToString(header) === "OTTO";
  22722. }
  22723. function isType1File(file) {
  22724. const header = file.peekBytes(2);
  22725. if (header[0] === 0x25 && header[1] === 0x21) {
  22726. return true;
  22727. }
  22728. if (header[0] === 0x80 && header[1] === 0x01) {
  22729. return true;
  22730. }
  22731. return false;
  22732. }
  22733. function isCFFFile(file) {
  22734. const header = file.peekBytes(4);
  22735. if (header[0] >= 1 && header[3] >= 1 && header[3] <= 4) {
  22736. return true;
  22737. }
  22738. return false;
  22739. }
  22740. function getFontFileType(file, {
  22741. type,
  22742. subtype,
  22743. composite
  22744. }) {
  22745. let fileType, fileSubtype;
  22746. if (isTrueTypeFile(file) || isTrueTypeCollectionFile(file)) {
  22747. fileType = composite ? "CIDFontType2" : "TrueType";
  22748. } else if (isOpenTypeFile(file)) {
  22749. fileType = composite ? "CIDFontType2" : "OpenType";
  22750. } else if (isType1File(file)) {
  22751. if (composite) {
  22752. fileType = "CIDFontType0";
  22753. } else {
  22754. fileType = type === "MMType1" ? "MMType1" : "Type1";
  22755. }
  22756. } else if (isCFFFile(file)) {
  22757. if (composite) {
  22758. fileType = "CIDFontType0";
  22759. fileSubtype = "CIDFontType0C";
  22760. } else {
  22761. fileType = type === "MMType1" ? "MMType1" : "Type1";
  22762. fileSubtype = "Type1C";
  22763. }
  22764. } else {
  22765. warn("getFontFileType: Unable to detect correct font file Type/Subtype.");
  22766. fileType = type;
  22767. fileSubtype = subtype;
  22768. }
  22769. return [fileType, fileSubtype];
  22770. }
  22771. function applyStandardFontGlyphMap(map, glyphMap) {
  22772. for (const charCode in glyphMap) {
  22773. map[+charCode] = glyphMap[charCode];
  22774. }
  22775. }
  22776. function buildToFontChar(encoding, glyphsUnicodeMap, differences) {
  22777. const toFontChar = [];
  22778. let unicode;
  22779. for (let i = 0, ii = encoding.length; i < ii; i++) {
  22780. unicode = getUnicodeForGlyph(encoding[i], glyphsUnicodeMap);
  22781. if (unicode !== -1) {
  22782. toFontChar[i] = unicode;
  22783. }
  22784. }
  22785. for (const charCode in differences) {
  22786. unicode = getUnicodeForGlyph(differences[charCode], glyphsUnicodeMap);
  22787. if (unicode !== -1) {
  22788. toFontChar[+charCode] = unicode;
  22789. }
  22790. }
  22791. return toFontChar;
  22792. }
  22793. function isMacNameRecord(r) {
  22794. return r.platform === 1 && r.encoding === 0 && r.language === 0;
  22795. }
  22796. function isWinNameRecord(r) {
  22797. return r.platform === 3 && r.encoding === 1 && r.language === 0x409;
  22798. }
  22799. function convertCidString(charCode, cid, shouldThrow = false) {
  22800. switch (cid.length) {
  22801. case 1:
  22802. return cid.charCodeAt(0);
  22803. case 2:
  22804. return cid.charCodeAt(0) << 8 | cid.charCodeAt(1);
  22805. }
  22806. const msg = `Unsupported CID string (charCode ${charCode}): "${cid}".`;
  22807. if (shouldThrow) {
  22808. throw new FormatError(msg);
  22809. }
  22810. warn(msg);
  22811. return cid;
  22812. }
  22813. function adjustMapping(charCodeToGlyphId, hasGlyph, newGlyphZeroId, toUnicode) {
  22814. const newMap = Object.create(null);
  22815. const toUnicodeExtraMap = new Map();
  22816. const toFontChar = [];
  22817. const usedGlyphIds = new Set();
  22818. let privateUseAreaIndex = 0;
  22819. const privateUseOffetStart = PRIVATE_USE_AREAS[privateUseAreaIndex][0];
  22820. let nextAvailableFontCharCode = privateUseOffetStart;
  22821. let privateUseOffetEnd = PRIVATE_USE_AREAS[privateUseAreaIndex][1];
  22822. 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];
  22823. for (const originalCharCode in charCodeToGlyphId) {
  22824. let glyphId = charCodeToGlyphId[originalCharCode];
  22825. if (!hasGlyph(glyphId)) {
  22826. continue;
  22827. }
  22828. if (nextAvailableFontCharCode > privateUseOffetEnd) {
  22829. privateUseAreaIndex++;
  22830. if (privateUseAreaIndex >= PRIVATE_USE_AREAS.length) {
  22831. warn("Ran out of space in font private use area.");
  22832. break;
  22833. }
  22834. nextAvailableFontCharCode = PRIVATE_USE_AREAS[privateUseAreaIndex][0];
  22835. privateUseOffetEnd = PRIVATE_USE_AREAS[privateUseAreaIndex][1];
  22836. }
  22837. const fontCharCode = nextAvailableFontCharCode++;
  22838. if (glyphId === 0) {
  22839. glyphId = newGlyphZeroId;
  22840. }
  22841. let unicode = toUnicode.get(originalCharCode);
  22842. if (typeof unicode === "string") {
  22843. unicode = unicode.codePointAt(0);
  22844. }
  22845. if (unicode && !isInPrivateArea(unicode) && !usedGlyphIds.has(glyphId)) {
  22846. toUnicodeExtraMap.set(unicode, glyphId);
  22847. usedGlyphIds.add(glyphId);
  22848. }
  22849. newMap[fontCharCode] = glyphId;
  22850. toFontChar[originalCharCode] = fontCharCode;
  22851. }
  22852. return {
  22853. toFontChar,
  22854. charCodeToGlyphId: newMap,
  22855. toUnicodeExtraMap,
  22856. nextAvailableFontCharCode
  22857. };
  22858. }
  22859. function getRanges(glyphs, toUnicodeExtraMap, numGlyphs) {
  22860. const codes = [];
  22861. for (const charCode in glyphs) {
  22862. if (glyphs[charCode] >= numGlyphs) {
  22863. continue;
  22864. }
  22865. codes.push({
  22866. fontCharCode: charCode | 0,
  22867. glyphId: glyphs[charCode]
  22868. });
  22869. }
  22870. if (toUnicodeExtraMap) {
  22871. for (const [unicode, glyphId] of toUnicodeExtraMap) {
  22872. if (glyphId >= numGlyphs) {
  22873. continue;
  22874. }
  22875. codes.push({
  22876. fontCharCode: unicode,
  22877. glyphId
  22878. });
  22879. }
  22880. }
  22881. if (codes.length === 0) {
  22882. codes.push({
  22883. fontCharCode: 0,
  22884. glyphId: 0
  22885. });
  22886. }
  22887. codes.sort(function fontGetRangesSort(a, b) {
  22888. return a.fontCharCode - b.fontCharCode;
  22889. });
  22890. const ranges = [];
  22891. const length = codes.length;
  22892. for (let n = 0; n < length;) {
  22893. const start = codes[n].fontCharCode;
  22894. const codeIndices = [codes[n].glyphId];
  22895. ++n;
  22896. let end = start;
  22897. while (n < length && end + 1 === codes[n].fontCharCode) {
  22898. codeIndices.push(codes[n].glyphId);
  22899. ++end;
  22900. ++n;
  22901. if (end === 0xffff) {
  22902. break;
  22903. }
  22904. }
  22905. ranges.push([start, end, codeIndices]);
  22906. }
  22907. return ranges;
  22908. }
  22909. function createCmapTable(glyphs, toUnicodeExtraMap, numGlyphs) {
  22910. const ranges = getRanges(glyphs, toUnicodeExtraMap, numGlyphs);
  22911. const numTables = ranges.at(-1)[1] > 0xffff ? 2 : 1;
  22912. let cmap = "\x00\x00" + string16(numTables) + "\x00\x03" + "\x00\x01" + string32(4 + numTables * 8);
  22913. let i, ii, j, jj;
  22914. for (i = ranges.length - 1; i >= 0; --i) {
  22915. if (ranges[i][0] <= 0xffff) {
  22916. break;
  22917. }
  22918. }
  22919. const bmpLength = i + 1;
  22920. if (ranges[i][0] < 0xffff && ranges[i][1] === 0xffff) {
  22921. ranges[i][1] = 0xfffe;
  22922. }
  22923. const trailingRangesCount = ranges[i][1] < 0xffff ? 1 : 0;
  22924. const segCount = bmpLength + trailingRangesCount;
  22925. const searchParams = OpenTypeFileBuilder.getSearchParams(segCount, 2);
  22926. let startCount = "";
  22927. let endCount = "";
  22928. let idDeltas = "";
  22929. let idRangeOffsets = "";
  22930. let glyphsIds = "";
  22931. let bias = 0;
  22932. let range, start, end, codes;
  22933. for (i = 0, ii = bmpLength; i < ii; i++) {
  22934. range = ranges[i];
  22935. start = range[0];
  22936. end = range[1];
  22937. startCount += string16(start);
  22938. endCount += string16(end);
  22939. codes = range[2];
  22940. let contiguous = true;
  22941. for (j = 1, jj = codes.length; j < jj; ++j) {
  22942. if (codes[j] !== codes[j - 1] + 1) {
  22943. contiguous = false;
  22944. break;
  22945. }
  22946. }
  22947. if (!contiguous) {
  22948. const offset = (segCount - i) * 2 + bias * 2;
  22949. bias += end - start + 1;
  22950. idDeltas += string16(0);
  22951. idRangeOffsets += string16(offset);
  22952. for (j = 0, jj = codes.length; j < jj; ++j) {
  22953. glyphsIds += string16(codes[j]);
  22954. }
  22955. } else {
  22956. const startCode = codes[0];
  22957. idDeltas += string16(startCode - start & 0xffff);
  22958. idRangeOffsets += string16(0);
  22959. }
  22960. }
  22961. if (trailingRangesCount > 0) {
  22962. endCount += "\xFF\xFF";
  22963. startCount += "\xFF\xFF";
  22964. idDeltas += "\x00\x01";
  22965. idRangeOffsets += "\x00\x00";
  22966. }
  22967. const format314 = "\x00\x00" + string16(2 * segCount) + string16(searchParams.range) + string16(searchParams.entry) + string16(searchParams.rangeShift) + endCount + "\x00\x00" + startCount + idDeltas + idRangeOffsets + glyphsIds;
  22968. let format31012 = "";
  22969. let header31012 = "";
  22970. if (numTables > 1) {
  22971. cmap += "\x00\x03" + "\x00\x0A" + string32(4 + numTables * 8 + 4 + format314.length);
  22972. format31012 = "";
  22973. for (i = 0, ii = ranges.length; i < ii; i++) {
  22974. range = ranges[i];
  22975. start = range[0];
  22976. codes = range[2];
  22977. let code = codes[0];
  22978. for (j = 1, jj = codes.length; j < jj; ++j) {
  22979. if (codes[j] !== codes[j - 1] + 1) {
  22980. end = range[0] + j - 1;
  22981. format31012 += string32(start) + string32(end) + string32(code);
  22982. start = end + 1;
  22983. code = codes[j];
  22984. }
  22985. }
  22986. format31012 += string32(start) + string32(range[1]) + string32(code);
  22987. }
  22988. header31012 = "\x00\x0C" + "\x00\x00" + string32(format31012.length + 16) + "\x00\x00\x00\x00" + string32(format31012.length / 12);
  22989. }
  22990. return cmap + "\x00\x04" + string16(format314.length + 4) + format314 + header31012 + format31012;
  22991. }
  22992. function validateOS2Table(os2, file) {
  22993. file.pos = (file.start || 0) + os2.offset;
  22994. const version = file.getUint16();
  22995. file.skip(60);
  22996. const selection = file.getUint16();
  22997. if (version < 4 && selection & 0x0300) {
  22998. return false;
  22999. }
  23000. const firstChar = file.getUint16();
  23001. const lastChar = file.getUint16();
  23002. if (firstChar > lastChar) {
  23003. return false;
  23004. }
  23005. file.skip(6);
  23006. const usWinAscent = file.getUint16();
  23007. if (usWinAscent === 0) {
  23008. return false;
  23009. }
  23010. os2.data[8] = os2.data[9] = 0;
  23011. return true;
  23012. }
  23013. function createOS2Table(properties, charstrings, override) {
  23014. override ||= {
  23015. unitsPerEm: 0,
  23016. yMax: 0,
  23017. yMin: 0,
  23018. ascent: 0,
  23019. descent: 0
  23020. };
  23021. let ulUnicodeRange1 = 0;
  23022. let ulUnicodeRange2 = 0;
  23023. let ulUnicodeRange3 = 0;
  23024. let ulUnicodeRange4 = 0;
  23025. let firstCharIndex = null;
  23026. let lastCharIndex = 0;
  23027. let position = -1;
  23028. if (charstrings) {
  23029. for (let code in charstrings) {
  23030. code |= 0;
  23031. if (firstCharIndex > code || !firstCharIndex) {
  23032. firstCharIndex = code;
  23033. }
  23034. if (lastCharIndex < code) {
  23035. lastCharIndex = code;
  23036. }
  23037. position = getUnicodeRangeFor(code, position);
  23038. if (position < 32) {
  23039. ulUnicodeRange1 |= 1 << position;
  23040. } else if (position < 64) {
  23041. ulUnicodeRange2 |= 1 << position - 32;
  23042. } else if (position < 96) {
  23043. ulUnicodeRange3 |= 1 << position - 64;
  23044. } else if (position < 123) {
  23045. ulUnicodeRange4 |= 1 << position - 96;
  23046. } else {
  23047. throw new FormatError("Unicode ranges Bits > 123 are reserved for internal usage");
  23048. }
  23049. }
  23050. if (lastCharIndex > 0xffff) {
  23051. lastCharIndex = 0xffff;
  23052. }
  23053. } else {
  23054. firstCharIndex = 0;
  23055. lastCharIndex = 255;
  23056. }
  23057. const bbox = properties.bbox || [0, 0, 0, 0];
  23058. const unitsPerEm = override.unitsPerEm || (properties.fontMatrix ? 1 / Math.max(...properties.fontMatrix.slice(0, 4).map(Math.abs)) : 1000);
  23059. const scale = properties.ascentScaled ? 1.0 : unitsPerEm / PDF_GLYPH_SPACE_UNITS;
  23060. const typoAscent = override.ascent || Math.round(scale * (properties.ascent || bbox[3]));
  23061. let typoDescent = override.descent || Math.round(scale * (properties.descent || bbox[1]));
  23062. if (typoDescent > 0 && properties.descent > 0 && bbox[1] < 0) {
  23063. typoDescent = -typoDescent;
  23064. }
  23065. const winAscent = override.yMax || typoAscent;
  23066. const winDescent = -override.yMin || -typoDescent;
  23067. 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";
  23068. }
  23069. function createPostTable(properties) {
  23070. const angle = Math.floor(properties.italicAngle * 2 ** 16);
  23071. 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";
  23072. }
  23073. function createPostscriptName(name) {
  23074. return name.replaceAll(/[^\x21-\x7E]|[[\](){}<>/%]/g, "").slice(0, 63);
  23075. }
  23076. function createNameTable(name, proto) {
  23077. if (!proto) {
  23078. proto = [[], []];
  23079. }
  23080. 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"];
  23081. const stringsUnicode = [];
  23082. let i, ii, j, jj, str;
  23083. for (i = 0, ii = strings.length; i < ii; i++) {
  23084. str = proto[1][i] || strings[i];
  23085. const strBufUnicode = [];
  23086. for (j = 0, jj = str.length; j < jj; j++) {
  23087. strBufUnicode.push(string16(str.charCodeAt(j)));
  23088. }
  23089. stringsUnicode.push(strBufUnicode.join(""));
  23090. }
  23091. const names = [strings, stringsUnicode];
  23092. const platforms = ["\x00\x01", "\x00\x03"];
  23093. const encodings = ["\x00\x00", "\x00\x01"];
  23094. const languages = ["\x00\x00", "\x04\x09"];
  23095. const namesRecordCount = strings.length * platforms.length;
  23096. let nameTable = "\x00\x00" + string16(namesRecordCount) + string16(namesRecordCount * 12 + 6);
  23097. let strOffset = 0;
  23098. for (i = 0, ii = platforms.length; i < ii; i++) {
  23099. const strs = names[i];
  23100. for (j = 0, jj = strs.length; j < jj; j++) {
  23101. str = strs[j];
  23102. const nameRecord = platforms[i] + encodings[i] + languages[i] + string16(j) + string16(str.length) + string16(strOffset);
  23103. nameTable += nameRecord;
  23104. strOffset += str.length;
  23105. }
  23106. }
  23107. nameTable += strings.join("") + stringsUnicode.join("");
  23108. return nameTable;
  23109. }
  23110. class Font {
  23111. constructor(name, file, properties) {
  23112. this.name = name;
  23113. this.psName = null;
  23114. this.mimetype = null;
  23115. this.disableFontFace = false;
  23116. this.loadedName = properties.loadedName;
  23117. this.isType3Font = properties.isType3Font;
  23118. this.missingFile = false;
  23119. this.cssFontInfo = properties.cssFontInfo;
  23120. this._charsCache = Object.create(null);
  23121. this._glyphCache = Object.create(null);
  23122. let isSerifFont = !!(properties.flags & FontFlags.Serif);
  23123. if (!isSerifFont && !properties.isSimulatedFlags) {
  23124. const baseName = name.replaceAll(/[,_]/g, "-").split("-", 1)[0],
  23125. serifFonts = getSerifFonts();
  23126. for (const namePart of baseName.split("+")) {
  23127. if (serifFonts[namePart]) {
  23128. isSerifFont = true;
  23129. break;
  23130. }
  23131. }
  23132. }
  23133. this.isSerifFont = isSerifFont;
  23134. this.isSymbolicFont = !!(properties.flags & FontFlags.Symbolic);
  23135. this.isMonospace = !!(properties.flags & FontFlags.FixedPitch);
  23136. let {
  23137. type,
  23138. subtype
  23139. } = properties;
  23140. this.type = type;
  23141. this.subtype = subtype;
  23142. this.systemFontInfo = properties.systemFontInfo;
  23143. const matches = name.match(/^InvalidPDFjsFont_(.*)_\d+$/);
  23144. this.isInvalidPDFjsFont = !!matches;
  23145. if (this.isInvalidPDFjsFont) {
  23146. this.fallbackName = matches[1];
  23147. } else if (this.isMonospace) {
  23148. this.fallbackName = "monospace";
  23149. } else if (this.isSerifFont) {
  23150. this.fallbackName = "serif";
  23151. } else {
  23152. this.fallbackName = "sans-serif";
  23153. }
  23154. if (this.systemFontInfo?.guessFallback) {
  23155. this.systemFontInfo.guessFallback = false;
  23156. this.systemFontInfo.css += `,${this.fallbackName}`;
  23157. }
  23158. this.differences = properties.differences;
  23159. this.widths = properties.widths;
  23160. this.defaultWidth = properties.defaultWidth;
  23161. this.composite = properties.composite;
  23162. this.cMap = properties.cMap;
  23163. this.capHeight = properties.capHeight / PDF_GLYPH_SPACE_UNITS;
  23164. this.ascent = properties.ascent / PDF_GLYPH_SPACE_UNITS;
  23165. this.descent = properties.descent / PDF_GLYPH_SPACE_UNITS;
  23166. this.lineHeight = this.ascent - this.descent;
  23167. this.fontMatrix = properties.fontMatrix;
  23168. this.bbox = properties.bbox;
  23169. this.defaultEncoding = properties.defaultEncoding;
  23170. this.toUnicode = properties.toUnicode;
  23171. this.toFontChar = [];
  23172. if (properties.type === "Type3") {
  23173. for (let charCode = 0; charCode < 256; charCode++) {
  23174. this.toFontChar[charCode] = this.differences[charCode] || properties.defaultEncoding[charCode];
  23175. }
  23176. return;
  23177. }
  23178. this.cidEncoding = properties.cidEncoding || "";
  23179. this.vertical = !!properties.vertical;
  23180. if (this.vertical) {
  23181. this.vmetrics = properties.vmetrics;
  23182. this.defaultVMetrics = properties.defaultVMetrics;
  23183. }
  23184. if (!file || file.isEmpty) {
  23185. if (file) {
  23186. warn('Font file is empty in "' + name + '" (' + this.loadedName + ")");
  23187. }
  23188. this.fallbackToSystemFont(properties);
  23189. return;
  23190. }
  23191. [type, subtype] = getFontFileType(file, properties);
  23192. if (type !== this.type || subtype !== this.subtype) {
  23193. info("Inconsistent font file Type/SubType, expected: " + `${this.type}/${this.subtype} but found: ${type}/${subtype}.`);
  23194. }
  23195. let data;
  23196. try {
  23197. switch (type) {
  23198. case "MMType1":
  23199. info("MMType1 font (" + name + "), falling back to Type1.");
  23200. case "Type1":
  23201. case "CIDFontType0":
  23202. this.mimetype = "font/opentype";
  23203. const cff = subtype === "Type1C" || subtype === "CIDFontType0C" ? new CFFFont(file, properties) : new Type1Font(name, file, properties);
  23204. adjustWidths(properties);
  23205. data = this.convert(name, cff, properties);
  23206. break;
  23207. case "OpenType":
  23208. case "TrueType":
  23209. case "CIDFontType2":
  23210. this.mimetype = "font/opentype";
  23211. data = this.checkAndRepair(name, file, properties);
  23212. if (this.isOpenType) {
  23213. adjustWidths(properties);
  23214. type = "OpenType";
  23215. }
  23216. break;
  23217. default:
  23218. throw new FormatError(`Font ${type} is not supported`);
  23219. }
  23220. } catch (e) {
  23221. warn(e);
  23222. this.fallbackToSystemFont(properties);
  23223. return;
  23224. }
  23225. amendFallbackToUnicode(properties);
  23226. this.data = data;
  23227. this.type = type;
  23228. this.subtype = subtype;
  23229. this.fontMatrix = properties.fontMatrix;
  23230. this.widths = properties.widths;
  23231. this.defaultWidth = properties.defaultWidth;
  23232. this.toUnicode = properties.toUnicode;
  23233. this.seacMap = properties.seacMap;
  23234. }
  23235. get renderer() {
  23236. const renderer = FontRendererFactory.create(this, SEAC_ANALYSIS_ENABLED);
  23237. return shadow(this, "renderer", renderer);
  23238. }
  23239. exportData(extraProperties = false) {
  23240. const exportDataProperties = extraProperties ? [...EXPORT_DATA_PROPERTIES, ...EXPORT_DATA_EXTRA_PROPERTIES] : EXPORT_DATA_PROPERTIES;
  23241. const data = Object.create(null);
  23242. let property, value;
  23243. for (property of exportDataProperties) {
  23244. value = this[property];
  23245. if (value !== undefined) {
  23246. data[property] = value;
  23247. }
  23248. }
  23249. return data;
  23250. }
  23251. fallbackToSystemFont(properties) {
  23252. this.missingFile = true;
  23253. const {
  23254. name,
  23255. type
  23256. } = this;
  23257. let fontName = normalizeFontName(name);
  23258. const stdFontMap = getStdFontMap(),
  23259. nonStdFontMap = getNonStdFontMap();
  23260. const isStandardFont = !!stdFontMap[fontName];
  23261. const isMappedToStandardFont = !!(nonStdFontMap[fontName] && stdFontMap[nonStdFontMap[fontName]]);
  23262. fontName = stdFontMap[fontName] || nonStdFontMap[fontName] || fontName;
  23263. const fontBasicMetricsMap = getFontBasicMetrics();
  23264. const metrics = fontBasicMetricsMap[fontName];
  23265. if (metrics) {
  23266. if (isNaN(this.ascent)) {
  23267. this.ascent = metrics.ascent / PDF_GLYPH_SPACE_UNITS;
  23268. }
  23269. if (isNaN(this.descent)) {
  23270. this.descent = metrics.descent / PDF_GLYPH_SPACE_UNITS;
  23271. }
  23272. if (isNaN(this.capHeight)) {
  23273. this.capHeight = metrics.capHeight / PDF_GLYPH_SPACE_UNITS;
  23274. }
  23275. }
  23276. this.bold = /bold/gi.test(fontName);
  23277. this.italic = /oblique|italic/gi.test(fontName);
  23278. this.black = /Black/g.test(name);
  23279. const isNarrow = /Narrow/g.test(name);
  23280. this.remeasure = (!isStandardFont || isNarrow) && Object.keys(this.widths).length > 0;
  23281. if ((isStandardFont || isMappedToStandardFont) && type === "CIDFontType2" && this.cidEncoding.startsWith("Identity-")) {
  23282. const cidToGidMap = properties.cidToGidMap;
  23283. const map = [];
  23284. applyStandardFontGlyphMap(map, getGlyphMapForStandardFonts());
  23285. if (/Arial-?Black/i.test(name)) {
  23286. applyStandardFontGlyphMap(map, getSupplementalGlyphMapForArialBlack());
  23287. } else if (/Calibri/i.test(name)) {
  23288. applyStandardFontGlyphMap(map, getSupplementalGlyphMapForCalibri());
  23289. }
  23290. if (cidToGidMap) {
  23291. for (const charCode in map) {
  23292. const cid = map[charCode];
  23293. if (cidToGidMap[cid] !== undefined) {
  23294. map[+charCode] = cidToGidMap[cid];
  23295. }
  23296. }
  23297. if (cidToGidMap.length !== this.toUnicode.length && properties.hasIncludedToUnicodeMap && this.toUnicode instanceof IdentityToUnicodeMap) {
  23298. this.toUnicode.forEach(function (charCode, unicodeCharCode) {
  23299. const cid = map[charCode];
  23300. if (cidToGidMap[cid] === undefined) {
  23301. map[+charCode] = unicodeCharCode;
  23302. }
  23303. });
  23304. }
  23305. }
  23306. if (!(this.toUnicode instanceof IdentityToUnicodeMap)) {
  23307. this.toUnicode.forEach(function (charCode, unicodeCharCode) {
  23308. map[+charCode] = unicodeCharCode;
  23309. });
  23310. }
  23311. this.toFontChar = map;
  23312. this.toUnicode = new ToUnicodeMap(map);
  23313. } else if (/Symbol/i.test(fontName)) {
  23314. this.toFontChar = buildToFontChar(SymbolSetEncoding, getGlyphsUnicode(), this.differences);
  23315. } else if (/Dingbats/i.test(fontName)) {
  23316. this.toFontChar = buildToFontChar(ZapfDingbatsEncoding, getDingbatsGlyphsUnicode(), this.differences);
  23317. } else if (isStandardFont) {
  23318. const map = buildToFontChar(this.defaultEncoding, getGlyphsUnicode(), this.differences);
  23319. if (type === "CIDFontType2" && !this.cidEncoding.startsWith("Identity-") && !(this.toUnicode instanceof IdentityToUnicodeMap)) {
  23320. this.toUnicode.forEach(function (charCode, unicodeCharCode) {
  23321. map[+charCode] = unicodeCharCode;
  23322. });
  23323. }
  23324. this.toFontChar = map;
  23325. } else {
  23326. const glyphsUnicodeMap = getGlyphsUnicode();
  23327. const map = [];
  23328. this.toUnicode.forEach((charCode, unicodeCharCode) => {
  23329. if (!this.composite) {
  23330. const glyphName = this.differences[charCode] || this.defaultEncoding[charCode];
  23331. const unicode = getUnicodeForGlyph(glyphName, glyphsUnicodeMap);
  23332. if (unicode !== -1) {
  23333. unicodeCharCode = unicode;
  23334. }
  23335. }
  23336. map[+charCode] = unicodeCharCode;
  23337. });
  23338. if (this.composite && this.toUnicode instanceof IdentityToUnicodeMap) {
  23339. if (/Tahoma|Verdana/i.test(name)) {
  23340. applyStandardFontGlyphMap(map, getGlyphMapForStandardFonts());
  23341. }
  23342. }
  23343. this.toFontChar = map;
  23344. }
  23345. amendFallbackToUnicode(properties);
  23346. this.loadedName = fontName.split("-", 1)[0];
  23347. }
  23348. checkAndRepair(name, font, properties) {
  23349. const VALID_TABLES = ["OS/2", "cmap", "head", "hhea", "hmtx", "maxp", "name", "post", "loca", "glyf", "fpgm", "prep", "cvt ", "CFF "];
  23350. function readTables(file, numTables) {
  23351. const tables = Object.create(null);
  23352. tables["OS/2"] = null;
  23353. tables.cmap = null;
  23354. tables.head = null;
  23355. tables.hhea = null;
  23356. tables.hmtx = null;
  23357. tables.maxp = null;
  23358. tables.name = null;
  23359. tables.post = null;
  23360. for (let i = 0; i < numTables; i++) {
  23361. const table = readTableEntry(file);
  23362. if (!VALID_TABLES.includes(table.tag)) {
  23363. continue;
  23364. }
  23365. if (table.length === 0) {
  23366. continue;
  23367. }
  23368. tables[table.tag] = table;
  23369. }
  23370. return tables;
  23371. }
  23372. function readTableEntry(file) {
  23373. const tag = file.getString(4);
  23374. const checksum = file.getInt32() >>> 0;
  23375. const offset = file.getInt32() >>> 0;
  23376. const length = file.getInt32() >>> 0;
  23377. const previousPosition = file.pos;
  23378. file.pos = file.start || 0;
  23379. file.skip(offset);
  23380. const data = file.getBytes(length);
  23381. file.pos = previousPosition;
  23382. if (tag === "head") {
  23383. data[8] = data[9] = data[10] = data[11] = 0;
  23384. data[17] |= 0x20;
  23385. }
  23386. return {
  23387. tag,
  23388. checksum,
  23389. length,
  23390. offset,
  23391. data
  23392. };
  23393. }
  23394. function readOpenTypeHeader(ttf) {
  23395. return {
  23396. version: ttf.getString(4),
  23397. numTables: ttf.getUint16(),
  23398. searchRange: ttf.getUint16(),
  23399. entrySelector: ttf.getUint16(),
  23400. rangeShift: ttf.getUint16()
  23401. };
  23402. }
  23403. function readTrueTypeCollectionHeader(ttc) {
  23404. const ttcTag = ttc.getString(4);
  23405. assert(ttcTag === "ttcf", "Must be a TrueType Collection font.");
  23406. const majorVersion = ttc.getUint16();
  23407. const minorVersion = ttc.getUint16();
  23408. const numFonts = ttc.getInt32() >>> 0;
  23409. const offsetTable = [];
  23410. for (let i = 0; i < numFonts; i++) {
  23411. offsetTable.push(ttc.getInt32() >>> 0);
  23412. }
  23413. const header = {
  23414. ttcTag,
  23415. majorVersion,
  23416. minorVersion,
  23417. numFonts,
  23418. offsetTable
  23419. };
  23420. switch (majorVersion) {
  23421. case 1:
  23422. return header;
  23423. case 2:
  23424. header.dsigTag = ttc.getInt32() >>> 0;
  23425. header.dsigLength = ttc.getInt32() >>> 0;
  23426. header.dsigOffset = ttc.getInt32() >>> 0;
  23427. return header;
  23428. }
  23429. throw new FormatError(`Invalid TrueType Collection majorVersion: ${majorVersion}.`);
  23430. }
  23431. function readTrueTypeCollectionData(ttc, fontName) {
  23432. const {
  23433. numFonts,
  23434. offsetTable
  23435. } = readTrueTypeCollectionHeader(ttc);
  23436. const fontNameParts = fontName.split("+");
  23437. let fallbackData;
  23438. for (let i = 0; i < numFonts; i++) {
  23439. ttc.pos = (ttc.start || 0) + offsetTable[i];
  23440. const potentialHeader = readOpenTypeHeader(ttc);
  23441. const potentialTables = readTables(ttc, potentialHeader.numTables);
  23442. if (!potentialTables.name) {
  23443. throw new FormatError('TrueType Collection font must contain a "name" table.');
  23444. }
  23445. const [nameTable] = readNameTable(potentialTables.name);
  23446. for (let j = 0, jj = nameTable.length; j < jj; j++) {
  23447. for (let k = 0, kk = nameTable[j].length; k < kk; k++) {
  23448. const nameEntry = nameTable[j][k]?.replaceAll(/\s/g, "");
  23449. if (!nameEntry) {
  23450. continue;
  23451. }
  23452. if (nameEntry === fontName) {
  23453. return {
  23454. header: potentialHeader,
  23455. tables: potentialTables
  23456. };
  23457. }
  23458. if (fontNameParts.length < 2) {
  23459. continue;
  23460. }
  23461. for (const part of fontNameParts) {
  23462. if (nameEntry === part) {
  23463. fallbackData = {
  23464. name: part,
  23465. header: potentialHeader,
  23466. tables: potentialTables
  23467. };
  23468. }
  23469. }
  23470. }
  23471. }
  23472. }
  23473. if (fallbackData) {
  23474. warn(`TrueType Collection does not contain "${fontName}" font, ` + `falling back to "${fallbackData.name}" font instead.`);
  23475. return {
  23476. header: fallbackData.header,
  23477. tables: fallbackData.tables
  23478. };
  23479. }
  23480. throw new FormatError(`TrueType Collection does not contain "${fontName}" font.`);
  23481. }
  23482. function readCmapTable(cmap, file, isSymbolicFont, hasEncoding) {
  23483. if (!cmap) {
  23484. warn("No cmap table available.");
  23485. return {
  23486. platformId: -1,
  23487. encodingId: -1,
  23488. mappings: [],
  23489. hasShortCmap: false
  23490. };
  23491. }
  23492. let segment;
  23493. let start = (file.start || 0) + cmap.offset;
  23494. file.pos = start;
  23495. file.skip(2);
  23496. const numTables = file.getUint16();
  23497. let potentialTable;
  23498. let canBreak = false;
  23499. for (let i = 0; i < numTables; i++) {
  23500. const platformId = file.getUint16();
  23501. const encodingId = file.getUint16();
  23502. const offset = file.getInt32() >>> 0;
  23503. let useTable = false;
  23504. if (potentialTable?.platformId === platformId && potentialTable?.encodingId === encodingId) {
  23505. continue;
  23506. }
  23507. if (platformId === 0 && (encodingId === 0 || encodingId === 1 || encodingId === 3)) {
  23508. useTable = true;
  23509. } else if (platformId === 1 && encodingId === 0) {
  23510. useTable = true;
  23511. } else if (platformId === 3 && encodingId === 1 && (hasEncoding || !potentialTable)) {
  23512. useTable = true;
  23513. if (!isSymbolicFont) {
  23514. canBreak = true;
  23515. }
  23516. } else if (isSymbolicFont && platformId === 3 && encodingId === 0) {
  23517. useTable = true;
  23518. let correctlySorted = true;
  23519. if (i < numTables - 1) {
  23520. const nextBytes = file.peekBytes(2),
  23521. nextPlatformId = int16(nextBytes[0], nextBytes[1]);
  23522. if (nextPlatformId < platformId) {
  23523. correctlySorted = false;
  23524. }
  23525. }
  23526. if (correctlySorted) {
  23527. canBreak = true;
  23528. }
  23529. }
  23530. if (useTable) {
  23531. potentialTable = {
  23532. platformId,
  23533. encodingId,
  23534. offset
  23535. };
  23536. }
  23537. if (canBreak) {
  23538. break;
  23539. }
  23540. }
  23541. if (potentialTable) {
  23542. file.pos = start + potentialTable.offset;
  23543. }
  23544. if (!potentialTable || file.peekByte() === -1) {
  23545. warn("Could not find a preferred cmap table.");
  23546. return {
  23547. platformId: -1,
  23548. encodingId: -1,
  23549. mappings: [],
  23550. hasShortCmap: false
  23551. };
  23552. }
  23553. const format = file.getUint16();
  23554. let hasShortCmap = false;
  23555. const mappings = [];
  23556. let j, glyphId;
  23557. if (format === 0) {
  23558. file.skip(2 + 2);
  23559. for (j = 0; j < 256; j++) {
  23560. const index = file.getByte();
  23561. if (!index) {
  23562. continue;
  23563. }
  23564. mappings.push({
  23565. charCode: j,
  23566. glyphId: index
  23567. });
  23568. }
  23569. hasShortCmap = true;
  23570. } else if (format === 2) {
  23571. file.skip(2 + 2);
  23572. const subHeaderKeys = [];
  23573. let maxSubHeaderKey = 0;
  23574. for (let i = 0; i < 256; i++) {
  23575. const subHeaderKey = file.getUint16() >> 3;
  23576. subHeaderKeys.push(subHeaderKey);
  23577. maxSubHeaderKey = Math.max(subHeaderKey, maxSubHeaderKey);
  23578. }
  23579. const subHeaders = [];
  23580. for (let i = 0; i <= maxSubHeaderKey; i++) {
  23581. subHeaders.push({
  23582. firstCode: file.getUint16(),
  23583. entryCount: file.getUint16(),
  23584. idDelta: signedInt16(file.getByte(), file.getByte()),
  23585. idRangePos: file.pos + file.getUint16()
  23586. });
  23587. }
  23588. for (let i = 0; i < 256; i++) {
  23589. if (subHeaderKeys[i] === 0) {
  23590. file.pos = subHeaders[0].idRangePos + 2 * i;
  23591. glyphId = file.getUint16();
  23592. mappings.push({
  23593. charCode: i,
  23594. glyphId
  23595. });
  23596. } else {
  23597. const s = subHeaders[subHeaderKeys[i]];
  23598. for (j = 0; j < s.entryCount; j++) {
  23599. const charCode = (i << 8) + j + s.firstCode;
  23600. file.pos = s.idRangePos + 2 * j;
  23601. glyphId = file.getUint16();
  23602. if (glyphId !== 0) {
  23603. glyphId = (glyphId + s.idDelta) % 65536;
  23604. }
  23605. mappings.push({
  23606. charCode,
  23607. glyphId
  23608. });
  23609. }
  23610. }
  23611. }
  23612. } else if (format === 4) {
  23613. file.skip(2 + 2);
  23614. const segCount = file.getUint16() >> 1;
  23615. file.skip(6);
  23616. const segments = [];
  23617. let segIndex;
  23618. for (segIndex = 0; segIndex < segCount; segIndex++) {
  23619. segments.push({
  23620. end: file.getUint16()
  23621. });
  23622. }
  23623. file.skip(2);
  23624. for (segIndex = 0; segIndex < segCount; segIndex++) {
  23625. segments[segIndex].start = file.getUint16();
  23626. }
  23627. for (segIndex = 0; segIndex < segCount; segIndex++) {
  23628. segments[segIndex].delta = file.getUint16();
  23629. }
  23630. let offsetsCount = 0,
  23631. offsetIndex;
  23632. for (segIndex = 0; segIndex < segCount; segIndex++) {
  23633. segment = segments[segIndex];
  23634. const rangeOffset = file.getUint16();
  23635. if (!rangeOffset) {
  23636. segment.offsetIndex = -1;
  23637. continue;
  23638. }
  23639. offsetIndex = (rangeOffset >> 1) - (segCount - segIndex);
  23640. segment.offsetIndex = offsetIndex;
  23641. offsetsCount = Math.max(offsetsCount, offsetIndex + segment.end - segment.start + 1);
  23642. }
  23643. const offsets = [];
  23644. for (j = 0; j < offsetsCount; j++) {
  23645. offsets.push(file.getUint16());
  23646. }
  23647. for (segIndex = 0; segIndex < segCount; segIndex++) {
  23648. segment = segments[segIndex];
  23649. start = segment.start;
  23650. const end = segment.end;
  23651. const delta = segment.delta;
  23652. offsetIndex = segment.offsetIndex;
  23653. for (j = start; j <= end; j++) {
  23654. if (j === 0xffff) {
  23655. continue;
  23656. }
  23657. glyphId = offsetIndex < 0 ? j : offsets[offsetIndex + j - start];
  23658. glyphId = glyphId + delta & 0xffff;
  23659. mappings.push({
  23660. charCode: j,
  23661. glyphId
  23662. });
  23663. }
  23664. }
  23665. } else if (format === 6) {
  23666. file.skip(2 + 2);
  23667. const firstCode = file.getUint16();
  23668. const entryCount = file.getUint16();
  23669. for (j = 0; j < entryCount; j++) {
  23670. glyphId = file.getUint16();
  23671. const charCode = firstCode + j;
  23672. mappings.push({
  23673. charCode,
  23674. glyphId
  23675. });
  23676. }
  23677. } else if (format === 12) {
  23678. file.skip(2 + 4 + 4);
  23679. const nGroups = file.getInt32() >>> 0;
  23680. for (j = 0; j < nGroups; j++) {
  23681. const startCharCode = file.getInt32() >>> 0;
  23682. const endCharCode = file.getInt32() >>> 0;
  23683. let glyphCode = file.getInt32() >>> 0;
  23684. for (let charCode = startCharCode; charCode <= endCharCode; charCode++) {
  23685. mappings.push({
  23686. charCode,
  23687. glyphId: glyphCode++
  23688. });
  23689. }
  23690. }
  23691. } else {
  23692. warn("cmap table has unsupported format: " + format);
  23693. return {
  23694. platformId: -1,
  23695. encodingId: -1,
  23696. mappings: [],
  23697. hasShortCmap: false
  23698. };
  23699. }
  23700. mappings.sort(function (a, b) {
  23701. return a.charCode - b.charCode;
  23702. });
  23703. for (let i = 1; i < mappings.length; i++) {
  23704. if (mappings[i - 1].charCode === mappings[i].charCode) {
  23705. mappings.splice(i, 1);
  23706. i--;
  23707. }
  23708. }
  23709. return {
  23710. platformId: potentialTable.platformId,
  23711. encodingId: potentialTable.encodingId,
  23712. mappings,
  23713. hasShortCmap
  23714. };
  23715. }
  23716. function sanitizeMetrics(file, header, metrics, headTable, numGlyphs, dupFirstEntry) {
  23717. if (!header) {
  23718. if (metrics) {
  23719. metrics.data = null;
  23720. }
  23721. return;
  23722. }
  23723. file.pos = (file.start || 0) + header.offset;
  23724. file.pos += 4;
  23725. file.pos += 2;
  23726. file.pos += 2;
  23727. file.pos += 2;
  23728. file.pos += 2;
  23729. file.pos += 2;
  23730. file.pos += 2;
  23731. file.pos += 2;
  23732. file.pos += 2;
  23733. file.pos += 2;
  23734. const caretOffset = file.getUint16();
  23735. file.pos += 8;
  23736. file.pos += 2;
  23737. let numOfMetrics = file.getUint16();
  23738. if (caretOffset !== 0) {
  23739. const macStyle = int16(headTable.data[44], headTable.data[45]);
  23740. if (!(macStyle & 2)) {
  23741. header.data[22] = 0;
  23742. header.data[23] = 0;
  23743. }
  23744. }
  23745. if (numOfMetrics > numGlyphs) {
  23746. info(`The numOfMetrics (${numOfMetrics}) should not be ` + `greater than the numGlyphs (${numGlyphs}).`);
  23747. numOfMetrics = numGlyphs;
  23748. header.data[34] = (numOfMetrics & 0xff00) >> 8;
  23749. header.data[35] = numOfMetrics & 0x00ff;
  23750. }
  23751. const numOfSidebearings = numGlyphs - numOfMetrics;
  23752. const numMissing = numOfSidebearings - (metrics.length - numOfMetrics * 4 >> 1);
  23753. if (numMissing > 0) {
  23754. const entries = new Uint8Array(metrics.length + numMissing * 2);
  23755. entries.set(metrics.data);
  23756. if (dupFirstEntry) {
  23757. entries[metrics.length] = metrics.data[2];
  23758. entries[metrics.length + 1] = metrics.data[3];
  23759. }
  23760. metrics.data = entries;
  23761. }
  23762. }
  23763. function sanitizeGlyph(source, sourceStart, sourceEnd, dest, destStart, hintsValid) {
  23764. const glyphProfile = {
  23765. length: 0,
  23766. sizeOfInstructions: 0
  23767. };
  23768. if (sourceStart < 0 || sourceStart >= source.length || sourceEnd > source.length || sourceEnd - sourceStart <= 12) {
  23769. return glyphProfile;
  23770. }
  23771. const glyf = source.subarray(sourceStart, sourceEnd);
  23772. const xMin = signedInt16(glyf[2], glyf[3]);
  23773. const yMin = signedInt16(glyf[4], glyf[5]);
  23774. const xMax = signedInt16(glyf[6], glyf[7]);
  23775. const yMax = signedInt16(glyf[8], glyf[9]);
  23776. if (xMin > xMax) {
  23777. writeSignedInt16(glyf, 2, xMax);
  23778. writeSignedInt16(glyf, 6, xMin);
  23779. }
  23780. if (yMin > yMax) {
  23781. writeSignedInt16(glyf, 4, yMax);
  23782. writeSignedInt16(glyf, 8, yMin);
  23783. }
  23784. const contoursCount = signedInt16(glyf[0], glyf[1]);
  23785. if (contoursCount < 0) {
  23786. if (contoursCount < -1) {
  23787. return glyphProfile;
  23788. }
  23789. dest.set(glyf, destStart);
  23790. glyphProfile.length = glyf.length;
  23791. return glyphProfile;
  23792. }
  23793. let i,
  23794. j = 10,
  23795. flagsCount = 0;
  23796. for (i = 0; i < contoursCount; i++) {
  23797. const endPoint = glyf[j] << 8 | glyf[j + 1];
  23798. flagsCount = endPoint + 1;
  23799. j += 2;
  23800. }
  23801. const instructionsStart = j;
  23802. const instructionsLength = glyf[j] << 8 | glyf[j + 1];
  23803. glyphProfile.sizeOfInstructions = instructionsLength;
  23804. j += 2 + instructionsLength;
  23805. const instructionsEnd = j;
  23806. let coordinatesLength = 0;
  23807. for (i = 0; i < flagsCount; i++) {
  23808. const flag = glyf[j++];
  23809. if (flag & 0xc0) {
  23810. glyf[j - 1] = flag & 0x3f;
  23811. }
  23812. let xLength = 2;
  23813. if (flag & 2) {
  23814. xLength = 1;
  23815. } else if (flag & 16) {
  23816. xLength = 0;
  23817. }
  23818. let yLength = 2;
  23819. if (flag & 4) {
  23820. yLength = 1;
  23821. } else if (flag & 32) {
  23822. yLength = 0;
  23823. }
  23824. const xyLength = xLength + yLength;
  23825. coordinatesLength += xyLength;
  23826. if (flag & 8) {
  23827. const repeat = glyf[j++];
  23828. if (repeat === 0) {
  23829. glyf[j - 1] ^= 8;
  23830. }
  23831. i += repeat;
  23832. coordinatesLength += repeat * xyLength;
  23833. }
  23834. }
  23835. if (coordinatesLength === 0) {
  23836. return glyphProfile;
  23837. }
  23838. let glyphDataLength = j + coordinatesLength;
  23839. if (glyphDataLength > glyf.length) {
  23840. return glyphProfile;
  23841. }
  23842. if (!hintsValid && instructionsLength > 0) {
  23843. dest.set(glyf.subarray(0, instructionsStart), destStart);
  23844. dest.set([0, 0], destStart + instructionsStart);
  23845. dest.set(glyf.subarray(instructionsEnd, glyphDataLength), destStart + instructionsStart + 2);
  23846. glyphDataLength -= instructionsLength;
  23847. if (glyf.length - glyphDataLength > 3) {
  23848. glyphDataLength = glyphDataLength + 3 & ~3;
  23849. }
  23850. glyphProfile.length = glyphDataLength;
  23851. return glyphProfile;
  23852. }
  23853. if (glyf.length - glyphDataLength > 3) {
  23854. glyphDataLength = glyphDataLength + 3 & ~3;
  23855. dest.set(glyf.subarray(0, glyphDataLength), destStart);
  23856. glyphProfile.length = glyphDataLength;
  23857. return glyphProfile;
  23858. }
  23859. dest.set(glyf, destStart);
  23860. glyphProfile.length = glyf.length;
  23861. return glyphProfile;
  23862. }
  23863. function sanitizeHead(head, numGlyphs, locaLength) {
  23864. const data = head.data;
  23865. const version = int32(data[0], data[1], data[2], data[3]);
  23866. if (version >> 16 !== 1) {
  23867. info("Attempting to fix invalid version in head table: " + version);
  23868. data[0] = 0;
  23869. data[1] = 1;
  23870. data[2] = 0;
  23871. data[3] = 0;
  23872. }
  23873. const indexToLocFormat = int16(data[50], data[51]);
  23874. if (indexToLocFormat < 0 || indexToLocFormat > 1) {
  23875. info("Attempting to fix invalid indexToLocFormat in head table: " + indexToLocFormat);
  23876. const numGlyphsPlusOne = numGlyphs + 1;
  23877. if (locaLength === numGlyphsPlusOne << 1) {
  23878. data[50] = 0;
  23879. data[51] = 0;
  23880. } else if (locaLength === numGlyphsPlusOne << 2) {
  23881. data[50] = 0;
  23882. data[51] = 1;
  23883. } else {
  23884. throw new FormatError("Could not fix indexToLocFormat: " + indexToLocFormat);
  23885. }
  23886. }
  23887. }
  23888. function sanitizeGlyphLocations(loca, glyf, numGlyphs, isGlyphLocationsLong, hintsValid, dupFirstEntry, maxSizeOfInstructions) {
  23889. let itemSize, itemDecode, itemEncode;
  23890. if (isGlyphLocationsLong) {
  23891. itemSize = 4;
  23892. itemDecode = function fontItemDecodeLong(data, offset) {
  23893. return data[offset] << 24 | data[offset + 1] << 16 | data[offset + 2] << 8 | data[offset + 3];
  23894. };
  23895. itemEncode = function fontItemEncodeLong(data, offset, value) {
  23896. data[offset] = value >>> 24 & 0xff;
  23897. data[offset + 1] = value >> 16 & 0xff;
  23898. data[offset + 2] = value >> 8 & 0xff;
  23899. data[offset + 3] = value & 0xff;
  23900. };
  23901. } else {
  23902. itemSize = 2;
  23903. itemDecode = function fontItemDecode(data, offset) {
  23904. return data[offset] << 9 | data[offset + 1] << 1;
  23905. };
  23906. itemEncode = function fontItemEncode(data, offset, value) {
  23907. data[offset] = value >> 9 & 0xff;
  23908. data[offset + 1] = value >> 1 & 0xff;
  23909. };
  23910. }
  23911. const numGlyphsOut = dupFirstEntry ? numGlyphs + 1 : numGlyphs;
  23912. const locaDataSize = itemSize * (1 + numGlyphsOut);
  23913. const locaData = new Uint8Array(locaDataSize);
  23914. locaData.set(loca.data.subarray(0, locaDataSize));
  23915. loca.data = locaData;
  23916. const oldGlyfData = glyf.data;
  23917. const oldGlyfDataLength = oldGlyfData.length;
  23918. const newGlyfData = new Uint8Array(oldGlyfDataLength);
  23919. let i, j;
  23920. const locaEntries = [];
  23921. for (i = 0, j = 0; i < numGlyphs + 1; i++, j += itemSize) {
  23922. let offset = itemDecode(locaData, j);
  23923. if (offset > oldGlyfDataLength) {
  23924. offset = oldGlyfDataLength;
  23925. }
  23926. locaEntries.push({
  23927. index: i,
  23928. offset,
  23929. endOffset: 0
  23930. });
  23931. }
  23932. locaEntries.sort((a, b) => a.offset - b.offset);
  23933. for (i = 0; i < numGlyphs; i++) {
  23934. locaEntries[i].endOffset = locaEntries[i + 1].offset;
  23935. }
  23936. locaEntries.sort((a, b) => a.index - b.index);
  23937. for (i = 0; i < numGlyphs; i++) {
  23938. const {
  23939. offset,
  23940. endOffset
  23941. } = locaEntries[i];
  23942. if (offset !== 0 || endOffset !== 0) {
  23943. break;
  23944. }
  23945. const nextOffset = locaEntries[i + 1].offset;
  23946. if (nextOffset === 0) {
  23947. continue;
  23948. }
  23949. locaEntries[i].endOffset = nextOffset;
  23950. break;
  23951. }
  23952. const last = locaEntries.at(-2);
  23953. if (last.offset !== 0 && last.endOffset === 0) {
  23954. last.endOffset = oldGlyfDataLength;
  23955. }
  23956. const missingGlyphs = Object.create(null);
  23957. let writeOffset = 0;
  23958. itemEncode(locaData, 0, writeOffset);
  23959. for (i = 0, j = itemSize; i < numGlyphs; i++, j += itemSize) {
  23960. const glyphProfile = sanitizeGlyph(oldGlyfData, locaEntries[i].offset, locaEntries[i].endOffset, newGlyfData, writeOffset, hintsValid);
  23961. const newLength = glyphProfile.length;
  23962. if (newLength === 0) {
  23963. missingGlyphs[i] = true;
  23964. }
  23965. if (glyphProfile.sizeOfInstructions > maxSizeOfInstructions) {
  23966. maxSizeOfInstructions = glyphProfile.sizeOfInstructions;
  23967. }
  23968. writeOffset += newLength;
  23969. itemEncode(locaData, j, writeOffset);
  23970. }
  23971. if (writeOffset === 0) {
  23972. const simpleGlyph = new Uint8Array([0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 0]);
  23973. for (i = 0, j = itemSize; i < numGlyphsOut; i++, j += itemSize) {
  23974. itemEncode(locaData, j, simpleGlyph.length);
  23975. }
  23976. glyf.data = simpleGlyph;
  23977. } else if (dupFirstEntry) {
  23978. const firstEntryLength = itemDecode(locaData, itemSize);
  23979. if (newGlyfData.length > firstEntryLength + writeOffset) {
  23980. glyf.data = newGlyfData.subarray(0, firstEntryLength + writeOffset);
  23981. } else {
  23982. glyf.data = new Uint8Array(firstEntryLength + writeOffset);
  23983. glyf.data.set(newGlyfData.subarray(0, writeOffset));
  23984. }
  23985. glyf.data.set(newGlyfData.subarray(0, firstEntryLength), writeOffset);
  23986. itemEncode(loca.data, locaData.length - itemSize, writeOffset + firstEntryLength);
  23987. } else {
  23988. glyf.data = newGlyfData.subarray(0, writeOffset);
  23989. }
  23990. return {
  23991. missingGlyphs,
  23992. maxSizeOfInstructions
  23993. };
  23994. }
  23995. function readPostScriptTable(post, propertiesObj, maxpNumGlyphs) {
  23996. const start = (font.start || 0) + post.offset;
  23997. font.pos = start;
  23998. const length = post.length,
  23999. end = start + length;
  24000. const version = font.getInt32();
  24001. font.skip(28);
  24002. let glyphNames;
  24003. let valid = true;
  24004. let i;
  24005. switch (version) {
  24006. case 0x00010000:
  24007. glyphNames = MacStandardGlyphOrdering;
  24008. break;
  24009. case 0x00020000:
  24010. const numGlyphs = font.getUint16();
  24011. if (numGlyphs !== maxpNumGlyphs) {
  24012. valid = false;
  24013. break;
  24014. }
  24015. const glyphNameIndexes = [];
  24016. for (i = 0; i < numGlyphs; ++i) {
  24017. const index = font.getUint16();
  24018. if (index >= 32768) {
  24019. valid = false;
  24020. break;
  24021. }
  24022. glyphNameIndexes.push(index);
  24023. }
  24024. if (!valid) {
  24025. break;
  24026. }
  24027. const customNames = [],
  24028. strBuf = [];
  24029. while (font.pos < end) {
  24030. const stringLength = font.getByte();
  24031. strBuf.length = stringLength;
  24032. for (i = 0; i < stringLength; ++i) {
  24033. strBuf[i] = String.fromCharCode(font.getByte());
  24034. }
  24035. customNames.push(strBuf.join(""));
  24036. }
  24037. glyphNames = [];
  24038. for (i = 0; i < numGlyphs; ++i) {
  24039. const j = glyphNameIndexes[i];
  24040. if (j < 258) {
  24041. glyphNames.push(MacStandardGlyphOrdering[j]);
  24042. continue;
  24043. }
  24044. glyphNames.push(customNames[j - 258]);
  24045. }
  24046. break;
  24047. case 0x00030000:
  24048. break;
  24049. default:
  24050. warn("Unknown/unsupported post table version " + version);
  24051. valid = false;
  24052. if (propertiesObj.defaultEncoding) {
  24053. glyphNames = propertiesObj.defaultEncoding;
  24054. }
  24055. break;
  24056. }
  24057. propertiesObj.glyphNames = glyphNames;
  24058. return valid;
  24059. }
  24060. function readNameTable(nameTable) {
  24061. const start = (font.start || 0) + nameTable.offset;
  24062. font.pos = start;
  24063. const names = [[], []],
  24064. records = [];
  24065. const length = nameTable.length,
  24066. end = start + length;
  24067. const format = font.getUint16();
  24068. const FORMAT_0_HEADER_LENGTH = 6;
  24069. if (format !== 0 || length < FORMAT_0_HEADER_LENGTH) {
  24070. return [names, records];
  24071. }
  24072. const numRecords = font.getUint16();
  24073. const stringsStart = font.getUint16();
  24074. const NAME_RECORD_LENGTH = 12;
  24075. let i, ii;
  24076. for (i = 0; i < numRecords && font.pos + NAME_RECORD_LENGTH <= end; i++) {
  24077. const r = {
  24078. platform: font.getUint16(),
  24079. encoding: font.getUint16(),
  24080. language: font.getUint16(),
  24081. name: font.getUint16(),
  24082. length: font.getUint16(),
  24083. offset: font.getUint16()
  24084. };
  24085. if (isMacNameRecord(r) || isWinNameRecord(r)) {
  24086. records.push(r);
  24087. }
  24088. }
  24089. for (i = 0, ii = records.length; i < ii; i++) {
  24090. const record = records[i];
  24091. if (record.length <= 0) {
  24092. continue;
  24093. }
  24094. const pos = start + stringsStart + record.offset;
  24095. if (pos + record.length > end) {
  24096. continue;
  24097. }
  24098. font.pos = pos;
  24099. const nameIndex = record.name;
  24100. if (record.encoding) {
  24101. let str = "";
  24102. for (let j = 0, jj = record.length; j < jj; j += 2) {
  24103. str += String.fromCharCode(font.getUint16());
  24104. }
  24105. names[1][nameIndex] = str;
  24106. } else {
  24107. names[0][nameIndex] = font.getString(record.length);
  24108. }
  24109. }
  24110. return [names, records];
  24111. }
  24112. 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];
  24113. function sanitizeTTProgram(table, ttContext) {
  24114. let data = table.data;
  24115. let i = 0,
  24116. j,
  24117. n,
  24118. b,
  24119. funcId,
  24120. pc,
  24121. lastEndf = 0,
  24122. lastDeff = 0;
  24123. const stack = [];
  24124. const callstack = [];
  24125. const functionsCalled = [];
  24126. let tooComplexToFollowFunctions = ttContext.tooComplexToFollowFunctions;
  24127. let inFDEF = false,
  24128. ifLevel = 0,
  24129. inELSE = 0;
  24130. for (let ii = data.length; i < ii;) {
  24131. const op = data[i++];
  24132. if (op === 0x40) {
  24133. n = data[i++];
  24134. if (inFDEF || inELSE) {
  24135. i += n;
  24136. } else {
  24137. for (j = 0; j < n; j++) {
  24138. stack.push(data[i++]);
  24139. }
  24140. }
  24141. } else if (op === 0x41) {
  24142. n = data[i++];
  24143. if (inFDEF || inELSE) {
  24144. i += n * 2;
  24145. } else {
  24146. for (j = 0; j < n; j++) {
  24147. b = data[i++];
  24148. stack.push(b << 8 | data[i++]);
  24149. }
  24150. }
  24151. } else if ((op & 0xf8) === 0xb0) {
  24152. n = op - 0xb0 + 1;
  24153. if (inFDEF || inELSE) {
  24154. i += n;
  24155. } else {
  24156. for (j = 0; j < n; j++) {
  24157. stack.push(data[i++]);
  24158. }
  24159. }
  24160. } else if ((op & 0xf8) === 0xb8) {
  24161. n = op - 0xb8 + 1;
  24162. if (inFDEF || inELSE) {
  24163. i += n * 2;
  24164. } else {
  24165. for (j = 0; j < n; j++) {
  24166. b = data[i++];
  24167. stack.push(b << 8 | data[i++]);
  24168. }
  24169. }
  24170. } else if (op === 0x2b && !tooComplexToFollowFunctions) {
  24171. if (!inFDEF && !inELSE) {
  24172. funcId = stack.at(-1);
  24173. if (isNaN(funcId)) {
  24174. info("TT: CALL empty stack (or invalid entry).");
  24175. } else {
  24176. ttContext.functionsUsed[funcId] = true;
  24177. if (funcId in ttContext.functionsStackDeltas) {
  24178. const newStackLength = stack.length + ttContext.functionsStackDeltas[funcId];
  24179. if (newStackLength < 0) {
  24180. warn("TT: CALL invalid functions stack delta.");
  24181. ttContext.hintsValid = false;
  24182. return;
  24183. }
  24184. stack.length = newStackLength;
  24185. } else if (funcId in ttContext.functionsDefined && !functionsCalled.includes(funcId)) {
  24186. callstack.push({
  24187. data,
  24188. i,
  24189. stackTop: stack.length - 1
  24190. });
  24191. functionsCalled.push(funcId);
  24192. pc = ttContext.functionsDefined[funcId];
  24193. if (!pc) {
  24194. warn("TT: CALL non-existent function");
  24195. ttContext.hintsValid = false;
  24196. return;
  24197. }
  24198. data = pc.data;
  24199. i = pc.i;
  24200. }
  24201. }
  24202. }
  24203. } else if (op === 0x2c && !tooComplexToFollowFunctions) {
  24204. if (inFDEF || inELSE) {
  24205. warn("TT: nested FDEFs not allowed");
  24206. tooComplexToFollowFunctions = true;
  24207. }
  24208. inFDEF = true;
  24209. lastDeff = i;
  24210. funcId = stack.pop();
  24211. ttContext.functionsDefined[funcId] = {
  24212. data,
  24213. i
  24214. };
  24215. } else if (op === 0x2d) {
  24216. if (inFDEF) {
  24217. inFDEF = false;
  24218. lastEndf = i;
  24219. } else {
  24220. pc = callstack.pop();
  24221. if (!pc) {
  24222. warn("TT: ENDF bad stack");
  24223. ttContext.hintsValid = false;
  24224. return;
  24225. }
  24226. funcId = functionsCalled.pop();
  24227. data = pc.data;
  24228. i = pc.i;
  24229. ttContext.functionsStackDeltas[funcId] = stack.length - pc.stackTop;
  24230. }
  24231. } else if (op === 0x89) {
  24232. if (inFDEF || inELSE) {
  24233. warn("TT: nested IDEFs not allowed");
  24234. tooComplexToFollowFunctions = true;
  24235. }
  24236. inFDEF = true;
  24237. lastDeff = i;
  24238. } else if (op === 0x58) {
  24239. ++ifLevel;
  24240. } else if (op === 0x1b) {
  24241. inELSE = ifLevel;
  24242. } else if (op === 0x59) {
  24243. if (inELSE === ifLevel) {
  24244. inELSE = 0;
  24245. }
  24246. --ifLevel;
  24247. } else if (op === 0x1c) {
  24248. if (!inFDEF && !inELSE) {
  24249. const offset = stack.at(-1);
  24250. if (offset > 0) {
  24251. i += offset - 1;
  24252. }
  24253. }
  24254. }
  24255. if (!inFDEF && !inELSE) {
  24256. let stackDelta = 0;
  24257. if (op <= 0x8e) {
  24258. stackDelta = TTOpsStackDeltas[op];
  24259. } else if (op >= 0xc0 && op <= 0xdf) {
  24260. stackDelta = -1;
  24261. } else if (op >= 0xe0) {
  24262. stackDelta = -2;
  24263. }
  24264. if (op >= 0x71 && op <= 0x75) {
  24265. n = stack.pop();
  24266. if (!isNaN(n)) {
  24267. stackDelta = -n * 2;
  24268. }
  24269. }
  24270. while (stackDelta < 0 && stack.length > 0) {
  24271. stack.pop();
  24272. stackDelta++;
  24273. }
  24274. while (stackDelta > 0) {
  24275. stack.push(NaN);
  24276. stackDelta--;
  24277. }
  24278. }
  24279. }
  24280. ttContext.tooComplexToFollowFunctions = tooComplexToFollowFunctions;
  24281. const content = [data];
  24282. if (i > data.length) {
  24283. content.push(new Uint8Array(i - data.length));
  24284. }
  24285. if (lastDeff > lastEndf) {
  24286. warn("TT: complementing a missing function tail");
  24287. content.push(new Uint8Array([0x22, 0x2d]));
  24288. }
  24289. foldTTTable(table, content);
  24290. }
  24291. function checkInvalidFunctions(ttContext, maxFunctionDefs) {
  24292. if (ttContext.tooComplexToFollowFunctions) {
  24293. return;
  24294. }
  24295. if (ttContext.functionsDefined.length > maxFunctionDefs) {
  24296. warn("TT: more functions defined than expected");
  24297. ttContext.hintsValid = false;
  24298. return;
  24299. }
  24300. for (let j = 0, jj = ttContext.functionsUsed.length; j < jj; j++) {
  24301. if (j > maxFunctionDefs) {
  24302. warn("TT: invalid function id: " + j);
  24303. ttContext.hintsValid = false;
  24304. return;
  24305. }
  24306. if (ttContext.functionsUsed[j] && !ttContext.functionsDefined[j]) {
  24307. warn("TT: undefined function: " + j);
  24308. ttContext.hintsValid = false;
  24309. return;
  24310. }
  24311. }
  24312. }
  24313. function foldTTTable(table, content) {
  24314. if (content.length > 1) {
  24315. let newLength = 0;
  24316. let j, jj;
  24317. for (j = 0, jj = content.length; j < jj; j++) {
  24318. newLength += content[j].length;
  24319. }
  24320. newLength = newLength + 3 & ~3;
  24321. const result = new Uint8Array(newLength);
  24322. let pos = 0;
  24323. for (j = 0, jj = content.length; j < jj; j++) {
  24324. result.set(content[j], pos);
  24325. pos += content[j].length;
  24326. }
  24327. table.data = result;
  24328. table.length = newLength;
  24329. }
  24330. }
  24331. function sanitizeTTPrograms(fpgm, prep, cvt, maxFunctionDefs) {
  24332. const ttContext = {
  24333. functionsDefined: [],
  24334. functionsUsed: [],
  24335. functionsStackDeltas: [],
  24336. tooComplexToFollowFunctions: false,
  24337. hintsValid: true
  24338. };
  24339. if (fpgm) {
  24340. sanitizeTTProgram(fpgm, ttContext);
  24341. }
  24342. if (prep) {
  24343. sanitizeTTProgram(prep, ttContext);
  24344. }
  24345. if (fpgm) {
  24346. checkInvalidFunctions(ttContext, maxFunctionDefs);
  24347. }
  24348. if (cvt && cvt.length & 1) {
  24349. const cvtData = new Uint8Array(cvt.length + 1);
  24350. cvtData.set(cvt.data);
  24351. cvt.data = cvtData;
  24352. }
  24353. return ttContext.hintsValid;
  24354. }
  24355. font = new Stream(new Uint8Array(font.getBytes()));
  24356. let header, tables;
  24357. if (isTrueTypeCollectionFile(font)) {
  24358. const ttcData = readTrueTypeCollectionData(font, this.name);
  24359. header = ttcData.header;
  24360. tables = ttcData.tables;
  24361. } else {
  24362. header = readOpenTypeHeader(font);
  24363. tables = readTables(font, header.numTables);
  24364. }
  24365. let cff, cffFile;
  24366. const isTrueType = !tables["CFF "];
  24367. if (!isTrueType) {
  24368. const isComposite = properties.composite && (properties.cidToGidMap?.length > 0 || !(properties.cMap instanceof IdentityCMap));
  24369. if (header.version === "OTTO" && !isComposite || !tables.head || !tables.hhea || !tables.maxp || !tables.post) {
  24370. cffFile = new Stream(tables["CFF "].data);
  24371. cff = new CFFFont(cffFile, properties);
  24372. adjustWidths(properties);
  24373. return this.convert(name, cff, properties);
  24374. }
  24375. delete tables.glyf;
  24376. delete tables.loca;
  24377. delete tables.fpgm;
  24378. delete tables.prep;
  24379. delete tables["cvt "];
  24380. this.isOpenType = true;
  24381. } else {
  24382. if (!tables.loca) {
  24383. throw new FormatError('Required "loca" table is not found');
  24384. }
  24385. if (!tables.glyf) {
  24386. warn('Required "glyf" table is not found -- trying to recover.');
  24387. tables.glyf = {
  24388. tag: "glyf",
  24389. data: new Uint8Array(0)
  24390. };
  24391. }
  24392. this.isOpenType = false;
  24393. }
  24394. if (!tables.maxp) {
  24395. throw new FormatError('Required "maxp" table is not found');
  24396. }
  24397. font.pos = (font.start || 0) + tables.maxp.offset;
  24398. let version = font.getInt32();
  24399. const numGlyphs = font.getUint16();
  24400. if (version !== 0x00010000 && version !== 0x00005000) {
  24401. if (tables.maxp.length === 6) {
  24402. version = 0x0005000;
  24403. } else if (tables.maxp.length >= 32) {
  24404. version = 0x00010000;
  24405. } else {
  24406. throw new FormatError(`"maxp" table has a wrong version number`);
  24407. }
  24408. writeUint32(tables.maxp.data, 0, version);
  24409. }
  24410. if (properties.scaleFactors?.length === numGlyphs && isTrueType) {
  24411. const {
  24412. scaleFactors
  24413. } = properties;
  24414. const isGlyphLocationsLong = int16(tables.head.data[50], tables.head.data[51]);
  24415. const glyphs = new GlyfTable({
  24416. glyfTable: tables.glyf.data,
  24417. isGlyphLocationsLong,
  24418. locaTable: tables.loca.data,
  24419. numGlyphs
  24420. });
  24421. glyphs.scale(scaleFactors);
  24422. const {
  24423. glyf,
  24424. loca,
  24425. isLocationLong
  24426. } = glyphs.write();
  24427. tables.glyf.data = glyf;
  24428. tables.loca.data = loca;
  24429. if (isLocationLong !== !!isGlyphLocationsLong) {
  24430. tables.head.data[50] = 0;
  24431. tables.head.data[51] = isLocationLong ? 1 : 0;
  24432. }
  24433. const metrics = tables.hmtx.data;
  24434. for (let i = 0; i < numGlyphs; i++) {
  24435. const j = 4 * i;
  24436. const advanceWidth = Math.round(scaleFactors[i] * int16(metrics[j], metrics[j + 1]));
  24437. metrics[j] = advanceWidth >> 8 & 0xff;
  24438. metrics[j + 1] = advanceWidth & 0xff;
  24439. const lsb = Math.round(scaleFactors[i] * signedInt16(metrics[j + 2], metrics[j + 3]));
  24440. writeSignedInt16(metrics, j + 2, lsb);
  24441. }
  24442. }
  24443. let numGlyphsOut = numGlyphs + 1;
  24444. let dupFirstEntry = true;
  24445. if (numGlyphsOut > 0xffff) {
  24446. dupFirstEntry = false;
  24447. numGlyphsOut = numGlyphs;
  24448. warn("Not enough space in glyfs to duplicate first glyph.");
  24449. }
  24450. let maxFunctionDefs = 0;
  24451. let maxSizeOfInstructions = 0;
  24452. if (version >= 0x00010000 && tables.maxp.length >= 32) {
  24453. font.pos += 8;
  24454. const maxZones = font.getUint16();
  24455. if (maxZones > 2) {
  24456. tables.maxp.data[14] = 0;
  24457. tables.maxp.data[15] = 2;
  24458. }
  24459. font.pos += 4;
  24460. maxFunctionDefs = font.getUint16();
  24461. font.pos += 4;
  24462. maxSizeOfInstructions = font.getUint16();
  24463. }
  24464. tables.maxp.data[4] = numGlyphsOut >> 8;
  24465. tables.maxp.data[5] = numGlyphsOut & 255;
  24466. const hintsValid = sanitizeTTPrograms(tables.fpgm, tables.prep, tables["cvt "], maxFunctionDefs);
  24467. if (!hintsValid) {
  24468. delete tables.fpgm;
  24469. delete tables.prep;
  24470. delete tables["cvt "];
  24471. }
  24472. sanitizeMetrics(font, tables.hhea, tables.hmtx, tables.head, numGlyphsOut, dupFirstEntry);
  24473. if (!tables.head) {
  24474. throw new FormatError('Required "head" table is not found');
  24475. }
  24476. sanitizeHead(tables.head, numGlyphs, isTrueType ? tables.loca.length : 0);
  24477. let missingGlyphs = Object.create(null);
  24478. if (isTrueType) {
  24479. const isGlyphLocationsLong = int16(tables.head.data[50], tables.head.data[51]);
  24480. const glyphsInfo = sanitizeGlyphLocations(tables.loca, tables.glyf, numGlyphs, isGlyphLocationsLong, hintsValid, dupFirstEntry, maxSizeOfInstructions);
  24481. missingGlyphs = glyphsInfo.missingGlyphs;
  24482. if (version >= 0x00010000 && tables.maxp.length >= 32) {
  24483. tables.maxp.data[26] = glyphsInfo.maxSizeOfInstructions >> 8;
  24484. tables.maxp.data[27] = glyphsInfo.maxSizeOfInstructions & 255;
  24485. }
  24486. }
  24487. if (!tables.hhea) {
  24488. throw new FormatError('Required "hhea" table is not found');
  24489. }
  24490. if (tables.hhea.data[10] === 0 && tables.hhea.data[11] === 0) {
  24491. tables.hhea.data[10] = 0xff;
  24492. tables.hhea.data[11] = 0xff;
  24493. }
  24494. const metricsOverride = {
  24495. unitsPerEm: int16(tables.head.data[18], tables.head.data[19]),
  24496. yMax: signedInt16(tables.head.data[42], tables.head.data[43]),
  24497. yMin: signedInt16(tables.head.data[38], tables.head.data[39]),
  24498. ascent: signedInt16(tables.hhea.data[4], tables.hhea.data[5]),
  24499. descent: signedInt16(tables.hhea.data[6], tables.hhea.data[7]),
  24500. lineGap: signedInt16(tables.hhea.data[8], tables.hhea.data[9])
  24501. };
  24502. this.ascent = metricsOverride.ascent / metricsOverride.unitsPerEm;
  24503. this.descent = metricsOverride.descent / metricsOverride.unitsPerEm;
  24504. this.lineGap = metricsOverride.lineGap / metricsOverride.unitsPerEm;
  24505. if (this.cssFontInfo?.lineHeight) {
  24506. this.lineHeight = this.cssFontInfo.metrics.lineHeight;
  24507. this.lineGap = this.cssFontInfo.metrics.lineGap;
  24508. } else {
  24509. this.lineHeight = this.ascent - this.descent + this.lineGap;
  24510. }
  24511. if (tables.post) {
  24512. readPostScriptTable(tables.post, properties, numGlyphs);
  24513. }
  24514. tables.post = {
  24515. tag: "post",
  24516. data: createPostTable(properties)
  24517. };
  24518. const charCodeToGlyphId = Object.create(null);
  24519. function hasGlyph(glyphId) {
  24520. return !missingGlyphs[glyphId];
  24521. }
  24522. if (properties.composite) {
  24523. const cidToGidMap = properties.cidToGidMap || [];
  24524. const isCidToGidMapEmpty = cidToGidMap.length === 0;
  24525. properties.cMap.forEach(function (charCode, cid) {
  24526. if (typeof cid === "string") {
  24527. cid = convertCidString(charCode, cid, true);
  24528. }
  24529. if (cid > 0xffff) {
  24530. throw new FormatError("Max size of CID is 65,535");
  24531. }
  24532. let glyphId = -1;
  24533. if (isCidToGidMapEmpty) {
  24534. glyphId = cid;
  24535. } else if (cidToGidMap[cid] !== undefined) {
  24536. glyphId = cidToGidMap[cid];
  24537. }
  24538. if (glyphId >= 0 && glyphId < numGlyphs && hasGlyph(glyphId)) {
  24539. charCodeToGlyphId[charCode] = glyphId;
  24540. }
  24541. });
  24542. } else {
  24543. const cmapTable = readCmapTable(tables.cmap, font, this.isSymbolicFont, properties.hasEncoding);
  24544. const cmapPlatformId = cmapTable.platformId;
  24545. const cmapEncodingId = cmapTable.encodingId;
  24546. const cmapMappings = cmapTable.mappings;
  24547. let baseEncoding = [],
  24548. forcePostTable = false;
  24549. if (properties.hasEncoding && (properties.baseEncodingName === "MacRomanEncoding" || properties.baseEncodingName === "WinAnsiEncoding")) {
  24550. baseEncoding = getEncoding(properties.baseEncodingName);
  24551. }
  24552. if (properties.hasEncoding && !this.isSymbolicFont && (cmapPlatformId === 3 && cmapEncodingId === 1 || cmapPlatformId === 1 && cmapEncodingId === 0)) {
  24553. const glyphsUnicodeMap = getGlyphsUnicode();
  24554. for (let charCode = 0; charCode < 256; charCode++) {
  24555. let glyphName;
  24556. if (this.differences[charCode] !== undefined) {
  24557. glyphName = this.differences[charCode];
  24558. } else if (baseEncoding.length && baseEncoding[charCode] !== "") {
  24559. glyphName = baseEncoding[charCode];
  24560. } else {
  24561. glyphName = StandardEncoding[charCode];
  24562. }
  24563. if (!glyphName) {
  24564. continue;
  24565. }
  24566. const standardGlyphName = recoverGlyphName(glyphName, glyphsUnicodeMap);
  24567. let unicodeOrCharCode;
  24568. if (cmapPlatformId === 3 && cmapEncodingId === 1) {
  24569. unicodeOrCharCode = glyphsUnicodeMap[standardGlyphName];
  24570. } else if (cmapPlatformId === 1 && cmapEncodingId === 0) {
  24571. unicodeOrCharCode = MacRomanEncoding.indexOf(standardGlyphName);
  24572. }
  24573. if (unicodeOrCharCode === undefined) {
  24574. if (!properties.glyphNames && properties.hasIncludedToUnicodeMap && !(this.toUnicode instanceof IdentityToUnicodeMap)) {
  24575. const unicode = this.toUnicode.get(charCode);
  24576. if (unicode) {
  24577. unicodeOrCharCode = unicode.codePointAt(0);
  24578. }
  24579. }
  24580. if (unicodeOrCharCode === undefined) {
  24581. continue;
  24582. }
  24583. }
  24584. for (const mapping of cmapMappings) {
  24585. if (mapping.charCode !== unicodeOrCharCode) {
  24586. continue;
  24587. }
  24588. charCodeToGlyphId[charCode] = mapping.glyphId;
  24589. break;
  24590. }
  24591. }
  24592. } else if (cmapPlatformId === 0) {
  24593. for (const mapping of cmapMappings) {
  24594. charCodeToGlyphId[mapping.charCode] = mapping.glyphId;
  24595. }
  24596. forcePostTable = true;
  24597. } else if (cmapPlatformId === 3 && cmapEncodingId === 0) {
  24598. for (const mapping of cmapMappings) {
  24599. let charCode = mapping.charCode;
  24600. if (charCode >= 0xf000 && charCode <= 0xf0ff) {
  24601. charCode &= 0xff;
  24602. }
  24603. charCodeToGlyphId[charCode] = mapping.glyphId;
  24604. }
  24605. } else {
  24606. for (const mapping of cmapMappings) {
  24607. charCodeToGlyphId[mapping.charCode] = mapping.glyphId;
  24608. }
  24609. }
  24610. if (properties.glyphNames && (baseEncoding.length || this.differences.length)) {
  24611. for (let i = 0; i < 256; ++i) {
  24612. if (!forcePostTable && charCodeToGlyphId[i] !== undefined) {
  24613. continue;
  24614. }
  24615. const glyphName = this.differences[i] || baseEncoding[i];
  24616. if (!glyphName) {
  24617. continue;
  24618. }
  24619. const glyphId = properties.glyphNames.indexOf(glyphName);
  24620. if (glyphId > 0 && hasGlyph(glyphId)) {
  24621. charCodeToGlyphId[i] = glyphId;
  24622. }
  24623. }
  24624. }
  24625. }
  24626. if (charCodeToGlyphId.length === 0) {
  24627. charCodeToGlyphId[0] = 0;
  24628. }
  24629. let glyphZeroId = numGlyphsOut - 1;
  24630. if (!dupFirstEntry) {
  24631. glyphZeroId = 0;
  24632. }
  24633. if (!properties.cssFontInfo) {
  24634. const newMapping = adjustMapping(charCodeToGlyphId, hasGlyph, glyphZeroId, this.toUnicode);
  24635. this.toFontChar = newMapping.toFontChar;
  24636. tables.cmap = {
  24637. tag: "cmap",
  24638. data: createCmapTable(newMapping.charCodeToGlyphId, newMapping.toUnicodeExtraMap, numGlyphsOut)
  24639. };
  24640. if (!tables["OS/2"] || !validateOS2Table(tables["OS/2"], font)) {
  24641. tables["OS/2"] = {
  24642. tag: "OS/2",
  24643. data: createOS2Table(properties, newMapping.charCodeToGlyphId, metricsOverride)
  24644. };
  24645. }
  24646. }
  24647. if (!isTrueType) {
  24648. try {
  24649. cffFile = new Stream(tables["CFF "].data);
  24650. const parser = new CFFParser(cffFile, properties, SEAC_ANALYSIS_ENABLED);
  24651. cff = parser.parse();
  24652. cff.duplicateFirstGlyph();
  24653. const compiler = new CFFCompiler(cff);
  24654. tables["CFF "].data = compiler.compile();
  24655. } catch {
  24656. warn("Failed to compile font " + properties.loadedName);
  24657. }
  24658. }
  24659. if (!tables.name) {
  24660. tables.name = {
  24661. tag: "name",
  24662. data: createNameTable(this.name)
  24663. };
  24664. } else {
  24665. const [namePrototype, nameRecords] = readNameTable(tables.name);
  24666. tables.name.data = createNameTable(name, namePrototype);
  24667. this.psName = namePrototype[0][6] || null;
  24668. if (!properties.composite) {
  24669. adjustTrueTypeToUnicode(properties, this.isSymbolicFont, nameRecords);
  24670. }
  24671. }
  24672. const builder = new OpenTypeFileBuilder(header.version);
  24673. for (const tableTag in tables) {
  24674. builder.addTable(tableTag, tables[tableTag].data);
  24675. }
  24676. return builder.toArray();
  24677. }
  24678. convert(fontName, font, properties) {
  24679. properties.fixedPitch = false;
  24680. if (properties.builtInEncoding) {
  24681. adjustType1ToUnicode(properties, properties.builtInEncoding);
  24682. }
  24683. let glyphZeroId = 1;
  24684. if (font instanceof CFFFont) {
  24685. glyphZeroId = font.numGlyphs - 1;
  24686. }
  24687. const mapping = font.getGlyphMapping(properties);
  24688. let newMapping = null;
  24689. let newCharCodeToGlyphId = mapping;
  24690. let toUnicodeExtraMap = null;
  24691. if (!properties.cssFontInfo) {
  24692. newMapping = adjustMapping(mapping, font.hasGlyphId.bind(font), glyphZeroId, this.toUnicode);
  24693. this.toFontChar = newMapping.toFontChar;
  24694. newCharCodeToGlyphId = newMapping.charCodeToGlyphId;
  24695. toUnicodeExtraMap = newMapping.toUnicodeExtraMap;
  24696. }
  24697. const numGlyphs = font.numGlyphs;
  24698. function getCharCodes(charCodeToGlyphId, glyphId) {
  24699. let charCodes = null;
  24700. for (const charCode in charCodeToGlyphId) {
  24701. if (glyphId === charCodeToGlyphId[charCode]) {
  24702. (charCodes ||= []).push(charCode | 0);
  24703. }
  24704. }
  24705. return charCodes;
  24706. }
  24707. function createCharCode(charCodeToGlyphId, glyphId) {
  24708. for (const charCode in charCodeToGlyphId) {
  24709. if (glyphId === charCodeToGlyphId[charCode]) {
  24710. return charCode | 0;
  24711. }
  24712. }
  24713. newMapping.charCodeToGlyphId[newMapping.nextAvailableFontCharCode] = glyphId;
  24714. return newMapping.nextAvailableFontCharCode++;
  24715. }
  24716. const seacs = font.seacs;
  24717. if (newMapping && SEAC_ANALYSIS_ENABLED && seacs?.length) {
  24718. const matrix = properties.fontMatrix || FONT_IDENTITY_MATRIX;
  24719. const charset = font.getCharset();
  24720. const seacMap = Object.create(null);
  24721. for (let glyphId in seacs) {
  24722. glyphId |= 0;
  24723. const seac = seacs[glyphId];
  24724. const baseGlyphName = StandardEncoding[seac[2]];
  24725. const accentGlyphName = StandardEncoding[seac[3]];
  24726. const baseGlyphId = charset.indexOf(baseGlyphName);
  24727. const accentGlyphId = charset.indexOf(accentGlyphName);
  24728. if (baseGlyphId < 0 || accentGlyphId < 0) {
  24729. continue;
  24730. }
  24731. const accentOffset = {
  24732. x: seac[0] * matrix[0] + seac[1] * matrix[2] + matrix[4],
  24733. y: seac[0] * matrix[1] + seac[1] * matrix[3] + matrix[5]
  24734. };
  24735. const charCodes = getCharCodes(mapping, glyphId);
  24736. if (!charCodes) {
  24737. continue;
  24738. }
  24739. for (const charCode of charCodes) {
  24740. const charCodeToGlyphId = newMapping.charCodeToGlyphId;
  24741. const baseFontCharCode = createCharCode(charCodeToGlyphId, baseGlyphId);
  24742. const accentFontCharCode = createCharCode(charCodeToGlyphId, accentGlyphId);
  24743. seacMap[charCode] = {
  24744. baseFontCharCode,
  24745. accentFontCharCode,
  24746. accentOffset
  24747. };
  24748. }
  24749. }
  24750. properties.seacMap = seacMap;
  24751. }
  24752. const unitsPerEm = properties.fontMatrix ? 1 / Math.max(...properties.fontMatrix.slice(0, 4).map(Math.abs)) : 1000;
  24753. const builder = new OpenTypeFileBuilder("\x4F\x54\x54\x4F");
  24754. builder.addTable("CFF ", font.data);
  24755. builder.addTable("OS/2", createOS2Table(properties, newCharCodeToGlyphId));
  24756. builder.addTable("cmap", createCmapTable(newCharCodeToGlyphId, toUnicodeExtraMap, numGlyphs));
  24757. 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");
  24758. 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));
  24759. builder.addTable("hmtx", function fontFieldsHmtx() {
  24760. const charstrings = font.charstrings;
  24761. const cffWidths = font.cff ? font.cff.widths : null;
  24762. let hmtx = "\x00\x00\x00\x00";
  24763. for (let i = 1, ii = numGlyphs; i < ii; i++) {
  24764. let width = 0;
  24765. if (charstrings) {
  24766. const charstring = charstrings[i - 1];
  24767. width = "width" in charstring ? charstring.width : 0;
  24768. } else if (cffWidths) {
  24769. width = Math.ceil(cffWidths[i] || 0);
  24770. }
  24771. hmtx += string16(width) + string16(0);
  24772. }
  24773. return hmtx;
  24774. }());
  24775. builder.addTable("maxp", "\x00\x00\x50\x00" + string16(numGlyphs));
  24776. builder.addTable("name", createNameTable(fontName));
  24777. builder.addTable("post", createPostTable(properties));
  24778. return builder.toArray();
  24779. }
  24780. get _spaceWidth() {
  24781. const possibleSpaceReplacements = ["space", "minus", "one", "i", "I"];
  24782. let width;
  24783. for (const glyphName of possibleSpaceReplacements) {
  24784. if (glyphName in this.widths) {
  24785. width = this.widths[glyphName];
  24786. break;
  24787. }
  24788. const glyphsUnicodeMap = getGlyphsUnicode();
  24789. const glyphUnicode = glyphsUnicodeMap[glyphName];
  24790. let charcode = 0;
  24791. if (this.composite && this.cMap.contains(glyphUnicode)) {
  24792. charcode = this.cMap.lookup(glyphUnicode);
  24793. if (typeof charcode === "string") {
  24794. charcode = convertCidString(glyphUnicode, charcode);
  24795. }
  24796. }
  24797. if (!charcode && this.toUnicode) {
  24798. charcode = this.toUnicode.charCodeOf(glyphUnicode);
  24799. }
  24800. if (charcode <= 0) {
  24801. charcode = glyphUnicode;
  24802. }
  24803. width = this.widths[charcode];
  24804. if (width) {
  24805. break;
  24806. }
  24807. }
  24808. return shadow(this, "_spaceWidth", width || this.defaultWidth);
  24809. }
  24810. _charToGlyph(charcode, isSpace = false) {
  24811. let glyph = this._glyphCache[charcode];
  24812. if (glyph?.isSpace === isSpace) {
  24813. return glyph;
  24814. }
  24815. let fontCharCode, width, operatorListId;
  24816. let widthCode = charcode;
  24817. if (this.cMap?.contains(charcode)) {
  24818. widthCode = this.cMap.lookup(charcode);
  24819. if (typeof widthCode === "string") {
  24820. widthCode = convertCidString(charcode, widthCode);
  24821. }
  24822. }
  24823. width = this.widths[widthCode];
  24824. if (typeof width !== "number") {
  24825. width = this.defaultWidth;
  24826. }
  24827. const vmetric = this.vmetrics?.[widthCode];
  24828. let unicode = this.toUnicode.get(charcode) || charcode;
  24829. if (typeof unicode === "number") {
  24830. unicode = String.fromCharCode(unicode);
  24831. }
  24832. let isInFont = this.toFontChar[charcode] !== undefined;
  24833. fontCharCode = this.toFontChar[charcode] || charcode;
  24834. if (this.missingFile) {
  24835. const glyphName = this.differences[charcode] || this.defaultEncoding[charcode];
  24836. if ((glyphName === ".notdef" || glyphName === "") && this.type === "Type1") {
  24837. fontCharCode = 0x20;
  24838. if (glyphName === "") {
  24839. width ||= this._spaceWidth;
  24840. unicode = String.fromCharCode(fontCharCode);
  24841. }
  24842. }
  24843. fontCharCode = mapSpecialUnicodeValues(fontCharCode);
  24844. }
  24845. if (this.isType3Font) {
  24846. operatorListId = fontCharCode;
  24847. }
  24848. let accent = null;
  24849. if (this.seacMap?.[charcode]) {
  24850. isInFont = true;
  24851. const seac = this.seacMap[charcode];
  24852. fontCharCode = seac.baseFontCharCode;
  24853. accent = {
  24854. fontChar: String.fromCodePoint(seac.accentFontCharCode),
  24855. offset: seac.accentOffset
  24856. };
  24857. }
  24858. let fontChar = "";
  24859. if (typeof fontCharCode === "number") {
  24860. if (fontCharCode <= 0x10ffff) {
  24861. fontChar = String.fromCodePoint(fontCharCode);
  24862. } else {
  24863. warn(`charToGlyph - invalid fontCharCode: ${fontCharCode}`);
  24864. }
  24865. }
  24866. if (this.missingFile && this.vertical && fontChar.length === 1) {
  24867. const vertical = getVerticalPresentationForm()[fontChar.charCodeAt(0)];
  24868. if (vertical) {
  24869. fontChar = unicode = String.fromCharCode(vertical);
  24870. }
  24871. }
  24872. glyph = new fonts_Glyph(charcode, fontChar, unicode, accent, width, vmetric, operatorListId, isSpace, isInFont);
  24873. return this._glyphCache[charcode] = glyph;
  24874. }
  24875. charsToGlyphs(chars) {
  24876. let glyphs = this._charsCache[chars];
  24877. if (glyphs) {
  24878. return glyphs;
  24879. }
  24880. glyphs = [];
  24881. if (this.cMap) {
  24882. const c = Object.create(null),
  24883. ii = chars.length;
  24884. let i = 0;
  24885. while (i < ii) {
  24886. this.cMap.readCharCode(chars, i, c);
  24887. const {
  24888. charcode,
  24889. length
  24890. } = c;
  24891. i += length;
  24892. const glyph = this._charToGlyph(charcode, length === 1 && chars.charCodeAt(i - 1) === 0x20);
  24893. glyphs.push(glyph);
  24894. }
  24895. } else {
  24896. for (let i = 0, ii = chars.length; i < ii; ++i) {
  24897. const charcode = chars.charCodeAt(i);
  24898. const glyph = this._charToGlyph(charcode, charcode === 0x20);
  24899. glyphs.push(glyph);
  24900. }
  24901. }
  24902. return this._charsCache[chars] = glyphs;
  24903. }
  24904. getCharPositions(chars) {
  24905. const positions = [];
  24906. if (this.cMap) {
  24907. const c = Object.create(null);
  24908. let i = 0;
  24909. while (i < chars.length) {
  24910. this.cMap.readCharCode(chars, i, c);
  24911. const length = c.length;
  24912. positions.push([i, i + length]);
  24913. i += length;
  24914. }
  24915. } else {
  24916. for (let i = 0, ii = chars.length; i < ii; ++i) {
  24917. positions.push([i, i + 1]);
  24918. }
  24919. }
  24920. return positions;
  24921. }
  24922. get glyphCacheValues() {
  24923. return Object.values(this._glyphCache);
  24924. }
  24925. encodeString(str) {
  24926. const buffers = [];
  24927. const currentBuf = [];
  24928. const hasCurrentBufErrors = () => buffers.length % 2 === 1;
  24929. const getCharCode = this.toUnicode instanceof IdentityToUnicodeMap ? unicode => this.toUnicode.charCodeOf(unicode) : unicode => this.toUnicode.charCodeOf(String.fromCodePoint(unicode));
  24930. for (let i = 0, ii = str.length; i < ii; i++) {
  24931. const unicode = str.codePointAt(i);
  24932. if (unicode > 0xd7ff && (unicode < 0xe000 || unicode > 0xfffd)) {
  24933. i++;
  24934. }
  24935. if (this.toUnicode) {
  24936. const charCode = getCharCode(unicode);
  24937. if (charCode !== -1) {
  24938. if (hasCurrentBufErrors()) {
  24939. buffers.push(currentBuf.join(""));
  24940. currentBuf.length = 0;
  24941. }
  24942. const charCodeLength = this.cMap ? this.cMap.getCharCodeLength(charCode) : 1;
  24943. for (let j = charCodeLength - 1; j >= 0; j--) {
  24944. currentBuf.push(String.fromCharCode(charCode >> 8 * j & 0xff));
  24945. }
  24946. continue;
  24947. }
  24948. }
  24949. if (!hasCurrentBufErrors()) {
  24950. buffers.push(currentBuf.join(""));
  24951. currentBuf.length = 0;
  24952. }
  24953. currentBuf.push(String.fromCodePoint(unicode));
  24954. }
  24955. buffers.push(currentBuf.join(""));
  24956. return buffers;
  24957. }
  24958. }
  24959. class ErrorFont {
  24960. constructor(error) {
  24961. this.error = error;
  24962. this.loadedName = "g_font_error";
  24963. this.missingFile = true;
  24964. }
  24965. charsToGlyphs() {
  24966. return [];
  24967. }
  24968. encodeString(chars) {
  24969. return [chars];
  24970. }
  24971. exportData(extraProperties = false) {
  24972. return {
  24973. error: this.error
  24974. };
  24975. }
  24976. }
  24977. ;// CONCATENATED MODULE: ./src/core/pattern.js
  24978. const ShadingType = {
  24979. FUNCTION_BASED: 1,
  24980. AXIAL: 2,
  24981. RADIAL: 3,
  24982. FREE_FORM_MESH: 4,
  24983. LATTICE_FORM_MESH: 5,
  24984. COONS_PATCH_MESH: 6,
  24985. TENSOR_PATCH_MESH: 7
  24986. };
  24987. class Pattern {
  24988. constructor() {
  24989. unreachable("Cannot initialize Pattern.");
  24990. }
  24991. static parseShading(shading, xref, res, pdfFunctionFactory, localColorSpaceCache) {
  24992. const dict = shading instanceof BaseStream ? shading.dict : shading;
  24993. const type = dict.get("ShadingType");
  24994. try {
  24995. switch (type) {
  24996. case ShadingType.AXIAL:
  24997. case ShadingType.RADIAL:
  24998. return new RadialAxialShading(dict, xref, res, pdfFunctionFactory, localColorSpaceCache);
  24999. case ShadingType.FREE_FORM_MESH:
  25000. case ShadingType.LATTICE_FORM_MESH:
  25001. case ShadingType.COONS_PATCH_MESH:
  25002. case ShadingType.TENSOR_PATCH_MESH:
  25003. return new MeshShading(shading, xref, res, pdfFunctionFactory, localColorSpaceCache);
  25004. default:
  25005. throw new FormatError("Unsupported ShadingType: " + type);
  25006. }
  25007. } catch (ex) {
  25008. if (ex instanceof MissingDataException) {
  25009. throw ex;
  25010. }
  25011. warn(ex);
  25012. return new DummyShading();
  25013. }
  25014. }
  25015. }
  25016. class BaseShading {
  25017. static SMALL_NUMBER = 1e-6;
  25018. constructor() {
  25019. if (this.constructor === BaseShading) {
  25020. unreachable("Cannot initialize BaseShading.");
  25021. }
  25022. }
  25023. getIR() {
  25024. unreachable("Abstract method `getIR` called.");
  25025. }
  25026. }
  25027. class RadialAxialShading extends BaseShading {
  25028. constructor(dict, xref, resources, pdfFunctionFactory, localColorSpaceCache) {
  25029. super();
  25030. this.shadingType = dict.get("ShadingType");
  25031. let coordsLen = 0;
  25032. if (this.shadingType === ShadingType.AXIAL) {
  25033. coordsLen = 4;
  25034. } else if (this.shadingType === ShadingType.RADIAL) {
  25035. coordsLen = 6;
  25036. }
  25037. this.coordsArr = dict.getArray("Coords");
  25038. if (!isNumberArray(this.coordsArr, coordsLen)) {
  25039. throw new FormatError("RadialAxialShading: Invalid /Coords array.");
  25040. }
  25041. const cs = ColorSpace.parse({
  25042. cs: dict.getRaw("CS") || dict.getRaw("ColorSpace"),
  25043. xref,
  25044. resources,
  25045. pdfFunctionFactory,
  25046. localColorSpaceCache
  25047. });
  25048. this.bbox = lookupNormalRect(dict.getArray("BBox"), null);
  25049. let t0 = 0.0,
  25050. t1 = 1.0;
  25051. const domainArr = dict.getArray("Domain");
  25052. if (isNumberArray(domainArr, 2)) {
  25053. [t0, t1] = domainArr;
  25054. }
  25055. let extendStart = false,
  25056. extendEnd = false;
  25057. const extendArr = dict.getArray("Extend");
  25058. if (isBooleanArray(extendArr, 2)) {
  25059. [extendStart, extendEnd] = extendArr;
  25060. }
  25061. if (this.shadingType === ShadingType.RADIAL && (!extendStart || !extendEnd)) {
  25062. const [x1, y1, r1, x2, y2, r2] = this.coordsArr;
  25063. const distance = Math.hypot(x1 - x2, y1 - y2);
  25064. if (r1 <= r2 + distance && r2 <= r1 + distance) {
  25065. warn("Unsupported radial gradient.");
  25066. }
  25067. }
  25068. this.extendStart = extendStart;
  25069. this.extendEnd = extendEnd;
  25070. const fnObj = dict.getRaw("Function");
  25071. const fn = pdfFunctionFactory.createFromArray(fnObj);
  25072. const NUMBER_OF_SAMPLES = 840;
  25073. const step = (t1 - t0) / NUMBER_OF_SAMPLES;
  25074. const colorStops = this.colorStops = [];
  25075. if (t0 >= t1 || step <= 0) {
  25076. info("Bad shading domain.");
  25077. return;
  25078. }
  25079. const color = new Float32Array(cs.numComps),
  25080. ratio = new Float32Array(1);
  25081. let rgbColor;
  25082. let iBase = 0;
  25083. ratio[0] = t0;
  25084. fn(ratio, 0, color, 0);
  25085. let rgbBase = cs.getRgb(color, 0);
  25086. const cssColorBase = Util.makeHexColor(rgbBase[0], rgbBase[1], rgbBase[2]);
  25087. colorStops.push([0, cssColorBase]);
  25088. let iPrev = 1;
  25089. ratio[0] = t0 + step;
  25090. fn(ratio, 0, color, 0);
  25091. let rgbPrev = cs.getRgb(color, 0);
  25092. let maxSlopeR = rgbPrev[0] - rgbBase[0] + 1;
  25093. let maxSlopeG = rgbPrev[1] - rgbBase[1] + 1;
  25094. let maxSlopeB = rgbPrev[2] - rgbBase[2] + 1;
  25095. let minSlopeR = rgbPrev[0] - rgbBase[0] - 1;
  25096. let minSlopeG = rgbPrev[1] - rgbBase[1] - 1;
  25097. let minSlopeB = rgbPrev[2] - rgbBase[2] - 1;
  25098. for (let i = 2; i < NUMBER_OF_SAMPLES; i++) {
  25099. ratio[0] = t0 + i * step;
  25100. fn(ratio, 0, color, 0);
  25101. rgbColor = cs.getRgb(color, 0);
  25102. const run = i - iBase;
  25103. maxSlopeR = Math.min(maxSlopeR, (rgbColor[0] - rgbBase[0] + 1) / run);
  25104. maxSlopeG = Math.min(maxSlopeG, (rgbColor[1] - rgbBase[1] + 1) / run);
  25105. maxSlopeB = Math.min(maxSlopeB, (rgbColor[2] - rgbBase[2] + 1) / run);
  25106. minSlopeR = Math.max(minSlopeR, (rgbColor[0] - rgbBase[0] - 1) / run);
  25107. minSlopeG = Math.max(minSlopeG, (rgbColor[1] - rgbBase[1] - 1) / run);
  25108. minSlopeB = Math.max(minSlopeB, (rgbColor[2] - rgbBase[2] - 1) / run);
  25109. const slopesExist = minSlopeR <= maxSlopeR && minSlopeG <= maxSlopeG && minSlopeB <= maxSlopeB;
  25110. if (!slopesExist) {
  25111. const cssColor = Util.makeHexColor(rgbPrev[0], rgbPrev[1], rgbPrev[2]);
  25112. colorStops.push([iPrev / NUMBER_OF_SAMPLES, cssColor]);
  25113. maxSlopeR = rgbColor[0] - rgbPrev[0] + 1;
  25114. maxSlopeG = rgbColor[1] - rgbPrev[1] + 1;
  25115. maxSlopeB = rgbColor[2] - rgbPrev[2] + 1;
  25116. minSlopeR = rgbColor[0] - rgbPrev[0] - 1;
  25117. minSlopeG = rgbColor[1] - rgbPrev[1] - 1;
  25118. minSlopeB = rgbColor[2] - rgbPrev[2] - 1;
  25119. iBase = iPrev;
  25120. rgbBase = rgbPrev;
  25121. }
  25122. iPrev = i;
  25123. rgbPrev = rgbColor;
  25124. }
  25125. const cssColor = Util.makeHexColor(rgbPrev[0], rgbPrev[1], rgbPrev[2]);
  25126. colorStops.push([1, cssColor]);
  25127. let background = "transparent";
  25128. if (dict.has("Background")) {
  25129. rgbColor = cs.getRgb(dict.get("Background"), 0);
  25130. background = Util.makeHexColor(rgbColor[0], rgbColor[1], rgbColor[2]);
  25131. }
  25132. if (!extendStart) {
  25133. colorStops.unshift([0, background]);
  25134. colorStops[1][0] += BaseShading.SMALL_NUMBER;
  25135. }
  25136. if (!extendEnd) {
  25137. colorStops.at(-1)[0] -= BaseShading.SMALL_NUMBER;
  25138. colorStops.push([1, background]);
  25139. }
  25140. this.colorStops = colorStops;
  25141. }
  25142. getIR() {
  25143. const {
  25144. coordsArr,
  25145. shadingType
  25146. } = this;
  25147. let type, p0, p1, r0, r1;
  25148. if (shadingType === ShadingType.AXIAL) {
  25149. p0 = [coordsArr[0], coordsArr[1]];
  25150. p1 = [coordsArr[2], coordsArr[3]];
  25151. r0 = null;
  25152. r1 = null;
  25153. type = "axial";
  25154. } else if (shadingType === ShadingType.RADIAL) {
  25155. p0 = [coordsArr[0], coordsArr[1]];
  25156. p1 = [coordsArr[3], coordsArr[4]];
  25157. r0 = coordsArr[2];
  25158. r1 = coordsArr[5];
  25159. type = "radial";
  25160. } else {
  25161. unreachable(`getPattern type unknown: ${shadingType}`);
  25162. }
  25163. return ["RadialAxial", type, this.bbox, this.colorStops, p0, p1, r0, r1];
  25164. }
  25165. }
  25166. class MeshStreamReader {
  25167. constructor(stream, context) {
  25168. this.stream = stream;
  25169. this.context = context;
  25170. this.buffer = 0;
  25171. this.bufferLength = 0;
  25172. const numComps = context.numComps;
  25173. this.tmpCompsBuf = new Float32Array(numComps);
  25174. const csNumComps = context.colorSpace.numComps;
  25175. this.tmpCsCompsBuf = context.colorFn ? new Float32Array(csNumComps) : this.tmpCompsBuf;
  25176. }
  25177. get hasData() {
  25178. if (this.stream.end) {
  25179. return this.stream.pos < this.stream.end;
  25180. }
  25181. if (this.bufferLength > 0) {
  25182. return true;
  25183. }
  25184. const nextByte = this.stream.getByte();
  25185. if (nextByte < 0) {
  25186. return false;
  25187. }
  25188. this.buffer = nextByte;
  25189. this.bufferLength = 8;
  25190. return true;
  25191. }
  25192. readBits(n) {
  25193. let buffer = this.buffer;
  25194. let bufferLength = this.bufferLength;
  25195. if (n === 32) {
  25196. if (bufferLength === 0) {
  25197. return (this.stream.getByte() << 24 | this.stream.getByte() << 16 | this.stream.getByte() << 8 | this.stream.getByte()) >>> 0;
  25198. }
  25199. buffer = buffer << 24 | this.stream.getByte() << 16 | this.stream.getByte() << 8 | this.stream.getByte();
  25200. const nextByte = this.stream.getByte();
  25201. this.buffer = nextByte & (1 << bufferLength) - 1;
  25202. return (buffer << 8 - bufferLength | (nextByte & 0xff) >> bufferLength) >>> 0;
  25203. }
  25204. if (n === 8 && bufferLength === 0) {
  25205. return this.stream.getByte();
  25206. }
  25207. while (bufferLength < n) {
  25208. buffer = buffer << 8 | this.stream.getByte();
  25209. bufferLength += 8;
  25210. }
  25211. bufferLength -= n;
  25212. this.bufferLength = bufferLength;
  25213. this.buffer = buffer & (1 << bufferLength) - 1;
  25214. return buffer >> bufferLength;
  25215. }
  25216. align() {
  25217. this.buffer = 0;
  25218. this.bufferLength = 0;
  25219. }
  25220. readFlag() {
  25221. return this.readBits(this.context.bitsPerFlag);
  25222. }
  25223. readCoordinate() {
  25224. const bitsPerCoordinate = this.context.bitsPerCoordinate;
  25225. const xi = this.readBits(bitsPerCoordinate);
  25226. const yi = this.readBits(bitsPerCoordinate);
  25227. const decode = this.context.decode;
  25228. const scale = bitsPerCoordinate < 32 ? 1 / ((1 << bitsPerCoordinate) - 1) : 2.3283064365386963e-10;
  25229. return [xi * scale * (decode[1] - decode[0]) + decode[0], yi * scale * (decode[3] - decode[2]) + decode[2]];
  25230. }
  25231. readComponents() {
  25232. const numComps = this.context.numComps;
  25233. const bitsPerComponent = this.context.bitsPerComponent;
  25234. const scale = bitsPerComponent < 32 ? 1 / ((1 << bitsPerComponent) - 1) : 2.3283064365386963e-10;
  25235. const decode = this.context.decode;
  25236. const components = this.tmpCompsBuf;
  25237. for (let i = 0, j = 4; i < numComps; i++, j += 2) {
  25238. const ci = this.readBits(bitsPerComponent);
  25239. components[i] = ci * scale * (decode[j + 1] - decode[j]) + decode[j];
  25240. }
  25241. const color = this.tmpCsCompsBuf;
  25242. if (this.context.colorFn) {
  25243. this.context.colorFn(components, 0, color, 0);
  25244. }
  25245. return this.context.colorSpace.getRgb(color, 0);
  25246. }
  25247. }
  25248. let bCache = Object.create(null);
  25249. function buildB(count) {
  25250. const lut = [];
  25251. for (let i = 0; i <= count; i++) {
  25252. const t = i / count,
  25253. t_ = 1 - t;
  25254. lut.push(new Float32Array([t_ ** 3, 3 * t * t_ ** 2, 3 * t ** 2 * t_, t ** 3]));
  25255. }
  25256. return lut;
  25257. }
  25258. function getB(count) {
  25259. return bCache[count] ||= buildB(count);
  25260. }
  25261. function clearPatternCaches() {
  25262. bCache = Object.create(null);
  25263. }
  25264. class MeshShading extends BaseShading {
  25265. static MIN_SPLIT_PATCH_CHUNKS_AMOUNT = 3;
  25266. static MAX_SPLIT_PATCH_CHUNKS_AMOUNT = 20;
  25267. static TRIANGLE_DENSITY = 20;
  25268. constructor(stream, xref, resources, pdfFunctionFactory, localColorSpaceCache) {
  25269. super();
  25270. if (!(stream instanceof BaseStream)) {
  25271. throw new FormatError("Mesh data is not a stream");
  25272. }
  25273. const dict = stream.dict;
  25274. this.shadingType = dict.get("ShadingType");
  25275. this.bbox = lookupNormalRect(dict.getArray("BBox"), null);
  25276. const cs = ColorSpace.parse({
  25277. cs: dict.getRaw("CS") || dict.getRaw("ColorSpace"),
  25278. xref,
  25279. resources,
  25280. pdfFunctionFactory,
  25281. localColorSpaceCache
  25282. });
  25283. this.background = dict.has("Background") ? cs.getRgb(dict.get("Background"), 0) : null;
  25284. const fnObj = dict.getRaw("Function");
  25285. const fn = fnObj ? pdfFunctionFactory.createFromArray(fnObj) : null;
  25286. this.coords = [];
  25287. this.colors = [];
  25288. this.figures = [];
  25289. const decodeContext = {
  25290. bitsPerCoordinate: dict.get("BitsPerCoordinate"),
  25291. bitsPerComponent: dict.get("BitsPerComponent"),
  25292. bitsPerFlag: dict.get("BitsPerFlag"),
  25293. decode: dict.getArray("Decode"),
  25294. colorFn: fn,
  25295. colorSpace: cs,
  25296. numComps: fn ? 1 : cs.numComps
  25297. };
  25298. const reader = new MeshStreamReader(stream, decodeContext);
  25299. let patchMesh = false;
  25300. switch (this.shadingType) {
  25301. case ShadingType.FREE_FORM_MESH:
  25302. this._decodeType4Shading(reader);
  25303. break;
  25304. case ShadingType.LATTICE_FORM_MESH:
  25305. const verticesPerRow = dict.get("VerticesPerRow") | 0;
  25306. if (verticesPerRow < 2) {
  25307. throw new FormatError("Invalid VerticesPerRow");
  25308. }
  25309. this._decodeType5Shading(reader, verticesPerRow);
  25310. break;
  25311. case ShadingType.COONS_PATCH_MESH:
  25312. this._decodeType6Shading(reader);
  25313. patchMesh = true;
  25314. break;
  25315. case ShadingType.TENSOR_PATCH_MESH:
  25316. this._decodeType7Shading(reader);
  25317. patchMesh = true;
  25318. break;
  25319. default:
  25320. unreachable("Unsupported mesh type.");
  25321. break;
  25322. }
  25323. if (patchMesh) {
  25324. this._updateBounds();
  25325. for (let i = 0, ii = this.figures.length; i < ii; i++) {
  25326. this._buildFigureFromPatch(i);
  25327. }
  25328. }
  25329. this._updateBounds();
  25330. this._packData();
  25331. }
  25332. _decodeType4Shading(reader) {
  25333. const coords = this.coords;
  25334. const colors = this.colors;
  25335. const operators = [];
  25336. const ps = [];
  25337. let verticesLeft = 0;
  25338. while (reader.hasData) {
  25339. const f = reader.readFlag();
  25340. const coord = reader.readCoordinate();
  25341. const color = reader.readComponents();
  25342. if (verticesLeft === 0) {
  25343. if (!(0 <= f && f <= 2)) {
  25344. throw new FormatError("Unknown type4 flag");
  25345. }
  25346. switch (f) {
  25347. case 0:
  25348. verticesLeft = 3;
  25349. break;
  25350. case 1:
  25351. ps.push(ps.at(-2), ps.at(-1));
  25352. verticesLeft = 1;
  25353. break;
  25354. case 2:
  25355. ps.push(ps.at(-3), ps.at(-1));
  25356. verticesLeft = 1;
  25357. break;
  25358. }
  25359. operators.push(f);
  25360. }
  25361. ps.push(coords.length);
  25362. coords.push(coord);
  25363. colors.push(color);
  25364. verticesLeft--;
  25365. reader.align();
  25366. }
  25367. this.figures.push({
  25368. type: "triangles",
  25369. coords: new Int32Array(ps),
  25370. colors: new Int32Array(ps)
  25371. });
  25372. }
  25373. _decodeType5Shading(reader, verticesPerRow) {
  25374. const coords = this.coords;
  25375. const colors = this.colors;
  25376. const ps = [];
  25377. while (reader.hasData) {
  25378. const coord = reader.readCoordinate();
  25379. const color = reader.readComponents();
  25380. ps.push(coords.length);
  25381. coords.push(coord);
  25382. colors.push(color);
  25383. }
  25384. this.figures.push({
  25385. type: "lattice",
  25386. coords: new Int32Array(ps),
  25387. colors: new Int32Array(ps),
  25388. verticesPerRow
  25389. });
  25390. }
  25391. _decodeType6Shading(reader) {
  25392. const coords = this.coords;
  25393. const colors = this.colors;
  25394. const ps = new Int32Array(16);
  25395. const cs = new Int32Array(4);
  25396. while (reader.hasData) {
  25397. const f = reader.readFlag();
  25398. if (!(0 <= f && f <= 3)) {
  25399. throw new FormatError("Unknown type6 flag");
  25400. }
  25401. const pi = coords.length;
  25402. for (let i = 0, ii = f !== 0 ? 8 : 12; i < ii; i++) {
  25403. coords.push(reader.readCoordinate());
  25404. }
  25405. const ci = colors.length;
  25406. for (let i = 0, ii = f !== 0 ? 2 : 4; i < ii; i++) {
  25407. colors.push(reader.readComponents());
  25408. }
  25409. let tmp1, tmp2, tmp3, tmp4;
  25410. switch (f) {
  25411. case 0:
  25412. ps[12] = pi + 3;
  25413. ps[13] = pi + 4;
  25414. ps[14] = pi + 5;
  25415. ps[15] = pi + 6;
  25416. ps[8] = pi + 2;
  25417. ps[11] = pi + 7;
  25418. ps[4] = pi + 1;
  25419. ps[7] = pi + 8;
  25420. ps[0] = pi;
  25421. ps[1] = pi + 11;
  25422. ps[2] = pi + 10;
  25423. ps[3] = pi + 9;
  25424. cs[2] = ci + 1;
  25425. cs[3] = ci + 2;
  25426. cs[0] = ci;
  25427. cs[1] = ci + 3;
  25428. break;
  25429. case 1:
  25430. tmp1 = ps[12];
  25431. tmp2 = ps[13];
  25432. tmp3 = ps[14];
  25433. tmp4 = ps[15];
  25434. ps[12] = tmp4;
  25435. ps[13] = pi + 0;
  25436. ps[14] = pi + 1;
  25437. ps[15] = pi + 2;
  25438. ps[8] = tmp3;
  25439. ps[11] = pi + 3;
  25440. ps[4] = tmp2;
  25441. ps[7] = pi + 4;
  25442. ps[0] = tmp1;
  25443. ps[1] = pi + 7;
  25444. ps[2] = pi + 6;
  25445. ps[3] = pi + 5;
  25446. tmp1 = cs[2];
  25447. tmp2 = cs[3];
  25448. cs[2] = tmp2;
  25449. cs[3] = ci;
  25450. cs[0] = tmp1;
  25451. cs[1] = ci + 1;
  25452. break;
  25453. case 2:
  25454. tmp1 = ps[15];
  25455. tmp2 = ps[11];
  25456. ps[12] = ps[3];
  25457. ps[13] = pi + 0;
  25458. ps[14] = pi + 1;
  25459. ps[15] = pi + 2;
  25460. ps[8] = ps[7];
  25461. ps[11] = pi + 3;
  25462. ps[4] = tmp2;
  25463. ps[7] = pi + 4;
  25464. ps[0] = tmp1;
  25465. ps[1] = pi + 7;
  25466. ps[2] = pi + 6;
  25467. ps[3] = pi + 5;
  25468. tmp1 = cs[3];
  25469. cs[2] = cs[1];
  25470. cs[3] = ci;
  25471. cs[0] = tmp1;
  25472. cs[1] = ci + 1;
  25473. break;
  25474. case 3:
  25475. ps[12] = ps[0];
  25476. ps[13] = pi + 0;
  25477. ps[14] = pi + 1;
  25478. ps[15] = pi + 2;
  25479. ps[8] = ps[1];
  25480. ps[11] = pi + 3;
  25481. ps[4] = ps[2];
  25482. ps[7] = pi + 4;
  25483. ps[0] = ps[3];
  25484. ps[1] = pi + 7;
  25485. ps[2] = pi + 6;
  25486. ps[3] = pi + 5;
  25487. cs[2] = cs[0];
  25488. cs[3] = ci;
  25489. cs[0] = cs[1];
  25490. cs[1] = ci + 1;
  25491. break;
  25492. }
  25493. ps[5] = coords.length;
  25494. 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]);
  25495. ps[6] = coords.length;
  25496. 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]);
  25497. ps[9] = coords.length;
  25498. 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]);
  25499. ps[10] = coords.length;
  25500. 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]);
  25501. this.figures.push({
  25502. type: "patch",
  25503. coords: new Int32Array(ps),
  25504. colors: new Int32Array(cs)
  25505. });
  25506. }
  25507. }
  25508. _decodeType7Shading(reader) {
  25509. const coords = this.coords;
  25510. const colors = this.colors;
  25511. const ps = new Int32Array(16);
  25512. const cs = new Int32Array(4);
  25513. while (reader.hasData) {
  25514. const f = reader.readFlag();
  25515. if (!(0 <= f && f <= 3)) {
  25516. throw new FormatError("Unknown type7 flag");
  25517. }
  25518. const pi = coords.length;
  25519. for (let i = 0, ii = f !== 0 ? 12 : 16; i < ii; i++) {
  25520. coords.push(reader.readCoordinate());
  25521. }
  25522. const ci = colors.length;
  25523. for (let i = 0, ii = f !== 0 ? 2 : 4; i < ii; i++) {
  25524. colors.push(reader.readComponents());
  25525. }
  25526. let tmp1, tmp2, tmp3, tmp4;
  25527. switch (f) {
  25528. case 0:
  25529. ps[12] = pi + 3;
  25530. ps[13] = pi + 4;
  25531. ps[14] = pi + 5;
  25532. ps[15] = pi + 6;
  25533. ps[8] = pi + 2;
  25534. ps[9] = pi + 13;
  25535. ps[10] = pi + 14;
  25536. ps[11] = pi + 7;
  25537. ps[4] = pi + 1;
  25538. ps[5] = pi + 12;
  25539. ps[6] = pi + 15;
  25540. ps[7] = pi + 8;
  25541. ps[0] = pi;
  25542. ps[1] = pi + 11;
  25543. ps[2] = pi + 10;
  25544. ps[3] = pi + 9;
  25545. cs[2] = ci + 1;
  25546. cs[3] = ci + 2;
  25547. cs[0] = ci;
  25548. cs[1] = ci + 3;
  25549. break;
  25550. case 1:
  25551. tmp1 = ps[12];
  25552. tmp2 = ps[13];
  25553. tmp3 = ps[14];
  25554. tmp4 = ps[15];
  25555. ps[12] = tmp4;
  25556. ps[13] = pi + 0;
  25557. ps[14] = pi + 1;
  25558. ps[15] = pi + 2;
  25559. ps[8] = tmp3;
  25560. ps[9] = pi + 9;
  25561. ps[10] = pi + 10;
  25562. ps[11] = pi + 3;
  25563. ps[4] = tmp2;
  25564. ps[5] = pi + 8;
  25565. ps[6] = pi + 11;
  25566. ps[7] = pi + 4;
  25567. ps[0] = tmp1;
  25568. ps[1] = pi + 7;
  25569. ps[2] = pi + 6;
  25570. ps[3] = pi + 5;
  25571. tmp1 = cs[2];
  25572. tmp2 = cs[3];
  25573. cs[2] = tmp2;
  25574. cs[3] = ci;
  25575. cs[0] = tmp1;
  25576. cs[1] = ci + 1;
  25577. break;
  25578. case 2:
  25579. tmp1 = ps[15];
  25580. tmp2 = ps[11];
  25581. ps[12] = ps[3];
  25582. ps[13] = pi + 0;
  25583. ps[14] = pi + 1;
  25584. ps[15] = pi + 2;
  25585. ps[8] = ps[7];
  25586. ps[9] = pi + 9;
  25587. ps[10] = pi + 10;
  25588. ps[11] = pi + 3;
  25589. ps[4] = tmp2;
  25590. ps[5] = pi + 8;
  25591. ps[6] = pi + 11;
  25592. ps[7] = pi + 4;
  25593. ps[0] = tmp1;
  25594. ps[1] = pi + 7;
  25595. ps[2] = pi + 6;
  25596. ps[3] = pi + 5;
  25597. tmp1 = cs[3];
  25598. cs[2] = cs[1];
  25599. cs[3] = ci;
  25600. cs[0] = tmp1;
  25601. cs[1] = ci + 1;
  25602. break;
  25603. case 3:
  25604. ps[12] = ps[0];
  25605. ps[13] = pi + 0;
  25606. ps[14] = pi + 1;
  25607. ps[15] = pi + 2;
  25608. ps[8] = ps[1];
  25609. ps[9] = pi + 9;
  25610. ps[10] = pi + 10;
  25611. ps[11] = pi + 3;
  25612. ps[4] = ps[2];
  25613. ps[5] = pi + 8;
  25614. ps[6] = pi + 11;
  25615. ps[7] = pi + 4;
  25616. ps[0] = ps[3];
  25617. ps[1] = pi + 7;
  25618. ps[2] = pi + 6;
  25619. ps[3] = pi + 5;
  25620. cs[2] = cs[0];
  25621. cs[3] = ci;
  25622. cs[0] = cs[1];
  25623. cs[1] = ci + 1;
  25624. break;
  25625. }
  25626. this.figures.push({
  25627. type: "patch",
  25628. coords: new Int32Array(ps),
  25629. colors: new Int32Array(cs)
  25630. });
  25631. }
  25632. }
  25633. _buildFigureFromPatch(index) {
  25634. const figure = this.figures[index];
  25635. assert(figure.type === "patch", "Unexpected patch mesh figure");
  25636. const coords = this.coords,
  25637. colors = this.colors;
  25638. const pi = figure.coords;
  25639. const ci = figure.colors;
  25640. const figureMinX = Math.min(coords[pi[0]][0], coords[pi[3]][0], coords[pi[12]][0], coords[pi[15]][0]);
  25641. const figureMinY = Math.min(coords[pi[0]][1], coords[pi[3]][1], coords[pi[12]][1], coords[pi[15]][1]);
  25642. const figureMaxX = Math.max(coords[pi[0]][0], coords[pi[3]][0], coords[pi[12]][0], coords[pi[15]][0]);
  25643. const figureMaxY = Math.max(coords[pi[0]][1], coords[pi[3]][1], coords[pi[12]][1], coords[pi[15]][1]);
  25644. let splitXBy = Math.ceil((figureMaxX - figureMinX) * MeshShading.TRIANGLE_DENSITY / (this.bounds[2] - this.bounds[0]));
  25645. splitXBy = Math.max(MeshShading.MIN_SPLIT_PATCH_CHUNKS_AMOUNT, Math.min(MeshShading.MAX_SPLIT_PATCH_CHUNKS_AMOUNT, splitXBy));
  25646. let splitYBy = Math.ceil((figureMaxY - figureMinY) * MeshShading.TRIANGLE_DENSITY / (this.bounds[3] - this.bounds[1]));
  25647. splitYBy = Math.max(MeshShading.MIN_SPLIT_PATCH_CHUNKS_AMOUNT, Math.min(MeshShading.MAX_SPLIT_PATCH_CHUNKS_AMOUNT, splitYBy));
  25648. const verticesPerRow = splitXBy + 1;
  25649. const figureCoords = new Int32Array((splitYBy + 1) * verticesPerRow);
  25650. const figureColors = new Int32Array((splitYBy + 1) * verticesPerRow);
  25651. let k = 0;
  25652. const cl = new Uint8Array(3),
  25653. cr = new Uint8Array(3);
  25654. const c0 = colors[ci[0]],
  25655. c1 = colors[ci[1]],
  25656. c2 = colors[ci[2]],
  25657. c3 = colors[ci[3]];
  25658. const bRow = getB(splitYBy),
  25659. bCol = getB(splitXBy);
  25660. for (let row = 0; row <= splitYBy; row++) {
  25661. cl[0] = (c0[0] * (splitYBy - row) + c2[0] * row) / splitYBy | 0;
  25662. cl[1] = (c0[1] * (splitYBy - row) + c2[1] * row) / splitYBy | 0;
  25663. cl[2] = (c0[2] * (splitYBy - row) + c2[2] * row) / splitYBy | 0;
  25664. cr[0] = (c1[0] * (splitYBy - row) + c3[0] * row) / splitYBy | 0;
  25665. cr[1] = (c1[1] * (splitYBy - row) + c3[1] * row) / splitYBy | 0;
  25666. cr[2] = (c1[2] * (splitYBy - row) + c3[2] * row) / splitYBy | 0;
  25667. for (let col = 0; col <= splitXBy; col++, k++) {
  25668. if ((row === 0 || row === splitYBy) && (col === 0 || col === splitXBy)) {
  25669. continue;
  25670. }
  25671. let x = 0,
  25672. y = 0;
  25673. let q = 0;
  25674. for (let i = 0; i <= 3; i++) {
  25675. for (let j = 0; j <= 3; j++, q++) {
  25676. const m = bRow[row][i] * bCol[col][j];
  25677. x += coords[pi[q]][0] * m;
  25678. y += coords[pi[q]][1] * m;
  25679. }
  25680. }
  25681. figureCoords[k] = coords.length;
  25682. coords.push([x, y]);
  25683. figureColors[k] = colors.length;
  25684. const newColor = new Uint8Array(3);
  25685. newColor[0] = (cl[0] * (splitXBy - col) + cr[0] * col) / splitXBy | 0;
  25686. newColor[1] = (cl[1] * (splitXBy - col) + cr[1] * col) / splitXBy | 0;
  25687. newColor[2] = (cl[2] * (splitXBy - col) + cr[2] * col) / splitXBy | 0;
  25688. colors.push(newColor);
  25689. }
  25690. }
  25691. figureCoords[0] = pi[0];
  25692. figureColors[0] = ci[0];
  25693. figureCoords[splitXBy] = pi[3];
  25694. figureColors[splitXBy] = ci[1];
  25695. figureCoords[verticesPerRow * splitYBy] = pi[12];
  25696. figureColors[verticesPerRow * splitYBy] = ci[2];
  25697. figureCoords[verticesPerRow * splitYBy + splitXBy] = pi[15];
  25698. figureColors[verticesPerRow * splitYBy + splitXBy] = ci[3];
  25699. this.figures[index] = {
  25700. type: "lattice",
  25701. coords: figureCoords,
  25702. colors: figureColors,
  25703. verticesPerRow
  25704. };
  25705. }
  25706. _updateBounds() {
  25707. let minX = this.coords[0][0],
  25708. minY = this.coords[0][1],
  25709. maxX = minX,
  25710. maxY = minY;
  25711. for (let i = 1, ii = this.coords.length; i < ii; i++) {
  25712. const x = this.coords[i][0],
  25713. y = this.coords[i][1];
  25714. minX = minX > x ? x : minX;
  25715. minY = minY > y ? y : minY;
  25716. maxX = maxX < x ? x : maxX;
  25717. maxY = maxY < y ? y : maxY;
  25718. }
  25719. this.bounds = [minX, minY, maxX, maxY];
  25720. }
  25721. _packData() {
  25722. let i, ii, j, jj;
  25723. const coords = this.coords;
  25724. const coordsPacked = new Float32Array(coords.length * 2);
  25725. for (i = 0, j = 0, ii = coords.length; i < ii; i++) {
  25726. const xy = coords[i];
  25727. coordsPacked[j++] = xy[0];
  25728. coordsPacked[j++] = xy[1];
  25729. }
  25730. this.coords = coordsPacked;
  25731. const colors = this.colors;
  25732. const colorsPacked = new Uint8Array(colors.length * 3);
  25733. for (i = 0, j = 0, ii = colors.length; i < ii; i++) {
  25734. const c = colors[i];
  25735. colorsPacked[j++] = c[0];
  25736. colorsPacked[j++] = c[1];
  25737. colorsPacked[j++] = c[2];
  25738. }
  25739. this.colors = colorsPacked;
  25740. const figures = this.figures;
  25741. for (i = 0, ii = figures.length; i < ii; i++) {
  25742. const figure = figures[i],
  25743. ps = figure.coords,
  25744. cs = figure.colors;
  25745. for (j = 0, jj = ps.length; j < jj; j++) {
  25746. ps[j] *= 2;
  25747. cs[j] *= 3;
  25748. }
  25749. }
  25750. }
  25751. getIR() {
  25752. const {
  25753. bounds
  25754. } = this;
  25755. if (bounds[2] - bounds[0] === 0 || bounds[3] - bounds[1] === 0) {
  25756. throw new FormatError(`Invalid MeshShading bounds: [${bounds}].`);
  25757. }
  25758. return ["Mesh", this.shadingType, this.coords, this.colors, this.figures, bounds, this.bbox, this.background];
  25759. }
  25760. }
  25761. class DummyShading extends BaseShading {
  25762. getIR() {
  25763. return ["Dummy"];
  25764. }
  25765. }
  25766. function getTilingPatternIR(operatorList, dict, color) {
  25767. const matrix = lookupMatrix(dict.getArray("Matrix"), IDENTITY_MATRIX);
  25768. const bbox = lookupNormalRect(dict.getArray("BBox"), null);
  25769. if (!bbox || bbox[2] - bbox[0] === 0 || bbox[3] - bbox[1] === 0) {
  25770. throw new FormatError(`Invalid getTilingPatternIR /BBox array.`);
  25771. }
  25772. const xstep = dict.get("XStep");
  25773. if (typeof xstep !== "number") {
  25774. throw new FormatError(`Invalid getTilingPatternIR /XStep value.`);
  25775. }
  25776. const ystep = dict.get("YStep");
  25777. if (typeof ystep !== "number") {
  25778. throw new FormatError(`Invalid getTilingPatternIR /YStep value.`);
  25779. }
  25780. const paintType = dict.get("PaintType");
  25781. if (!Number.isInteger(paintType)) {
  25782. throw new FormatError(`Invalid getTilingPatternIR /PaintType value.`);
  25783. }
  25784. const tilingType = dict.get("TilingType");
  25785. if (!Number.isInteger(tilingType)) {
  25786. throw new FormatError(`Invalid getTilingPatternIR /TilingType value.`);
  25787. }
  25788. return ["TilingPattern", color, operatorList, matrix, bbox, xstep, ystep, paintType, tilingType];
  25789. }
  25790. ;// CONCATENATED MODULE: ./src/core/calibri_factors.js
  25791. 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];
  25792. const CalibriBoldMetrics = {
  25793. lineHeight: 1.2207,
  25794. lineGap: 0.2207
  25795. };
  25796. 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];
  25797. const CalibriBoldItalicMetrics = {
  25798. lineHeight: 1.2207,
  25799. lineGap: 0.2207
  25800. };
  25801. 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];
  25802. const CalibriItalicMetrics = {
  25803. lineHeight: 1.2207,
  25804. lineGap: 0.2207
  25805. };
  25806. 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];
  25807. const CalibriRegularMetrics = {
  25808. lineHeight: 1.2207,
  25809. lineGap: 0.2207
  25810. };
  25811. ;// CONCATENATED MODULE: ./src/core/helvetica_factors.js
  25812. 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];
  25813. const HelveticaBoldMetrics = {
  25814. lineHeight: 1.2,
  25815. lineGap: 0.2
  25816. };
  25817. 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];
  25818. const HelveticaBoldItalicMetrics = {
  25819. lineHeight: 1.35,
  25820. lineGap: 0.2
  25821. };
  25822. 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];
  25823. const HelveticaItalicMetrics = {
  25824. lineHeight: 1.35,
  25825. lineGap: 0.2
  25826. };
  25827. 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];
  25828. const HelveticaRegularMetrics = {
  25829. lineHeight: 1.2,
  25830. lineGap: 0.2
  25831. };
  25832. ;// CONCATENATED MODULE: ./src/core/liberationsans_widths.js
  25833. 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];
  25834. 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];
  25835. 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];
  25836. 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];
  25837. 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];
  25838. 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];
  25839. 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];
  25840. 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];
  25841. ;// CONCATENATED MODULE: ./src/core/myriadpro_factors.js
  25842. 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];
  25843. const MyriadProBoldMetrics = {
  25844. lineHeight: 1.2,
  25845. lineGap: 0.2
  25846. };
  25847. 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];
  25848. const MyriadProBoldItalicMetrics = {
  25849. lineHeight: 1.2,
  25850. lineGap: 0.2
  25851. };
  25852. 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];
  25853. const MyriadProItalicMetrics = {
  25854. lineHeight: 1.2,
  25855. lineGap: 0.2
  25856. };
  25857. 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];
  25858. const MyriadProRegularMetrics = {
  25859. lineHeight: 1.2,
  25860. lineGap: 0.2
  25861. };
  25862. ;// CONCATENATED MODULE: ./src/core/segoeui_factors.js
  25863. 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];
  25864. const SegoeuiBoldMetrics = {
  25865. lineHeight: 1.33008,
  25866. lineGap: 0
  25867. };
  25868. 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];
  25869. const SegoeuiBoldItalicMetrics = {
  25870. lineHeight: 1.33008,
  25871. lineGap: 0
  25872. };
  25873. 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];
  25874. const SegoeuiItalicMetrics = {
  25875. lineHeight: 1.33008,
  25876. lineGap: 0
  25877. };
  25878. 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];
  25879. const SegoeuiRegularMetrics = {
  25880. lineHeight: 1.33008,
  25881. lineGap: 0
  25882. };
  25883. ;// CONCATENATED MODULE: ./src/core/xfa_fonts.js
  25884. const getXFAFontMap = getLookupTableFactory(function (t) {
  25885. t["MyriadPro-Regular"] = t["PdfJS-Fallback-Regular"] = {
  25886. name: "LiberationSans-Regular",
  25887. factors: MyriadProRegularFactors,
  25888. baseWidths: LiberationSansRegularWidths,
  25889. baseMapping: LiberationSansRegularMapping,
  25890. metrics: MyriadProRegularMetrics
  25891. };
  25892. t["MyriadPro-Bold"] = t["PdfJS-Fallback-Bold"] = {
  25893. name: "LiberationSans-Bold",
  25894. factors: MyriadProBoldFactors,
  25895. baseWidths: LiberationSansBoldWidths,
  25896. baseMapping: LiberationSansBoldMapping,
  25897. metrics: MyriadProBoldMetrics
  25898. };
  25899. t["MyriadPro-It"] = t["MyriadPro-Italic"] = t["PdfJS-Fallback-Italic"] = {
  25900. name: "LiberationSans-Italic",
  25901. factors: MyriadProItalicFactors,
  25902. baseWidths: LiberationSansItalicWidths,
  25903. baseMapping: LiberationSansItalicMapping,
  25904. metrics: MyriadProItalicMetrics
  25905. };
  25906. t["MyriadPro-BoldIt"] = t["MyriadPro-BoldItalic"] = t["PdfJS-Fallback-BoldItalic"] = {
  25907. name: "LiberationSans-BoldItalic",
  25908. factors: MyriadProBoldItalicFactors,
  25909. baseWidths: LiberationSansBoldItalicWidths,
  25910. baseMapping: LiberationSansBoldItalicMapping,
  25911. metrics: MyriadProBoldItalicMetrics
  25912. };
  25913. t.ArialMT = t.Arial = t["Arial-Regular"] = {
  25914. name: "LiberationSans-Regular",
  25915. baseWidths: LiberationSansRegularWidths,
  25916. baseMapping: LiberationSansRegularMapping
  25917. };
  25918. t["Arial-BoldMT"] = t["Arial-Bold"] = {
  25919. name: "LiberationSans-Bold",
  25920. baseWidths: LiberationSansBoldWidths,
  25921. baseMapping: LiberationSansBoldMapping
  25922. };
  25923. t["Arial-ItalicMT"] = t["Arial-Italic"] = {
  25924. name: "LiberationSans-Italic",
  25925. baseWidths: LiberationSansItalicWidths,
  25926. baseMapping: LiberationSansItalicMapping
  25927. };
  25928. t["Arial-BoldItalicMT"] = t["Arial-BoldItalic"] = {
  25929. name: "LiberationSans-BoldItalic",
  25930. baseWidths: LiberationSansBoldItalicWidths,
  25931. baseMapping: LiberationSansBoldItalicMapping
  25932. };
  25933. t["Calibri-Regular"] = {
  25934. name: "LiberationSans-Regular",
  25935. factors: CalibriRegularFactors,
  25936. baseWidths: LiberationSansRegularWidths,
  25937. baseMapping: LiberationSansRegularMapping,
  25938. metrics: CalibriRegularMetrics
  25939. };
  25940. t["Calibri-Bold"] = {
  25941. name: "LiberationSans-Bold",
  25942. factors: CalibriBoldFactors,
  25943. baseWidths: LiberationSansBoldWidths,
  25944. baseMapping: LiberationSansBoldMapping,
  25945. metrics: CalibriBoldMetrics
  25946. };
  25947. t["Calibri-Italic"] = {
  25948. name: "LiberationSans-Italic",
  25949. factors: CalibriItalicFactors,
  25950. baseWidths: LiberationSansItalicWidths,
  25951. baseMapping: LiberationSansItalicMapping,
  25952. metrics: CalibriItalicMetrics
  25953. };
  25954. t["Calibri-BoldItalic"] = {
  25955. name: "LiberationSans-BoldItalic",
  25956. factors: CalibriBoldItalicFactors,
  25957. baseWidths: LiberationSansBoldItalicWidths,
  25958. baseMapping: LiberationSansBoldItalicMapping,
  25959. metrics: CalibriBoldItalicMetrics
  25960. };
  25961. t["Segoeui-Regular"] = {
  25962. name: "LiberationSans-Regular",
  25963. factors: SegoeuiRegularFactors,
  25964. baseWidths: LiberationSansRegularWidths,
  25965. baseMapping: LiberationSansRegularMapping,
  25966. metrics: SegoeuiRegularMetrics
  25967. };
  25968. t["Segoeui-Bold"] = {
  25969. name: "LiberationSans-Bold",
  25970. factors: SegoeuiBoldFactors,
  25971. baseWidths: LiberationSansBoldWidths,
  25972. baseMapping: LiberationSansBoldMapping,
  25973. metrics: SegoeuiBoldMetrics
  25974. };
  25975. t["Segoeui-Italic"] = {
  25976. name: "LiberationSans-Italic",
  25977. factors: SegoeuiItalicFactors,
  25978. baseWidths: LiberationSansItalicWidths,
  25979. baseMapping: LiberationSansItalicMapping,
  25980. metrics: SegoeuiItalicMetrics
  25981. };
  25982. t["Segoeui-BoldItalic"] = {
  25983. name: "LiberationSans-BoldItalic",
  25984. factors: SegoeuiBoldItalicFactors,
  25985. baseWidths: LiberationSansBoldItalicWidths,
  25986. baseMapping: LiberationSansBoldItalicMapping,
  25987. metrics: SegoeuiBoldItalicMetrics
  25988. };
  25989. t["Helvetica-Regular"] = t.Helvetica = {
  25990. name: "LiberationSans-Regular",
  25991. factors: HelveticaRegularFactors,
  25992. baseWidths: LiberationSansRegularWidths,
  25993. baseMapping: LiberationSansRegularMapping,
  25994. metrics: HelveticaRegularMetrics
  25995. };
  25996. t["Helvetica-Bold"] = {
  25997. name: "LiberationSans-Bold",
  25998. factors: HelveticaBoldFactors,
  25999. baseWidths: LiberationSansBoldWidths,
  26000. baseMapping: LiberationSansBoldMapping,
  26001. metrics: HelveticaBoldMetrics
  26002. };
  26003. t["Helvetica-Italic"] = {
  26004. name: "LiberationSans-Italic",
  26005. factors: HelveticaItalicFactors,
  26006. baseWidths: LiberationSansItalicWidths,
  26007. baseMapping: LiberationSansItalicMapping,
  26008. metrics: HelveticaItalicMetrics
  26009. };
  26010. t["Helvetica-BoldItalic"] = {
  26011. name: "LiberationSans-BoldItalic",
  26012. factors: HelveticaBoldItalicFactors,
  26013. baseWidths: LiberationSansBoldItalicWidths,
  26014. baseMapping: LiberationSansBoldItalicMapping,
  26015. metrics: HelveticaBoldItalicMetrics
  26016. };
  26017. });
  26018. function getXfaFontName(name) {
  26019. const fontName = normalizeFontName(name);
  26020. const fontMap = getXFAFontMap();
  26021. return fontMap[fontName];
  26022. }
  26023. function getXfaFontWidths(name) {
  26024. const info = getXfaFontName(name);
  26025. if (!info) {
  26026. return null;
  26027. }
  26028. const {
  26029. baseWidths,
  26030. baseMapping,
  26031. factors
  26032. } = info;
  26033. const rescaledBaseWidths = !factors ? baseWidths : baseWidths.map((w, i) => w * factors[i]);
  26034. let currentCode = -2;
  26035. let currentArray;
  26036. const newWidths = [];
  26037. for (const [unicode, glyphIndex] of baseMapping.map((charUnicode, index) => [charUnicode, index]).sort(([unicode1], [unicode2]) => unicode1 - unicode2)) {
  26038. if (unicode === -1) {
  26039. continue;
  26040. }
  26041. if (unicode === currentCode + 1) {
  26042. currentArray.push(rescaledBaseWidths[glyphIndex]);
  26043. currentCode += 1;
  26044. } else {
  26045. currentCode = unicode;
  26046. currentArray = [rescaledBaseWidths[glyphIndex]];
  26047. newWidths.push(unicode, currentArray);
  26048. }
  26049. }
  26050. return newWidths;
  26051. }
  26052. function getXfaFontDict(name) {
  26053. const widths = getXfaFontWidths(name);
  26054. const dict = new Dict(null);
  26055. dict.set("BaseFont", Name.get(name));
  26056. dict.set("Type", Name.get("Font"));
  26057. dict.set("Subtype", Name.get("CIDFontType2"));
  26058. dict.set("Encoding", Name.get("Identity-H"));
  26059. dict.set("CIDToGIDMap", Name.get("Identity"));
  26060. dict.set("W", widths);
  26061. dict.set("FirstChar", widths[0]);
  26062. dict.set("LastChar", widths.at(-2) + widths.at(-1).length - 1);
  26063. const descriptor = new Dict(null);
  26064. dict.set("FontDescriptor", descriptor);
  26065. const systemInfo = new Dict(null);
  26066. systemInfo.set("Ordering", "Identity");
  26067. systemInfo.set("Registry", "Adobe");
  26068. systemInfo.set("Supplement", 0);
  26069. dict.set("CIDSystemInfo", systemInfo);
  26070. return dict;
  26071. }
  26072. ;// CONCATENATED MODULE: ./src/core/ps_parser.js
  26073. class PostScriptParser {
  26074. constructor(lexer) {
  26075. this.lexer = lexer;
  26076. this.operators = [];
  26077. this.token = null;
  26078. this.prev = null;
  26079. }
  26080. nextToken() {
  26081. this.prev = this.token;
  26082. this.token = this.lexer.getToken();
  26083. }
  26084. accept(type) {
  26085. if (this.token.type === type) {
  26086. this.nextToken();
  26087. return true;
  26088. }
  26089. return false;
  26090. }
  26091. expect(type) {
  26092. if (this.accept(type)) {
  26093. return true;
  26094. }
  26095. throw new FormatError(`Unexpected symbol: found ${this.token.type} expected ${type}.`);
  26096. }
  26097. parse() {
  26098. this.nextToken();
  26099. this.expect(PostScriptTokenTypes.LBRACE);
  26100. this.parseBlock();
  26101. this.expect(PostScriptTokenTypes.RBRACE);
  26102. return this.operators;
  26103. }
  26104. parseBlock() {
  26105. while (true) {
  26106. if (this.accept(PostScriptTokenTypes.NUMBER)) {
  26107. this.operators.push(this.prev.value);
  26108. } else if (this.accept(PostScriptTokenTypes.OPERATOR)) {
  26109. this.operators.push(this.prev.value);
  26110. } else if (this.accept(PostScriptTokenTypes.LBRACE)) {
  26111. this.parseCondition();
  26112. } else {
  26113. return;
  26114. }
  26115. }
  26116. }
  26117. parseCondition() {
  26118. const conditionLocation = this.operators.length;
  26119. this.operators.push(null, null);
  26120. this.parseBlock();
  26121. this.expect(PostScriptTokenTypes.RBRACE);
  26122. if (this.accept(PostScriptTokenTypes.IF)) {
  26123. this.operators[conditionLocation] = this.operators.length;
  26124. this.operators[conditionLocation + 1] = "jz";
  26125. } else if (this.accept(PostScriptTokenTypes.LBRACE)) {
  26126. const jumpLocation = this.operators.length;
  26127. this.operators.push(null, null);
  26128. const endOfTrue = this.operators.length;
  26129. this.parseBlock();
  26130. this.expect(PostScriptTokenTypes.RBRACE);
  26131. this.expect(PostScriptTokenTypes.IFELSE);
  26132. this.operators[jumpLocation] = this.operators.length;
  26133. this.operators[jumpLocation + 1] = "j";
  26134. this.operators[conditionLocation] = endOfTrue;
  26135. this.operators[conditionLocation + 1] = "jz";
  26136. } else {
  26137. throw new FormatError("PS Function: error parsing conditional.");
  26138. }
  26139. }
  26140. }
  26141. const PostScriptTokenTypes = {
  26142. LBRACE: 0,
  26143. RBRACE: 1,
  26144. NUMBER: 2,
  26145. OPERATOR: 3,
  26146. IF: 4,
  26147. IFELSE: 5
  26148. };
  26149. class PostScriptToken {
  26150. static get opCache() {
  26151. return shadow(this, "opCache", Object.create(null));
  26152. }
  26153. constructor(type, value) {
  26154. this.type = type;
  26155. this.value = value;
  26156. }
  26157. static getOperator(op) {
  26158. return PostScriptToken.opCache[op] ||= new PostScriptToken(PostScriptTokenTypes.OPERATOR, op);
  26159. }
  26160. static get LBRACE() {
  26161. return shadow(this, "LBRACE", new PostScriptToken(PostScriptTokenTypes.LBRACE, "{"));
  26162. }
  26163. static get RBRACE() {
  26164. return shadow(this, "RBRACE", new PostScriptToken(PostScriptTokenTypes.RBRACE, "}"));
  26165. }
  26166. static get IF() {
  26167. return shadow(this, "IF", new PostScriptToken(PostScriptTokenTypes.IF, "IF"));
  26168. }
  26169. static get IFELSE() {
  26170. return shadow(this, "IFELSE", new PostScriptToken(PostScriptTokenTypes.IFELSE, "IFELSE"));
  26171. }
  26172. }
  26173. class PostScriptLexer {
  26174. constructor(stream) {
  26175. this.stream = stream;
  26176. this.nextChar();
  26177. this.strBuf = [];
  26178. }
  26179. nextChar() {
  26180. return this.currentChar = this.stream.getByte();
  26181. }
  26182. getToken() {
  26183. let comment = false;
  26184. let ch = this.currentChar;
  26185. while (true) {
  26186. if (ch < 0) {
  26187. return EOF;
  26188. }
  26189. if (comment) {
  26190. if (ch === 0x0a || ch === 0x0d) {
  26191. comment = false;
  26192. }
  26193. } else if (ch === 0x25) {
  26194. comment = true;
  26195. } else if (!isWhiteSpace(ch)) {
  26196. break;
  26197. }
  26198. ch = this.nextChar();
  26199. }
  26200. switch (ch | 0) {
  26201. case 0x30:
  26202. case 0x31:
  26203. case 0x32:
  26204. case 0x33:
  26205. case 0x34:
  26206. case 0x35:
  26207. case 0x36:
  26208. case 0x37:
  26209. case 0x38:
  26210. case 0x39:
  26211. case 0x2b:
  26212. case 0x2d:
  26213. case 0x2e:
  26214. return new PostScriptToken(PostScriptTokenTypes.NUMBER, this.getNumber());
  26215. case 0x7b:
  26216. this.nextChar();
  26217. return PostScriptToken.LBRACE;
  26218. case 0x7d:
  26219. this.nextChar();
  26220. return PostScriptToken.RBRACE;
  26221. }
  26222. const strBuf = this.strBuf;
  26223. strBuf.length = 0;
  26224. strBuf[0] = String.fromCharCode(ch);
  26225. while ((ch = this.nextChar()) >= 0 && (ch >= 0x41 && ch <= 0x5a || ch >= 0x61 && ch <= 0x7a)) {
  26226. strBuf.push(String.fromCharCode(ch));
  26227. }
  26228. const str = strBuf.join("");
  26229. switch (str.toLowerCase()) {
  26230. case "if":
  26231. return PostScriptToken.IF;
  26232. case "ifelse":
  26233. return PostScriptToken.IFELSE;
  26234. default:
  26235. return PostScriptToken.getOperator(str);
  26236. }
  26237. }
  26238. getNumber() {
  26239. let ch = this.currentChar;
  26240. const strBuf = this.strBuf;
  26241. strBuf.length = 0;
  26242. strBuf[0] = String.fromCharCode(ch);
  26243. while ((ch = this.nextChar()) >= 0) {
  26244. if (ch >= 0x30 && ch <= 0x39 || ch === 0x2d || ch === 0x2e) {
  26245. strBuf.push(String.fromCharCode(ch));
  26246. } else {
  26247. break;
  26248. }
  26249. }
  26250. const value = parseFloat(strBuf.join(""));
  26251. if (isNaN(value)) {
  26252. throw new FormatError(`Invalid floating point number: ${value}`);
  26253. }
  26254. return value;
  26255. }
  26256. }
  26257. ;// CONCATENATED MODULE: ./src/core/image_utils.js
  26258. class BaseLocalCache {
  26259. constructor(options) {
  26260. if (this.constructor === BaseLocalCache) {
  26261. unreachable("Cannot initialize BaseLocalCache.");
  26262. }
  26263. this._onlyRefs = options?.onlyRefs === true;
  26264. if (!this._onlyRefs) {
  26265. this._nameRefMap = new Map();
  26266. this._imageMap = new Map();
  26267. }
  26268. this._imageCache = new RefSetCache();
  26269. }
  26270. getByName(name) {
  26271. if (this._onlyRefs) {
  26272. unreachable("Should not call `getByName` method.");
  26273. }
  26274. const ref = this._nameRefMap.get(name);
  26275. if (ref) {
  26276. return this.getByRef(ref);
  26277. }
  26278. return this._imageMap.get(name) || null;
  26279. }
  26280. getByRef(ref) {
  26281. return this._imageCache.get(ref) || null;
  26282. }
  26283. set(name, ref, data) {
  26284. unreachable("Abstract method `set` called.");
  26285. }
  26286. }
  26287. class LocalImageCache extends BaseLocalCache {
  26288. set(name, ref = null, data) {
  26289. if (typeof name !== "string") {
  26290. throw new Error('LocalImageCache.set - expected "name" argument.');
  26291. }
  26292. if (ref) {
  26293. if (this._imageCache.has(ref)) {
  26294. return;
  26295. }
  26296. this._nameRefMap.set(name, ref);
  26297. this._imageCache.put(ref, data);
  26298. return;
  26299. }
  26300. if (this._imageMap.has(name)) {
  26301. return;
  26302. }
  26303. this._imageMap.set(name, data);
  26304. }
  26305. }
  26306. class LocalColorSpaceCache extends BaseLocalCache {
  26307. set(name = null, ref = null, data) {
  26308. if (typeof name !== "string" && !ref) {
  26309. throw new Error('LocalColorSpaceCache.set - expected "name" and/or "ref" argument.');
  26310. }
  26311. if (ref) {
  26312. if (this._imageCache.has(ref)) {
  26313. return;
  26314. }
  26315. if (name !== null) {
  26316. this._nameRefMap.set(name, ref);
  26317. }
  26318. this._imageCache.put(ref, data);
  26319. return;
  26320. }
  26321. if (this._imageMap.has(name)) {
  26322. return;
  26323. }
  26324. this._imageMap.set(name, data);
  26325. }
  26326. }
  26327. class LocalFunctionCache extends BaseLocalCache {
  26328. constructor(options) {
  26329. super({
  26330. onlyRefs: true
  26331. });
  26332. }
  26333. set(name = null, ref, data) {
  26334. if (!ref) {
  26335. throw new Error('LocalFunctionCache.set - expected "ref" argument.');
  26336. }
  26337. if (this._imageCache.has(ref)) {
  26338. return;
  26339. }
  26340. this._imageCache.put(ref, data);
  26341. }
  26342. }
  26343. class LocalGStateCache extends BaseLocalCache {
  26344. set(name, ref = null, data) {
  26345. if (typeof name !== "string") {
  26346. throw new Error('LocalGStateCache.set - expected "name" argument.');
  26347. }
  26348. if (ref) {
  26349. if (this._imageCache.has(ref)) {
  26350. return;
  26351. }
  26352. this._nameRefMap.set(name, ref);
  26353. this._imageCache.put(ref, data);
  26354. return;
  26355. }
  26356. if (this._imageMap.has(name)) {
  26357. return;
  26358. }
  26359. this._imageMap.set(name, data);
  26360. }
  26361. }
  26362. class LocalTilingPatternCache extends BaseLocalCache {
  26363. constructor(options) {
  26364. super({
  26365. onlyRefs: true
  26366. });
  26367. }
  26368. set(name = null, ref, data) {
  26369. if (!ref) {
  26370. throw new Error('LocalTilingPatternCache.set - expected "ref" argument.');
  26371. }
  26372. if (this._imageCache.has(ref)) {
  26373. return;
  26374. }
  26375. this._imageCache.put(ref, data);
  26376. }
  26377. }
  26378. class RegionalImageCache extends BaseLocalCache {
  26379. constructor(options) {
  26380. super({
  26381. onlyRefs: true
  26382. });
  26383. }
  26384. set(name = null, ref, data) {
  26385. if (!ref) {
  26386. throw new Error('RegionalImageCache.set - expected "ref" argument.');
  26387. }
  26388. if (this._imageCache.has(ref)) {
  26389. return;
  26390. }
  26391. this._imageCache.put(ref, data);
  26392. }
  26393. }
  26394. class GlobalImageCache {
  26395. static NUM_PAGES_THRESHOLD = 2;
  26396. static MIN_IMAGES_TO_CACHE = 10;
  26397. static MAX_BYTE_SIZE = 5 * MAX_IMAGE_SIZE_TO_CACHE;
  26398. #decodeFailedSet = new RefSet();
  26399. constructor() {
  26400. this._refCache = new RefSetCache();
  26401. this._imageCache = new RefSetCache();
  26402. }
  26403. get #byteSize() {
  26404. let byteSize = 0;
  26405. for (const imageData of this._imageCache) {
  26406. byteSize += imageData.byteSize;
  26407. }
  26408. return byteSize;
  26409. }
  26410. get #cacheLimitReached() {
  26411. if (this._imageCache.size < GlobalImageCache.MIN_IMAGES_TO_CACHE) {
  26412. return false;
  26413. }
  26414. if (this.#byteSize < GlobalImageCache.MAX_BYTE_SIZE) {
  26415. return false;
  26416. }
  26417. return true;
  26418. }
  26419. shouldCache(ref, pageIndex) {
  26420. let pageIndexSet = this._refCache.get(ref);
  26421. if (!pageIndexSet) {
  26422. pageIndexSet = new Set();
  26423. this._refCache.put(ref, pageIndexSet);
  26424. }
  26425. pageIndexSet.add(pageIndex);
  26426. if (pageIndexSet.size < GlobalImageCache.NUM_PAGES_THRESHOLD) {
  26427. return false;
  26428. }
  26429. if (!this._imageCache.has(ref) && this.#cacheLimitReached) {
  26430. return false;
  26431. }
  26432. return true;
  26433. }
  26434. addDecodeFailed(ref) {
  26435. this.#decodeFailedSet.put(ref);
  26436. }
  26437. hasDecodeFailed(ref) {
  26438. return this.#decodeFailedSet.has(ref);
  26439. }
  26440. addByteSize(ref, byteSize) {
  26441. const imageData = this._imageCache.get(ref);
  26442. if (!imageData) {
  26443. return;
  26444. }
  26445. if (imageData.byteSize) {
  26446. return;
  26447. }
  26448. imageData.byteSize = byteSize;
  26449. }
  26450. getData(ref, pageIndex) {
  26451. const pageIndexSet = this._refCache.get(ref);
  26452. if (!pageIndexSet) {
  26453. return null;
  26454. }
  26455. if (pageIndexSet.size < GlobalImageCache.NUM_PAGES_THRESHOLD) {
  26456. return null;
  26457. }
  26458. const imageData = this._imageCache.get(ref);
  26459. if (!imageData) {
  26460. return null;
  26461. }
  26462. pageIndexSet.add(pageIndex);
  26463. return imageData;
  26464. }
  26465. setData(ref, data) {
  26466. if (!this._refCache.has(ref)) {
  26467. throw new Error('GlobalImageCache.setData - expected "shouldCache" to have been called.');
  26468. }
  26469. if (this._imageCache.has(ref)) {
  26470. return;
  26471. }
  26472. if (this.#cacheLimitReached) {
  26473. warn("GlobalImageCache.setData - cache limit reached.");
  26474. return;
  26475. }
  26476. this._imageCache.put(ref, data);
  26477. }
  26478. clear(onlyData = false) {
  26479. if (!onlyData) {
  26480. this.#decodeFailedSet.clear();
  26481. this._refCache.clear();
  26482. }
  26483. this._imageCache.clear();
  26484. }
  26485. }
  26486. ;// CONCATENATED MODULE: ./src/core/function.js
  26487. class PDFFunctionFactory {
  26488. constructor({
  26489. xref,
  26490. isEvalSupported = true
  26491. }) {
  26492. this.xref = xref;
  26493. this.isEvalSupported = isEvalSupported !== false;
  26494. }
  26495. create(fn) {
  26496. const cachedFunction = this.getCached(fn);
  26497. if (cachedFunction) {
  26498. return cachedFunction;
  26499. }
  26500. const parsedFunction = PDFFunction.parse({
  26501. xref: this.xref,
  26502. isEvalSupported: this.isEvalSupported,
  26503. fn: fn instanceof Ref ? this.xref.fetch(fn) : fn
  26504. });
  26505. this._cache(fn, parsedFunction);
  26506. return parsedFunction;
  26507. }
  26508. createFromArray(fnObj) {
  26509. const cachedFunction = this.getCached(fnObj);
  26510. if (cachedFunction) {
  26511. return cachedFunction;
  26512. }
  26513. const parsedFunction = PDFFunction.parseArray({
  26514. xref: this.xref,
  26515. isEvalSupported: this.isEvalSupported,
  26516. fnObj: fnObj instanceof Ref ? this.xref.fetch(fnObj) : fnObj
  26517. });
  26518. this._cache(fnObj, parsedFunction);
  26519. return parsedFunction;
  26520. }
  26521. getCached(cacheKey) {
  26522. let fnRef;
  26523. if (cacheKey instanceof Ref) {
  26524. fnRef = cacheKey;
  26525. } else if (cacheKey instanceof Dict) {
  26526. fnRef = cacheKey.objId;
  26527. } else if (cacheKey instanceof BaseStream) {
  26528. fnRef = cacheKey.dict?.objId;
  26529. }
  26530. if (fnRef) {
  26531. const localFunction = this._localFunctionCache.getByRef(fnRef);
  26532. if (localFunction) {
  26533. return localFunction;
  26534. }
  26535. }
  26536. return null;
  26537. }
  26538. _cache(cacheKey, parsedFunction) {
  26539. if (!parsedFunction) {
  26540. throw new Error('PDFFunctionFactory._cache - expected "parsedFunction" argument.');
  26541. }
  26542. let fnRef;
  26543. if (cacheKey instanceof Ref) {
  26544. fnRef = cacheKey;
  26545. } else if (cacheKey instanceof Dict) {
  26546. fnRef = cacheKey.objId;
  26547. } else if (cacheKey instanceof BaseStream) {
  26548. fnRef = cacheKey.dict?.objId;
  26549. }
  26550. if (fnRef) {
  26551. this._localFunctionCache.set(null, fnRef, parsedFunction);
  26552. }
  26553. }
  26554. get _localFunctionCache() {
  26555. return shadow(this, "_localFunctionCache", new LocalFunctionCache());
  26556. }
  26557. }
  26558. function toNumberArray(arr) {
  26559. if (!Array.isArray(arr)) {
  26560. return null;
  26561. }
  26562. if (!isNumberArray(arr, null)) {
  26563. return arr.map(x => +x);
  26564. }
  26565. return arr;
  26566. }
  26567. class PDFFunction {
  26568. static getSampleArray(size, outputSize, bps, stream) {
  26569. let i, ii;
  26570. let length = 1;
  26571. for (i = 0, ii = size.length; i < ii; i++) {
  26572. length *= size[i];
  26573. }
  26574. length *= outputSize;
  26575. const array = new Array(length);
  26576. let codeSize = 0;
  26577. let codeBuf = 0;
  26578. const sampleMul = 1.0 / (2.0 ** bps - 1);
  26579. const strBytes = stream.getBytes((length * bps + 7) / 8);
  26580. let strIdx = 0;
  26581. for (i = 0; i < length; i++) {
  26582. while (codeSize < bps) {
  26583. codeBuf <<= 8;
  26584. codeBuf |= strBytes[strIdx++];
  26585. codeSize += 8;
  26586. }
  26587. codeSize -= bps;
  26588. array[i] = (codeBuf >> codeSize) * sampleMul;
  26589. codeBuf &= (1 << codeSize) - 1;
  26590. }
  26591. return array;
  26592. }
  26593. static parse({
  26594. xref,
  26595. isEvalSupported,
  26596. fn
  26597. }) {
  26598. const dict = fn.dict || fn;
  26599. const typeNum = dict.get("FunctionType");
  26600. switch (typeNum) {
  26601. case 0:
  26602. return this.constructSampled({
  26603. xref,
  26604. isEvalSupported,
  26605. fn,
  26606. dict
  26607. });
  26608. case 1:
  26609. break;
  26610. case 2:
  26611. return this.constructInterpolated({
  26612. xref,
  26613. isEvalSupported,
  26614. dict
  26615. });
  26616. case 3:
  26617. return this.constructStiched({
  26618. xref,
  26619. isEvalSupported,
  26620. dict
  26621. });
  26622. case 4:
  26623. return this.constructPostScript({
  26624. xref,
  26625. isEvalSupported,
  26626. fn,
  26627. dict
  26628. });
  26629. }
  26630. throw new FormatError("Unknown type of function");
  26631. }
  26632. static parseArray({
  26633. xref,
  26634. isEvalSupported,
  26635. fnObj
  26636. }) {
  26637. if (!Array.isArray(fnObj)) {
  26638. return this.parse({
  26639. xref,
  26640. isEvalSupported,
  26641. fn: fnObj
  26642. });
  26643. }
  26644. const fnArray = [];
  26645. for (const fn of fnObj) {
  26646. fnArray.push(this.parse({
  26647. xref,
  26648. isEvalSupported,
  26649. fn: xref.fetchIfRef(fn)
  26650. }));
  26651. }
  26652. return function (src, srcOffset, dest, destOffset) {
  26653. for (let i = 0, ii = fnArray.length; i < ii; i++) {
  26654. fnArray[i](src, srcOffset, dest, destOffset + i);
  26655. }
  26656. };
  26657. }
  26658. static constructSampled({
  26659. xref,
  26660. isEvalSupported,
  26661. fn,
  26662. dict
  26663. }) {
  26664. function toMultiArray(arr) {
  26665. const inputLength = arr.length;
  26666. const out = [];
  26667. let index = 0;
  26668. for (let i = 0; i < inputLength; i += 2) {
  26669. out[index++] = [arr[i], arr[i + 1]];
  26670. }
  26671. return out;
  26672. }
  26673. function interpolate(x, xmin, xmax, ymin, ymax) {
  26674. return ymin + (x - xmin) * ((ymax - ymin) / (xmax - xmin));
  26675. }
  26676. let domain = toNumberArray(dict.getArray("Domain"));
  26677. let range = toNumberArray(dict.getArray("Range"));
  26678. if (!domain || !range) {
  26679. throw new FormatError("No domain or range");
  26680. }
  26681. const inputSize = domain.length / 2;
  26682. const outputSize = range.length / 2;
  26683. domain = toMultiArray(domain);
  26684. range = toMultiArray(range);
  26685. const size = toNumberArray(dict.getArray("Size"));
  26686. const bps = dict.get("BitsPerSample");
  26687. const order = dict.get("Order") || 1;
  26688. if (order !== 1) {
  26689. info("No support for cubic spline interpolation: " + order);
  26690. }
  26691. let encode = toNumberArray(dict.getArray("Encode"));
  26692. if (!encode) {
  26693. encode = [];
  26694. for (let i = 0; i < inputSize; ++i) {
  26695. encode.push([0, size[i] - 1]);
  26696. }
  26697. } else {
  26698. encode = toMultiArray(encode);
  26699. }
  26700. let decode = toNumberArray(dict.getArray("Decode"));
  26701. decode = !decode ? range : toMultiArray(decode);
  26702. const samples = this.getSampleArray(size, outputSize, bps, fn);
  26703. return function constructSampledFn(src, srcOffset, dest, destOffset) {
  26704. const cubeVertices = 1 << inputSize;
  26705. const cubeN = new Float64Array(cubeVertices);
  26706. const cubeVertex = new Uint32Array(cubeVertices);
  26707. let i, j;
  26708. for (j = 0; j < cubeVertices; j++) {
  26709. cubeN[j] = 1;
  26710. }
  26711. let k = outputSize,
  26712. pos = 1;
  26713. for (i = 0; i < inputSize; ++i) {
  26714. const domain_2i = domain[i][0];
  26715. const domain_2i_1 = domain[i][1];
  26716. const xi = Math.min(Math.max(src[srcOffset + i], domain_2i), domain_2i_1);
  26717. let e = interpolate(xi, domain_2i, domain_2i_1, encode[i][0], encode[i][1]);
  26718. const size_i = size[i];
  26719. e = Math.min(Math.max(e, 0), size_i - 1);
  26720. const e0 = e < size_i - 1 ? Math.floor(e) : e - 1;
  26721. const n0 = e0 + 1 - e;
  26722. const n1 = e - e0;
  26723. const offset0 = e0 * k;
  26724. const offset1 = offset0 + k;
  26725. for (j = 0; j < cubeVertices; j++) {
  26726. if (j & pos) {
  26727. cubeN[j] *= n1;
  26728. cubeVertex[j] += offset1;
  26729. } else {
  26730. cubeN[j] *= n0;
  26731. cubeVertex[j] += offset0;
  26732. }
  26733. }
  26734. k *= size_i;
  26735. pos <<= 1;
  26736. }
  26737. for (j = 0; j < outputSize; ++j) {
  26738. let rj = 0;
  26739. for (i = 0; i < cubeVertices; i++) {
  26740. rj += samples[cubeVertex[i] + j] * cubeN[i];
  26741. }
  26742. rj = interpolate(rj, 0, 1, decode[j][0], decode[j][1]);
  26743. dest[destOffset + j] = Math.min(Math.max(rj, range[j][0]), range[j][1]);
  26744. }
  26745. };
  26746. }
  26747. static constructInterpolated({
  26748. xref,
  26749. isEvalSupported,
  26750. dict
  26751. }) {
  26752. const c0 = toNumberArray(dict.getArray("C0")) || [0];
  26753. const c1 = toNumberArray(dict.getArray("C1")) || [1];
  26754. const n = dict.get("N");
  26755. const diff = [];
  26756. for (let i = 0, ii = c0.length; i < ii; ++i) {
  26757. diff.push(c1[i] - c0[i]);
  26758. }
  26759. const length = diff.length;
  26760. return function constructInterpolatedFn(src, srcOffset, dest, destOffset) {
  26761. const x = n === 1 ? src[srcOffset] : src[srcOffset] ** n;
  26762. for (let j = 0; j < length; ++j) {
  26763. dest[destOffset + j] = c0[j] + x * diff[j];
  26764. }
  26765. };
  26766. }
  26767. static constructStiched({
  26768. xref,
  26769. isEvalSupported,
  26770. dict
  26771. }) {
  26772. const domain = toNumberArray(dict.getArray("Domain"));
  26773. if (!domain) {
  26774. throw new FormatError("No domain");
  26775. }
  26776. const inputSize = domain.length / 2;
  26777. if (inputSize !== 1) {
  26778. throw new FormatError("Bad domain for stiched function");
  26779. }
  26780. const fns = [];
  26781. for (const fn of dict.get("Functions")) {
  26782. fns.push(this.parse({
  26783. xref,
  26784. isEvalSupported,
  26785. fn: xref.fetchIfRef(fn)
  26786. }));
  26787. }
  26788. const bounds = toNumberArray(dict.getArray("Bounds"));
  26789. const encode = toNumberArray(dict.getArray("Encode"));
  26790. const tmpBuf = new Float32Array(1);
  26791. return function constructStichedFn(src, srcOffset, dest, destOffset) {
  26792. const clip = function constructStichedFromIRClip(v, min, max) {
  26793. if (v > max) {
  26794. v = max;
  26795. } else if (v < min) {
  26796. v = min;
  26797. }
  26798. return v;
  26799. };
  26800. const v = clip(src[srcOffset], domain[0], domain[1]);
  26801. const length = bounds.length;
  26802. let i;
  26803. for (i = 0; i < length; ++i) {
  26804. if (v < bounds[i]) {
  26805. break;
  26806. }
  26807. }
  26808. let dmin = domain[0];
  26809. if (i > 0) {
  26810. dmin = bounds[i - 1];
  26811. }
  26812. let dmax = domain[1];
  26813. if (i < bounds.length) {
  26814. dmax = bounds[i];
  26815. }
  26816. const rmin = encode[2 * i];
  26817. const rmax = encode[2 * i + 1];
  26818. tmpBuf[0] = dmin === dmax ? rmin : rmin + (v - dmin) * (rmax - rmin) / (dmax - dmin);
  26819. fns[i](tmpBuf, 0, dest, destOffset);
  26820. };
  26821. }
  26822. static constructPostScript({
  26823. xref,
  26824. isEvalSupported,
  26825. fn,
  26826. dict
  26827. }) {
  26828. const domain = toNumberArray(dict.getArray("Domain"));
  26829. const range = toNumberArray(dict.getArray("Range"));
  26830. if (!domain) {
  26831. throw new FormatError("No domain.");
  26832. }
  26833. if (!range) {
  26834. throw new FormatError("No range.");
  26835. }
  26836. const lexer = new PostScriptLexer(fn);
  26837. const parser = new PostScriptParser(lexer);
  26838. const code = parser.parse();
  26839. if (isEvalSupported && FeatureTest.isEvalSupported) {
  26840. const compiled = new PostScriptCompiler().compile(code, domain, range);
  26841. if (compiled) {
  26842. return new Function("src", "srcOffset", "dest", "destOffset", compiled);
  26843. }
  26844. }
  26845. info("Unable to compile PS function");
  26846. const numOutputs = range.length >> 1;
  26847. const numInputs = domain.length >> 1;
  26848. const evaluator = new PostScriptEvaluator(code);
  26849. const cache = Object.create(null);
  26850. const MAX_CACHE_SIZE = 2048 * 4;
  26851. let cache_available = MAX_CACHE_SIZE;
  26852. const tmpBuf = new Float32Array(numInputs);
  26853. return function constructPostScriptFn(src, srcOffset, dest, destOffset) {
  26854. let i, value;
  26855. let key = "";
  26856. const input = tmpBuf;
  26857. for (i = 0; i < numInputs; i++) {
  26858. value = src[srcOffset + i];
  26859. input[i] = value;
  26860. key += value + "_";
  26861. }
  26862. const cachedValue = cache[key];
  26863. if (cachedValue !== undefined) {
  26864. dest.set(cachedValue, destOffset);
  26865. return;
  26866. }
  26867. const output = new Float32Array(numOutputs);
  26868. const stack = evaluator.execute(input);
  26869. const stackIndex = stack.length - numOutputs;
  26870. for (i = 0; i < numOutputs; i++) {
  26871. value = stack[stackIndex + i];
  26872. let bound = range[i * 2];
  26873. if (value < bound) {
  26874. value = bound;
  26875. } else {
  26876. bound = range[i * 2 + 1];
  26877. if (value > bound) {
  26878. value = bound;
  26879. }
  26880. }
  26881. output[i] = value;
  26882. }
  26883. if (cache_available > 0) {
  26884. cache_available--;
  26885. cache[key] = output;
  26886. }
  26887. dest.set(output, destOffset);
  26888. };
  26889. }
  26890. }
  26891. function isPDFFunction(v) {
  26892. let fnDict;
  26893. if (v instanceof Dict) {
  26894. fnDict = v;
  26895. } else if (v instanceof BaseStream) {
  26896. fnDict = v.dict;
  26897. } else {
  26898. return false;
  26899. }
  26900. return fnDict.has("FunctionType");
  26901. }
  26902. class PostScriptStack {
  26903. static MAX_STACK_SIZE = 100;
  26904. constructor(initialStack) {
  26905. this.stack = initialStack ? Array.from(initialStack) : [];
  26906. }
  26907. push(value) {
  26908. if (this.stack.length >= PostScriptStack.MAX_STACK_SIZE) {
  26909. throw new Error("PostScript function stack overflow.");
  26910. }
  26911. this.stack.push(value);
  26912. }
  26913. pop() {
  26914. if (this.stack.length <= 0) {
  26915. throw new Error("PostScript function stack underflow.");
  26916. }
  26917. return this.stack.pop();
  26918. }
  26919. copy(n) {
  26920. if (this.stack.length + n >= PostScriptStack.MAX_STACK_SIZE) {
  26921. throw new Error("PostScript function stack overflow.");
  26922. }
  26923. const stack = this.stack;
  26924. for (let i = stack.length - n, j = n - 1; j >= 0; j--, i++) {
  26925. stack.push(stack[i]);
  26926. }
  26927. }
  26928. index(n) {
  26929. this.push(this.stack[this.stack.length - n - 1]);
  26930. }
  26931. roll(n, p) {
  26932. const stack = this.stack;
  26933. const l = stack.length - n;
  26934. const r = stack.length - 1;
  26935. const c = l + (p - Math.floor(p / n) * n);
  26936. for (let i = l, j = r; i < j; i++, j--) {
  26937. const t = stack[i];
  26938. stack[i] = stack[j];
  26939. stack[j] = t;
  26940. }
  26941. for (let i = l, j = c - 1; i < j; i++, j--) {
  26942. const t = stack[i];
  26943. stack[i] = stack[j];
  26944. stack[j] = t;
  26945. }
  26946. for (let i = c, j = r; i < j; i++, j--) {
  26947. const t = stack[i];
  26948. stack[i] = stack[j];
  26949. stack[j] = t;
  26950. }
  26951. }
  26952. }
  26953. class PostScriptEvaluator {
  26954. constructor(operators) {
  26955. this.operators = operators;
  26956. }
  26957. execute(initialStack) {
  26958. const stack = new PostScriptStack(initialStack);
  26959. let counter = 0;
  26960. const operators = this.operators;
  26961. const length = operators.length;
  26962. let operator, a, b;
  26963. while (counter < length) {
  26964. operator = operators[counter++];
  26965. if (typeof operator === "number") {
  26966. stack.push(operator);
  26967. continue;
  26968. }
  26969. switch (operator) {
  26970. case "jz":
  26971. b = stack.pop();
  26972. a = stack.pop();
  26973. if (!a) {
  26974. counter = b;
  26975. }
  26976. break;
  26977. case "j":
  26978. a = stack.pop();
  26979. counter = a;
  26980. break;
  26981. case "abs":
  26982. a = stack.pop();
  26983. stack.push(Math.abs(a));
  26984. break;
  26985. case "add":
  26986. b = stack.pop();
  26987. a = stack.pop();
  26988. stack.push(a + b);
  26989. break;
  26990. case "and":
  26991. b = stack.pop();
  26992. a = stack.pop();
  26993. if (typeof a === "boolean" && typeof b === "boolean") {
  26994. stack.push(a && b);
  26995. } else {
  26996. stack.push(a & b);
  26997. }
  26998. break;
  26999. case "atan":
  27000. b = stack.pop();
  27001. a = stack.pop();
  27002. a = Math.atan2(a, b) / Math.PI * 180;
  27003. if (a < 0) {
  27004. a += 360;
  27005. }
  27006. stack.push(a);
  27007. break;
  27008. case "bitshift":
  27009. b = stack.pop();
  27010. a = stack.pop();
  27011. if (a > 0) {
  27012. stack.push(a << b);
  27013. } else {
  27014. stack.push(a >> b);
  27015. }
  27016. break;
  27017. case "ceiling":
  27018. a = stack.pop();
  27019. stack.push(Math.ceil(a));
  27020. break;
  27021. case "copy":
  27022. a = stack.pop();
  27023. stack.copy(a);
  27024. break;
  27025. case "cos":
  27026. a = stack.pop();
  27027. stack.push(Math.cos(a % 360 / 180 * Math.PI));
  27028. break;
  27029. case "cvi":
  27030. a = stack.pop() | 0;
  27031. stack.push(a);
  27032. break;
  27033. case "cvr":
  27034. break;
  27035. case "div":
  27036. b = stack.pop();
  27037. a = stack.pop();
  27038. stack.push(a / b);
  27039. break;
  27040. case "dup":
  27041. stack.copy(1);
  27042. break;
  27043. case "eq":
  27044. b = stack.pop();
  27045. a = stack.pop();
  27046. stack.push(a === b);
  27047. break;
  27048. case "exch":
  27049. stack.roll(2, 1);
  27050. break;
  27051. case "exp":
  27052. b = stack.pop();
  27053. a = stack.pop();
  27054. stack.push(a ** b);
  27055. break;
  27056. case "false":
  27057. stack.push(false);
  27058. break;
  27059. case "floor":
  27060. a = stack.pop();
  27061. stack.push(Math.floor(a));
  27062. break;
  27063. case "ge":
  27064. b = stack.pop();
  27065. a = stack.pop();
  27066. stack.push(a >= b);
  27067. break;
  27068. case "gt":
  27069. b = stack.pop();
  27070. a = stack.pop();
  27071. stack.push(a > b);
  27072. break;
  27073. case "idiv":
  27074. b = stack.pop();
  27075. a = stack.pop();
  27076. stack.push(a / b | 0);
  27077. break;
  27078. case "index":
  27079. a = stack.pop();
  27080. stack.index(a);
  27081. break;
  27082. case "le":
  27083. b = stack.pop();
  27084. a = stack.pop();
  27085. stack.push(a <= b);
  27086. break;
  27087. case "ln":
  27088. a = stack.pop();
  27089. stack.push(Math.log(a));
  27090. break;
  27091. case "log":
  27092. a = stack.pop();
  27093. stack.push(Math.log10(a));
  27094. break;
  27095. case "lt":
  27096. b = stack.pop();
  27097. a = stack.pop();
  27098. stack.push(a < b);
  27099. break;
  27100. case "mod":
  27101. b = stack.pop();
  27102. a = stack.pop();
  27103. stack.push(a % b);
  27104. break;
  27105. case "mul":
  27106. b = stack.pop();
  27107. a = stack.pop();
  27108. stack.push(a * b);
  27109. break;
  27110. case "ne":
  27111. b = stack.pop();
  27112. a = stack.pop();
  27113. stack.push(a !== b);
  27114. break;
  27115. case "neg":
  27116. a = stack.pop();
  27117. stack.push(-a);
  27118. break;
  27119. case "not":
  27120. a = stack.pop();
  27121. if (typeof a === "boolean") {
  27122. stack.push(!a);
  27123. } else {
  27124. stack.push(~a);
  27125. }
  27126. break;
  27127. case "or":
  27128. b = stack.pop();
  27129. a = stack.pop();
  27130. if (typeof a === "boolean" && typeof b === "boolean") {
  27131. stack.push(a || b);
  27132. } else {
  27133. stack.push(a | b);
  27134. }
  27135. break;
  27136. case "pop":
  27137. stack.pop();
  27138. break;
  27139. case "roll":
  27140. b = stack.pop();
  27141. a = stack.pop();
  27142. stack.roll(a, b);
  27143. break;
  27144. case "round":
  27145. a = stack.pop();
  27146. stack.push(Math.round(a));
  27147. break;
  27148. case "sin":
  27149. a = stack.pop();
  27150. stack.push(Math.sin(a % 360 / 180 * Math.PI));
  27151. break;
  27152. case "sqrt":
  27153. a = stack.pop();
  27154. stack.push(Math.sqrt(a));
  27155. break;
  27156. case "sub":
  27157. b = stack.pop();
  27158. a = stack.pop();
  27159. stack.push(a - b);
  27160. break;
  27161. case "true":
  27162. stack.push(true);
  27163. break;
  27164. case "truncate":
  27165. a = stack.pop();
  27166. a = a < 0 ? Math.ceil(a) : Math.floor(a);
  27167. stack.push(a);
  27168. break;
  27169. case "xor":
  27170. b = stack.pop();
  27171. a = stack.pop();
  27172. if (typeof a === "boolean" && typeof b === "boolean") {
  27173. stack.push(a !== b);
  27174. } else {
  27175. stack.push(a ^ b);
  27176. }
  27177. break;
  27178. default:
  27179. throw new FormatError(`Unknown operator ${operator}`);
  27180. }
  27181. }
  27182. return stack.stack;
  27183. }
  27184. }
  27185. class AstNode {
  27186. constructor(type) {
  27187. this.type = type;
  27188. }
  27189. visit(visitor) {
  27190. unreachable("abstract method");
  27191. }
  27192. }
  27193. class AstArgument extends AstNode {
  27194. constructor(index, min, max) {
  27195. super("args");
  27196. this.index = index;
  27197. this.min = min;
  27198. this.max = max;
  27199. }
  27200. visit(visitor) {
  27201. visitor.visitArgument(this);
  27202. }
  27203. }
  27204. class AstLiteral extends AstNode {
  27205. constructor(number) {
  27206. super("literal");
  27207. this.number = number;
  27208. this.min = number;
  27209. this.max = number;
  27210. }
  27211. visit(visitor) {
  27212. visitor.visitLiteral(this);
  27213. }
  27214. }
  27215. class AstBinaryOperation extends AstNode {
  27216. constructor(op, arg1, arg2, min, max) {
  27217. super("binary");
  27218. this.op = op;
  27219. this.arg1 = arg1;
  27220. this.arg2 = arg2;
  27221. this.min = min;
  27222. this.max = max;
  27223. }
  27224. visit(visitor) {
  27225. visitor.visitBinaryOperation(this);
  27226. }
  27227. }
  27228. class AstMin extends AstNode {
  27229. constructor(arg, max) {
  27230. super("max");
  27231. this.arg = arg;
  27232. this.min = arg.min;
  27233. this.max = max;
  27234. }
  27235. visit(visitor) {
  27236. visitor.visitMin(this);
  27237. }
  27238. }
  27239. class AstVariable extends AstNode {
  27240. constructor(index, min, max) {
  27241. super("var");
  27242. this.index = index;
  27243. this.min = min;
  27244. this.max = max;
  27245. }
  27246. visit(visitor) {
  27247. visitor.visitVariable(this);
  27248. }
  27249. }
  27250. class AstVariableDefinition extends AstNode {
  27251. constructor(variable, arg) {
  27252. super("definition");
  27253. this.variable = variable;
  27254. this.arg = arg;
  27255. }
  27256. visit(visitor) {
  27257. visitor.visitVariableDefinition(this);
  27258. }
  27259. }
  27260. class ExpressionBuilderVisitor {
  27261. constructor() {
  27262. this.parts = [];
  27263. }
  27264. visitArgument(arg) {
  27265. this.parts.push("Math.max(", arg.min, ", Math.min(", arg.max, ", src[srcOffset + ", arg.index, "]))");
  27266. }
  27267. visitVariable(variable) {
  27268. this.parts.push("v", variable.index);
  27269. }
  27270. visitLiteral(literal) {
  27271. this.parts.push(literal.number);
  27272. }
  27273. visitBinaryOperation(operation) {
  27274. this.parts.push("(");
  27275. operation.arg1.visit(this);
  27276. this.parts.push(" ", operation.op, " ");
  27277. operation.arg2.visit(this);
  27278. this.parts.push(")");
  27279. }
  27280. visitVariableDefinition(definition) {
  27281. this.parts.push("var ");
  27282. definition.variable.visit(this);
  27283. this.parts.push(" = ");
  27284. definition.arg.visit(this);
  27285. this.parts.push(";");
  27286. }
  27287. visitMin(max) {
  27288. this.parts.push("Math.min(");
  27289. max.arg.visit(this);
  27290. this.parts.push(", ", max.max, ")");
  27291. }
  27292. toString() {
  27293. return this.parts.join("");
  27294. }
  27295. }
  27296. function buildAddOperation(num1, num2) {
  27297. if (num2.type === "literal" && num2.number === 0) {
  27298. return num1;
  27299. }
  27300. if (num1.type === "literal" && num1.number === 0) {
  27301. return num2;
  27302. }
  27303. if (num2.type === "literal" && num1.type === "literal") {
  27304. return new AstLiteral(num1.number + num2.number);
  27305. }
  27306. return new AstBinaryOperation("+", num1, num2, num1.min + num2.min, num1.max + num2.max);
  27307. }
  27308. function buildMulOperation(num1, num2) {
  27309. if (num2.type === "literal") {
  27310. if (num2.number === 0) {
  27311. return new AstLiteral(0);
  27312. } else if (num2.number === 1) {
  27313. return num1;
  27314. } else if (num1.type === "literal") {
  27315. return new AstLiteral(num1.number * num2.number);
  27316. }
  27317. }
  27318. if (num1.type === "literal") {
  27319. if (num1.number === 0) {
  27320. return new AstLiteral(0);
  27321. } else if (num1.number === 1) {
  27322. return num2;
  27323. }
  27324. }
  27325. const min = Math.min(num1.min * num2.min, num1.min * num2.max, num1.max * num2.min, num1.max * num2.max);
  27326. const max = Math.max(num1.min * num2.min, num1.min * num2.max, num1.max * num2.min, num1.max * num2.max);
  27327. return new AstBinaryOperation("*", num1, num2, min, max);
  27328. }
  27329. function buildSubOperation(num1, num2) {
  27330. if (num2.type === "literal") {
  27331. if (num2.number === 0) {
  27332. return num1;
  27333. } else if (num1.type === "literal") {
  27334. return new AstLiteral(num1.number - num2.number);
  27335. }
  27336. }
  27337. if (num2.type === "binary" && num2.op === "-" && num1.type === "literal" && num1.number === 1 && num2.arg1.type === "literal" && num2.arg1.number === 1) {
  27338. return num2.arg2;
  27339. }
  27340. return new AstBinaryOperation("-", num1, num2, num1.min - num2.max, num1.max - num2.min);
  27341. }
  27342. function buildMinOperation(num1, max) {
  27343. if (num1.min >= max) {
  27344. return new AstLiteral(max);
  27345. } else if (num1.max <= max) {
  27346. return num1;
  27347. }
  27348. return new AstMin(num1, max);
  27349. }
  27350. class PostScriptCompiler {
  27351. compile(code, domain, range) {
  27352. const stack = [];
  27353. const instructions = [];
  27354. const inputSize = domain.length >> 1,
  27355. outputSize = range.length >> 1;
  27356. let lastRegister = 0;
  27357. let n, j;
  27358. let num1, num2, ast1, ast2, tmpVar, item;
  27359. for (let i = 0; i < inputSize; i++) {
  27360. stack.push(new AstArgument(i, domain[i * 2], domain[i * 2 + 1]));
  27361. }
  27362. for (let i = 0, ii = code.length; i < ii; i++) {
  27363. item = code[i];
  27364. if (typeof item === "number") {
  27365. stack.push(new AstLiteral(item));
  27366. continue;
  27367. }
  27368. switch (item) {
  27369. case "add":
  27370. if (stack.length < 2) {
  27371. return null;
  27372. }
  27373. num2 = stack.pop();
  27374. num1 = stack.pop();
  27375. stack.push(buildAddOperation(num1, num2));
  27376. break;
  27377. case "cvr":
  27378. if (stack.length < 1) {
  27379. return null;
  27380. }
  27381. break;
  27382. case "mul":
  27383. if (stack.length < 2) {
  27384. return null;
  27385. }
  27386. num2 = stack.pop();
  27387. num1 = stack.pop();
  27388. stack.push(buildMulOperation(num1, num2));
  27389. break;
  27390. case "sub":
  27391. if (stack.length < 2) {
  27392. return null;
  27393. }
  27394. num2 = stack.pop();
  27395. num1 = stack.pop();
  27396. stack.push(buildSubOperation(num1, num2));
  27397. break;
  27398. case "exch":
  27399. if (stack.length < 2) {
  27400. return null;
  27401. }
  27402. ast1 = stack.pop();
  27403. ast2 = stack.pop();
  27404. stack.push(ast1, ast2);
  27405. break;
  27406. case "pop":
  27407. if (stack.length < 1) {
  27408. return null;
  27409. }
  27410. stack.pop();
  27411. break;
  27412. case "index":
  27413. if (stack.length < 1) {
  27414. return null;
  27415. }
  27416. num1 = stack.pop();
  27417. if (num1.type !== "literal") {
  27418. return null;
  27419. }
  27420. n = num1.number;
  27421. if (n < 0 || !Number.isInteger(n) || stack.length < n) {
  27422. return null;
  27423. }
  27424. ast1 = stack[stack.length - n - 1];
  27425. if (ast1.type === "literal" || ast1.type === "var") {
  27426. stack.push(ast1);
  27427. break;
  27428. }
  27429. tmpVar = new AstVariable(lastRegister++, ast1.min, ast1.max);
  27430. stack[stack.length - n - 1] = tmpVar;
  27431. stack.push(tmpVar);
  27432. instructions.push(new AstVariableDefinition(tmpVar, ast1));
  27433. break;
  27434. case "dup":
  27435. if (stack.length < 1) {
  27436. return null;
  27437. }
  27438. 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]) {
  27439. num1 = stack.pop();
  27440. stack.push(buildMinOperation(num1, code[i + 1]));
  27441. i += 6;
  27442. break;
  27443. }
  27444. ast1 = stack.at(-1);
  27445. if (ast1.type === "literal" || ast1.type === "var") {
  27446. stack.push(ast1);
  27447. break;
  27448. }
  27449. tmpVar = new AstVariable(lastRegister++, ast1.min, ast1.max);
  27450. stack[stack.length - 1] = tmpVar;
  27451. stack.push(tmpVar);
  27452. instructions.push(new AstVariableDefinition(tmpVar, ast1));
  27453. break;
  27454. case "roll":
  27455. if (stack.length < 2) {
  27456. return null;
  27457. }
  27458. num2 = stack.pop();
  27459. num1 = stack.pop();
  27460. if (num2.type !== "literal" || num1.type !== "literal") {
  27461. return null;
  27462. }
  27463. j = num2.number;
  27464. n = num1.number;
  27465. if (n <= 0 || !Number.isInteger(n) || !Number.isInteger(j) || stack.length < n) {
  27466. return null;
  27467. }
  27468. j = (j % n + n) % n;
  27469. if (j === 0) {
  27470. break;
  27471. }
  27472. stack.push(...stack.splice(stack.length - n, n - j));
  27473. break;
  27474. default:
  27475. return null;
  27476. }
  27477. }
  27478. if (stack.length !== outputSize) {
  27479. return null;
  27480. }
  27481. const result = [];
  27482. for (const instruction of instructions) {
  27483. const statementBuilder = new ExpressionBuilderVisitor();
  27484. instruction.visit(statementBuilder);
  27485. result.push(statementBuilder.toString());
  27486. }
  27487. for (let i = 0, ii = stack.length; i < ii; i++) {
  27488. const expr = stack[i],
  27489. statementBuilder = new ExpressionBuilderVisitor();
  27490. expr.visit(statementBuilder);
  27491. const min = range[i * 2],
  27492. max = range[i * 2 + 1];
  27493. const out = [statementBuilder.toString()];
  27494. if (min > expr.min) {
  27495. out.unshift("Math.max(", min, ", ");
  27496. out.push(")");
  27497. }
  27498. if (max < expr.max) {
  27499. out.unshift("Math.min(", max, ", ");
  27500. out.push(")");
  27501. }
  27502. out.unshift("dest[destOffset + ", i, "] = ");
  27503. out.push(";");
  27504. result.push(out.join(""));
  27505. }
  27506. return result.join("\n");
  27507. }
  27508. }
  27509. ;// CONCATENATED MODULE: ./src/core/bidi.js
  27510. 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"];
  27511. 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"];
  27512. function isOdd(i) {
  27513. return (i & 1) !== 0;
  27514. }
  27515. function isEven(i) {
  27516. return (i & 1) === 0;
  27517. }
  27518. function findUnequal(arr, start, value) {
  27519. let j, jj;
  27520. for (j = start, jj = arr.length; j < jj; ++j) {
  27521. if (arr[j] !== value) {
  27522. return j;
  27523. }
  27524. }
  27525. return j;
  27526. }
  27527. function setValues(arr, start, end, value) {
  27528. for (let j = start; j < end; ++j) {
  27529. arr[j] = value;
  27530. }
  27531. }
  27532. function reverseValues(arr, start, end) {
  27533. for (let i = start, j = end - 1; i < j; ++i, --j) {
  27534. const temp = arr[i];
  27535. arr[i] = arr[j];
  27536. arr[j] = temp;
  27537. }
  27538. }
  27539. function createBidiText(str, isLTR, vertical = false) {
  27540. let dir = "ltr";
  27541. if (vertical) {
  27542. dir = "ttb";
  27543. } else if (!isLTR) {
  27544. dir = "rtl";
  27545. }
  27546. return {
  27547. str,
  27548. dir
  27549. };
  27550. }
  27551. const chars = [];
  27552. const types = [];
  27553. function bidi(str, startLevel = -1, vertical = false) {
  27554. let isLTR = true;
  27555. const strLength = str.length;
  27556. if (strLength === 0 || vertical) {
  27557. return createBidiText(str, isLTR, vertical);
  27558. }
  27559. chars.length = strLength;
  27560. types.length = strLength;
  27561. let numBidi = 0;
  27562. let i, ii;
  27563. for (i = 0; i < strLength; ++i) {
  27564. chars[i] = str.charAt(i);
  27565. const charCode = str.charCodeAt(i);
  27566. let charType = "L";
  27567. if (charCode <= 0x00ff) {
  27568. charType = baseTypes[charCode];
  27569. } else if (0x0590 <= charCode && charCode <= 0x05f4) {
  27570. charType = "R";
  27571. } else if (0x0600 <= charCode && charCode <= 0x06ff) {
  27572. charType = arabicTypes[charCode & 0xff];
  27573. if (!charType) {
  27574. warn("Bidi: invalid Unicode character " + charCode.toString(16));
  27575. }
  27576. } else if (0x0700 <= charCode && charCode <= 0x08ac || 0xfb50 <= charCode && charCode <= 0xfdff || 0xfe70 <= charCode && charCode <= 0xfeff) {
  27577. charType = "AL";
  27578. }
  27579. if (charType === "R" || charType === "AL" || charType === "AN") {
  27580. numBidi++;
  27581. }
  27582. types[i] = charType;
  27583. }
  27584. if (numBidi === 0) {
  27585. isLTR = true;
  27586. return createBidiText(str, isLTR);
  27587. }
  27588. if (startLevel === -1) {
  27589. if (numBidi / strLength < 0.3 && strLength > 4) {
  27590. isLTR = true;
  27591. startLevel = 0;
  27592. } else {
  27593. isLTR = false;
  27594. startLevel = 1;
  27595. }
  27596. }
  27597. const levels = [];
  27598. for (i = 0; i < strLength; ++i) {
  27599. levels[i] = startLevel;
  27600. }
  27601. const e = isOdd(startLevel) ? "R" : "L";
  27602. const sor = e;
  27603. const eor = sor;
  27604. let lastType = sor;
  27605. for (i = 0; i < strLength; ++i) {
  27606. if (types[i] === "NSM") {
  27607. types[i] = lastType;
  27608. } else {
  27609. lastType = types[i];
  27610. }
  27611. }
  27612. lastType = sor;
  27613. let t;
  27614. for (i = 0; i < strLength; ++i) {
  27615. t = types[i];
  27616. if (t === "EN") {
  27617. types[i] = lastType === "AL" ? "AN" : "EN";
  27618. } else if (t === "R" || t === "L" || t === "AL") {
  27619. lastType = t;
  27620. }
  27621. }
  27622. for (i = 0; i < strLength; ++i) {
  27623. t = types[i];
  27624. if (t === "AL") {
  27625. types[i] = "R";
  27626. }
  27627. }
  27628. for (i = 1; i < strLength - 1; ++i) {
  27629. if (types[i] === "ES" && types[i - 1] === "EN" && types[i + 1] === "EN") {
  27630. types[i] = "EN";
  27631. }
  27632. if (types[i] === "CS" && (types[i - 1] === "EN" || types[i - 1] === "AN") && types[i + 1] === types[i - 1]) {
  27633. types[i] = types[i - 1];
  27634. }
  27635. }
  27636. for (i = 0; i < strLength; ++i) {
  27637. if (types[i] === "EN") {
  27638. for (let j = i - 1; j >= 0; --j) {
  27639. if (types[j] !== "ET") {
  27640. break;
  27641. }
  27642. types[j] = "EN";
  27643. }
  27644. for (let j = i + 1; j < strLength; ++j) {
  27645. if (types[j] !== "ET") {
  27646. break;
  27647. }
  27648. types[j] = "EN";
  27649. }
  27650. }
  27651. }
  27652. for (i = 0; i < strLength; ++i) {
  27653. t = types[i];
  27654. if (t === "WS" || t === "ES" || t === "ET" || t === "CS") {
  27655. types[i] = "ON";
  27656. }
  27657. }
  27658. lastType = sor;
  27659. for (i = 0; i < strLength; ++i) {
  27660. t = types[i];
  27661. if (t === "EN") {
  27662. types[i] = lastType === "L" ? "L" : "EN";
  27663. } else if (t === "R" || t === "L") {
  27664. lastType = t;
  27665. }
  27666. }
  27667. for (i = 0; i < strLength; ++i) {
  27668. if (types[i] === "ON") {
  27669. const end = findUnequal(types, i + 1, "ON");
  27670. let before = sor;
  27671. if (i > 0) {
  27672. before = types[i - 1];
  27673. }
  27674. let after = eor;
  27675. if (end + 1 < strLength) {
  27676. after = types[end + 1];
  27677. }
  27678. if (before !== "L") {
  27679. before = "R";
  27680. }
  27681. if (after !== "L") {
  27682. after = "R";
  27683. }
  27684. if (before === after) {
  27685. setValues(types, i, end, before);
  27686. }
  27687. i = end - 1;
  27688. }
  27689. }
  27690. for (i = 0; i < strLength; ++i) {
  27691. if (types[i] === "ON") {
  27692. types[i] = e;
  27693. }
  27694. }
  27695. for (i = 0; i < strLength; ++i) {
  27696. t = types[i];
  27697. if (isEven(levels[i])) {
  27698. if (t === "R") {
  27699. levels[i] += 1;
  27700. } else if (t === "AN" || t === "EN") {
  27701. levels[i] += 2;
  27702. }
  27703. } else if (t === "L" || t === "AN" || t === "EN") {
  27704. levels[i] += 1;
  27705. }
  27706. }
  27707. let highestLevel = -1;
  27708. let lowestOddLevel = 99;
  27709. let level;
  27710. for (i = 0, ii = levels.length; i < ii; ++i) {
  27711. level = levels[i];
  27712. if (highestLevel < level) {
  27713. highestLevel = level;
  27714. }
  27715. if (lowestOddLevel > level && isOdd(level)) {
  27716. lowestOddLevel = level;
  27717. }
  27718. }
  27719. for (level = highestLevel; level >= lowestOddLevel; --level) {
  27720. let start = -1;
  27721. for (i = 0, ii = levels.length; i < ii; ++i) {
  27722. if (levels[i] < level) {
  27723. if (start >= 0) {
  27724. reverseValues(chars, start, i);
  27725. start = -1;
  27726. }
  27727. } else if (start < 0) {
  27728. start = i;
  27729. }
  27730. }
  27731. if (start >= 0) {
  27732. reverseValues(chars, start, levels.length);
  27733. }
  27734. }
  27735. for (i = 0, ii = chars.length; i < ii; ++i) {
  27736. const ch = chars[i];
  27737. if (ch === "<" || ch === ">") {
  27738. chars[i] = "";
  27739. }
  27740. }
  27741. return createBidiText(chars.join(""), isLTR);
  27742. }
  27743. ;// CONCATENATED MODULE: ./src/core/font_substitutions.js
  27744. const NORMAL = {
  27745. style: "normal",
  27746. weight: "normal"
  27747. };
  27748. const BOLD = {
  27749. style: "normal",
  27750. weight: "bold"
  27751. };
  27752. const ITALIC = {
  27753. style: "italic",
  27754. weight: "normal"
  27755. };
  27756. const BOLDITALIC = {
  27757. style: "italic",
  27758. weight: "bold"
  27759. };
  27760. const substitutionMap = new Map([["Times-Roman", {
  27761. 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"],
  27762. style: NORMAL,
  27763. ultimate: "serif"
  27764. }], ["Times-Bold", {
  27765. alias: "Times-Roman",
  27766. style: BOLD,
  27767. ultimate: "serif"
  27768. }], ["Times-Italic", {
  27769. alias: "Times-Roman",
  27770. style: ITALIC,
  27771. ultimate: "serif"
  27772. }], ["Times-BoldItalic", {
  27773. alias: "Times-Roman",
  27774. style: BOLDITALIC,
  27775. ultimate: "serif"
  27776. }], ["Helvetica", {
  27777. 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"],
  27778. path: "LiberationSans-Regular.ttf",
  27779. style: NORMAL,
  27780. ultimate: "sans-serif"
  27781. }], ["Helvetica-Bold", {
  27782. alias: "Helvetica",
  27783. path: "LiberationSans-Bold.ttf",
  27784. style: BOLD,
  27785. ultimate: "sans-serif"
  27786. }], ["Helvetica-Oblique", {
  27787. alias: "Helvetica",
  27788. path: "LiberationSans-Italic.ttf",
  27789. style: ITALIC,
  27790. ultimate: "sans-serif"
  27791. }], ["Helvetica-BoldOblique", {
  27792. alias: "Helvetica",
  27793. path: "LiberationSans-BoldItalic.ttf",
  27794. style: BOLDITALIC,
  27795. ultimate: "sans-serif"
  27796. }], ["Courier", {
  27797. local: ["Courier", "Courier New", "Liberation Mono", "Nimbus Mono", "Nimbus Mono L", "Cousine", "Cumberland", "TeX Gyre Cursor", "FreeMono", "Linux Libertine Mono O", "Libertinus Mono"],
  27798. style: NORMAL,
  27799. ultimate: "monospace"
  27800. }], ["Courier-Bold", {
  27801. alias: "Courier",
  27802. style: BOLD,
  27803. ultimate: "monospace"
  27804. }], ["Courier-Oblique", {
  27805. alias: "Courier",
  27806. style: ITALIC,
  27807. ultimate: "monospace"
  27808. }], ["Courier-BoldOblique", {
  27809. alias: "Courier",
  27810. style: BOLDITALIC,
  27811. ultimate: "monospace"
  27812. }], ["ArialBlack", {
  27813. local: ["Arial Black"],
  27814. style: {
  27815. style: "normal",
  27816. weight: "900"
  27817. },
  27818. fallback: "Helvetica-Bold"
  27819. }], ["ArialBlack-Bold", {
  27820. alias: "ArialBlack"
  27821. }], ["ArialBlack-Italic", {
  27822. alias: "ArialBlack",
  27823. style: {
  27824. style: "italic",
  27825. weight: "900"
  27826. },
  27827. fallback: "Helvetica-BoldOblique"
  27828. }], ["ArialBlack-BoldItalic", {
  27829. alias: "ArialBlack-Italic"
  27830. }], ["ArialNarrow", {
  27831. local: ["Arial Narrow", "Liberation Sans Narrow", "Helvetica Condensed", "Nimbus Sans Narrow", "TeX Gyre Heros Cn"],
  27832. style: NORMAL,
  27833. fallback: "Helvetica"
  27834. }], ["ArialNarrow-Bold", {
  27835. alias: "ArialNarrow",
  27836. style: BOLD,
  27837. fallback: "Helvetica-Bold"
  27838. }], ["ArialNarrow-Italic", {
  27839. alias: "ArialNarrow",
  27840. style: ITALIC,
  27841. fallback: "Helvetica-Oblique"
  27842. }], ["ArialNarrow-BoldItalic", {
  27843. alias: "ArialNarrow",
  27844. style: BOLDITALIC,
  27845. fallback: "Helvetica-BoldOblique"
  27846. }], ["Calibri", {
  27847. local: ["Calibri", "Carlito"],
  27848. style: NORMAL,
  27849. fallback: "Helvetica"
  27850. }], ["Calibri-Bold", {
  27851. alias: "Calibri",
  27852. style: BOLD,
  27853. fallback: "Helvetica-Bold"
  27854. }], ["Calibri-Italic", {
  27855. alias: "Calibri",
  27856. style: ITALIC,
  27857. fallback: "Helvetica-Oblique"
  27858. }], ["Calibri-BoldItalic", {
  27859. alias: "Calibri",
  27860. style: BOLDITALIC,
  27861. fallback: "Helvetica-BoldOblique"
  27862. }], ["Wingdings", {
  27863. local: ["Wingdings", "URW Dingbats"],
  27864. style: NORMAL
  27865. }], ["Wingdings-Regular", {
  27866. alias: "Wingdings"
  27867. }], ["Wingdings-Bold", {
  27868. alias: "Wingdings"
  27869. }]]);
  27870. const fontAliases = new Map([["Arial-Black", "ArialBlack"]]);
  27871. function getStyleToAppend(style) {
  27872. switch (style) {
  27873. case BOLD:
  27874. return "Bold";
  27875. case ITALIC:
  27876. return "Italic";
  27877. case BOLDITALIC:
  27878. return "Bold Italic";
  27879. default:
  27880. if (style?.weight === "bold") {
  27881. return "Bold";
  27882. }
  27883. if (style?.style === "italic") {
  27884. return "Italic";
  27885. }
  27886. }
  27887. return "";
  27888. }
  27889. function getFamilyName(str) {
  27890. 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"]);
  27891. return str.split(/[- ,+]+/g).filter(tok => !keywords.has(tok.toLowerCase())).join(" ");
  27892. }
  27893. function generateFont({
  27894. alias,
  27895. local,
  27896. path,
  27897. fallback,
  27898. style,
  27899. ultimate
  27900. }, src, localFontPath, useFallback = true, usePath = true, append = "") {
  27901. const result = {
  27902. style: null,
  27903. ultimate: null
  27904. };
  27905. if (local) {
  27906. const extra = append ? ` ${append}` : "";
  27907. for (const name of local) {
  27908. src.push(`local(${name}${extra})`);
  27909. }
  27910. }
  27911. if (alias) {
  27912. const substitution = substitutionMap.get(alias);
  27913. const aliasAppend = append || getStyleToAppend(style);
  27914. Object.assign(result, generateFont(substitution, src, localFontPath, useFallback && !fallback, usePath && !path, aliasAppend));
  27915. }
  27916. if (style) {
  27917. result.style = style;
  27918. }
  27919. if (ultimate) {
  27920. result.ultimate = ultimate;
  27921. }
  27922. if (useFallback && fallback) {
  27923. const fallbackInfo = substitutionMap.get(fallback);
  27924. const {
  27925. ultimate: fallbackUltimate
  27926. } = generateFont(fallbackInfo, src, localFontPath, useFallback, usePath && !path, append);
  27927. result.ultimate ||= fallbackUltimate;
  27928. }
  27929. if (usePath && path && localFontPath) {
  27930. src.push(`url(${localFontPath}${path})`);
  27931. }
  27932. return result;
  27933. }
  27934. function getFontSubstitution(systemFontCache, idFactory, localFontPath, baseFontName, standardFontName, type) {
  27935. if (baseFontName.startsWith("InvalidPDFjsFont_")) {
  27936. return null;
  27937. }
  27938. if ((type === "TrueType" || type === "Type1") && /^[A-Z]{6}\+/.test(baseFontName)) {
  27939. baseFontName = baseFontName.slice(7);
  27940. }
  27941. baseFontName = normalizeFontName(baseFontName);
  27942. const key = baseFontName;
  27943. let substitutionInfo = systemFontCache.get(key);
  27944. if (substitutionInfo) {
  27945. return substitutionInfo;
  27946. }
  27947. let substitution = substitutionMap.get(baseFontName);
  27948. if (!substitution) {
  27949. for (const [alias, subst] of fontAliases) {
  27950. if (baseFontName.startsWith(alias)) {
  27951. baseFontName = `${subst}${baseFontName.substring(alias.length)}`;
  27952. substitution = substitutionMap.get(baseFontName);
  27953. break;
  27954. }
  27955. }
  27956. }
  27957. let mustAddBaseFont = false;
  27958. if (!substitution) {
  27959. substitution = substitutionMap.get(standardFontName);
  27960. mustAddBaseFont = true;
  27961. }
  27962. const loadedName = `${idFactory.getDocId()}_s${idFactory.createFontId()}`;
  27963. if (!substitution) {
  27964. if (!validateFontName(baseFontName)) {
  27965. warn(`Cannot substitute the font because of its name: ${baseFontName}`);
  27966. systemFontCache.set(key, null);
  27967. return null;
  27968. }
  27969. const bold = /bold/gi.test(baseFontName);
  27970. const italic = /oblique|italic/gi.test(baseFontName);
  27971. const style = bold && italic && BOLDITALIC || bold && BOLD || italic && ITALIC || NORMAL;
  27972. substitutionInfo = {
  27973. css: `"${getFamilyName(baseFontName)}",${loadedName}`,
  27974. guessFallback: true,
  27975. loadedName,
  27976. baseFontName,
  27977. src: `local(${baseFontName})`,
  27978. style
  27979. };
  27980. systemFontCache.set(key, substitutionInfo);
  27981. return substitutionInfo;
  27982. }
  27983. const src = [];
  27984. if (mustAddBaseFont && validateFontName(baseFontName)) {
  27985. src.push(`local(${baseFontName})`);
  27986. }
  27987. const {
  27988. style,
  27989. ultimate
  27990. } = generateFont(substitution, src, localFontPath);
  27991. const guessFallback = ultimate === null;
  27992. const fallback = guessFallback ? "" : `,${ultimate}`;
  27993. substitutionInfo = {
  27994. css: `"${getFamilyName(baseFontName)}",${loadedName}${fallback}`,
  27995. guessFallback,
  27996. loadedName,
  27997. baseFontName,
  27998. src: src.join(","),
  27999. style
  28000. };
  28001. systemFontCache.set(key, substitutionInfo);
  28002. return substitutionInfo;
  28003. }
  28004. ;// CONCATENATED MODULE: ./src/core/image_resizer.js
  28005. const MIN_IMAGE_DIM = 2048;
  28006. const MAX_IMAGE_DIM = 65537;
  28007. const MAX_ERROR = 128;
  28008. class ImageResizer {
  28009. constructor(imgData, isMask) {
  28010. this._imgData = imgData;
  28011. this._isMask = isMask;
  28012. }
  28013. static needsToBeResized(width, height) {
  28014. if (width <= this._goodSquareLength && height <= this._goodSquareLength) {
  28015. return false;
  28016. }
  28017. const {
  28018. MAX_DIM
  28019. } = this;
  28020. if (width > MAX_DIM || height > MAX_DIM) {
  28021. return true;
  28022. }
  28023. const area = width * height;
  28024. if (this._hasMaxArea) {
  28025. return area > this.MAX_AREA;
  28026. }
  28027. if (area < this._goodSquareLength ** 2) {
  28028. return false;
  28029. }
  28030. if (this._areGoodDims(width, height)) {
  28031. this._goodSquareLength = Math.max(this._goodSquareLength, Math.floor(Math.sqrt(width * height)));
  28032. return false;
  28033. }
  28034. this._goodSquareLength = this._guessMax(this._goodSquareLength, MAX_DIM, MAX_ERROR, 0);
  28035. const maxArea = this.MAX_AREA = this._goodSquareLength ** 2;
  28036. return area > maxArea;
  28037. }
  28038. static get MAX_DIM() {
  28039. return shadow(this, "MAX_DIM", this._guessMax(MIN_IMAGE_DIM, MAX_IMAGE_DIM, 0, 1));
  28040. }
  28041. static get MAX_AREA() {
  28042. this._hasMaxArea = true;
  28043. return shadow(this, "MAX_AREA", this._guessMax(ImageResizer._goodSquareLength, this.MAX_DIM, MAX_ERROR, 0) ** 2);
  28044. }
  28045. static set MAX_AREA(area) {
  28046. if (area >= 0) {
  28047. this._hasMaxArea = true;
  28048. shadow(this, "MAX_AREA", area);
  28049. }
  28050. }
  28051. static setMaxArea(area) {
  28052. if (!this._hasMaxArea) {
  28053. this.MAX_AREA = area >> 2;
  28054. }
  28055. }
  28056. static _areGoodDims(width, height) {
  28057. try {
  28058. const canvas = new OffscreenCanvas(width, height);
  28059. const ctx = canvas.getContext("2d");
  28060. ctx.fillRect(0, 0, 1, 1);
  28061. const opacity = ctx.getImageData(0, 0, 1, 1).data[3];
  28062. canvas.width = canvas.height = 1;
  28063. return opacity !== 0;
  28064. } catch {
  28065. return false;
  28066. }
  28067. }
  28068. static _guessMax(start, end, tolerance, defaultHeight) {
  28069. while (start + tolerance + 1 < end) {
  28070. const middle = Math.floor((start + end) / 2);
  28071. const height = defaultHeight || middle;
  28072. if (this._areGoodDims(middle, height)) {
  28073. start = middle;
  28074. } else {
  28075. end = middle;
  28076. }
  28077. }
  28078. return start;
  28079. }
  28080. static async createImage(imgData, isMask = false) {
  28081. return new ImageResizer(imgData, isMask)._createImage();
  28082. }
  28083. async _createImage() {
  28084. const data = this._encodeBMP();
  28085. const blob = new Blob([data.buffer], {
  28086. type: "image/bmp"
  28087. });
  28088. const bitmapPromise = createImageBitmap(blob);
  28089. const {
  28090. MAX_AREA,
  28091. MAX_DIM
  28092. } = ImageResizer;
  28093. const {
  28094. _imgData: imgData
  28095. } = this;
  28096. const {
  28097. width,
  28098. height
  28099. } = imgData;
  28100. const minFactor = Math.max(width / MAX_DIM, height / MAX_DIM, Math.sqrt(width * height / MAX_AREA));
  28101. const firstFactor = Math.max(minFactor, 2);
  28102. const factor = Math.round(10 * (minFactor + 1.25)) / 10 / firstFactor;
  28103. const N = Math.floor(Math.log2(factor));
  28104. const steps = new Array(N + 2).fill(2);
  28105. steps[0] = firstFactor;
  28106. steps.splice(-1, 1, factor / (1 << N));
  28107. let newWidth = width;
  28108. let newHeight = height;
  28109. let bitmap = await bitmapPromise;
  28110. for (const step of steps) {
  28111. const prevWidth = newWidth;
  28112. const prevHeight = newHeight;
  28113. newWidth = Math.floor(newWidth / step) - 1;
  28114. newHeight = Math.floor(newHeight / step) - 1;
  28115. const canvas = new OffscreenCanvas(newWidth, newHeight);
  28116. const ctx = canvas.getContext("2d");
  28117. ctx.drawImage(bitmap, 0, 0, prevWidth, prevHeight, 0, 0, newWidth, newHeight);
  28118. bitmap = canvas.transferToImageBitmap();
  28119. }
  28120. imgData.data = null;
  28121. imgData.bitmap = bitmap;
  28122. imgData.width = newWidth;
  28123. imgData.height = newHeight;
  28124. return imgData;
  28125. }
  28126. _encodeBMP() {
  28127. const {
  28128. width,
  28129. height,
  28130. kind
  28131. } = this._imgData;
  28132. let data = this._imgData.data;
  28133. let bitPerPixel;
  28134. let colorTable = new Uint8Array(0);
  28135. let maskTable = colorTable;
  28136. let compression = 0;
  28137. switch (kind) {
  28138. case ImageKind.GRAYSCALE_1BPP:
  28139. {
  28140. bitPerPixel = 1;
  28141. colorTable = new Uint8Array(this._isMask ? [255, 255, 255, 255, 0, 0, 0, 0] : [0, 0, 0, 0, 255, 255, 255, 255]);
  28142. const rowLen = width + 7 >> 3;
  28143. const rowSize = rowLen + 3 & -4;
  28144. if (rowLen !== rowSize) {
  28145. const newData = new Uint8Array(rowSize * height);
  28146. let k = 0;
  28147. for (let i = 0, ii = height * rowLen; i < ii; i += rowLen, k += rowSize) {
  28148. newData.set(data.subarray(i, i + rowLen), k);
  28149. }
  28150. data = newData;
  28151. }
  28152. break;
  28153. }
  28154. case ImageKind.RGB_24BPP:
  28155. {
  28156. bitPerPixel = 24;
  28157. if (width & 3) {
  28158. const rowLen = 3 * width;
  28159. const rowSize = rowLen + 3 & -4;
  28160. const extraLen = rowSize - rowLen;
  28161. const newData = new Uint8Array(rowSize * height);
  28162. let k = 0;
  28163. for (let i = 0, ii = height * rowLen; i < ii; i += rowLen) {
  28164. const row = data.subarray(i, i + rowLen);
  28165. for (let j = 0; j < rowLen; j += 3) {
  28166. newData[k++] = row[j + 2];
  28167. newData[k++] = row[j + 1];
  28168. newData[k++] = row[j];
  28169. }
  28170. k += extraLen;
  28171. }
  28172. data = newData;
  28173. } else {
  28174. for (let i = 0, ii = data.length; i < ii; i += 3) {
  28175. const tmp = data[i];
  28176. data[i] = data[i + 2];
  28177. data[i + 2] = tmp;
  28178. }
  28179. }
  28180. break;
  28181. }
  28182. case ImageKind.RGBA_32BPP:
  28183. bitPerPixel = 32;
  28184. compression = 3;
  28185. maskTable = new Uint8Array(4 + 4 + 4 + 4 + 52);
  28186. const view = new DataView(maskTable.buffer);
  28187. if (FeatureTest.isLittleEndian) {
  28188. view.setUint32(0, 0x000000ff, true);
  28189. view.setUint32(4, 0x0000ff00, true);
  28190. view.setUint32(8, 0x00ff0000, true);
  28191. view.setUint32(12, 0xff000000, true);
  28192. } else {
  28193. view.setUint32(0, 0xff000000, true);
  28194. view.setUint32(4, 0x00ff0000, true);
  28195. view.setUint32(8, 0x0000ff00, true);
  28196. view.setUint32(12, 0x000000ff, true);
  28197. }
  28198. break;
  28199. default:
  28200. throw new Error("invalid format");
  28201. }
  28202. let i = 0;
  28203. const headerLength = 40 + maskTable.length;
  28204. const fileLength = 14 + headerLength + colorTable.length + data.length;
  28205. const bmpData = new Uint8Array(fileLength);
  28206. const view = new DataView(bmpData.buffer);
  28207. view.setUint16(i, 0x4d42, true);
  28208. i += 2;
  28209. view.setUint32(i, fileLength, true);
  28210. i += 4;
  28211. view.setUint32(i, 0, true);
  28212. i += 4;
  28213. view.setUint32(i, 14 + headerLength + colorTable.length, true);
  28214. i += 4;
  28215. view.setUint32(i, headerLength, true);
  28216. i += 4;
  28217. view.setInt32(i, width, true);
  28218. i += 4;
  28219. view.setInt32(i, -height, true);
  28220. i += 4;
  28221. view.setUint16(i, 1, true);
  28222. i += 2;
  28223. view.setUint16(i, bitPerPixel, true);
  28224. i += 2;
  28225. view.setUint32(i, compression, true);
  28226. i += 4;
  28227. view.setUint32(i, 0, true);
  28228. i += 4;
  28229. view.setInt32(i, 0, true);
  28230. i += 4;
  28231. view.setInt32(i, 0, true);
  28232. i += 4;
  28233. view.setUint32(i, colorTable.length / 4, true);
  28234. i += 4;
  28235. view.setUint32(i, 0, true);
  28236. i += 4;
  28237. bmpData.set(maskTable, i);
  28238. i += maskTable.length;
  28239. bmpData.set(colorTable, i);
  28240. i += colorTable.length;
  28241. bmpData.set(data, i);
  28242. return bmpData;
  28243. }
  28244. }
  28245. ImageResizer._goodSquareLength = MIN_IMAGE_DIM;
  28246. ;// CONCATENATED MODULE: ./src/shared/murmurhash3.js
  28247. const SEED = 0xc3d2e1f0;
  28248. const MASK_HIGH = 0xffff0000;
  28249. const MASK_LOW = 0xffff;
  28250. class MurmurHash3_64 {
  28251. constructor(seed) {
  28252. this.h1 = seed ? seed & 0xffffffff : SEED;
  28253. this.h2 = seed ? seed & 0xffffffff : SEED;
  28254. }
  28255. update(input) {
  28256. let data, length;
  28257. if (typeof input === "string") {
  28258. data = new Uint8Array(input.length * 2);
  28259. length = 0;
  28260. for (let i = 0, ii = input.length; i < ii; i++) {
  28261. const code = input.charCodeAt(i);
  28262. if (code <= 0xff) {
  28263. data[length++] = code;
  28264. } else {
  28265. data[length++] = code >>> 8;
  28266. data[length++] = code & 0xff;
  28267. }
  28268. }
  28269. } else if (ArrayBuffer.isView(input)) {
  28270. data = input.slice();
  28271. length = data.byteLength;
  28272. } else {
  28273. throw new Error("Invalid data format, must be a string or TypedArray.");
  28274. }
  28275. const blockCounts = length >> 2;
  28276. const tailLength = length - blockCounts * 4;
  28277. const dataUint32 = new Uint32Array(data.buffer, 0, blockCounts);
  28278. let k1 = 0,
  28279. k2 = 0;
  28280. let h1 = this.h1,
  28281. h2 = this.h2;
  28282. const C1 = 0xcc9e2d51,
  28283. C2 = 0x1b873593;
  28284. const C1_LOW = C1 & MASK_LOW,
  28285. C2_LOW = C2 & MASK_LOW;
  28286. for (let i = 0; i < blockCounts; i++) {
  28287. if (i & 1) {
  28288. k1 = dataUint32[i];
  28289. k1 = k1 * C1 & MASK_HIGH | k1 * C1_LOW & MASK_LOW;
  28290. k1 = k1 << 15 | k1 >>> 17;
  28291. k1 = k1 * C2 & MASK_HIGH | k1 * C2_LOW & MASK_LOW;
  28292. h1 ^= k1;
  28293. h1 = h1 << 13 | h1 >>> 19;
  28294. h1 = h1 * 5 + 0xe6546b64;
  28295. } else {
  28296. k2 = dataUint32[i];
  28297. k2 = k2 * C1 & MASK_HIGH | k2 * C1_LOW & MASK_LOW;
  28298. k2 = k2 << 15 | k2 >>> 17;
  28299. k2 = k2 * C2 & MASK_HIGH | k2 * C2_LOW & MASK_LOW;
  28300. h2 ^= k2;
  28301. h2 = h2 << 13 | h2 >>> 19;
  28302. h2 = h2 * 5 + 0xe6546b64;
  28303. }
  28304. }
  28305. k1 = 0;
  28306. switch (tailLength) {
  28307. case 3:
  28308. k1 ^= data[blockCounts * 4 + 2] << 16;
  28309. case 2:
  28310. k1 ^= data[blockCounts * 4 + 1] << 8;
  28311. case 1:
  28312. k1 ^= data[blockCounts * 4];
  28313. k1 = k1 * C1 & MASK_HIGH | k1 * C1_LOW & MASK_LOW;
  28314. k1 = k1 << 15 | k1 >>> 17;
  28315. k1 = k1 * C2 & MASK_HIGH | k1 * C2_LOW & MASK_LOW;
  28316. if (blockCounts & 1) {
  28317. h1 ^= k1;
  28318. } else {
  28319. h2 ^= k1;
  28320. }
  28321. }
  28322. this.h1 = h1;
  28323. this.h2 = h2;
  28324. }
  28325. hexdigest() {
  28326. let h1 = this.h1,
  28327. h2 = this.h2;
  28328. h1 ^= h2 >>> 1;
  28329. h1 = h1 * 0xed558ccd & MASK_HIGH | h1 * 0x8ccd & MASK_LOW;
  28330. h2 = h2 * 0xff51afd7 & MASK_HIGH | ((h2 << 16 | h1 >>> 16) * 0xafd7ed55 & MASK_HIGH) >>> 16;
  28331. h1 ^= h2 >>> 1;
  28332. h1 = h1 * 0x1a85ec53 & MASK_HIGH | h1 * 0xec53 & MASK_LOW;
  28333. h2 = h2 * 0xc4ceb9fe & MASK_HIGH | ((h2 << 16 | h1 >>> 16) * 0xb9fe1a85 & MASK_HIGH) >>> 16;
  28334. h1 ^= h2 >>> 1;
  28335. return (h1 >>> 0).toString(16).padStart(8, "0") + (h2 >>> 0).toString(16).padStart(8, "0");
  28336. }
  28337. }
  28338. ;// CONCATENATED MODULE: ./src/core/operator_list.js
  28339. function addState(parentState, pattern, checkFn, iterateFn, processFn) {
  28340. let state = parentState;
  28341. for (let i = 0, ii = pattern.length - 1; i < ii; i++) {
  28342. const item = pattern[i];
  28343. state = state[item] ||= [];
  28344. }
  28345. state[pattern.at(-1)] = {
  28346. checkFn,
  28347. iterateFn,
  28348. processFn
  28349. };
  28350. }
  28351. const InitialState = [];
  28352. addState(InitialState, [OPS.save, OPS.transform, OPS.paintInlineImageXObject, OPS.restore], null, function iterateInlineImageGroup(context, i) {
  28353. const fnArray = context.fnArray;
  28354. const iFirstSave = context.iCurr - 3;
  28355. const pos = (i - iFirstSave) % 4;
  28356. switch (pos) {
  28357. case 0:
  28358. return fnArray[i] === OPS.save;
  28359. case 1:
  28360. return fnArray[i] === OPS.transform;
  28361. case 2:
  28362. return fnArray[i] === OPS.paintInlineImageXObject;
  28363. case 3:
  28364. return fnArray[i] === OPS.restore;
  28365. }
  28366. throw new Error(`iterateInlineImageGroup - invalid pos: ${pos}`);
  28367. }, function foundInlineImageGroup(context, i) {
  28368. const MIN_IMAGES_IN_INLINE_IMAGES_BLOCK = 10;
  28369. const MAX_IMAGES_IN_INLINE_IMAGES_BLOCK = 200;
  28370. const MAX_WIDTH = 1000;
  28371. const IMAGE_PADDING = 1;
  28372. const fnArray = context.fnArray,
  28373. argsArray = context.argsArray;
  28374. const curr = context.iCurr;
  28375. const iFirstSave = curr - 3;
  28376. const iFirstTransform = curr - 2;
  28377. const iFirstPIIXO = curr - 1;
  28378. const count = Math.min(Math.floor((i - iFirstSave) / 4), MAX_IMAGES_IN_INLINE_IMAGES_BLOCK);
  28379. if (count < MIN_IMAGES_IN_INLINE_IMAGES_BLOCK) {
  28380. return i - (i - iFirstSave) % 4;
  28381. }
  28382. let maxX = 0;
  28383. const map = [];
  28384. let maxLineHeight = 0;
  28385. let currentX = IMAGE_PADDING,
  28386. currentY = IMAGE_PADDING;
  28387. for (let q = 0; q < count; q++) {
  28388. const transform = argsArray[iFirstTransform + (q << 2)];
  28389. const img = argsArray[iFirstPIIXO + (q << 2)][0];
  28390. if (currentX + img.width > MAX_WIDTH) {
  28391. maxX = Math.max(maxX, currentX);
  28392. currentY += maxLineHeight + 2 * IMAGE_PADDING;
  28393. currentX = 0;
  28394. maxLineHeight = 0;
  28395. }
  28396. map.push({
  28397. transform,
  28398. x: currentX,
  28399. y: currentY,
  28400. w: img.width,
  28401. h: img.height
  28402. });
  28403. currentX += img.width + 2 * IMAGE_PADDING;
  28404. maxLineHeight = Math.max(maxLineHeight, img.height);
  28405. }
  28406. const imgWidth = Math.max(maxX, currentX) + IMAGE_PADDING;
  28407. const imgHeight = currentY + maxLineHeight + IMAGE_PADDING;
  28408. const imgData = new Uint8Array(imgWidth * imgHeight * 4);
  28409. const imgRowSize = imgWidth << 2;
  28410. for (let q = 0; q < count; q++) {
  28411. const data = argsArray[iFirstPIIXO + (q << 2)][0].data;
  28412. const rowSize = map[q].w << 2;
  28413. let dataOffset = 0;
  28414. let offset = map[q].x + map[q].y * imgWidth << 2;
  28415. imgData.set(data.subarray(0, rowSize), offset - imgRowSize);
  28416. for (let k = 0, kk = map[q].h; k < kk; k++) {
  28417. imgData.set(data.subarray(dataOffset, dataOffset + rowSize), offset);
  28418. dataOffset += rowSize;
  28419. offset += imgRowSize;
  28420. }
  28421. imgData.set(data.subarray(dataOffset - rowSize, dataOffset), offset);
  28422. while (offset >= 0) {
  28423. data[offset - 4] = data[offset];
  28424. data[offset - 3] = data[offset + 1];
  28425. data[offset - 2] = data[offset + 2];
  28426. data[offset - 1] = data[offset + 3];
  28427. data[offset + rowSize] = data[offset + rowSize - 4];
  28428. data[offset + rowSize + 1] = data[offset + rowSize - 3];
  28429. data[offset + rowSize + 2] = data[offset + rowSize - 2];
  28430. data[offset + rowSize + 3] = data[offset + rowSize - 1];
  28431. offset -= imgRowSize;
  28432. }
  28433. }
  28434. const img = {
  28435. width: imgWidth,
  28436. height: imgHeight
  28437. };
  28438. if (context.isOffscreenCanvasSupported) {
  28439. const canvas = new OffscreenCanvas(imgWidth, imgHeight);
  28440. const ctx = canvas.getContext("2d");
  28441. ctx.putImageData(new ImageData(new Uint8ClampedArray(imgData.buffer), imgWidth, imgHeight), 0, 0);
  28442. img.bitmap = canvas.transferToImageBitmap();
  28443. img.data = null;
  28444. } else {
  28445. img.kind = ImageKind.RGBA_32BPP;
  28446. img.data = imgData;
  28447. }
  28448. fnArray.splice(iFirstSave, count * 4, OPS.paintInlineImageXObjectGroup);
  28449. argsArray.splice(iFirstSave, count * 4, [img, map]);
  28450. return iFirstSave + 1;
  28451. });
  28452. addState(InitialState, [OPS.save, OPS.transform, OPS.paintImageMaskXObject, OPS.restore], null, function iterateImageMaskGroup(context, i) {
  28453. const fnArray = context.fnArray;
  28454. const iFirstSave = context.iCurr - 3;
  28455. const pos = (i - iFirstSave) % 4;
  28456. switch (pos) {
  28457. case 0:
  28458. return fnArray[i] === OPS.save;
  28459. case 1:
  28460. return fnArray[i] === OPS.transform;
  28461. case 2:
  28462. return fnArray[i] === OPS.paintImageMaskXObject;
  28463. case 3:
  28464. return fnArray[i] === OPS.restore;
  28465. }
  28466. throw new Error(`iterateImageMaskGroup - invalid pos: ${pos}`);
  28467. }, function foundImageMaskGroup(context, i) {
  28468. const MIN_IMAGES_IN_MASKS_BLOCK = 10;
  28469. const MAX_IMAGES_IN_MASKS_BLOCK = 100;
  28470. const MAX_SAME_IMAGES_IN_MASKS_BLOCK = 1000;
  28471. const fnArray = context.fnArray,
  28472. argsArray = context.argsArray;
  28473. const curr = context.iCurr;
  28474. const iFirstSave = curr - 3;
  28475. const iFirstTransform = curr - 2;
  28476. const iFirstPIMXO = curr - 1;
  28477. let count = Math.floor((i - iFirstSave) / 4);
  28478. if (count < MIN_IMAGES_IN_MASKS_BLOCK) {
  28479. return i - (i - iFirstSave) % 4;
  28480. }
  28481. let isSameImage = false;
  28482. let iTransform, transformArgs;
  28483. const firstPIMXOArg0 = argsArray[iFirstPIMXO][0];
  28484. const firstTransformArg0 = argsArray[iFirstTransform][0],
  28485. firstTransformArg1 = argsArray[iFirstTransform][1],
  28486. firstTransformArg2 = argsArray[iFirstTransform][2],
  28487. firstTransformArg3 = argsArray[iFirstTransform][3];
  28488. if (firstTransformArg1 === firstTransformArg2) {
  28489. isSameImage = true;
  28490. iTransform = iFirstTransform + 4;
  28491. let iPIMXO = iFirstPIMXO + 4;
  28492. for (let q = 1; q < count; q++, iTransform += 4, iPIMXO += 4) {
  28493. transformArgs = argsArray[iTransform];
  28494. if (argsArray[iPIMXO][0] !== firstPIMXOArg0 || transformArgs[0] !== firstTransformArg0 || transformArgs[1] !== firstTransformArg1 || transformArgs[2] !== firstTransformArg2 || transformArgs[3] !== firstTransformArg3) {
  28495. if (q < MIN_IMAGES_IN_MASKS_BLOCK) {
  28496. isSameImage = false;
  28497. } else {
  28498. count = q;
  28499. }
  28500. break;
  28501. }
  28502. }
  28503. }
  28504. if (isSameImage) {
  28505. count = Math.min(count, MAX_SAME_IMAGES_IN_MASKS_BLOCK);
  28506. const positions = new Float32Array(count * 2);
  28507. iTransform = iFirstTransform;
  28508. for (let q = 0; q < count; q++, iTransform += 4) {
  28509. transformArgs = argsArray[iTransform];
  28510. positions[q << 1] = transformArgs[4];
  28511. positions[(q << 1) + 1] = transformArgs[5];
  28512. }
  28513. fnArray.splice(iFirstSave, count * 4, OPS.paintImageMaskXObjectRepeat);
  28514. argsArray.splice(iFirstSave, count * 4, [firstPIMXOArg0, firstTransformArg0, firstTransformArg1, firstTransformArg2, firstTransformArg3, positions]);
  28515. } else {
  28516. count = Math.min(count, MAX_IMAGES_IN_MASKS_BLOCK);
  28517. const images = [];
  28518. for (let q = 0; q < count; q++) {
  28519. transformArgs = argsArray[iFirstTransform + (q << 2)];
  28520. const maskParams = argsArray[iFirstPIMXO + (q << 2)][0];
  28521. images.push({
  28522. data: maskParams.data,
  28523. width: maskParams.width,
  28524. height: maskParams.height,
  28525. interpolate: maskParams.interpolate,
  28526. count: maskParams.count,
  28527. transform: transformArgs
  28528. });
  28529. }
  28530. fnArray.splice(iFirstSave, count * 4, OPS.paintImageMaskXObjectGroup);
  28531. argsArray.splice(iFirstSave, count * 4, [images]);
  28532. }
  28533. return iFirstSave + 1;
  28534. });
  28535. addState(InitialState, [OPS.save, OPS.transform, OPS.paintImageXObject, OPS.restore], function (context) {
  28536. const argsArray = context.argsArray;
  28537. const iFirstTransform = context.iCurr - 2;
  28538. return argsArray[iFirstTransform][1] === 0 && argsArray[iFirstTransform][2] === 0;
  28539. }, function iterateImageGroup(context, i) {
  28540. const fnArray = context.fnArray,
  28541. argsArray = context.argsArray;
  28542. const iFirstSave = context.iCurr - 3;
  28543. const pos = (i - iFirstSave) % 4;
  28544. switch (pos) {
  28545. case 0:
  28546. return fnArray[i] === OPS.save;
  28547. case 1:
  28548. if (fnArray[i] !== OPS.transform) {
  28549. return false;
  28550. }
  28551. const iFirstTransform = context.iCurr - 2;
  28552. const firstTransformArg0 = argsArray[iFirstTransform][0];
  28553. const firstTransformArg3 = argsArray[iFirstTransform][3];
  28554. if (argsArray[i][0] !== firstTransformArg0 || argsArray[i][1] !== 0 || argsArray[i][2] !== 0 || argsArray[i][3] !== firstTransformArg3) {
  28555. return false;
  28556. }
  28557. return true;
  28558. case 2:
  28559. if (fnArray[i] !== OPS.paintImageXObject) {
  28560. return false;
  28561. }
  28562. const iFirstPIXO = context.iCurr - 1;
  28563. const firstPIXOArg0 = argsArray[iFirstPIXO][0];
  28564. if (argsArray[i][0] !== firstPIXOArg0) {
  28565. return false;
  28566. }
  28567. return true;
  28568. case 3:
  28569. return fnArray[i] === OPS.restore;
  28570. }
  28571. throw new Error(`iterateImageGroup - invalid pos: ${pos}`);
  28572. }, function (context, i) {
  28573. const MIN_IMAGES_IN_BLOCK = 3;
  28574. const MAX_IMAGES_IN_BLOCK = 1000;
  28575. const fnArray = context.fnArray,
  28576. argsArray = context.argsArray;
  28577. const curr = context.iCurr;
  28578. const iFirstSave = curr - 3;
  28579. const iFirstTransform = curr - 2;
  28580. const iFirstPIXO = curr - 1;
  28581. const firstPIXOArg0 = argsArray[iFirstPIXO][0];
  28582. const firstTransformArg0 = argsArray[iFirstTransform][0];
  28583. const firstTransformArg3 = argsArray[iFirstTransform][3];
  28584. const count = Math.min(Math.floor((i - iFirstSave) / 4), MAX_IMAGES_IN_BLOCK);
  28585. if (count < MIN_IMAGES_IN_BLOCK) {
  28586. return i - (i - iFirstSave) % 4;
  28587. }
  28588. const positions = new Float32Array(count * 2);
  28589. let iTransform = iFirstTransform;
  28590. for (let q = 0; q < count; q++, iTransform += 4) {
  28591. const transformArgs = argsArray[iTransform];
  28592. positions[q << 1] = transformArgs[4];
  28593. positions[(q << 1) + 1] = transformArgs[5];
  28594. }
  28595. const args = [firstPIXOArg0, firstTransformArg0, firstTransformArg3, positions];
  28596. fnArray.splice(iFirstSave, count * 4, OPS.paintImageXObjectRepeat);
  28597. argsArray.splice(iFirstSave, count * 4, args);
  28598. return iFirstSave + 1;
  28599. });
  28600. addState(InitialState, [OPS.beginText, OPS.setFont, OPS.setTextMatrix, OPS.showText, OPS.endText], null, function iterateShowTextGroup(context, i) {
  28601. const fnArray = context.fnArray,
  28602. argsArray = context.argsArray;
  28603. const iFirstSave = context.iCurr - 4;
  28604. const pos = (i - iFirstSave) % 5;
  28605. switch (pos) {
  28606. case 0:
  28607. return fnArray[i] === OPS.beginText;
  28608. case 1:
  28609. return fnArray[i] === OPS.setFont;
  28610. case 2:
  28611. return fnArray[i] === OPS.setTextMatrix;
  28612. case 3:
  28613. if (fnArray[i] !== OPS.showText) {
  28614. return false;
  28615. }
  28616. const iFirstSetFont = context.iCurr - 3;
  28617. const firstSetFontArg0 = argsArray[iFirstSetFont][0];
  28618. const firstSetFontArg1 = argsArray[iFirstSetFont][1];
  28619. if (argsArray[i][0] !== firstSetFontArg0 || argsArray[i][1] !== firstSetFontArg1) {
  28620. return false;
  28621. }
  28622. return true;
  28623. case 4:
  28624. return fnArray[i] === OPS.endText;
  28625. }
  28626. throw new Error(`iterateShowTextGroup - invalid pos: ${pos}`);
  28627. }, function (context, i) {
  28628. const MIN_CHARS_IN_BLOCK = 3;
  28629. const MAX_CHARS_IN_BLOCK = 1000;
  28630. const fnArray = context.fnArray,
  28631. argsArray = context.argsArray;
  28632. const curr = context.iCurr;
  28633. const iFirstBeginText = curr - 4;
  28634. const iFirstSetFont = curr - 3;
  28635. const iFirstSetTextMatrix = curr - 2;
  28636. const iFirstShowText = curr - 1;
  28637. const iFirstEndText = curr;
  28638. const firstSetFontArg0 = argsArray[iFirstSetFont][0];
  28639. const firstSetFontArg1 = argsArray[iFirstSetFont][1];
  28640. let count = Math.min(Math.floor((i - iFirstBeginText) / 5), MAX_CHARS_IN_BLOCK);
  28641. if (count < MIN_CHARS_IN_BLOCK) {
  28642. return i - (i - iFirstBeginText) % 5;
  28643. }
  28644. let iFirst = iFirstBeginText;
  28645. 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) {
  28646. count++;
  28647. iFirst -= 5;
  28648. }
  28649. let iEndText = iFirst + 4;
  28650. for (let q = 1; q < count; q++) {
  28651. fnArray.splice(iEndText, 3);
  28652. argsArray.splice(iEndText, 3);
  28653. iEndText += 2;
  28654. }
  28655. return iEndText + 1;
  28656. });
  28657. class NullOptimizer {
  28658. constructor(queue) {
  28659. this.queue = queue;
  28660. }
  28661. _optimize() {}
  28662. push(fn, args) {
  28663. this.queue.fnArray.push(fn);
  28664. this.queue.argsArray.push(args);
  28665. this._optimize();
  28666. }
  28667. flush() {}
  28668. reset() {}
  28669. }
  28670. class QueueOptimizer extends NullOptimizer {
  28671. constructor(queue) {
  28672. super(queue);
  28673. this.state = null;
  28674. this.context = {
  28675. iCurr: 0,
  28676. fnArray: queue.fnArray,
  28677. argsArray: queue.argsArray,
  28678. isOffscreenCanvasSupported: false
  28679. };
  28680. this.match = null;
  28681. this.lastProcessed = 0;
  28682. }
  28683. set isOffscreenCanvasSupported(value) {
  28684. this.context.isOffscreenCanvasSupported = value;
  28685. }
  28686. _optimize() {
  28687. const fnArray = this.queue.fnArray;
  28688. let i = this.lastProcessed,
  28689. ii = fnArray.length;
  28690. let state = this.state;
  28691. let match = this.match;
  28692. if (!state && !match && i + 1 === ii && !InitialState[fnArray[i]]) {
  28693. this.lastProcessed = ii;
  28694. return;
  28695. }
  28696. const context = this.context;
  28697. while (i < ii) {
  28698. if (match) {
  28699. const iterate = (0, match.iterateFn)(context, i);
  28700. if (iterate) {
  28701. i++;
  28702. continue;
  28703. }
  28704. i = (0, match.processFn)(context, i + 1);
  28705. ii = fnArray.length;
  28706. match = null;
  28707. state = null;
  28708. if (i >= ii) {
  28709. break;
  28710. }
  28711. }
  28712. state = (state || InitialState)[fnArray[i]];
  28713. if (!state || Array.isArray(state)) {
  28714. i++;
  28715. continue;
  28716. }
  28717. context.iCurr = i;
  28718. i++;
  28719. if (state.checkFn && !(0, state.checkFn)(context)) {
  28720. state = null;
  28721. continue;
  28722. }
  28723. match = state;
  28724. state = null;
  28725. }
  28726. this.state = state;
  28727. this.match = match;
  28728. this.lastProcessed = i;
  28729. }
  28730. flush() {
  28731. while (this.match) {
  28732. const length = this.queue.fnArray.length;
  28733. this.lastProcessed = (0, this.match.processFn)(this.context, length);
  28734. this.match = null;
  28735. this.state = null;
  28736. this._optimize();
  28737. }
  28738. }
  28739. reset() {
  28740. this.state = null;
  28741. this.match = null;
  28742. this.lastProcessed = 0;
  28743. }
  28744. }
  28745. class OperatorList {
  28746. static CHUNK_SIZE = 1000;
  28747. static CHUNK_SIZE_ABOUT = this.CHUNK_SIZE - 5;
  28748. constructor(intent = 0, streamSink) {
  28749. this._streamSink = streamSink;
  28750. this.fnArray = [];
  28751. this.argsArray = [];
  28752. this.optimizer = streamSink && !(intent & RenderingIntentFlag.OPLIST) ? new QueueOptimizer(this) : new NullOptimizer(this);
  28753. this.dependencies = new Set();
  28754. this._totalLength = 0;
  28755. this.weight = 0;
  28756. this._resolved = streamSink ? null : Promise.resolve();
  28757. }
  28758. set isOffscreenCanvasSupported(value) {
  28759. this.optimizer.isOffscreenCanvasSupported = value;
  28760. }
  28761. get length() {
  28762. return this.argsArray.length;
  28763. }
  28764. get ready() {
  28765. return this._resolved || this._streamSink.ready;
  28766. }
  28767. get totalLength() {
  28768. return this._totalLength + this.length;
  28769. }
  28770. addOp(fn, args) {
  28771. this.optimizer.push(fn, args);
  28772. this.weight++;
  28773. if (this._streamSink) {
  28774. if (this.weight >= OperatorList.CHUNK_SIZE) {
  28775. this.flush();
  28776. } else if (this.weight >= OperatorList.CHUNK_SIZE_ABOUT && (fn === OPS.restore || fn === OPS.endText)) {
  28777. this.flush();
  28778. }
  28779. }
  28780. }
  28781. addImageOps(fn, args, optionalContent) {
  28782. if (optionalContent !== undefined) {
  28783. this.addOp(OPS.beginMarkedContentProps, ["OC", optionalContent]);
  28784. }
  28785. this.addOp(fn, args);
  28786. if (optionalContent !== undefined) {
  28787. this.addOp(OPS.endMarkedContent, []);
  28788. }
  28789. }
  28790. addDependency(dependency) {
  28791. if (this.dependencies.has(dependency)) {
  28792. return;
  28793. }
  28794. this.dependencies.add(dependency);
  28795. this.addOp(OPS.dependency, [dependency]);
  28796. }
  28797. addDependencies(dependencies) {
  28798. for (const dependency of dependencies) {
  28799. this.addDependency(dependency);
  28800. }
  28801. }
  28802. addOpList(opList) {
  28803. if (!(opList instanceof OperatorList)) {
  28804. warn('addOpList - ignoring invalid "opList" parameter.');
  28805. return;
  28806. }
  28807. for (const dependency of opList.dependencies) {
  28808. this.dependencies.add(dependency);
  28809. }
  28810. for (let i = 0, ii = opList.length; i < ii; i++) {
  28811. this.addOp(opList.fnArray[i], opList.argsArray[i]);
  28812. }
  28813. }
  28814. getIR() {
  28815. return {
  28816. fnArray: this.fnArray,
  28817. argsArray: this.argsArray,
  28818. length: this.length
  28819. };
  28820. }
  28821. get _transfers() {
  28822. const transfers = [];
  28823. const {
  28824. fnArray,
  28825. argsArray,
  28826. length
  28827. } = this;
  28828. for (let i = 0; i < length; i++) {
  28829. switch (fnArray[i]) {
  28830. case OPS.paintInlineImageXObject:
  28831. case OPS.paintInlineImageXObjectGroup:
  28832. case OPS.paintImageMaskXObject:
  28833. const arg = argsArray[i][0];
  28834. if (!arg.cached && arg.data?.buffer instanceof ArrayBuffer) {
  28835. transfers.push(arg.data.buffer);
  28836. }
  28837. break;
  28838. }
  28839. }
  28840. return transfers;
  28841. }
  28842. flush(lastChunk = false, separateAnnots = null) {
  28843. this.optimizer.flush();
  28844. const length = this.length;
  28845. this._totalLength += length;
  28846. this._streamSink.enqueue({
  28847. fnArray: this.fnArray,
  28848. argsArray: this.argsArray,
  28849. lastChunk,
  28850. separateAnnots,
  28851. length
  28852. }, 1, this._transfers);
  28853. this.dependencies.clear();
  28854. this.fnArray.length = 0;
  28855. this.argsArray.length = 0;
  28856. this.weight = 0;
  28857. this.optimizer.reset();
  28858. }
  28859. }
  28860. ;// CONCATENATED MODULE: ./src/core/image.js
  28861. function decodeAndClamp(value, addend, coefficient, max) {
  28862. value = addend + value * coefficient;
  28863. if (value < 0) {
  28864. value = 0;
  28865. } else if (value > max) {
  28866. value = max;
  28867. }
  28868. return value;
  28869. }
  28870. function resizeImageMask(src, bpc, w1, h1, w2, h2) {
  28871. const length = w2 * h2;
  28872. let dest;
  28873. if (bpc <= 8) {
  28874. dest = new Uint8Array(length);
  28875. } else if (bpc <= 16) {
  28876. dest = new Uint16Array(length);
  28877. } else {
  28878. dest = new Uint32Array(length);
  28879. }
  28880. const xRatio = w1 / w2;
  28881. const yRatio = h1 / h2;
  28882. let i,
  28883. j,
  28884. py,
  28885. newIndex = 0,
  28886. oldIndex;
  28887. const xScaled = new Uint16Array(w2);
  28888. const w1Scanline = w1;
  28889. for (i = 0; i < w2; i++) {
  28890. xScaled[i] = Math.floor(i * xRatio);
  28891. }
  28892. for (i = 0; i < h2; i++) {
  28893. py = Math.floor(i * yRatio) * w1Scanline;
  28894. for (j = 0; j < w2; j++) {
  28895. oldIndex = py + xScaled[j];
  28896. dest[newIndex++] = src[oldIndex];
  28897. }
  28898. }
  28899. return dest;
  28900. }
  28901. class PDFImage {
  28902. constructor({
  28903. xref,
  28904. res,
  28905. image,
  28906. isInline = false,
  28907. smask = null,
  28908. mask = null,
  28909. isMask = false,
  28910. pdfFunctionFactory,
  28911. localColorSpaceCache
  28912. }) {
  28913. this.image = image;
  28914. const dict = image.dict;
  28915. const filter = dict.get("F", "Filter");
  28916. let filterName;
  28917. if (filter instanceof Name) {
  28918. filterName = filter.name;
  28919. } else if (Array.isArray(filter)) {
  28920. const filterZero = xref.fetchIfRef(filter[0]);
  28921. if (filterZero instanceof Name) {
  28922. filterName = filterZero.name;
  28923. }
  28924. }
  28925. switch (filterName) {
  28926. case "JPXDecode":
  28927. ({
  28928. width: image.width,
  28929. height: image.height,
  28930. componentsCount: image.numComps,
  28931. bitsPerComponent: image.bitsPerComponent
  28932. } = JpxImage.parseImageProperties(image.stream));
  28933. image.stream.reset();
  28934. this.jpxDecoderOptions = {
  28935. numComponents: 0,
  28936. isIndexedColormap: false,
  28937. smaskInData: dict.has("SMaskInData")
  28938. };
  28939. break;
  28940. case "JBIG2Decode":
  28941. image.bitsPerComponent = 1;
  28942. image.numComps = 1;
  28943. break;
  28944. }
  28945. let width = dict.get("W", "Width");
  28946. let height = dict.get("H", "Height");
  28947. if (Number.isInteger(image.width) && image.width > 0 && Number.isInteger(image.height) && image.height > 0 && (image.width !== width || image.height !== height)) {
  28948. warn("PDFImage - using the Width/Height of the image data, " + "rather than the image dictionary.");
  28949. width = image.width;
  28950. height = image.height;
  28951. }
  28952. if (width < 1 || height < 1) {
  28953. throw new FormatError(`Invalid image width: ${width} or height: ${height}`);
  28954. }
  28955. this.width = width;
  28956. this.height = height;
  28957. this.interpolate = dict.get("I", "Interpolate");
  28958. this.imageMask = dict.get("IM", "ImageMask") || false;
  28959. this.matte = dict.get("Matte") || false;
  28960. let bitsPerComponent = image.bitsPerComponent;
  28961. if (!bitsPerComponent) {
  28962. bitsPerComponent = dict.get("BPC", "BitsPerComponent");
  28963. if (!bitsPerComponent) {
  28964. if (this.imageMask) {
  28965. bitsPerComponent = 1;
  28966. } else {
  28967. throw new FormatError(`Bits per component missing in image: ${this.imageMask}`);
  28968. }
  28969. }
  28970. }
  28971. this.bpc = bitsPerComponent;
  28972. if (!this.imageMask) {
  28973. let colorSpace = dict.getRaw("CS") || dict.getRaw("ColorSpace");
  28974. const hasColorSpace = !!colorSpace;
  28975. if (!hasColorSpace) {
  28976. if (this.jpxDecoderOptions) {
  28977. colorSpace = Name.get("DeviceRGBA");
  28978. } else {
  28979. switch (image.numComps) {
  28980. case 1:
  28981. colorSpace = Name.get("DeviceGray");
  28982. break;
  28983. case 3:
  28984. colorSpace = Name.get("DeviceRGB");
  28985. break;
  28986. case 4:
  28987. colorSpace = Name.get("DeviceCMYK");
  28988. break;
  28989. default:
  28990. throw new Error(`Images with ${image.numComps} color components not supported.`);
  28991. }
  28992. }
  28993. } else if (this.jpxDecoderOptions?.smaskInData) {
  28994. colorSpace = Name.get("DeviceRGBA");
  28995. }
  28996. this.colorSpace = ColorSpace.parse({
  28997. cs: colorSpace,
  28998. xref,
  28999. resources: isInline ? res : null,
  29000. pdfFunctionFactory,
  29001. localColorSpaceCache
  29002. });
  29003. this.numComps = this.colorSpace.numComps;
  29004. if (this.jpxDecoderOptions) {
  29005. this.jpxDecoderOptions.numComponents = hasColorSpace ? this.numComp : 0;
  29006. this.jpxDecoderOptions.isIndexedColormap = this.colorSpace.name === "Indexed";
  29007. }
  29008. }
  29009. this.decode = dict.getArray("D", "Decode");
  29010. this.needsDecode = false;
  29011. if (this.decode && (this.colorSpace && !this.colorSpace.isDefaultDecode(this.decode, bitsPerComponent) || isMask && !ColorSpace.isDefaultDecode(this.decode, 1))) {
  29012. this.needsDecode = true;
  29013. const max = (1 << bitsPerComponent) - 1;
  29014. this.decodeCoefficients = [];
  29015. this.decodeAddends = [];
  29016. const isIndexed = this.colorSpace?.name === "Indexed";
  29017. for (let i = 0, j = 0; i < this.decode.length; i += 2, ++j) {
  29018. const dmin = this.decode[i];
  29019. const dmax = this.decode[i + 1];
  29020. this.decodeCoefficients[j] = isIndexed ? (dmax - dmin) / max : dmax - dmin;
  29021. this.decodeAddends[j] = isIndexed ? dmin : max * dmin;
  29022. }
  29023. }
  29024. if (smask) {
  29025. this.smask = new PDFImage({
  29026. xref,
  29027. res,
  29028. image: smask,
  29029. isInline,
  29030. pdfFunctionFactory,
  29031. localColorSpaceCache
  29032. });
  29033. } else if (mask) {
  29034. if (mask instanceof BaseStream) {
  29035. const maskDict = mask.dict,
  29036. imageMask = maskDict.get("IM", "ImageMask");
  29037. if (!imageMask) {
  29038. warn("Ignoring /Mask in image without /ImageMask.");
  29039. } else {
  29040. this.mask = new PDFImage({
  29041. xref,
  29042. res,
  29043. image: mask,
  29044. isInline,
  29045. isMask: true,
  29046. pdfFunctionFactory,
  29047. localColorSpaceCache
  29048. });
  29049. }
  29050. } else {
  29051. this.mask = mask;
  29052. }
  29053. }
  29054. }
  29055. static async buildImage({
  29056. xref,
  29057. res,
  29058. image,
  29059. isInline = false,
  29060. pdfFunctionFactory,
  29061. localColorSpaceCache
  29062. }) {
  29063. const imageData = image;
  29064. let smaskData = null;
  29065. let maskData = null;
  29066. const smask = image.dict.get("SMask");
  29067. const mask = image.dict.get("Mask");
  29068. if (smask) {
  29069. if (smask instanceof BaseStream) {
  29070. smaskData = smask;
  29071. } else {
  29072. warn("Unsupported /SMask format.");
  29073. }
  29074. } else if (mask) {
  29075. if (mask instanceof BaseStream || Array.isArray(mask)) {
  29076. maskData = mask;
  29077. } else {
  29078. warn("Unsupported /Mask format.");
  29079. }
  29080. }
  29081. return new PDFImage({
  29082. xref,
  29083. res,
  29084. image: imageData,
  29085. isInline,
  29086. smask: smaskData,
  29087. mask: maskData,
  29088. pdfFunctionFactory,
  29089. localColorSpaceCache
  29090. });
  29091. }
  29092. static createRawMask({
  29093. imgArray,
  29094. width,
  29095. height,
  29096. imageIsFromDecodeStream,
  29097. inverseDecode,
  29098. interpolate
  29099. }) {
  29100. const computedLength = (width + 7 >> 3) * height;
  29101. const actualLength = imgArray.byteLength;
  29102. const haveFullData = computedLength === actualLength;
  29103. let data, i;
  29104. if (imageIsFromDecodeStream && (!inverseDecode || haveFullData)) {
  29105. data = imgArray;
  29106. } else if (!inverseDecode) {
  29107. data = new Uint8Array(imgArray);
  29108. } else {
  29109. data = new Uint8Array(computedLength);
  29110. data.set(imgArray);
  29111. data.fill(0xff, actualLength);
  29112. }
  29113. if (inverseDecode) {
  29114. for (i = 0; i < actualLength; i++) {
  29115. data[i] ^= 0xff;
  29116. }
  29117. }
  29118. return {
  29119. data,
  29120. width,
  29121. height,
  29122. interpolate
  29123. };
  29124. }
  29125. static async createMask({
  29126. imgArray,
  29127. width,
  29128. height,
  29129. imageIsFromDecodeStream,
  29130. inverseDecode,
  29131. interpolate,
  29132. isOffscreenCanvasSupported = false
  29133. }) {
  29134. const isSingleOpaquePixel = width === 1 && height === 1 && inverseDecode === (imgArray.length === 0 || !!(imgArray[0] & 128));
  29135. if (isSingleOpaquePixel) {
  29136. return {
  29137. isSingleOpaquePixel
  29138. };
  29139. }
  29140. if (isOffscreenCanvasSupported) {
  29141. if (ImageResizer.needsToBeResized(width, height)) {
  29142. const data = new Uint8ClampedArray(width * height * 4);
  29143. convertBlackAndWhiteToRGBA({
  29144. src: imgArray,
  29145. dest: data,
  29146. width,
  29147. height,
  29148. nonBlackColor: 0,
  29149. inverseDecode
  29150. });
  29151. return ImageResizer.createImage({
  29152. kind: ImageKind.RGBA_32BPP,
  29153. data,
  29154. width,
  29155. height,
  29156. interpolate
  29157. });
  29158. }
  29159. const canvas = new OffscreenCanvas(width, height);
  29160. const ctx = canvas.getContext("2d");
  29161. const imgData = ctx.createImageData(width, height);
  29162. convertBlackAndWhiteToRGBA({
  29163. src: imgArray,
  29164. dest: imgData.data,
  29165. width,
  29166. height,
  29167. nonBlackColor: 0,
  29168. inverseDecode
  29169. });
  29170. ctx.putImageData(imgData, 0, 0);
  29171. const bitmap = canvas.transferToImageBitmap();
  29172. return {
  29173. data: null,
  29174. width,
  29175. height,
  29176. interpolate,
  29177. bitmap
  29178. };
  29179. }
  29180. return this.createRawMask({
  29181. imgArray,
  29182. width,
  29183. height,
  29184. inverseDecode,
  29185. imageIsFromDecodeStream,
  29186. interpolate
  29187. });
  29188. }
  29189. get drawWidth() {
  29190. return Math.max(this.width, this.smask?.width || 0, this.mask?.width || 0);
  29191. }
  29192. get drawHeight() {
  29193. return Math.max(this.height, this.smask?.height || 0, this.mask?.height || 0);
  29194. }
  29195. decodeBuffer(buffer) {
  29196. const bpc = this.bpc;
  29197. const numComps = this.numComps;
  29198. const decodeAddends = this.decodeAddends;
  29199. const decodeCoefficients = this.decodeCoefficients;
  29200. const max = (1 << bpc) - 1;
  29201. let i, ii;
  29202. if (bpc === 1) {
  29203. for (i = 0, ii = buffer.length; i < ii; i++) {
  29204. buffer[i] = +!buffer[i];
  29205. }
  29206. return;
  29207. }
  29208. let index = 0;
  29209. for (i = 0, ii = this.width * this.height; i < ii; i++) {
  29210. for (let j = 0; j < numComps; j++) {
  29211. buffer[index] = decodeAndClamp(buffer[index], decodeAddends[j], decodeCoefficients[j], max);
  29212. index++;
  29213. }
  29214. }
  29215. }
  29216. getComponents(buffer) {
  29217. const bpc = this.bpc;
  29218. if (bpc === 8) {
  29219. return buffer;
  29220. }
  29221. const width = this.width;
  29222. const height = this.height;
  29223. const numComps = this.numComps;
  29224. const length = width * height * numComps;
  29225. let bufferPos = 0;
  29226. let output;
  29227. if (bpc <= 8) {
  29228. output = new Uint8Array(length);
  29229. } else if (bpc <= 16) {
  29230. output = new Uint16Array(length);
  29231. } else {
  29232. output = new Uint32Array(length);
  29233. }
  29234. const rowComps = width * numComps;
  29235. const max = (1 << bpc) - 1;
  29236. let i = 0,
  29237. ii,
  29238. buf;
  29239. if (bpc === 1) {
  29240. let mask, loop1End, loop2End;
  29241. for (let j = 0; j < height; j++) {
  29242. loop1End = i + (rowComps & ~7);
  29243. loop2End = i + rowComps;
  29244. while (i < loop1End) {
  29245. buf = buffer[bufferPos++];
  29246. output[i] = buf >> 7 & 1;
  29247. output[i + 1] = buf >> 6 & 1;
  29248. output[i + 2] = buf >> 5 & 1;
  29249. output[i + 3] = buf >> 4 & 1;
  29250. output[i + 4] = buf >> 3 & 1;
  29251. output[i + 5] = buf >> 2 & 1;
  29252. output[i + 6] = buf >> 1 & 1;
  29253. output[i + 7] = buf & 1;
  29254. i += 8;
  29255. }
  29256. if (i < loop2End) {
  29257. buf = buffer[bufferPos++];
  29258. mask = 128;
  29259. while (i < loop2End) {
  29260. output[i++] = +!!(buf & mask);
  29261. mask >>= 1;
  29262. }
  29263. }
  29264. }
  29265. } else {
  29266. let bits = 0;
  29267. buf = 0;
  29268. for (i = 0, ii = length; i < ii; ++i) {
  29269. if (i % rowComps === 0) {
  29270. buf = 0;
  29271. bits = 0;
  29272. }
  29273. while (bits < bpc) {
  29274. buf = buf << 8 | buffer[bufferPos++];
  29275. bits += 8;
  29276. }
  29277. const remainingBits = bits - bpc;
  29278. let value = buf >> remainingBits;
  29279. if (value < 0) {
  29280. value = 0;
  29281. } else if (value > max) {
  29282. value = max;
  29283. }
  29284. output[i] = value;
  29285. buf &= (1 << remainingBits) - 1;
  29286. bits = remainingBits;
  29287. }
  29288. }
  29289. return output;
  29290. }
  29291. async fillOpacity(rgbaBuf, width, height, actualHeight, image) {
  29292. const smask = this.smask;
  29293. const mask = this.mask;
  29294. let alphaBuf, sw, sh, i, ii, j;
  29295. if (smask) {
  29296. sw = smask.width;
  29297. sh = smask.height;
  29298. alphaBuf = new Uint8ClampedArray(sw * sh);
  29299. await smask.fillGrayBuffer(alphaBuf);
  29300. if (sw !== width || sh !== height) {
  29301. alphaBuf = resizeImageMask(alphaBuf, smask.bpc, sw, sh, width, height);
  29302. }
  29303. } else if (mask) {
  29304. if (mask instanceof PDFImage) {
  29305. sw = mask.width;
  29306. sh = mask.height;
  29307. alphaBuf = new Uint8ClampedArray(sw * sh);
  29308. mask.numComps = 1;
  29309. await mask.fillGrayBuffer(alphaBuf);
  29310. for (i = 0, ii = sw * sh; i < ii; ++i) {
  29311. alphaBuf[i] = 255 - alphaBuf[i];
  29312. }
  29313. if (sw !== width || sh !== height) {
  29314. alphaBuf = resizeImageMask(alphaBuf, mask.bpc, sw, sh, width, height);
  29315. }
  29316. } else if (Array.isArray(mask)) {
  29317. alphaBuf = new Uint8ClampedArray(width * height);
  29318. const numComps = this.numComps;
  29319. for (i = 0, ii = width * height; i < ii; ++i) {
  29320. let opacity = 0;
  29321. const imageOffset = i * numComps;
  29322. for (j = 0; j < numComps; ++j) {
  29323. const color = image[imageOffset + j];
  29324. const maskOffset = j * 2;
  29325. if (color < mask[maskOffset] || color > mask[maskOffset + 1]) {
  29326. opacity = 255;
  29327. break;
  29328. }
  29329. }
  29330. alphaBuf[i] = opacity;
  29331. }
  29332. } else {
  29333. throw new FormatError("Unknown mask format.");
  29334. }
  29335. }
  29336. if (alphaBuf) {
  29337. for (i = 0, j = 3, ii = width * actualHeight; i < ii; ++i, j += 4) {
  29338. rgbaBuf[j] = alphaBuf[i];
  29339. }
  29340. } else {
  29341. for (i = 0, j = 3, ii = width * actualHeight; i < ii; ++i, j += 4) {
  29342. rgbaBuf[j] = 255;
  29343. }
  29344. }
  29345. }
  29346. undoPreblend(buffer, width, height) {
  29347. const matte = this.smask?.matte;
  29348. if (!matte) {
  29349. return;
  29350. }
  29351. const matteRgb = this.colorSpace.getRgb(matte, 0);
  29352. const matteR = matteRgb[0];
  29353. const matteG = matteRgb[1];
  29354. const matteB = matteRgb[2];
  29355. const length = width * height * 4;
  29356. for (let i = 0; i < length; i += 4) {
  29357. const alpha = buffer[i + 3];
  29358. if (alpha === 0) {
  29359. buffer[i] = 255;
  29360. buffer[i + 1] = 255;
  29361. buffer[i + 2] = 255;
  29362. continue;
  29363. }
  29364. const k = 255 / alpha;
  29365. buffer[i] = (buffer[i] - matteR) * k + matteR;
  29366. buffer[i + 1] = (buffer[i + 1] - matteG) * k + matteG;
  29367. buffer[i + 2] = (buffer[i + 2] - matteB) * k + matteB;
  29368. }
  29369. }
  29370. async createImageData(forceRGBA = false, isOffscreenCanvasSupported = false) {
  29371. const drawWidth = this.drawWidth;
  29372. const drawHeight = this.drawHeight;
  29373. const imgData = {
  29374. width: drawWidth,
  29375. height: drawHeight,
  29376. interpolate: this.interpolate,
  29377. kind: 0,
  29378. data: null
  29379. };
  29380. const numComps = this.numComps;
  29381. const originalWidth = this.width;
  29382. const originalHeight = this.height;
  29383. const bpc = this.bpc;
  29384. const rowBytes = originalWidth * numComps * bpc + 7 >> 3;
  29385. const mustBeResized = isOffscreenCanvasSupported && ImageResizer.needsToBeResized(drawWidth, drawHeight);
  29386. if (this.colorSpace.name === "DeviceRGBA") {
  29387. imgData.kind = ImageKind.RGBA_32BPP;
  29388. const imgArray = imgData.data = await this.getImageBytes(originalHeight * originalWidth * 4, {});
  29389. if (isOffscreenCanvasSupported) {
  29390. if (!mustBeResized) {
  29391. return this.createBitmap(ImageKind.RGBA_32BPP, drawWidth, drawHeight, imgArray);
  29392. }
  29393. return ImageResizer.createImage(imgData, false);
  29394. }
  29395. return imgData;
  29396. }
  29397. if (!forceRGBA) {
  29398. let kind;
  29399. if (this.colorSpace.name === "DeviceGray" && bpc === 1) {
  29400. kind = ImageKind.GRAYSCALE_1BPP;
  29401. } else if (this.colorSpace.name === "DeviceRGB" && bpc === 8 && !this.needsDecode) {
  29402. kind = ImageKind.RGB_24BPP;
  29403. }
  29404. if (kind && !this.smask && !this.mask && drawWidth === originalWidth && drawHeight === originalHeight) {
  29405. const data = await this.getImageBytes(originalHeight * rowBytes, {});
  29406. if (isOffscreenCanvasSupported) {
  29407. if (mustBeResized) {
  29408. return ImageResizer.createImage({
  29409. data,
  29410. kind,
  29411. width: drawWidth,
  29412. height: drawHeight,
  29413. interpolate: this.interpolate
  29414. }, this.needsDecode);
  29415. }
  29416. return this.createBitmap(kind, originalWidth, originalHeight, data);
  29417. }
  29418. imgData.kind = kind;
  29419. imgData.data = data;
  29420. if (this.needsDecode) {
  29421. assert(kind === ImageKind.GRAYSCALE_1BPP, "PDFImage.createImageData: The image must be grayscale.");
  29422. const buffer = imgData.data;
  29423. for (let i = 0, ii = buffer.length; i < ii; i++) {
  29424. buffer[i] ^= 0xff;
  29425. }
  29426. }
  29427. return imgData;
  29428. }
  29429. if (this.image instanceof JpegStream && !this.smask && !this.mask && !this.needsDecode) {
  29430. let imageLength = originalHeight * rowBytes;
  29431. if (isOffscreenCanvasSupported && !mustBeResized) {
  29432. let isHandled = false;
  29433. switch (this.colorSpace.name) {
  29434. case "DeviceGray":
  29435. imageLength *= 4;
  29436. isHandled = true;
  29437. break;
  29438. case "DeviceRGB":
  29439. imageLength = imageLength / 3 * 4;
  29440. isHandled = true;
  29441. break;
  29442. case "DeviceCMYK":
  29443. isHandled = true;
  29444. break;
  29445. }
  29446. if (isHandled) {
  29447. const rgba = await this.getImageBytes(imageLength, {
  29448. drawWidth,
  29449. drawHeight,
  29450. forceRGBA: true
  29451. });
  29452. return this.createBitmap(ImageKind.RGBA_32BPP, drawWidth, drawHeight, rgba);
  29453. }
  29454. } else {
  29455. switch (this.colorSpace.name) {
  29456. case "DeviceGray":
  29457. imageLength *= 3;
  29458. case "DeviceRGB":
  29459. case "DeviceCMYK":
  29460. imgData.kind = ImageKind.RGB_24BPP;
  29461. imgData.data = await this.getImageBytes(imageLength, {
  29462. drawWidth,
  29463. drawHeight,
  29464. forceRGB: true
  29465. });
  29466. if (mustBeResized) {
  29467. return ImageResizer.createImage(imgData);
  29468. }
  29469. return imgData;
  29470. }
  29471. }
  29472. }
  29473. }
  29474. const imgArray = await this.getImageBytes(originalHeight * rowBytes, {
  29475. internal: true
  29476. });
  29477. const actualHeight = 0 | imgArray.length / rowBytes * drawHeight / originalHeight;
  29478. const comps = this.getComponents(imgArray);
  29479. let alpha01, maybeUndoPreblend;
  29480. let canvas, ctx, canvasImgData, data;
  29481. if (isOffscreenCanvasSupported && !mustBeResized) {
  29482. canvas = new OffscreenCanvas(drawWidth, drawHeight);
  29483. ctx = canvas.getContext("2d");
  29484. canvasImgData = ctx.createImageData(drawWidth, drawHeight);
  29485. data = canvasImgData.data;
  29486. }
  29487. imgData.kind = ImageKind.RGBA_32BPP;
  29488. if (!forceRGBA && !this.smask && !this.mask) {
  29489. if (!isOffscreenCanvasSupported || mustBeResized) {
  29490. imgData.kind = ImageKind.RGB_24BPP;
  29491. data = new Uint8ClampedArray(drawWidth * drawHeight * 3);
  29492. alpha01 = 0;
  29493. } else {
  29494. const arr = new Uint32Array(data.buffer);
  29495. arr.fill(FeatureTest.isLittleEndian ? 0xff000000 : 0x000000ff);
  29496. alpha01 = 1;
  29497. }
  29498. maybeUndoPreblend = false;
  29499. } else {
  29500. if (!isOffscreenCanvasSupported || mustBeResized) {
  29501. data = new Uint8ClampedArray(drawWidth * drawHeight * 4);
  29502. }
  29503. alpha01 = 1;
  29504. maybeUndoPreblend = true;
  29505. await this.fillOpacity(data, drawWidth, drawHeight, actualHeight, comps);
  29506. }
  29507. if (this.needsDecode) {
  29508. this.decodeBuffer(comps);
  29509. }
  29510. this.colorSpace.fillRgb(data, originalWidth, originalHeight, drawWidth, drawHeight, actualHeight, bpc, comps, alpha01);
  29511. if (maybeUndoPreblend) {
  29512. this.undoPreblend(data, drawWidth, actualHeight);
  29513. }
  29514. if (isOffscreenCanvasSupported && !mustBeResized) {
  29515. ctx.putImageData(canvasImgData, 0, 0);
  29516. const bitmap = canvas.transferToImageBitmap();
  29517. return {
  29518. data: null,
  29519. width: drawWidth,
  29520. height: drawHeight,
  29521. bitmap,
  29522. interpolate: this.interpolate
  29523. };
  29524. }
  29525. imgData.data = data;
  29526. if (mustBeResized) {
  29527. return ImageResizer.createImage(imgData);
  29528. }
  29529. return imgData;
  29530. }
  29531. async fillGrayBuffer(buffer) {
  29532. const numComps = this.numComps;
  29533. if (numComps !== 1) {
  29534. throw new FormatError(`Reading gray scale from a color image: ${numComps}`);
  29535. }
  29536. const width = this.width;
  29537. const height = this.height;
  29538. const bpc = this.bpc;
  29539. const rowBytes = width * numComps * bpc + 7 >> 3;
  29540. const imgArray = await this.getImageBytes(height * rowBytes, {
  29541. internal: true
  29542. });
  29543. const comps = this.getComponents(imgArray);
  29544. let i, length;
  29545. if (bpc === 1) {
  29546. length = width * height;
  29547. if (this.needsDecode) {
  29548. for (i = 0; i < length; ++i) {
  29549. buffer[i] = comps[i] - 1 & 255;
  29550. }
  29551. } else {
  29552. for (i = 0; i < length; ++i) {
  29553. buffer[i] = -comps[i] & 255;
  29554. }
  29555. }
  29556. return;
  29557. }
  29558. if (this.needsDecode) {
  29559. this.decodeBuffer(comps);
  29560. }
  29561. length = width * height;
  29562. const scale = 255 / ((1 << bpc) - 1);
  29563. for (i = 0; i < length; ++i) {
  29564. buffer[i] = scale * comps[i];
  29565. }
  29566. }
  29567. createBitmap(kind, width, height, src) {
  29568. const canvas = new OffscreenCanvas(width, height);
  29569. const ctx = canvas.getContext("2d");
  29570. let imgData;
  29571. if (kind === ImageKind.RGBA_32BPP) {
  29572. imgData = new ImageData(src, width, height);
  29573. } else {
  29574. imgData = ctx.createImageData(width, height);
  29575. convertToRGBA({
  29576. kind,
  29577. src,
  29578. dest: new Uint32Array(imgData.data.buffer),
  29579. width,
  29580. height,
  29581. inverseDecode: this.needsDecode
  29582. });
  29583. }
  29584. ctx.putImageData(imgData, 0, 0);
  29585. const bitmap = canvas.transferToImageBitmap();
  29586. return {
  29587. data: null,
  29588. width,
  29589. height,
  29590. bitmap,
  29591. interpolate: this.interpolate
  29592. };
  29593. }
  29594. async getImageBytes(length, {
  29595. drawWidth,
  29596. drawHeight,
  29597. forceRGBA = false,
  29598. forceRGB = false,
  29599. internal = false
  29600. }) {
  29601. this.image.reset();
  29602. this.image.drawWidth = drawWidth || this.width;
  29603. this.image.drawHeight = drawHeight || this.height;
  29604. this.image.forceRGBA = !!forceRGBA;
  29605. this.image.forceRGB = !!forceRGB;
  29606. const imageBytes = await this.image.getImageData(length, this.jpxDecoderOptions);
  29607. if (internal || this.image instanceof DecodeStream) {
  29608. return imageBytes;
  29609. }
  29610. assert(imageBytes instanceof Uint8Array, 'PDFImage.getImageBytes: Unsupported "imageBytes" type.');
  29611. return new Uint8Array(imageBytes);
  29612. }
  29613. }
  29614. ;// CONCATENATED MODULE: ./src/core/evaluator.js
  29615. const DefaultPartialEvaluatorOptions = Object.freeze({
  29616. maxImageSize: -1,
  29617. disableFontFace: false,
  29618. ignoreErrors: false,
  29619. isEvalSupported: true,
  29620. isOffscreenCanvasSupported: false,
  29621. canvasMaxAreaInBytes: -1,
  29622. fontExtraProperties: false,
  29623. useSystemFonts: true,
  29624. cMapUrl: null,
  29625. standardFontDataUrl: null
  29626. });
  29627. const PatternType = {
  29628. TILING: 1,
  29629. SHADING: 2
  29630. };
  29631. const TEXT_CHUNK_BATCH_SIZE = 10;
  29632. const deferred = Promise.resolve();
  29633. function normalizeBlendMode(value, parsingArray = false) {
  29634. if (Array.isArray(value)) {
  29635. for (const val of value) {
  29636. const maybeBM = normalizeBlendMode(val, true);
  29637. if (maybeBM) {
  29638. return maybeBM;
  29639. }
  29640. }
  29641. warn(`Unsupported blend mode Array: ${value}`);
  29642. return "source-over";
  29643. }
  29644. if (!(value instanceof Name)) {
  29645. if (parsingArray) {
  29646. return null;
  29647. }
  29648. return "source-over";
  29649. }
  29650. switch (value.name) {
  29651. case "Normal":
  29652. case "Compatible":
  29653. return "source-over";
  29654. case "Multiply":
  29655. return "multiply";
  29656. case "Screen":
  29657. return "screen";
  29658. case "Overlay":
  29659. return "overlay";
  29660. case "Darken":
  29661. return "darken";
  29662. case "Lighten":
  29663. return "lighten";
  29664. case "ColorDodge":
  29665. return "color-dodge";
  29666. case "ColorBurn":
  29667. return "color-burn";
  29668. case "HardLight":
  29669. return "hard-light";
  29670. case "SoftLight":
  29671. return "soft-light";
  29672. case "Difference":
  29673. return "difference";
  29674. case "Exclusion":
  29675. return "exclusion";
  29676. case "Hue":
  29677. return "hue";
  29678. case "Saturation":
  29679. return "saturation";
  29680. case "Color":
  29681. return "color";
  29682. case "Luminosity":
  29683. return "luminosity";
  29684. }
  29685. if (parsingArray) {
  29686. return null;
  29687. }
  29688. warn(`Unsupported blend mode: ${value.name}`);
  29689. return "source-over";
  29690. }
  29691. function addLocallyCachedImageOps(opList, data) {
  29692. if (data.objId) {
  29693. opList.addDependency(data.objId);
  29694. }
  29695. opList.addImageOps(data.fn, data.args, data.optionalContent);
  29696. if (data.fn === OPS.paintImageMaskXObject && data.args[0]?.count > 0) {
  29697. data.args[0].count++;
  29698. }
  29699. }
  29700. class TimeSlotManager {
  29701. static TIME_SLOT_DURATION_MS = 20;
  29702. static CHECK_TIME_EVERY = 100;
  29703. constructor() {
  29704. this.reset();
  29705. }
  29706. check() {
  29707. if (++this.checked < TimeSlotManager.CHECK_TIME_EVERY) {
  29708. return false;
  29709. }
  29710. this.checked = 0;
  29711. return this.endTime <= Date.now();
  29712. }
  29713. reset() {
  29714. this.endTime = Date.now() + TimeSlotManager.TIME_SLOT_DURATION_MS;
  29715. this.checked = 0;
  29716. }
  29717. }
  29718. class PartialEvaluator {
  29719. constructor({
  29720. xref,
  29721. handler,
  29722. pageIndex,
  29723. idFactory,
  29724. fontCache,
  29725. builtInCMapCache,
  29726. standardFontDataCache,
  29727. globalImageCache,
  29728. systemFontCache,
  29729. options = null
  29730. }) {
  29731. this.xref = xref;
  29732. this.handler = handler;
  29733. this.pageIndex = pageIndex;
  29734. this.idFactory = idFactory;
  29735. this.fontCache = fontCache;
  29736. this.builtInCMapCache = builtInCMapCache;
  29737. this.standardFontDataCache = standardFontDataCache;
  29738. this.globalImageCache = globalImageCache;
  29739. this.systemFontCache = systemFontCache;
  29740. this.options = options || DefaultPartialEvaluatorOptions;
  29741. this.type3FontRefs = null;
  29742. this._regionalImageCache = new RegionalImageCache();
  29743. this._fetchBuiltInCMapBound = this.fetchBuiltInCMap.bind(this);
  29744. ImageResizer.setMaxArea(this.options.canvasMaxAreaInBytes);
  29745. }
  29746. get _pdfFunctionFactory() {
  29747. const pdfFunctionFactory = new PDFFunctionFactory({
  29748. xref: this.xref,
  29749. isEvalSupported: this.options.isEvalSupported
  29750. });
  29751. return shadow(this, "_pdfFunctionFactory", pdfFunctionFactory);
  29752. }
  29753. get parsingType3Font() {
  29754. return !!this.type3FontRefs;
  29755. }
  29756. clone(newOptions = null) {
  29757. const newEvaluator = Object.create(this);
  29758. newEvaluator.options = Object.assign(Object.create(null), this.options, newOptions);
  29759. return newEvaluator;
  29760. }
  29761. hasBlendModes(resources, nonBlendModesSet) {
  29762. if (!(resources instanceof Dict)) {
  29763. return false;
  29764. }
  29765. if (resources.objId && nonBlendModesSet.has(resources.objId)) {
  29766. return false;
  29767. }
  29768. const processed = new RefSet(nonBlendModesSet);
  29769. if (resources.objId) {
  29770. processed.put(resources.objId);
  29771. }
  29772. const nodes = [resources],
  29773. xref = this.xref;
  29774. while (nodes.length) {
  29775. const node = nodes.shift();
  29776. const graphicStates = node.get("ExtGState");
  29777. if (graphicStates instanceof Dict) {
  29778. for (let graphicState of graphicStates.getRawValues()) {
  29779. if (graphicState instanceof Ref) {
  29780. if (processed.has(graphicState)) {
  29781. continue;
  29782. }
  29783. try {
  29784. graphicState = xref.fetch(graphicState);
  29785. } catch (ex) {
  29786. processed.put(graphicState);
  29787. info(`hasBlendModes - ignoring ExtGState: "${ex}".`);
  29788. continue;
  29789. }
  29790. }
  29791. if (!(graphicState instanceof Dict)) {
  29792. continue;
  29793. }
  29794. if (graphicState.objId) {
  29795. processed.put(graphicState.objId);
  29796. }
  29797. const bm = graphicState.get("BM");
  29798. if (bm instanceof Name) {
  29799. if (bm.name !== "Normal") {
  29800. return true;
  29801. }
  29802. continue;
  29803. }
  29804. if (bm !== undefined && Array.isArray(bm)) {
  29805. for (const element of bm) {
  29806. if (element instanceof Name && element.name !== "Normal") {
  29807. return true;
  29808. }
  29809. }
  29810. }
  29811. }
  29812. }
  29813. const xObjects = node.get("XObject");
  29814. if (!(xObjects instanceof Dict)) {
  29815. continue;
  29816. }
  29817. for (let xObject of xObjects.getRawValues()) {
  29818. if (xObject instanceof Ref) {
  29819. if (processed.has(xObject)) {
  29820. continue;
  29821. }
  29822. try {
  29823. xObject = xref.fetch(xObject);
  29824. } catch (ex) {
  29825. processed.put(xObject);
  29826. info(`hasBlendModes - ignoring XObject: "${ex}".`);
  29827. continue;
  29828. }
  29829. }
  29830. if (!(xObject instanceof BaseStream)) {
  29831. continue;
  29832. }
  29833. if (xObject.dict.objId) {
  29834. processed.put(xObject.dict.objId);
  29835. }
  29836. const xResources = xObject.dict.get("Resources");
  29837. if (!(xResources instanceof Dict)) {
  29838. continue;
  29839. }
  29840. if (xResources.objId && processed.has(xResources.objId)) {
  29841. continue;
  29842. }
  29843. nodes.push(xResources);
  29844. if (xResources.objId) {
  29845. processed.put(xResources.objId);
  29846. }
  29847. }
  29848. }
  29849. for (const ref of processed) {
  29850. nonBlendModesSet.put(ref);
  29851. }
  29852. return false;
  29853. }
  29854. async fetchBuiltInCMap(name) {
  29855. const cachedData = this.builtInCMapCache.get(name);
  29856. if (cachedData) {
  29857. return cachedData;
  29858. }
  29859. let data;
  29860. if (this.options.cMapUrl !== null) {
  29861. const url = `${this.options.cMapUrl}${name}.bcmap`;
  29862. const response = await fetch(url);
  29863. if (!response.ok) {
  29864. throw new Error(`fetchBuiltInCMap: failed to fetch file "${url}" with "${response.statusText}".`);
  29865. }
  29866. data = {
  29867. cMapData: new Uint8Array(await response.arrayBuffer()),
  29868. compressionType: CMapCompressionType.BINARY
  29869. };
  29870. } else {
  29871. data = await this.handler.sendWithPromise("FetchBuiltInCMap", {
  29872. name
  29873. });
  29874. }
  29875. if (data.compressionType !== CMapCompressionType.NONE) {
  29876. this.builtInCMapCache.set(name, data);
  29877. }
  29878. return data;
  29879. }
  29880. async fetchStandardFontData(name) {
  29881. const cachedData = this.standardFontDataCache.get(name);
  29882. if (cachedData) {
  29883. return new Stream(cachedData);
  29884. }
  29885. if (this.options.useSystemFonts && name !== "Symbol" && name !== "ZapfDingbats") {
  29886. return null;
  29887. }
  29888. const standardFontNameToFileName = getFontNameToFileMap(),
  29889. filename = standardFontNameToFileName[name];
  29890. let data;
  29891. if (this.options.standardFontDataUrl !== null) {
  29892. const url = `${this.options.standardFontDataUrl}${filename}`;
  29893. const response = await fetch(url);
  29894. if (!response.ok) {
  29895. warn(`fetchStandardFontData: failed to fetch file "${url}" with "${response.statusText}".`);
  29896. } else {
  29897. data = new Uint8Array(await response.arrayBuffer());
  29898. }
  29899. } else {
  29900. try {
  29901. data = await this.handler.sendWithPromise("FetchStandardFontData", {
  29902. filename
  29903. });
  29904. } catch (e) {
  29905. warn(`fetchStandardFontData: failed to fetch file "${filename}" with "${e}".`);
  29906. }
  29907. }
  29908. if (!data) {
  29909. return null;
  29910. }
  29911. this.standardFontDataCache.set(name, data);
  29912. return new Stream(data);
  29913. }
  29914. async buildFormXObject(resources, xobj, smask, operatorList, task, initialState, localColorSpaceCache) {
  29915. const dict = xobj.dict;
  29916. const matrix = lookupMatrix(dict.getArray("Matrix"), null);
  29917. const bbox = lookupNormalRect(dict.getArray("BBox"), null);
  29918. let optionalContent, groupOptions;
  29919. if (dict.has("OC")) {
  29920. optionalContent = await this.parseMarkedContentProps(dict.get("OC"), resources);
  29921. }
  29922. if (optionalContent !== undefined) {
  29923. operatorList.addOp(OPS.beginMarkedContentProps, ["OC", optionalContent]);
  29924. }
  29925. const group = dict.get("Group");
  29926. if (group) {
  29927. groupOptions = {
  29928. matrix,
  29929. bbox,
  29930. smask,
  29931. isolated: false,
  29932. knockout: false
  29933. };
  29934. const groupSubtype = group.get("S");
  29935. let colorSpace = null;
  29936. if (isName(groupSubtype, "Transparency")) {
  29937. groupOptions.isolated = group.get("I") || false;
  29938. groupOptions.knockout = group.get("K") || false;
  29939. if (group.has("CS")) {
  29940. const cs = group.getRaw("CS");
  29941. const cachedColorSpace = ColorSpace.getCached(cs, this.xref, localColorSpaceCache);
  29942. if (cachedColorSpace) {
  29943. colorSpace = cachedColorSpace;
  29944. } else {
  29945. colorSpace = await this.parseColorSpace({
  29946. cs,
  29947. resources,
  29948. localColorSpaceCache
  29949. });
  29950. }
  29951. }
  29952. }
  29953. if (smask?.backdrop) {
  29954. colorSpace ||= ColorSpace.singletons.rgb;
  29955. smask.backdrop = colorSpace.getRgb(smask.backdrop, 0);
  29956. }
  29957. operatorList.addOp(OPS.beginGroup, [groupOptions]);
  29958. }
  29959. const args = group ? [matrix, null] : [matrix, bbox];
  29960. operatorList.addOp(OPS.paintFormXObjectBegin, args);
  29961. await this.getOperatorList({
  29962. stream: xobj,
  29963. task,
  29964. resources: dict.get("Resources") || resources,
  29965. operatorList,
  29966. initialState
  29967. });
  29968. operatorList.addOp(OPS.paintFormXObjectEnd, []);
  29969. if (group) {
  29970. operatorList.addOp(OPS.endGroup, [groupOptions]);
  29971. }
  29972. if (optionalContent !== undefined) {
  29973. operatorList.addOp(OPS.endMarkedContent, []);
  29974. }
  29975. }
  29976. _sendImgData(objId, imgData, cacheGlobally = false) {
  29977. const transfers = imgData ? [imgData.bitmap || imgData.data.buffer] : null;
  29978. if (this.parsingType3Font || cacheGlobally) {
  29979. return this.handler.send("commonobj", [objId, "Image", imgData], transfers);
  29980. }
  29981. return this.handler.send("obj", [objId, this.pageIndex, "Image", imgData], transfers);
  29982. }
  29983. async buildPaintImageXObject({
  29984. resources,
  29985. image,
  29986. isInline = false,
  29987. operatorList,
  29988. cacheKey,
  29989. localImageCache,
  29990. localColorSpaceCache
  29991. }) {
  29992. const dict = image.dict;
  29993. const imageRef = dict.objId;
  29994. const w = dict.get("W", "Width");
  29995. const h = dict.get("H", "Height");
  29996. if (!(w && typeof w === "number") || !(h && typeof h === "number")) {
  29997. warn("Image dimensions are missing, or not numbers.");
  29998. return;
  29999. }
  30000. const maxImageSize = this.options.maxImageSize;
  30001. if (maxImageSize !== -1 && w * h > maxImageSize) {
  30002. const msg = "Image exceeded maximum allowed size and was removed.";
  30003. if (this.options.ignoreErrors) {
  30004. warn(msg);
  30005. return;
  30006. }
  30007. throw new Error(msg);
  30008. }
  30009. let optionalContent;
  30010. if (dict.has("OC")) {
  30011. optionalContent = await this.parseMarkedContentProps(dict.get("OC"), resources);
  30012. }
  30013. const imageMask = dict.get("IM", "ImageMask") || false;
  30014. let imgData, args;
  30015. if (imageMask) {
  30016. const interpolate = dict.get("I", "Interpolate");
  30017. const bitStrideLength = w + 7 >> 3;
  30018. const imgArray = image.getBytes(bitStrideLength * h);
  30019. const decode = dict.getArray("D", "Decode");
  30020. if (this.parsingType3Font) {
  30021. imgData = PDFImage.createRawMask({
  30022. imgArray,
  30023. width: w,
  30024. height: h,
  30025. imageIsFromDecodeStream: image instanceof DecodeStream,
  30026. inverseDecode: decode?.[0] > 0,
  30027. interpolate
  30028. });
  30029. imgData.cached = !!cacheKey;
  30030. args = [imgData];
  30031. operatorList.addImageOps(OPS.paintImageMaskXObject, args, optionalContent);
  30032. if (cacheKey) {
  30033. const cacheData = {
  30034. fn: OPS.paintImageMaskXObject,
  30035. args,
  30036. optionalContent
  30037. };
  30038. localImageCache.set(cacheKey, imageRef, cacheData);
  30039. if (imageRef) {
  30040. this._regionalImageCache.set(null, imageRef, cacheData);
  30041. }
  30042. }
  30043. return;
  30044. }
  30045. imgData = await PDFImage.createMask({
  30046. imgArray,
  30047. width: w,
  30048. height: h,
  30049. imageIsFromDecodeStream: image instanceof DecodeStream,
  30050. inverseDecode: decode?.[0] > 0,
  30051. interpolate,
  30052. isOffscreenCanvasSupported: this.options.isOffscreenCanvasSupported
  30053. });
  30054. if (imgData.isSingleOpaquePixel) {
  30055. operatorList.addImageOps(OPS.paintSolidColorImageMask, [], optionalContent);
  30056. if (cacheKey) {
  30057. const cacheData = {
  30058. fn: OPS.paintSolidColorImageMask,
  30059. args: [],
  30060. optionalContent
  30061. };
  30062. localImageCache.set(cacheKey, imageRef, cacheData);
  30063. if (imageRef) {
  30064. this._regionalImageCache.set(null, imageRef, cacheData);
  30065. }
  30066. }
  30067. return;
  30068. }
  30069. const objId = `mask_${this.idFactory.createObjId()}`;
  30070. operatorList.addDependency(objId);
  30071. imgData.dataLen = imgData.bitmap ? imgData.width * imgData.height * 4 : imgData.data.length;
  30072. this._sendImgData(objId, imgData);
  30073. args = [{
  30074. data: objId,
  30075. width: imgData.width,
  30076. height: imgData.height,
  30077. interpolate: imgData.interpolate,
  30078. count: 1
  30079. }];
  30080. operatorList.addImageOps(OPS.paintImageMaskXObject, args, optionalContent);
  30081. if (cacheKey) {
  30082. const cacheData = {
  30083. objId,
  30084. fn: OPS.paintImageMaskXObject,
  30085. args,
  30086. optionalContent
  30087. };
  30088. localImageCache.set(cacheKey, imageRef, cacheData);
  30089. if (imageRef) {
  30090. this._regionalImageCache.set(null, imageRef, cacheData);
  30091. }
  30092. }
  30093. return;
  30094. }
  30095. const SMALL_IMAGE_DIMENSIONS = 200;
  30096. if (isInline && w + h < SMALL_IMAGE_DIMENSIONS && !dict.has("SMask") && !dict.has("Mask")) {
  30097. try {
  30098. const imageObj = new PDFImage({
  30099. xref: this.xref,
  30100. res: resources,
  30101. image,
  30102. isInline,
  30103. pdfFunctionFactory: this._pdfFunctionFactory,
  30104. localColorSpaceCache
  30105. });
  30106. imgData = await imageObj.createImageData(true, false);
  30107. operatorList.isOffscreenCanvasSupported = this.options.isOffscreenCanvasSupported;
  30108. operatorList.addImageOps(OPS.paintInlineImageXObject, [imgData], optionalContent);
  30109. } catch (reason) {
  30110. const msg = `Unable to decode inline image: "${reason}".`;
  30111. if (!this.options.ignoreErrors) {
  30112. throw new Error(msg);
  30113. }
  30114. warn(msg);
  30115. }
  30116. return;
  30117. }
  30118. let objId = `img_${this.idFactory.createObjId()}`,
  30119. cacheGlobally = false;
  30120. if (this.parsingType3Font) {
  30121. objId = `${this.idFactory.getDocId()}_type3_${objId}`;
  30122. } else if (cacheKey && imageRef) {
  30123. cacheGlobally = this.globalImageCache.shouldCache(imageRef, this.pageIndex);
  30124. if (cacheGlobally) {
  30125. assert(!isInline, "Cannot cache an inline image globally.");
  30126. objId = `${this.idFactory.getDocId()}_${objId}`;
  30127. }
  30128. }
  30129. operatorList.addDependency(objId);
  30130. args = [objId, w, h];
  30131. operatorList.addImageOps(OPS.paintImageXObject, args, optionalContent);
  30132. if (cacheGlobally) {
  30133. if (this.globalImageCache.hasDecodeFailed(imageRef)) {
  30134. this.globalImageCache.setData(imageRef, {
  30135. objId,
  30136. fn: OPS.paintImageXObject,
  30137. args,
  30138. optionalContent,
  30139. byteSize: 0
  30140. });
  30141. this._sendImgData(objId, null, cacheGlobally);
  30142. return;
  30143. }
  30144. if (w * h > 250000 || dict.has("SMask") || dict.has("Mask")) {
  30145. const localLength = await this.handler.sendWithPromise("commonobj", [objId, "CopyLocalImage", {
  30146. imageRef
  30147. }]);
  30148. if (localLength) {
  30149. this.globalImageCache.setData(imageRef, {
  30150. objId,
  30151. fn: OPS.paintImageXObject,
  30152. args,
  30153. optionalContent,
  30154. byteSize: 0
  30155. });
  30156. this.globalImageCache.addByteSize(imageRef, localLength);
  30157. return;
  30158. }
  30159. }
  30160. }
  30161. PDFImage.buildImage({
  30162. xref: this.xref,
  30163. res: resources,
  30164. image,
  30165. isInline,
  30166. pdfFunctionFactory: this._pdfFunctionFactory,
  30167. localColorSpaceCache
  30168. }).then(async imageObj => {
  30169. imgData = await imageObj.createImageData(false, this.options.isOffscreenCanvasSupported);
  30170. imgData.dataLen = imgData.bitmap ? imgData.width * imgData.height * 4 : imgData.data.length;
  30171. imgData.ref = imageRef;
  30172. if (cacheGlobally) {
  30173. this.globalImageCache.addByteSize(imageRef, imgData.dataLen);
  30174. }
  30175. return this._sendImgData(objId, imgData, cacheGlobally);
  30176. }).catch(reason => {
  30177. warn(`Unable to decode image "${objId}": "${reason}".`);
  30178. if (imageRef) {
  30179. this.globalImageCache.addDecodeFailed(imageRef);
  30180. }
  30181. return this._sendImgData(objId, null, cacheGlobally);
  30182. });
  30183. if (cacheKey) {
  30184. const cacheData = {
  30185. objId,
  30186. fn: OPS.paintImageXObject,
  30187. args,
  30188. optionalContent
  30189. };
  30190. localImageCache.set(cacheKey, imageRef, cacheData);
  30191. if (imageRef) {
  30192. this._regionalImageCache.set(null, imageRef, cacheData);
  30193. if (cacheGlobally) {
  30194. this.globalImageCache.setData(imageRef, {
  30195. objId,
  30196. fn: OPS.paintImageXObject,
  30197. args,
  30198. optionalContent,
  30199. byteSize: 0
  30200. });
  30201. }
  30202. }
  30203. }
  30204. }
  30205. handleSMask(smask, resources, operatorList, task, stateManager, localColorSpaceCache) {
  30206. const smaskContent = smask.get("G");
  30207. const smaskOptions = {
  30208. subtype: smask.get("S").name,
  30209. backdrop: smask.get("BC")
  30210. };
  30211. const transferObj = smask.get("TR");
  30212. if (isPDFFunction(transferObj)) {
  30213. const transferFn = this._pdfFunctionFactory.create(transferObj);
  30214. const transferMap = new Uint8Array(256);
  30215. const tmp = new Float32Array(1);
  30216. for (let i = 0; i < 256; i++) {
  30217. tmp[0] = i / 255;
  30218. transferFn(tmp, 0, tmp, 0);
  30219. transferMap[i] = tmp[0] * 255 | 0;
  30220. }
  30221. smaskOptions.transferMap = transferMap;
  30222. }
  30223. return this.buildFormXObject(resources, smaskContent, smaskOptions, operatorList, task, stateManager.state.clone(), localColorSpaceCache);
  30224. }
  30225. handleTransferFunction(tr) {
  30226. let transferArray;
  30227. if (Array.isArray(tr)) {
  30228. transferArray = tr;
  30229. } else if (isPDFFunction(tr)) {
  30230. transferArray = [tr];
  30231. } else {
  30232. return null;
  30233. }
  30234. const transferMaps = [];
  30235. let numFns = 0,
  30236. numEffectfulFns = 0;
  30237. for (const entry of transferArray) {
  30238. const transferObj = this.xref.fetchIfRef(entry);
  30239. numFns++;
  30240. if (isName(transferObj, "Identity")) {
  30241. transferMaps.push(null);
  30242. continue;
  30243. } else if (!isPDFFunction(transferObj)) {
  30244. return null;
  30245. }
  30246. const transferFn = this._pdfFunctionFactory.create(transferObj);
  30247. const transferMap = new Uint8Array(256),
  30248. tmp = new Float32Array(1);
  30249. for (let j = 0; j < 256; j++) {
  30250. tmp[0] = j / 255;
  30251. transferFn(tmp, 0, tmp, 0);
  30252. transferMap[j] = tmp[0] * 255 | 0;
  30253. }
  30254. transferMaps.push(transferMap);
  30255. numEffectfulFns++;
  30256. }
  30257. if (!(numFns === 1 || numFns === 4)) {
  30258. return null;
  30259. }
  30260. if (numEffectfulFns === 0) {
  30261. return null;
  30262. }
  30263. return transferMaps;
  30264. }
  30265. handleTilingType(fn, color, resources, pattern, patternDict, operatorList, task, localTilingPatternCache) {
  30266. const tilingOpList = new OperatorList();
  30267. const patternResources = Dict.merge({
  30268. xref: this.xref,
  30269. dictArray: [patternDict.get("Resources"), resources]
  30270. });
  30271. return this.getOperatorList({
  30272. stream: pattern,
  30273. task,
  30274. resources: patternResources,
  30275. operatorList: tilingOpList
  30276. }).then(function () {
  30277. const operatorListIR = tilingOpList.getIR();
  30278. const tilingPatternIR = getTilingPatternIR(operatorListIR, patternDict, color);
  30279. operatorList.addDependencies(tilingOpList.dependencies);
  30280. operatorList.addOp(fn, tilingPatternIR);
  30281. if (patternDict.objId) {
  30282. localTilingPatternCache.set(null, patternDict.objId, {
  30283. operatorListIR,
  30284. dict: patternDict
  30285. });
  30286. }
  30287. }).catch(reason => {
  30288. if (reason instanceof AbortException) {
  30289. return;
  30290. }
  30291. if (this.options.ignoreErrors) {
  30292. warn(`handleTilingType - ignoring pattern: "${reason}".`);
  30293. return;
  30294. }
  30295. throw reason;
  30296. });
  30297. }
  30298. async handleSetFont(resources, fontArgs, fontRef, operatorList, task, state, fallbackFontDict = null, cssFontInfo = null) {
  30299. const fontName = fontArgs?.[0] instanceof Name ? fontArgs[0].name : null;
  30300. let translated = await this.loadFont(fontName, fontRef, resources, fallbackFontDict, cssFontInfo);
  30301. if (translated.font.isType3Font) {
  30302. try {
  30303. await translated.loadType3Data(this, resources, task);
  30304. operatorList.addDependencies(translated.type3Dependencies);
  30305. } catch (reason) {
  30306. translated = new TranslatedFont({
  30307. loadedName: "g_font_error",
  30308. font: new ErrorFont(`Type3 font load error: ${reason}`),
  30309. dict: translated.font,
  30310. evaluatorOptions: this.options
  30311. });
  30312. }
  30313. }
  30314. state.font = translated.font;
  30315. translated.send(this.handler);
  30316. return translated.loadedName;
  30317. }
  30318. handleText(chars, state) {
  30319. const font = state.font;
  30320. const glyphs = font.charsToGlyphs(chars);
  30321. if (font.data) {
  30322. const isAddToPathSet = !!(state.textRenderingMode & TextRenderingMode.ADD_TO_PATH_FLAG);
  30323. if (isAddToPathSet || state.fillColorSpace.name === "Pattern" || font.disableFontFace || this.options.disableFontFace) {
  30324. PartialEvaluator.buildFontPaths(font, glyphs, this.handler, this.options);
  30325. }
  30326. }
  30327. return glyphs;
  30328. }
  30329. ensureStateFont(state) {
  30330. if (state.font) {
  30331. return;
  30332. }
  30333. const reason = new FormatError("Missing setFont (Tf) operator before text rendering operator.");
  30334. if (this.options.ignoreErrors) {
  30335. warn(`ensureStateFont: "${reason}".`);
  30336. return;
  30337. }
  30338. throw reason;
  30339. }
  30340. async setGState({
  30341. resources,
  30342. gState,
  30343. operatorList,
  30344. cacheKey,
  30345. task,
  30346. stateManager,
  30347. localGStateCache,
  30348. localColorSpaceCache
  30349. }) {
  30350. const gStateRef = gState.objId;
  30351. let isSimpleGState = true;
  30352. const gStateObj = [];
  30353. let promise = Promise.resolve();
  30354. for (const key of gState.getKeys()) {
  30355. const value = gState.get(key);
  30356. switch (key) {
  30357. case "Type":
  30358. break;
  30359. case "LW":
  30360. case "LC":
  30361. case "LJ":
  30362. case "ML":
  30363. case "D":
  30364. case "RI":
  30365. case "FL":
  30366. case "CA":
  30367. case "ca":
  30368. gStateObj.push([key, value]);
  30369. break;
  30370. case "Font":
  30371. isSimpleGState = false;
  30372. promise = promise.then(() => this.handleSetFont(resources, null, value[0], operatorList, task, stateManager.state).then(function (loadedName) {
  30373. operatorList.addDependency(loadedName);
  30374. gStateObj.push([key, [loadedName, value[1]]]);
  30375. }));
  30376. break;
  30377. case "BM":
  30378. gStateObj.push([key, normalizeBlendMode(value)]);
  30379. break;
  30380. case "SMask":
  30381. if (isName(value, "None")) {
  30382. gStateObj.push([key, false]);
  30383. break;
  30384. }
  30385. if (value instanceof Dict) {
  30386. isSimpleGState = false;
  30387. promise = promise.then(() => this.handleSMask(value, resources, operatorList, task, stateManager, localColorSpaceCache));
  30388. gStateObj.push([key, true]);
  30389. } else {
  30390. warn("Unsupported SMask type");
  30391. }
  30392. break;
  30393. case "TR":
  30394. const transferMaps = this.handleTransferFunction(value);
  30395. gStateObj.push([key, transferMaps]);
  30396. break;
  30397. case "OP":
  30398. case "op":
  30399. case "OPM":
  30400. case "BG":
  30401. case "BG2":
  30402. case "UCR":
  30403. case "UCR2":
  30404. case "TR2":
  30405. case "HT":
  30406. case "SM":
  30407. case "SA":
  30408. case "AIS":
  30409. case "TK":
  30410. info("graphic state operator " + key);
  30411. break;
  30412. default:
  30413. info("Unknown graphic state operator " + key);
  30414. break;
  30415. }
  30416. }
  30417. await promise;
  30418. if (gStateObj.length > 0) {
  30419. operatorList.addOp(OPS.setGState, [gStateObj]);
  30420. }
  30421. if (isSimpleGState) {
  30422. localGStateCache.set(cacheKey, gStateRef, gStateObj);
  30423. }
  30424. }
  30425. loadFont(fontName, font, resources, fallbackFontDict = null, cssFontInfo = null) {
  30426. const errorFont = async () => {
  30427. return new TranslatedFont({
  30428. loadedName: "g_font_error",
  30429. font: new ErrorFont(`Font "${fontName}" is not available.`),
  30430. dict: font,
  30431. evaluatorOptions: this.options
  30432. });
  30433. };
  30434. let fontRef;
  30435. if (font) {
  30436. if (font instanceof Ref) {
  30437. fontRef = font;
  30438. }
  30439. } else {
  30440. const fontRes = resources.get("Font");
  30441. if (fontRes) {
  30442. fontRef = fontRes.getRaw(fontName);
  30443. }
  30444. }
  30445. if (fontRef) {
  30446. if (this.type3FontRefs?.has(fontRef)) {
  30447. return errorFont();
  30448. }
  30449. if (this.fontCache.has(fontRef)) {
  30450. return this.fontCache.get(fontRef);
  30451. }
  30452. try {
  30453. font = this.xref.fetchIfRef(fontRef);
  30454. } catch (ex) {
  30455. warn(`loadFont - lookup failed: "${ex}".`);
  30456. }
  30457. }
  30458. if (!(font instanceof Dict)) {
  30459. if (!this.options.ignoreErrors && !this.parsingType3Font) {
  30460. warn(`Font "${fontName}" is not available.`);
  30461. return errorFont();
  30462. }
  30463. warn(`Font "${fontName}" is not available -- attempting to fallback to a default font.`);
  30464. font = fallbackFontDict || PartialEvaluator.fallbackFontDict;
  30465. }
  30466. if (font.cacheKey && this.fontCache.has(font.cacheKey)) {
  30467. return this.fontCache.get(font.cacheKey);
  30468. }
  30469. const {
  30470. promise,
  30471. resolve
  30472. } = Promise.withResolvers();
  30473. let preEvaluatedFont;
  30474. try {
  30475. preEvaluatedFont = this.preEvaluateFont(font);
  30476. preEvaluatedFont.cssFontInfo = cssFontInfo;
  30477. } catch (reason) {
  30478. warn(`loadFont - preEvaluateFont failed: "${reason}".`);
  30479. return errorFont();
  30480. }
  30481. const {
  30482. descriptor,
  30483. hash
  30484. } = preEvaluatedFont;
  30485. const fontRefIsRef = fontRef instanceof Ref;
  30486. let fontID;
  30487. if (hash && descriptor instanceof Dict) {
  30488. const fontAliases = descriptor.fontAliases ||= Object.create(null);
  30489. if (fontAliases[hash]) {
  30490. const aliasFontRef = fontAliases[hash].aliasRef;
  30491. if (fontRefIsRef && aliasFontRef && this.fontCache.has(aliasFontRef)) {
  30492. this.fontCache.putAlias(fontRef, aliasFontRef);
  30493. return this.fontCache.get(fontRef);
  30494. }
  30495. } else {
  30496. fontAliases[hash] = {
  30497. fontID: this.idFactory.createFontId()
  30498. };
  30499. }
  30500. if (fontRefIsRef) {
  30501. fontAliases[hash].aliasRef = fontRef;
  30502. }
  30503. fontID = fontAliases[hash].fontID;
  30504. } else {
  30505. fontID = this.idFactory.createFontId();
  30506. }
  30507. assert(fontID?.startsWith("f"), 'The "fontID" must be (correctly) defined.');
  30508. if (fontRefIsRef) {
  30509. this.fontCache.put(fontRef, promise);
  30510. } else {
  30511. font.cacheKey = `cacheKey_${fontID}`;
  30512. this.fontCache.put(font.cacheKey, promise);
  30513. }
  30514. font.loadedName = `${this.idFactory.getDocId()}_${fontID}`;
  30515. this.translateFont(preEvaluatedFont).then(translatedFont => {
  30516. resolve(new TranslatedFont({
  30517. loadedName: font.loadedName,
  30518. font: translatedFont,
  30519. dict: font,
  30520. evaluatorOptions: this.options
  30521. }));
  30522. }).catch(reason => {
  30523. warn(`loadFont - translateFont failed: "${reason}".`);
  30524. resolve(new TranslatedFont({
  30525. loadedName: font.loadedName,
  30526. font: new ErrorFont(reason instanceof Error ? reason.message : reason),
  30527. dict: font,
  30528. evaluatorOptions: this.options
  30529. }));
  30530. });
  30531. return promise;
  30532. }
  30533. buildPath(operatorList, fn, args, parsingText = false) {
  30534. const lastIndex = operatorList.length - 1;
  30535. if (!args) {
  30536. args = [];
  30537. }
  30538. if (lastIndex < 0 || operatorList.fnArray[lastIndex] !== OPS.constructPath) {
  30539. if (parsingText) {
  30540. warn(`Encountered path operator "${fn}" inside of a text object.`);
  30541. operatorList.addOp(OPS.save, null);
  30542. }
  30543. let minMax;
  30544. switch (fn) {
  30545. case OPS.rectangle:
  30546. const x = args[0] + args[2];
  30547. const y = args[1] + args[3];
  30548. minMax = [Math.min(args[0], x), Math.min(args[1], y), Math.max(args[0], x), Math.max(args[1], y)];
  30549. break;
  30550. case OPS.moveTo:
  30551. case OPS.lineTo:
  30552. minMax = [args[0], args[1], args[0], args[1]];
  30553. break;
  30554. default:
  30555. minMax = [Infinity, Infinity, -Infinity, -Infinity];
  30556. break;
  30557. }
  30558. operatorList.addOp(OPS.constructPath, [[fn], args, minMax]);
  30559. if (parsingText) {
  30560. operatorList.addOp(OPS.restore, null);
  30561. }
  30562. } else {
  30563. const opArgs = operatorList.argsArray[lastIndex];
  30564. opArgs[0].push(fn);
  30565. opArgs[1].push(...args);
  30566. const minMax = opArgs[2];
  30567. switch (fn) {
  30568. case OPS.rectangle:
  30569. const x = args[0] + args[2];
  30570. const y = args[1] + args[3];
  30571. minMax[0] = Math.min(minMax[0], args[0], x);
  30572. minMax[1] = Math.min(minMax[1], args[1], y);
  30573. minMax[2] = Math.max(minMax[2], args[0], x);
  30574. minMax[3] = Math.max(minMax[3], args[1], y);
  30575. break;
  30576. case OPS.moveTo:
  30577. case OPS.lineTo:
  30578. minMax[0] = Math.min(minMax[0], args[0]);
  30579. minMax[1] = Math.min(minMax[1], args[1]);
  30580. minMax[2] = Math.max(minMax[2], args[0]);
  30581. minMax[3] = Math.max(minMax[3], args[1]);
  30582. break;
  30583. }
  30584. }
  30585. }
  30586. parseColorSpace({
  30587. cs,
  30588. resources,
  30589. localColorSpaceCache
  30590. }) {
  30591. return ColorSpace.parseAsync({
  30592. cs,
  30593. xref: this.xref,
  30594. resources,
  30595. pdfFunctionFactory: this._pdfFunctionFactory,
  30596. localColorSpaceCache
  30597. }).catch(reason => {
  30598. if (reason instanceof AbortException) {
  30599. return null;
  30600. }
  30601. if (this.options.ignoreErrors) {
  30602. warn(`parseColorSpace - ignoring ColorSpace: "${reason}".`);
  30603. return null;
  30604. }
  30605. throw reason;
  30606. });
  30607. }
  30608. parseShading({
  30609. shading,
  30610. resources,
  30611. localColorSpaceCache,
  30612. localShadingPatternCache
  30613. }) {
  30614. let id = localShadingPatternCache.get(shading);
  30615. if (id) {
  30616. return id;
  30617. }
  30618. let patternIR;
  30619. try {
  30620. const shadingFill = Pattern.parseShading(shading, this.xref, resources, this._pdfFunctionFactory, localColorSpaceCache);
  30621. patternIR = shadingFill.getIR();
  30622. } catch (reason) {
  30623. if (reason instanceof AbortException) {
  30624. return null;
  30625. }
  30626. if (this.options.ignoreErrors) {
  30627. warn(`parseShading - ignoring shading: "${reason}".`);
  30628. localShadingPatternCache.set(shading, null);
  30629. return null;
  30630. }
  30631. throw reason;
  30632. }
  30633. id = `pattern_${this.idFactory.createObjId()}`;
  30634. if (this.parsingType3Font) {
  30635. id = `${this.idFactory.getDocId()}_type3_${id}`;
  30636. }
  30637. localShadingPatternCache.set(shading, id);
  30638. if (this.parsingType3Font) {
  30639. this.handler.send("commonobj", [id, "Pattern", patternIR]);
  30640. } else {
  30641. this.handler.send("obj", [id, this.pageIndex, "Pattern", patternIR]);
  30642. }
  30643. return id;
  30644. }
  30645. handleColorN(operatorList, fn, args, cs, patterns, resources, task, localColorSpaceCache, localTilingPatternCache, localShadingPatternCache) {
  30646. const patternName = args.pop();
  30647. if (patternName instanceof Name) {
  30648. const rawPattern = patterns.getRaw(patternName.name);
  30649. const localTilingPattern = rawPattern instanceof Ref && localTilingPatternCache.getByRef(rawPattern);
  30650. if (localTilingPattern) {
  30651. try {
  30652. const color = cs.base ? cs.base.getRgb(args, 0) : null;
  30653. const tilingPatternIR = getTilingPatternIR(localTilingPattern.operatorListIR, localTilingPattern.dict, color);
  30654. operatorList.addOp(fn, tilingPatternIR);
  30655. return undefined;
  30656. } catch {}
  30657. }
  30658. const pattern = this.xref.fetchIfRef(rawPattern);
  30659. if (pattern) {
  30660. const dict = pattern instanceof BaseStream ? pattern.dict : pattern;
  30661. const typeNum = dict.get("PatternType");
  30662. if (typeNum === PatternType.TILING) {
  30663. const color = cs.base ? cs.base.getRgb(args, 0) : null;
  30664. return this.handleTilingType(fn, color, resources, pattern, dict, operatorList, task, localTilingPatternCache);
  30665. } else if (typeNum === PatternType.SHADING) {
  30666. const shading = dict.get("Shading");
  30667. const objId = this.parseShading({
  30668. shading,
  30669. resources,
  30670. localColorSpaceCache,
  30671. localShadingPatternCache
  30672. });
  30673. if (objId) {
  30674. const matrix = lookupMatrix(dict.getArray("Matrix"), null);
  30675. operatorList.addOp(fn, ["Shading", objId, matrix]);
  30676. }
  30677. return undefined;
  30678. }
  30679. throw new FormatError(`Unknown PatternType: ${typeNum}`);
  30680. }
  30681. }
  30682. throw new FormatError(`Unknown PatternName: ${patternName}`);
  30683. }
  30684. _parseVisibilityExpression(array, nestingCounter, currentResult) {
  30685. const MAX_NESTING = 10;
  30686. if (++nestingCounter > MAX_NESTING) {
  30687. warn("Visibility expression is too deeply nested");
  30688. return;
  30689. }
  30690. const length = array.length;
  30691. const operator = this.xref.fetchIfRef(array[0]);
  30692. if (length < 2 || !(operator instanceof Name)) {
  30693. warn("Invalid visibility expression");
  30694. return;
  30695. }
  30696. switch (operator.name) {
  30697. case "And":
  30698. case "Or":
  30699. case "Not":
  30700. currentResult.push(operator.name);
  30701. break;
  30702. default:
  30703. warn(`Invalid operator ${operator.name} in visibility expression`);
  30704. return;
  30705. }
  30706. for (let i = 1; i < length; i++) {
  30707. const raw = array[i];
  30708. const object = this.xref.fetchIfRef(raw);
  30709. if (Array.isArray(object)) {
  30710. const nestedResult = [];
  30711. currentResult.push(nestedResult);
  30712. this._parseVisibilityExpression(object, nestingCounter, nestedResult);
  30713. } else if (raw instanceof Ref) {
  30714. currentResult.push(raw.toString());
  30715. }
  30716. }
  30717. }
  30718. async parseMarkedContentProps(contentProperties, resources) {
  30719. let optionalContent;
  30720. if (contentProperties instanceof Name) {
  30721. const properties = resources.get("Properties");
  30722. optionalContent = properties.get(contentProperties.name);
  30723. } else if (contentProperties instanceof Dict) {
  30724. optionalContent = contentProperties;
  30725. } else {
  30726. throw new FormatError("Optional content properties malformed.");
  30727. }
  30728. const optionalContentType = optionalContent.get("Type")?.name;
  30729. if (optionalContentType === "OCG") {
  30730. return {
  30731. type: optionalContentType,
  30732. id: optionalContent.objId
  30733. };
  30734. } else if (optionalContentType === "OCMD") {
  30735. const expression = optionalContent.get("VE");
  30736. if (Array.isArray(expression)) {
  30737. const result = [];
  30738. this._parseVisibilityExpression(expression, 0, result);
  30739. if (result.length > 0) {
  30740. return {
  30741. type: "OCMD",
  30742. expression: result
  30743. };
  30744. }
  30745. }
  30746. const optionalContentGroups = optionalContent.get("OCGs");
  30747. if (Array.isArray(optionalContentGroups) || optionalContentGroups instanceof Dict) {
  30748. const groupIds = [];
  30749. if (Array.isArray(optionalContentGroups)) {
  30750. for (const ocg of optionalContentGroups) {
  30751. groupIds.push(ocg.toString());
  30752. }
  30753. } else {
  30754. groupIds.push(optionalContentGroups.objId);
  30755. }
  30756. return {
  30757. type: optionalContentType,
  30758. ids: groupIds,
  30759. policy: optionalContent.get("P") instanceof Name ? optionalContent.get("P").name : null,
  30760. expression: null
  30761. };
  30762. } else if (optionalContentGroups instanceof Ref) {
  30763. return {
  30764. type: optionalContentType,
  30765. id: optionalContentGroups.toString()
  30766. };
  30767. }
  30768. }
  30769. return null;
  30770. }
  30771. getOperatorList({
  30772. stream,
  30773. task,
  30774. resources,
  30775. operatorList,
  30776. initialState = null,
  30777. fallbackFontDict = null
  30778. }) {
  30779. resources ||= Dict.empty;
  30780. initialState ||= new EvalState();
  30781. if (!operatorList) {
  30782. throw new Error('getOperatorList: missing "operatorList" parameter');
  30783. }
  30784. const self = this;
  30785. const xref = this.xref;
  30786. let parsingText = false;
  30787. const localImageCache = new LocalImageCache();
  30788. const localColorSpaceCache = new LocalColorSpaceCache();
  30789. const localGStateCache = new LocalGStateCache();
  30790. const localTilingPatternCache = new LocalTilingPatternCache();
  30791. const localShadingPatternCache = new Map();
  30792. const xobjs = resources.get("XObject") || Dict.empty;
  30793. const patterns = resources.get("Pattern") || Dict.empty;
  30794. const stateManager = new StateManager(initialState);
  30795. const preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager);
  30796. const timeSlotManager = new TimeSlotManager();
  30797. function closePendingRestoreOPS(argument) {
  30798. for (let i = 0, ii = preprocessor.savedStatesDepth; i < ii; i++) {
  30799. operatorList.addOp(OPS.restore, []);
  30800. }
  30801. }
  30802. return new Promise(function promiseBody(resolve, reject) {
  30803. const next = function (promise) {
  30804. Promise.all([promise, operatorList.ready]).then(function () {
  30805. try {
  30806. promiseBody(resolve, reject);
  30807. } catch (ex) {
  30808. reject(ex);
  30809. }
  30810. }, reject);
  30811. };
  30812. task.ensureNotTerminated();
  30813. timeSlotManager.reset();
  30814. const operation = {};
  30815. let stop, i, ii, cs, name, isValidName;
  30816. while (!(stop = timeSlotManager.check())) {
  30817. operation.args = null;
  30818. if (!preprocessor.read(operation)) {
  30819. break;
  30820. }
  30821. let args = operation.args;
  30822. let fn = operation.fn;
  30823. switch (fn | 0) {
  30824. case OPS.paintXObject:
  30825. isValidName = args[0] instanceof Name;
  30826. name = args[0].name;
  30827. if (isValidName) {
  30828. const localImage = localImageCache.getByName(name);
  30829. if (localImage) {
  30830. addLocallyCachedImageOps(operatorList, localImage);
  30831. args = null;
  30832. continue;
  30833. }
  30834. }
  30835. next(new Promise(function (resolveXObject, rejectXObject) {
  30836. if (!isValidName) {
  30837. throw new FormatError("XObject must be referred to by name.");
  30838. }
  30839. let xobj = xobjs.getRaw(name);
  30840. if (xobj instanceof Ref) {
  30841. const localImage = localImageCache.getByRef(xobj) || self._regionalImageCache.getByRef(xobj);
  30842. if (localImage) {
  30843. addLocallyCachedImageOps(operatorList, localImage);
  30844. resolveXObject();
  30845. return;
  30846. }
  30847. const globalImage = self.globalImageCache.getData(xobj, self.pageIndex);
  30848. if (globalImage) {
  30849. operatorList.addDependency(globalImage.objId);
  30850. operatorList.addImageOps(globalImage.fn, globalImage.args, globalImage.optionalContent);
  30851. resolveXObject();
  30852. return;
  30853. }
  30854. xobj = xref.fetch(xobj);
  30855. }
  30856. if (!(xobj instanceof BaseStream)) {
  30857. throw new FormatError("XObject should be a stream");
  30858. }
  30859. const type = xobj.dict.get("Subtype");
  30860. if (!(type instanceof Name)) {
  30861. throw new FormatError("XObject should have a Name subtype");
  30862. }
  30863. if (type.name === "Form") {
  30864. stateManager.save();
  30865. self.buildFormXObject(resources, xobj, null, operatorList, task, stateManager.state.clone(), localColorSpaceCache).then(function () {
  30866. stateManager.restore();
  30867. resolveXObject();
  30868. }, rejectXObject);
  30869. return;
  30870. } else if (type.name === "Image") {
  30871. self.buildPaintImageXObject({
  30872. resources,
  30873. image: xobj,
  30874. operatorList,
  30875. cacheKey: name,
  30876. localImageCache,
  30877. localColorSpaceCache
  30878. }).then(resolveXObject, rejectXObject);
  30879. return;
  30880. } else if (type.name === "PS") {
  30881. info("Ignored XObject subtype PS");
  30882. } else {
  30883. throw new FormatError(`Unhandled XObject subtype ${type.name}`);
  30884. }
  30885. resolveXObject();
  30886. }).catch(function (reason) {
  30887. if (reason instanceof AbortException) {
  30888. return;
  30889. }
  30890. if (self.options.ignoreErrors) {
  30891. warn(`getOperatorList - ignoring XObject: "${reason}".`);
  30892. return;
  30893. }
  30894. throw reason;
  30895. }));
  30896. return;
  30897. case OPS.setFont:
  30898. var fontSize = args[1];
  30899. next(self.handleSetFont(resources, args, null, operatorList, task, stateManager.state, fallbackFontDict).then(function (loadedName) {
  30900. operatorList.addDependency(loadedName);
  30901. operatorList.addOp(OPS.setFont, [loadedName, fontSize]);
  30902. }));
  30903. return;
  30904. case OPS.beginText:
  30905. parsingText = true;
  30906. break;
  30907. case OPS.endText:
  30908. parsingText = false;
  30909. break;
  30910. case OPS.endInlineImage:
  30911. var cacheKey = args[0].cacheKey;
  30912. if (cacheKey) {
  30913. const localImage = localImageCache.getByName(cacheKey);
  30914. if (localImage) {
  30915. addLocallyCachedImageOps(operatorList, localImage);
  30916. args = null;
  30917. continue;
  30918. }
  30919. }
  30920. next(self.buildPaintImageXObject({
  30921. resources,
  30922. image: args[0],
  30923. isInline: true,
  30924. operatorList,
  30925. cacheKey,
  30926. localImageCache,
  30927. localColorSpaceCache
  30928. }));
  30929. return;
  30930. case OPS.showText:
  30931. if (!stateManager.state.font) {
  30932. self.ensureStateFont(stateManager.state);
  30933. continue;
  30934. }
  30935. args[0] = self.handleText(args[0], stateManager.state);
  30936. break;
  30937. case OPS.showSpacedText:
  30938. if (!stateManager.state.font) {
  30939. self.ensureStateFont(stateManager.state);
  30940. continue;
  30941. }
  30942. var combinedGlyphs = [];
  30943. var state = stateManager.state;
  30944. for (const arrItem of args[0]) {
  30945. if (typeof arrItem === "string") {
  30946. combinedGlyphs.push(...self.handleText(arrItem, state));
  30947. } else if (typeof arrItem === "number") {
  30948. combinedGlyphs.push(arrItem);
  30949. }
  30950. }
  30951. args[0] = combinedGlyphs;
  30952. fn = OPS.showText;
  30953. break;
  30954. case OPS.nextLineShowText:
  30955. if (!stateManager.state.font) {
  30956. self.ensureStateFont(stateManager.state);
  30957. continue;
  30958. }
  30959. operatorList.addOp(OPS.nextLine);
  30960. args[0] = self.handleText(args[0], stateManager.state);
  30961. fn = OPS.showText;
  30962. break;
  30963. case OPS.nextLineSetSpacingShowText:
  30964. if (!stateManager.state.font) {
  30965. self.ensureStateFont(stateManager.state);
  30966. continue;
  30967. }
  30968. operatorList.addOp(OPS.nextLine);
  30969. operatorList.addOp(OPS.setWordSpacing, [args.shift()]);
  30970. operatorList.addOp(OPS.setCharSpacing, [args.shift()]);
  30971. args[0] = self.handleText(args[0], stateManager.state);
  30972. fn = OPS.showText;
  30973. break;
  30974. case OPS.setTextRenderingMode:
  30975. stateManager.state.textRenderingMode = args[0];
  30976. break;
  30977. case OPS.setFillColorSpace:
  30978. {
  30979. const cachedColorSpace = ColorSpace.getCached(args[0], xref, localColorSpaceCache);
  30980. if (cachedColorSpace) {
  30981. stateManager.state.fillColorSpace = cachedColorSpace;
  30982. continue;
  30983. }
  30984. next(self.parseColorSpace({
  30985. cs: args[0],
  30986. resources,
  30987. localColorSpaceCache
  30988. }).then(function (colorSpace) {
  30989. stateManager.state.fillColorSpace = colorSpace || ColorSpace.singletons.gray;
  30990. }));
  30991. return;
  30992. }
  30993. case OPS.setStrokeColorSpace:
  30994. {
  30995. const cachedColorSpace = ColorSpace.getCached(args[0], xref, localColorSpaceCache);
  30996. if (cachedColorSpace) {
  30997. stateManager.state.strokeColorSpace = cachedColorSpace;
  30998. continue;
  30999. }
  31000. next(self.parseColorSpace({
  31001. cs: args[0],
  31002. resources,
  31003. localColorSpaceCache
  31004. }).then(function (colorSpace) {
  31005. stateManager.state.strokeColorSpace = colorSpace || ColorSpace.singletons.gray;
  31006. }));
  31007. return;
  31008. }
  31009. case OPS.setFillColor:
  31010. cs = stateManager.state.fillColorSpace;
  31011. args = cs.getRgb(args, 0);
  31012. fn = OPS.setFillRGBColor;
  31013. break;
  31014. case OPS.setStrokeColor:
  31015. cs = stateManager.state.strokeColorSpace;
  31016. args = cs.getRgb(args, 0);
  31017. fn = OPS.setStrokeRGBColor;
  31018. break;
  31019. case OPS.setFillGray:
  31020. stateManager.state.fillColorSpace = ColorSpace.singletons.gray;
  31021. args = ColorSpace.singletons.gray.getRgb(args, 0);
  31022. fn = OPS.setFillRGBColor;
  31023. break;
  31024. case OPS.setStrokeGray:
  31025. stateManager.state.strokeColorSpace = ColorSpace.singletons.gray;
  31026. args = ColorSpace.singletons.gray.getRgb(args, 0);
  31027. fn = OPS.setStrokeRGBColor;
  31028. break;
  31029. case OPS.setFillCMYKColor:
  31030. stateManager.state.fillColorSpace = ColorSpace.singletons.cmyk;
  31031. args = ColorSpace.singletons.cmyk.getRgb(args, 0);
  31032. fn = OPS.setFillRGBColor;
  31033. break;
  31034. case OPS.setStrokeCMYKColor:
  31035. stateManager.state.strokeColorSpace = ColorSpace.singletons.cmyk;
  31036. args = ColorSpace.singletons.cmyk.getRgb(args, 0);
  31037. fn = OPS.setStrokeRGBColor;
  31038. break;
  31039. case OPS.setFillRGBColor:
  31040. stateManager.state.fillColorSpace = ColorSpace.singletons.rgb;
  31041. args = ColorSpace.singletons.rgb.getRgb(args, 0);
  31042. break;
  31043. case OPS.setStrokeRGBColor:
  31044. stateManager.state.strokeColorSpace = ColorSpace.singletons.rgb;
  31045. args = ColorSpace.singletons.rgb.getRgb(args, 0);
  31046. break;
  31047. case OPS.setFillColorN:
  31048. cs = stateManager.state.patternFillColorSpace;
  31049. if (!cs) {
  31050. args = [];
  31051. fn = OPS.setFillTransparent;
  31052. break;
  31053. }
  31054. if (cs.name === "Pattern") {
  31055. next(self.handleColorN(operatorList, OPS.setFillColorN, args, cs, patterns, resources, task, localColorSpaceCache, localTilingPatternCache, localShadingPatternCache));
  31056. return;
  31057. }
  31058. args = cs.getRgb(args, 0);
  31059. fn = OPS.setFillRGBColor;
  31060. break;
  31061. case OPS.setStrokeColorN:
  31062. cs = stateManager.state.patternStrokeColorSpace;
  31063. if (!cs) {
  31064. args = [];
  31065. fn = OPS.setStrokeTransparent;
  31066. break;
  31067. }
  31068. if (cs.name === "Pattern") {
  31069. next(self.handleColorN(operatorList, OPS.setStrokeColorN, args, cs, patterns, resources, task, localColorSpaceCache, localTilingPatternCache, localShadingPatternCache));
  31070. return;
  31071. }
  31072. args = cs.getRgb(args, 0);
  31073. fn = OPS.setStrokeRGBColor;
  31074. break;
  31075. case OPS.shadingFill:
  31076. var shadingRes = resources.get("Shading");
  31077. if (!shadingRes) {
  31078. throw new FormatError("No shading resource found");
  31079. }
  31080. var shading = shadingRes.get(args[0].name);
  31081. if (!shading) {
  31082. throw new FormatError("No shading object found");
  31083. }
  31084. const patternId = self.parseShading({
  31085. shading,
  31086. resources,
  31087. localColorSpaceCache,
  31088. localShadingPatternCache
  31089. });
  31090. if (!patternId) {
  31091. continue;
  31092. }
  31093. args = [patternId];
  31094. fn = OPS.shadingFill;
  31095. break;
  31096. case OPS.setGState:
  31097. isValidName = args[0] instanceof Name;
  31098. name = args[0].name;
  31099. if (isValidName) {
  31100. const localGStateObj = localGStateCache.getByName(name);
  31101. if (localGStateObj) {
  31102. if (localGStateObj.length > 0) {
  31103. operatorList.addOp(OPS.setGState, [localGStateObj]);
  31104. }
  31105. args = null;
  31106. continue;
  31107. }
  31108. }
  31109. next(new Promise(function (resolveGState, rejectGState) {
  31110. if (!isValidName) {
  31111. throw new FormatError("GState must be referred to by name.");
  31112. }
  31113. const extGState = resources.get("ExtGState");
  31114. if (!(extGState instanceof Dict)) {
  31115. throw new FormatError("ExtGState should be a dictionary.");
  31116. }
  31117. const gState = extGState.get(name);
  31118. if (!(gState instanceof Dict)) {
  31119. throw new FormatError("GState should be a dictionary.");
  31120. }
  31121. self.setGState({
  31122. resources,
  31123. gState,
  31124. operatorList,
  31125. cacheKey: name,
  31126. task,
  31127. stateManager,
  31128. localGStateCache,
  31129. localColorSpaceCache
  31130. }).then(resolveGState, rejectGState);
  31131. }).catch(function (reason) {
  31132. if (reason instanceof AbortException) {
  31133. return;
  31134. }
  31135. if (self.options.ignoreErrors) {
  31136. warn(`getOperatorList - ignoring ExtGState: "${reason}".`);
  31137. return;
  31138. }
  31139. throw reason;
  31140. }));
  31141. return;
  31142. case OPS.moveTo:
  31143. case OPS.lineTo:
  31144. case OPS.curveTo:
  31145. case OPS.curveTo2:
  31146. case OPS.curveTo3:
  31147. case OPS.closePath:
  31148. case OPS.rectangle:
  31149. self.buildPath(operatorList, fn, args, parsingText);
  31150. continue;
  31151. case OPS.markPoint:
  31152. case OPS.markPointProps:
  31153. case OPS.beginCompat:
  31154. case OPS.endCompat:
  31155. continue;
  31156. case OPS.beginMarkedContentProps:
  31157. if (!(args[0] instanceof Name)) {
  31158. warn(`Expected name for beginMarkedContentProps arg0=${args[0]}`);
  31159. operatorList.addOp(OPS.beginMarkedContentProps, ["OC", null]);
  31160. continue;
  31161. }
  31162. if (args[0].name === "OC") {
  31163. next(self.parseMarkedContentProps(args[1], resources).then(data => {
  31164. operatorList.addOp(OPS.beginMarkedContentProps, ["OC", data]);
  31165. }).catch(reason => {
  31166. if (reason instanceof AbortException) {
  31167. return;
  31168. }
  31169. if (self.options.ignoreErrors) {
  31170. warn(`getOperatorList - ignoring beginMarkedContentProps: "${reason}".`);
  31171. operatorList.addOp(OPS.beginMarkedContentProps, ["OC", null]);
  31172. return;
  31173. }
  31174. throw reason;
  31175. }));
  31176. return;
  31177. }
  31178. args = [args[0].name, args[1] instanceof Dict ? args[1].get("MCID") : null];
  31179. break;
  31180. case OPS.beginMarkedContent:
  31181. case OPS.endMarkedContent:
  31182. default:
  31183. if (args !== null) {
  31184. for (i = 0, ii = args.length; i < ii; i++) {
  31185. if (args[i] instanceof Dict) {
  31186. break;
  31187. }
  31188. }
  31189. if (i < ii) {
  31190. warn("getOperatorList - ignoring operator: " + fn);
  31191. continue;
  31192. }
  31193. }
  31194. }
  31195. operatorList.addOp(fn, args);
  31196. }
  31197. if (stop) {
  31198. next(deferred);
  31199. return;
  31200. }
  31201. closePendingRestoreOPS();
  31202. resolve();
  31203. }).catch(reason => {
  31204. if (reason instanceof AbortException) {
  31205. return;
  31206. }
  31207. if (this.options.ignoreErrors) {
  31208. warn(`getOperatorList - ignoring errors during "${task.name}" ` + `task: "${reason}".`);
  31209. closePendingRestoreOPS();
  31210. return;
  31211. }
  31212. throw reason;
  31213. });
  31214. }
  31215. getTextContent({
  31216. stream,
  31217. task,
  31218. resources,
  31219. stateManager = null,
  31220. includeMarkedContent = false,
  31221. sink,
  31222. seenStyles = new Set(),
  31223. viewBox,
  31224. lang = null,
  31225. markedContentData = null,
  31226. disableNormalization = false,
  31227. keepWhiteSpace = false
  31228. }) {
  31229. resources ||= Dict.empty;
  31230. stateManager ||= new StateManager(new TextState());
  31231. if (includeMarkedContent) {
  31232. markedContentData ||= {
  31233. level: 0
  31234. };
  31235. }
  31236. const textContent = {
  31237. items: [],
  31238. styles: Object.create(null),
  31239. lang
  31240. };
  31241. const textContentItem = {
  31242. initialized: false,
  31243. str: [],
  31244. totalWidth: 0,
  31245. totalHeight: 0,
  31246. width: 0,
  31247. height: 0,
  31248. vertical: false,
  31249. prevTransform: null,
  31250. textAdvanceScale: 0,
  31251. spaceInFlowMin: 0,
  31252. spaceInFlowMax: 0,
  31253. trackingSpaceMin: Infinity,
  31254. negativeSpaceMax: -Infinity,
  31255. notASpace: -Infinity,
  31256. transform: null,
  31257. fontName: null,
  31258. hasEOL: false
  31259. };
  31260. const twoLastChars = [" ", " "];
  31261. let twoLastCharsPos = 0;
  31262. function saveLastChar(char) {
  31263. const nextPos = (twoLastCharsPos + 1) % 2;
  31264. const ret = twoLastChars[twoLastCharsPos] !== " " && twoLastChars[nextPos] === " ";
  31265. twoLastChars[twoLastCharsPos] = char;
  31266. twoLastCharsPos = nextPos;
  31267. return !keepWhiteSpace && ret;
  31268. }
  31269. function shouldAddWhitepsace() {
  31270. return !keepWhiteSpace && twoLastChars[twoLastCharsPos] !== " " && twoLastChars[(twoLastCharsPos + 1) % 2] === " ";
  31271. }
  31272. function resetLastChars() {
  31273. twoLastChars[0] = twoLastChars[1] = " ";
  31274. twoLastCharsPos = 0;
  31275. }
  31276. const TRACKING_SPACE_FACTOR = 0.102;
  31277. const NOT_A_SPACE_FACTOR = 0.03;
  31278. const NEGATIVE_SPACE_FACTOR = -0.2;
  31279. const SPACE_IN_FLOW_MIN_FACTOR = 0.102;
  31280. const SPACE_IN_FLOW_MAX_FACTOR = 0.6;
  31281. const VERTICAL_SHIFT_RATIO = 0.25;
  31282. const self = this;
  31283. const xref = this.xref;
  31284. const showSpacedTextBuffer = [];
  31285. let xobjs = null;
  31286. const emptyXObjectCache = new LocalImageCache();
  31287. const emptyGStateCache = new LocalGStateCache();
  31288. const preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager);
  31289. let textState;
  31290. function pushWhitespace({
  31291. width = 0,
  31292. height = 0,
  31293. transform = textContentItem.prevTransform,
  31294. fontName = textContentItem.fontName
  31295. }) {
  31296. textContent.items.push({
  31297. str: " ",
  31298. dir: "ltr",
  31299. width,
  31300. height,
  31301. transform,
  31302. fontName,
  31303. hasEOL: false
  31304. });
  31305. }
  31306. function getCurrentTextTransform() {
  31307. const font = textState.font;
  31308. const tsm = [textState.fontSize * textState.textHScale, 0, 0, textState.fontSize, 0, textState.textRise];
  31309. if (font.isType3Font && (textState.fontSize <= 1 || font.isCharBBox) && !isArrayEqual(textState.fontMatrix, FONT_IDENTITY_MATRIX)) {
  31310. const glyphHeight = font.bbox[3] - font.bbox[1];
  31311. if (glyphHeight > 0) {
  31312. tsm[3] *= glyphHeight * textState.fontMatrix[3];
  31313. }
  31314. }
  31315. return Util.transform(textState.ctm, Util.transform(textState.textMatrix, tsm));
  31316. }
  31317. function ensureTextContentItem() {
  31318. if (textContentItem.initialized) {
  31319. return textContentItem;
  31320. }
  31321. const {
  31322. font,
  31323. loadedName
  31324. } = textState;
  31325. if (!seenStyles.has(loadedName)) {
  31326. seenStyles.add(loadedName);
  31327. textContent.styles[loadedName] = {
  31328. fontFamily: font.fallbackName,
  31329. ascent: font.ascent,
  31330. descent: font.descent,
  31331. vertical: font.vertical
  31332. };
  31333. if (self.options.fontExtraProperties && font.systemFontInfo) {
  31334. const style = textContent.styles[loadedName];
  31335. style.fontSubstitution = font.systemFontInfo.css;
  31336. style.fontSubstitutionLoadedName = font.systemFontInfo.loadedName;
  31337. }
  31338. }
  31339. textContentItem.fontName = loadedName;
  31340. const trm = textContentItem.transform = getCurrentTextTransform();
  31341. if (!font.vertical) {
  31342. textContentItem.width = textContentItem.totalWidth = 0;
  31343. textContentItem.height = textContentItem.totalHeight = Math.hypot(trm[2], trm[3]);
  31344. textContentItem.vertical = false;
  31345. } else {
  31346. textContentItem.width = textContentItem.totalWidth = Math.hypot(trm[0], trm[1]);
  31347. textContentItem.height = textContentItem.totalHeight = 0;
  31348. textContentItem.vertical = true;
  31349. }
  31350. const scaleLineX = Math.hypot(textState.textLineMatrix[0], textState.textLineMatrix[1]);
  31351. const scaleCtmX = Math.hypot(textState.ctm[0], textState.ctm[1]);
  31352. textContentItem.textAdvanceScale = scaleCtmX * scaleLineX;
  31353. const {
  31354. fontSize
  31355. } = textState;
  31356. textContentItem.trackingSpaceMin = fontSize * TRACKING_SPACE_FACTOR;
  31357. textContentItem.notASpace = fontSize * NOT_A_SPACE_FACTOR;
  31358. textContentItem.negativeSpaceMax = fontSize * NEGATIVE_SPACE_FACTOR;
  31359. textContentItem.spaceInFlowMin = fontSize * SPACE_IN_FLOW_MIN_FACTOR;
  31360. textContentItem.spaceInFlowMax = fontSize * SPACE_IN_FLOW_MAX_FACTOR;
  31361. textContentItem.hasEOL = false;
  31362. textContentItem.initialized = true;
  31363. return textContentItem;
  31364. }
  31365. function updateAdvanceScale() {
  31366. if (!textContentItem.initialized) {
  31367. return;
  31368. }
  31369. const scaleLineX = Math.hypot(textState.textLineMatrix[0], textState.textLineMatrix[1]);
  31370. const scaleCtmX = Math.hypot(textState.ctm[0], textState.ctm[1]);
  31371. const scaleFactor = scaleCtmX * scaleLineX;
  31372. if (scaleFactor === textContentItem.textAdvanceScale) {
  31373. return;
  31374. }
  31375. if (!textContentItem.vertical) {
  31376. textContentItem.totalWidth += textContentItem.width * textContentItem.textAdvanceScale;
  31377. textContentItem.width = 0;
  31378. } else {
  31379. textContentItem.totalHeight += textContentItem.height * textContentItem.textAdvanceScale;
  31380. textContentItem.height = 0;
  31381. }
  31382. textContentItem.textAdvanceScale = scaleFactor;
  31383. }
  31384. function runBidiTransform(textChunk) {
  31385. let text = textChunk.str.join("");
  31386. if (!disableNormalization) {
  31387. text = normalizeUnicode(text);
  31388. }
  31389. const bidiResult = bidi(text, -1, textChunk.vertical);
  31390. return {
  31391. str: bidiResult.str,
  31392. dir: bidiResult.dir,
  31393. width: Math.abs(textChunk.totalWidth),
  31394. height: Math.abs(textChunk.totalHeight),
  31395. transform: textChunk.transform,
  31396. fontName: textChunk.fontName,
  31397. hasEOL: textChunk.hasEOL
  31398. };
  31399. }
  31400. async function handleSetFont(fontName, fontRef) {
  31401. const translated = await self.loadFont(fontName, fontRef, resources);
  31402. if (translated.font.isType3Font) {
  31403. try {
  31404. await translated.loadType3Data(self, resources, task);
  31405. } catch {}
  31406. }
  31407. textState.loadedName = translated.loadedName;
  31408. textState.font = translated.font;
  31409. textState.fontMatrix = translated.font.fontMatrix || FONT_IDENTITY_MATRIX;
  31410. }
  31411. function applyInverseRotation(x, y, matrix) {
  31412. const scale = Math.hypot(matrix[0], matrix[1]);
  31413. return [(matrix[0] * x + matrix[1] * y) / scale, (matrix[2] * x + matrix[3] * y) / scale];
  31414. }
  31415. function compareWithLastPosition(glyphWidth) {
  31416. const currentTransform = getCurrentTextTransform();
  31417. let posX = currentTransform[4];
  31418. let posY = currentTransform[5];
  31419. if (textState.font?.vertical) {
  31420. if (posX < viewBox[0] || posX > viewBox[2] || posY + glyphWidth < viewBox[1] || posY > viewBox[3]) {
  31421. return false;
  31422. }
  31423. } else if (posX + glyphWidth < viewBox[0] || posX > viewBox[2] || posY < viewBox[1] || posY > viewBox[3]) {
  31424. return false;
  31425. }
  31426. if (!textState.font || !textContentItem.prevTransform) {
  31427. return true;
  31428. }
  31429. let lastPosX = textContentItem.prevTransform[4];
  31430. let lastPosY = textContentItem.prevTransform[5];
  31431. if (lastPosX === posX && lastPosY === posY) {
  31432. return true;
  31433. }
  31434. let rotate = -1;
  31435. if (currentTransform[0] && currentTransform[1] === 0 && currentTransform[2] === 0) {
  31436. rotate = currentTransform[0] > 0 ? 0 : 180;
  31437. } else if (currentTransform[1] && currentTransform[0] === 0 && currentTransform[3] === 0) {
  31438. rotate = currentTransform[1] > 0 ? 90 : 270;
  31439. }
  31440. switch (rotate) {
  31441. case 0:
  31442. break;
  31443. case 90:
  31444. [posX, posY] = [posY, posX];
  31445. [lastPosX, lastPosY] = [lastPosY, lastPosX];
  31446. break;
  31447. case 180:
  31448. [posX, posY, lastPosX, lastPosY] = [-posX, -posY, -lastPosX, -lastPosY];
  31449. break;
  31450. case 270:
  31451. [posX, posY] = [-posY, -posX];
  31452. [lastPosX, lastPosY] = [-lastPosY, -lastPosX];
  31453. break;
  31454. default:
  31455. [posX, posY] = applyInverseRotation(posX, posY, currentTransform);
  31456. [lastPosX, lastPosY] = applyInverseRotation(lastPosX, lastPosY, textContentItem.prevTransform);
  31457. }
  31458. if (textState.font.vertical) {
  31459. const advanceY = (lastPosY - posY) / textContentItem.textAdvanceScale;
  31460. const advanceX = posX - lastPosX;
  31461. const textOrientation = Math.sign(textContentItem.height);
  31462. if (advanceY < textOrientation * textContentItem.negativeSpaceMax) {
  31463. if (Math.abs(advanceX) > 0.5 * textContentItem.width) {
  31464. appendEOL();
  31465. return true;
  31466. }
  31467. resetLastChars();
  31468. flushTextContentItem();
  31469. return true;
  31470. }
  31471. if (Math.abs(advanceX) > textContentItem.width) {
  31472. appendEOL();
  31473. return true;
  31474. }
  31475. if (advanceY <= textOrientation * textContentItem.notASpace) {
  31476. resetLastChars();
  31477. }
  31478. if (advanceY <= textOrientation * textContentItem.trackingSpaceMin) {
  31479. if (shouldAddWhitepsace()) {
  31480. resetLastChars();
  31481. flushTextContentItem();
  31482. pushWhitespace({
  31483. height: Math.abs(advanceY)
  31484. });
  31485. } else {
  31486. textContentItem.height += advanceY;
  31487. }
  31488. } else if (!addFakeSpaces(advanceY, textContentItem.prevTransform, textOrientation)) {
  31489. if (textContentItem.str.length === 0) {
  31490. resetLastChars();
  31491. pushWhitespace({
  31492. height: Math.abs(advanceY)
  31493. });
  31494. } else {
  31495. textContentItem.height += advanceY;
  31496. }
  31497. }
  31498. if (Math.abs(advanceX) > textContentItem.width * VERTICAL_SHIFT_RATIO) {
  31499. flushTextContentItem();
  31500. }
  31501. return true;
  31502. }
  31503. const advanceX = (posX - lastPosX) / textContentItem.textAdvanceScale;
  31504. const advanceY = posY - lastPosY;
  31505. const textOrientation = Math.sign(textContentItem.width);
  31506. if (advanceX < textOrientation * textContentItem.negativeSpaceMax) {
  31507. if (Math.abs(advanceY) > 0.5 * textContentItem.height) {
  31508. appendEOL();
  31509. return true;
  31510. }
  31511. resetLastChars();
  31512. flushTextContentItem();
  31513. return true;
  31514. }
  31515. if (Math.abs(advanceY) > textContentItem.height) {
  31516. appendEOL();
  31517. return true;
  31518. }
  31519. if (advanceX <= textOrientation * textContentItem.notASpace) {
  31520. resetLastChars();
  31521. }
  31522. if (advanceX <= textOrientation * textContentItem.trackingSpaceMin) {
  31523. if (shouldAddWhitepsace()) {
  31524. resetLastChars();
  31525. flushTextContentItem();
  31526. pushWhitespace({
  31527. width: Math.abs(advanceX)
  31528. });
  31529. } else {
  31530. textContentItem.width += advanceX;
  31531. }
  31532. } else if (!addFakeSpaces(advanceX, textContentItem.prevTransform, textOrientation)) {
  31533. if (textContentItem.str.length === 0) {
  31534. resetLastChars();
  31535. pushWhitespace({
  31536. width: Math.abs(advanceX)
  31537. });
  31538. } else {
  31539. textContentItem.width += advanceX;
  31540. }
  31541. }
  31542. if (Math.abs(advanceY) > textContentItem.height * VERTICAL_SHIFT_RATIO) {
  31543. flushTextContentItem();
  31544. }
  31545. return true;
  31546. }
  31547. function buildTextContentItem({
  31548. chars,
  31549. extraSpacing
  31550. }) {
  31551. const font = textState.font;
  31552. if (!chars) {
  31553. const charSpacing = textState.charSpacing + extraSpacing;
  31554. if (charSpacing) {
  31555. if (!font.vertical) {
  31556. textState.translateTextMatrix(charSpacing * textState.textHScale, 0);
  31557. } else {
  31558. textState.translateTextMatrix(0, -charSpacing);
  31559. }
  31560. }
  31561. if (keepWhiteSpace) {
  31562. compareWithLastPosition(0);
  31563. }
  31564. return;
  31565. }
  31566. const glyphs = font.charsToGlyphs(chars);
  31567. const scale = textState.fontMatrix[0] * textState.fontSize;
  31568. for (let i = 0, ii = glyphs.length; i < ii; i++) {
  31569. const glyph = glyphs[i];
  31570. const {
  31571. category
  31572. } = glyph;
  31573. if (category.isInvisibleFormatMark) {
  31574. continue;
  31575. }
  31576. let charSpacing = textState.charSpacing + (i + 1 === ii ? extraSpacing : 0);
  31577. let glyphWidth = glyph.width;
  31578. if (font.vertical) {
  31579. glyphWidth = glyph.vmetric ? glyph.vmetric[0] : -glyphWidth;
  31580. }
  31581. let scaledDim = glyphWidth * scale;
  31582. if (!keepWhiteSpace && category.isWhitespace) {
  31583. if (!font.vertical) {
  31584. charSpacing += scaledDim + textState.wordSpacing;
  31585. textState.translateTextMatrix(charSpacing * textState.textHScale, 0);
  31586. } else {
  31587. charSpacing += -scaledDim + textState.wordSpacing;
  31588. textState.translateTextMatrix(0, -charSpacing);
  31589. }
  31590. saveLastChar(" ");
  31591. continue;
  31592. }
  31593. if (!category.isZeroWidthDiacritic && !compareWithLastPosition(scaledDim)) {
  31594. if (!font.vertical) {
  31595. textState.translateTextMatrix(scaledDim * textState.textHScale, 0);
  31596. } else {
  31597. textState.translateTextMatrix(0, scaledDim);
  31598. }
  31599. continue;
  31600. }
  31601. const textChunk = ensureTextContentItem();
  31602. if (category.isZeroWidthDiacritic) {
  31603. scaledDim = 0;
  31604. }
  31605. if (!font.vertical) {
  31606. scaledDim *= textState.textHScale;
  31607. textState.translateTextMatrix(scaledDim, 0);
  31608. textChunk.width += scaledDim;
  31609. } else {
  31610. textState.translateTextMatrix(0, scaledDim);
  31611. scaledDim = Math.abs(scaledDim);
  31612. textChunk.height += scaledDim;
  31613. }
  31614. if (scaledDim) {
  31615. textChunk.prevTransform = getCurrentTextTransform();
  31616. }
  31617. const glyphUnicode = glyph.unicode;
  31618. if (saveLastChar(glyphUnicode)) {
  31619. textChunk.str.push(" ");
  31620. }
  31621. textChunk.str.push(glyphUnicode);
  31622. if (charSpacing) {
  31623. if (!font.vertical) {
  31624. textState.translateTextMatrix(charSpacing * textState.textHScale, 0);
  31625. } else {
  31626. textState.translateTextMatrix(0, -charSpacing);
  31627. }
  31628. }
  31629. }
  31630. }
  31631. function appendEOL() {
  31632. resetLastChars();
  31633. if (textContentItem.initialized) {
  31634. textContentItem.hasEOL = true;
  31635. flushTextContentItem();
  31636. } else {
  31637. textContent.items.push({
  31638. str: "",
  31639. dir: "ltr",
  31640. width: 0,
  31641. height: 0,
  31642. transform: getCurrentTextTransform(),
  31643. fontName: textState.loadedName,
  31644. hasEOL: true
  31645. });
  31646. }
  31647. }
  31648. function addFakeSpaces(width, transf, textOrientation) {
  31649. if (textOrientation * textContentItem.spaceInFlowMin <= width && width <= textOrientation * textContentItem.spaceInFlowMax) {
  31650. if (textContentItem.initialized) {
  31651. resetLastChars();
  31652. textContentItem.str.push(" ");
  31653. }
  31654. return false;
  31655. }
  31656. const fontName = textContentItem.fontName;
  31657. let height = 0;
  31658. if (textContentItem.vertical) {
  31659. height = width;
  31660. width = 0;
  31661. }
  31662. flushTextContentItem();
  31663. resetLastChars();
  31664. pushWhitespace({
  31665. width: Math.abs(width),
  31666. height: Math.abs(height),
  31667. transform: transf || getCurrentTextTransform(),
  31668. fontName
  31669. });
  31670. return true;
  31671. }
  31672. function flushTextContentItem() {
  31673. if (!textContentItem.initialized || !textContentItem.str) {
  31674. return;
  31675. }
  31676. if (!textContentItem.vertical) {
  31677. textContentItem.totalWidth += textContentItem.width * textContentItem.textAdvanceScale;
  31678. } else {
  31679. textContentItem.totalHeight += textContentItem.height * textContentItem.textAdvanceScale;
  31680. }
  31681. textContent.items.push(runBidiTransform(textContentItem));
  31682. textContentItem.initialized = false;
  31683. textContentItem.str.length = 0;
  31684. }
  31685. function enqueueChunk(batch = false) {
  31686. const length = textContent.items.length;
  31687. if (length === 0) {
  31688. return;
  31689. }
  31690. if (batch && length < TEXT_CHUNK_BATCH_SIZE) {
  31691. return;
  31692. }
  31693. sink.enqueue(textContent, length);
  31694. textContent.items = [];
  31695. textContent.styles = Object.create(null);
  31696. }
  31697. const timeSlotManager = new TimeSlotManager();
  31698. return new Promise(function promiseBody(resolve, reject) {
  31699. const next = function (promise) {
  31700. enqueueChunk(true);
  31701. Promise.all([promise, sink.ready]).then(function () {
  31702. try {
  31703. promiseBody(resolve, reject);
  31704. } catch (ex) {
  31705. reject(ex);
  31706. }
  31707. }, reject);
  31708. };
  31709. task.ensureNotTerminated();
  31710. timeSlotManager.reset();
  31711. const operation = {};
  31712. let stop,
  31713. args = [];
  31714. while (!(stop = timeSlotManager.check())) {
  31715. args.length = 0;
  31716. operation.args = args;
  31717. if (!preprocessor.read(operation)) {
  31718. break;
  31719. }
  31720. const previousState = textState;
  31721. textState = stateManager.state;
  31722. const fn = operation.fn;
  31723. args = operation.args;
  31724. switch (fn | 0) {
  31725. case OPS.setFont:
  31726. var fontNameArg = args[0].name,
  31727. fontSizeArg = args[1];
  31728. if (textState.font && fontNameArg === textState.fontName && fontSizeArg === textState.fontSize) {
  31729. break;
  31730. }
  31731. flushTextContentItem();
  31732. textState.fontName = fontNameArg;
  31733. textState.fontSize = fontSizeArg;
  31734. next(handleSetFont(fontNameArg, null));
  31735. return;
  31736. case OPS.setTextRise:
  31737. textState.textRise = args[0];
  31738. break;
  31739. case OPS.setHScale:
  31740. textState.textHScale = args[0] / 100;
  31741. break;
  31742. case OPS.setLeading:
  31743. textState.leading = args[0];
  31744. break;
  31745. case OPS.moveText:
  31746. textState.translateTextLineMatrix(args[0], args[1]);
  31747. textState.textMatrix = textState.textLineMatrix.slice();
  31748. break;
  31749. case OPS.setLeadingMoveText:
  31750. textState.leading = -args[1];
  31751. textState.translateTextLineMatrix(args[0], args[1]);
  31752. textState.textMatrix = textState.textLineMatrix.slice();
  31753. break;
  31754. case OPS.nextLine:
  31755. textState.carriageReturn();
  31756. break;
  31757. case OPS.setTextMatrix:
  31758. textState.setTextMatrix(args[0], args[1], args[2], args[3], args[4], args[5]);
  31759. textState.setTextLineMatrix(args[0], args[1], args[2], args[3], args[4], args[5]);
  31760. updateAdvanceScale();
  31761. break;
  31762. case OPS.setCharSpacing:
  31763. textState.charSpacing = args[0];
  31764. break;
  31765. case OPS.setWordSpacing:
  31766. textState.wordSpacing = args[0];
  31767. break;
  31768. case OPS.beginText:
  31769. textState.textMatrix = IDENTITY_MATRIX.slice();
  31770. textState.textLineMatrix = IDENTITY_MATRIX.slice();
  31771. break;
  31772. case OPS.showSpacedText:
  31773. if (!stateManager.state.font) {
  31774. self.ensureStateFont(stateManager.state);
  31775. continue;
  31776. }
  31777. const spaceFactor = (textState.font.vertical ? 1 : -1) * textState.fontSize / 1000;
  31778. const elements = args[0];
  31779. for (let i = 0, ii = elements.length; i < ii; i++) {
  31780. const item = elements[i];
  31781. if (typeof item === "string") {
  31782. showSpacedTextBuffer.push(item);
  31783. } else if (typeof item === "number" && item !== 0) {
  31784. const str = showSpacedTextBuffer.join("");
  31785. showSpacedTextBuffer.length = 0;
  31786. buildTextContentItem({
  31787. chars: str,
  31788. extraSpacing: item * spaceFactor
  31789. });
  31790. }
  31791. }
  31792. if (showSpacedTextBuffer.length > 0) {
  31793. const str = showSpacedTextBuffer.join("");
  31794. showSpacedTextBuffer.length = 0;
  31795. buildTextContentItem({
  31796. chars: str,
  31797. extraSpacing: 0
  31798. });
  31799. }
  31800. break;
  31801. case OPS.showText:
  31802. if (!stateManager.state.font) {
  31803. self.ensureStateFont(stateManager.state);
  31804. continue;
  31805. }
  31806. buildTextContentItem({
  31807. chars: args[0],
  31808. extraSpacing: 0
  31809. });
  31810. break;
  31811. case OPS.nextLineShowText:
  31812. if (!stateManager.state.font) {
  31813. self.ensureStateFont(stateManager.state);
  31814. continue;
  31815. }
  31816. textState.carriageReturn();
  31817. buildTextContentItem({
  31818. chars: args[0],
  31819. extraSpacing: 0
  31820. });
  31821. break;
  31822. case OPS.nextLineSetSpacingShowText:
  31823. if (!stateManager.state.font) {
  31824. self.ensureStateFont(stateManager.state);
  31825. continue;
  31826. }
  31827. textState.wordSpacing = args[0];
  31828. textState.charSpacing = args[1];
  31829. textState.carriageReturn();
  31830. buildTextContentItem({
  31831. chars: args[2],
  31832. extraSpacing: 0
  31833. });
  31834. break;
  31835. case OPS.paintXObject:
  31836. flushTextContentItem();
  31837. if (!xobjs) {
  31838. xobjs = resources.get("XObject") || Dict.empty;
  31839. }
  31840. var isValidName = args[0] instanceof Name;
  31841. var name = args[0].name;
  31842. if (isValidName && emptyXObjectCache.getByName(name)) {
  31843. break;
  31844. }
  31845. next(new Promise(function (resolveXObject, rejectXObject) {
  31846. if (!isValidName) {
  31847. throw new FormatError("XObject must be referred to by name.");
  31848. }
  31849. let xobj = xobjs.getRaw(name);
  31850. if (xobj instanceof Ref) {
  31851. if (emptyXObjectCache.getByRef(xobj)) {
  31852. resolveXObject();
  31853. return;
  31854. }
  31855. const globalImage = self.globalImageCache.getData(xobj, self.pageIndex);
  31856. if (globalImage) {
  31857. resolveXObject();
  31858. return;
  31859. }
  31860. xobj = xref.fetch(xobj);
  31861. }
  31862. if (!(xobj instanceof BaseStream)) {
  31863. throw new FormatError("XObject should be a stream");
  31864. }
  31865. const type = xobj.dict.get("Subtype");
  31866. if (!(type instanceof Name)) {
  31867. throw new FormatError("XObject should have a Name subtype");
  31868. }
  31869. if (type.name !== "Form") {
  31870. emptyXObjectCache.set(name, xobj.dict.objId, true);
  31871. resolveXObject();
  31872. return;
  31873. }
  31874. const currentState = stateManager.state.clone();
  31875. const xObjStateManager = new StateManager(currentState);
  31876. const matrix = lookupMatrix(xobj.dict.getArray("Matrix"), null);
  31877. if (matrix) {
  31878. xObjStateManager.transform(matrix);
  31879. }
  31880. enqueueChunk();
  31881. const sinkWrapper = {
  31882. enqueueInvoked: false,
  31883. enqueue(chunk, size) {
  31884. this.enqueueInvoked = true;
  31885. sink.enqueue(chunk, size);
  31886. },
  31887. get desiredSize() {
  31888. return sink.desiredSize;
  31889. },
  31890. get ready() {
  31891. return sink.ready;
  31892. }
  31893. };
  31894. self.getTextContent({
  31895. stream: xobj,
  31896. task,
  31897. resources: xobj.dict.get("Resources") || resources,
  31898. stateManager: xObjStateManager,
  31899. includeMarkedContent,
  31900. sink: sinkWrapper,
  31901. seenStyles,
  31902. viewBox,
  31903. lang,
  31904. markedContentData,
  31905. disableNormalization,
  31906. keepWhiteSpace
  31907. }).then(function () {
  31908. if (!sinkWrapper.enqueueInvoked) {
  31909. emptyXObjectCache.set(name, xobj.dict.objId, true);
  31910. }
  31911. resolveXObject();
  31912. }, rejectXObject);
  31913. }).catch(function (reason) {
  31914. if (reason instanceof AbortException) {
  31915. return;
  31916. }
  31917. if (self.options.ignoreErrors) {
  31918. warn(`getTextContent - ignoring XObject: "${reason}".`);
  31919. return;
  31920. }
  31921. throw reason;
  31922. }));
  31923. return;
  31924. case OPS.setGState:
  31925. isValidName = args[0] instanceof Name;
  31926. name = args[0].name;
  31927. if (isValidName && emptyGStateCache.getByName(name)) {
  31928. break;
  31929. }
  31930. next(new Promise(function (resolveGState, rejectGState) {
  31931. if (!isValidName) {
  31932. throw new FormatError("GState must be referred to by name.");
  31933. }
  31934. const extGState = resources.get("ExtGState");
  31935. if (!(extGState instanceof Dict)) {
  31936. throw new FormatError("ExtGState should be a dictionary.");
  31937. }
  31938. const gState = extGState.get(name);
  31939. if (!(gState instanceof Dict)) {
  31940. throw new FormatError("GState should be a dictionary.");
  31941. }
  31942. const gStateFont = gState.get("Font");
  31943. if (!gStateFont) {
  31944. emptyGStateCache.set(name, gState.objId, true);
  31945. resolveGState();
  31946. return;
  31947. }
  31948. flushTextContentItem();
  31949. textState.fontName = null;
  31950. textState.fontSize = gStateFont[1];
  31951. handleSetFont(null, gStateFont[0]).then(resolveGState, rejectGState);
  31952. }).catch(function (reason) {
  31953. if (reason instanceof AbortException) {
  31954. return;
  31955. }
  31956. if (self.options.ignoreErrors) {
  31957. warn(`getTextContent - ignoring ExtGState: "${reason}".`);
  31958. return;
  31959. }
  31960. throw reason;
  31961. }));
  31962. return;
  31963. case OPS.beginMarkedContent:
  31964. flushTextContentItem();
  31965. if (includeMarkedContent) {
  31966. markedContentData.level++;
  31967. textContent.items.push({
  31968. type: "beginMarkedContent",
  31969. tag: args[0] instanceof Name ? args[0].name : null
  31970. });
  31971. }
  31972. break;
  31973. case OPS.beginMarkedContentProps:
  31974. flushTextContentItem();
  31975. if (includeMarkedContent) {
  31976. markedContentData.level++;
  31977. let mcid = null;
  31978. if (args[1] instanceof Dict) {
  31979. mcid = args[1].get("MCID");
  31980. }
  31981. textContent.items.push({
  31982. type: "beginMarkedContentProps",
  31983. id: Number.isInteger(mcid) ? `${self.idFactory.getPageObjId()}_mc${mcid}` : null,
  31984. tag: args[0] instanceof Name ? args[0].name : null
  31985. });
  31986. }
  31987. break;
  31988. case OPS.endMarkedContent:
  31989. flushTextContentItem();
  31990. if (includeMarkedContent) {
  31991. if (markedContentData.level === 0) {
  31992. break;
  31993. }
  31994. markedContentData.level--;
  31995. textContent.items.push({
  31996. type: "endMarkedContent"
  31997. });
  31998. }
  31999. break;
  32000. case OPS.restore:
  32001. if (previousState && (previousState.font !== textState.font || previousState.fontSize !== textState.fontSize || previousState.fontName !== textState.fontName)) {
  32002. flushTextContentItem();
  32003. }
  32004. break;
  32005. }
  32006. if (textContent.items.length >= sink.desiredSize) {
  32007. stop = true;
  32008. break;
  32009. }
  32010. }
  32011. if (stop) {
  32012. next(deferred);
  32013. return;
  32014. }
  32015. flushTextContentItem();
  32016. enqueueChunk();
  32017. resolve();
  32018. }).catch(reason => {
  32019. if (reason instanceof AbortException) {
  32020. return;
  32021. }
  32022. if (this.options.ignoreErrors) {
  32023. warn(`getTextContent - ignoring errors during "${task.name}" ` + `task: "${reason}".`);
  32024. flushTextContentItem();
  32025. enqueueChunk();
  32026. return;
  32027. }
  32028. throw reason;
  32029. });
  32030. }
  32031. async extractDataStructures(dict, properties) {
  32032. const xref = this.xref;
  32033. let cidToGidBytes;
  32034. const toUnicodePromise = this.readToUnicode(properties.toUnicode);
  32035. if (properties.composite) {
  32036. const cidSystemInfo = dict.get("CIDSystemInfo");
  32037. if (cidSystemInfo instanceof Dict) {
  32038. properties.cidSystemInfo = {
  32039. registry: stringToPDFString(cidSystemInfo.get("Registry")),
  32040. ordering: stringToPDFString(cidSystemInfo.get("Ordering")),
  32041. supplement: cidSystemInfo.get("Supplement")
  32042. };
  32043. }
  32044. try {
  32045. const cidToGidMap = dict.get("CIDToGIDMap");
  32046. if (cidToGidMap instanceof BaseStream) {
  32047. cidToGidBytes = cidToGidMap.getBytes();
  32048. }
  32049. } catch (ex) {
  32050. if (!this.options.ignoreErrors) {
  32051. throw ex;
  32052. }
  32053. warn(`extractDataStructures - ignoring CIDToGIDMap data: "${ex}".`);
  32054. }
  32055. }
  32056. const differences = [];
  32057. let baseEncodingName = null;
  32058. let encoding;
  32059. if (dict.has("Encoding")) {
  32060. encoding = dict.get("Encoding");
  32061. if (encoding instanceof Dict) {
  32062. baseEncodingName = encoding.get("BaseEncoding");
  32063. baseEncodingName = baseEncodingName instanceof Name ? baseEncodingName.name : null;
  32064. if (encoding.has("Differences")) {
  32065. const diffEncoding = encoding.get("Differences");
  32066. let index = 0;
  32067. for (const entry of diffEncoding) {
  32068. const data = xref.fetchIfRef(entry);
  32069. if (typeof data === "number") {
  32070. index = data;
  32071. } else if (data instanceof Name) {
  32072. differences[index++] = data.name;
  32073. } else {
  32074. throw new FormatError(`Invalid entry in 'Differences' array: ${data}`);
  32075. }
  32076. }
  32077. }
  32078. } else if (encoding instanceof Name) {
  32079. baseEncodingName = encoding.name;
  32080. } else {
  32081. const msg = "Encoding is not a Name nor a Dict";
  32082. if (!this.options.ignoreErrors) {
  32083. throw new FormatError(msg);
  32084. }
  32085. warn(msg);
  32086. }
  32087. if (baseEncodingName !== "MacRomanEncoding" && baseEncodingName !== "MacExpertEncoding" && baseEncodingName !== "WinAnsiEncoding") {
  32088. baseEncodingName = null;
  32089. }
  32090. }
  32091. const nonEmbeddedFont = !properties.file || properties.isInternalFont,
  32092. isSymbolsFontName = getSymbolsFonts()[properties.name];
  32093. if (baseEncodingName && nonEmbeddedFont && isSymbolsFontName) {
  32094. baseEncodingName = null;
  32095. }
  32096. if (baseEncodingName) {
  32097. properties.defaultEncoding = getEncoding(baseEncodingName);
  32098. } else {
  32099. const isSymbolicFont = !!(properties.flags & FontFlags.Symbolic);
  32100. const isNonsymbolicFont = !!(properties.flags & FontFlags.Nonsymbolic);
  32101. encoding = StandardEncoding;
  32102. if (properties.type === "TrueType" && !isNonsymbolicFont) {
  32103. encoding = WinAnsiEncoding;
  32104. }
  32105. if (isSymbolicFont || isSymbolsFontName) {
  32106. encoding = MacRomanEncoding;
  32107. if (nonEmbeddedFont) {
  32108. if (/Symbol/i.test(properties.name)) {
  32109. encoding = SymbolSetEncoding;
  32110. } else if (/Dingbats/i.test(properties.name)) {
  32111. encoding = ZapfDingbatsEncoding;
  32112. } else if (/Wingdings/i.test(properties.name)) {
  32113. encoding = WinAnsiEncoding;
  32114. }
  32115. }
  32116. }
  32117. properties.defaultEncoding = encoding;
  32118. }
  32119. properties.differences = differences;
  32120. properties.baseEncodingName = baseEncodingName;
  32121. properties.hasEncoding = !!baseEncodingName || differences.length > 0;
  32122. properties.dict = dict;
  32123. properties.toUnicode = await toUnicodePromise;
  32124. const builtToUnicode = await this.buildToUnicode(properties);
  32125. properties.toUnicode = builtToUnicode;
  32126. if (cidToGidBytes) {
  32127. properties.cidToGidMap = this.readCidToGidMap(cidToGidBytes, builtToUnicode);
  32128. }
  32129. return properties;
  32130. }
  32131. _simpleFontToUnicode(properties, forceGlyphs = false) {
  32132. assert(!properties.composite, "Must be a simple font.");
  32133. const toUnicode = [];
  32134. const encoding = properties.defaultEncoding.slice();
  32135. const baseEncodingName = properties.baseEncodingName;
  32136. const differences = properties.differences;
  32137. for (const charcode in differences) {
  32138. const glyphName = differences[charcode];
  32139. if (glyphName === ".notdef") {
  32140. continue;
  32141. }
  32142. encoding[charcode] = glyphName;
  32143. }
  32144. const glyphsUnicodeMap = getGlyphsUnicode();
  32145. for (const charcode in encoding) {
  32146. let glyphName = encoding[charcode];
  32147. if (glyphName === "") {
  32148. continue;
  32149. }
  32150. let unicode = glyphsUnicodeMap[glyphName];
  32151. if (unicode !== undefined) {
  32152. toUnicode[charcode] = String.fromCharCode(unicode);
  32153. continue;
  32154. }
  32155. let code = 0;
  32156. switch (glyphName[0]) {
  32157. case "G":
  32158. if (glyphName.length === 3) {
  32159. code = parseInt(glyphName.substring(1), 16);
  32160. }
  32161. break;
  32162. case "g":
  32163. if (glyphName.length === 5) {
  32164. code = parseInt(glyphName.substring(1), 16);
  32165. }
  32166. break;
  32167. case "C":
  32168. case "c":
  32169. if (glyphName.length >= 3 && glyphName.length <= 4) {
  32170. const codeStr = glyphName.substring(1);
  32171. if (forceGlyphs) {
  32172. code = parseInt(codeStr, 16);
  32173. break;
  32174. }
  32175. code = +codeStr;
  32176. if (Number.isNaN(code) && Number.isInteger(parseInt(codeStr, 16))) {
  32177. return this._simpleFontToUnicode(properties, true);
  32178. }
  32179. }
  32180. break;
  32181. case "u":
  32182. unicode = getUnicodeForGlyph(glyphName, glyphsUnicodeMap);
  32183. if (unicode !== -1) {
  32184. code = unicode;
  32185. }
  32186. break;
  32187. default:
  32188. switch (glyphName) {
  32189. case "f_h":
  32190. case "f_t":
  32191. case "T_h":
  32192. toUnicode[charcode] = glyphName.replaceAll("_", "");
  32193. continue;
  32194. }
  32195. break;
  32196. }
  32197. if (code > 0 && code <= 0x10ffff && Number.isInteger(code)) {
  32198. if (baseEncodingName && code === +charcode) {
  32199. const baseEncoding = getEncoding(baseEncodingName);
  32200. if (baseEncoding && (glyphName = baseEncoding[charcode])) {
  32201. toUnicode[charcode] = String.fromCharCode(glyphsUnicodeMap[glyphName]);
  32202. continue;
  32203. }
  32204. }
  32205. toUnicode[charcode] = String.fromCodePoint(code);
  32206. }
  32207. }
  32208. return toUnicode;
  32209. }
  32210. async buildToUnicode(properties) {
  32211. properties.hasIncludedToUnicodeMap = properties.toUnicode?.length > 0;
  32212. if (properties.hasIncludedToUnicodeMap) {
  32213. if (!properties.composite && properties.hasEncoding) {
  32214. properties.fallbackToUnicode = this._simpleFontToUnicode(properties);
  32215. }
  32216. return properties.toUnicode;
  32217. }
  32218. if (!properties.composite) {
  32219. return new ToUnicodeMap(this._simpleFontToUnicode(properties));
  32220. }
  32221. 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"))) {
  32222. const {
  32223. registry,
  32224. ordering
  32225. } = properties.cidSystemInfo;
  32226. const ucs2CMapName = Name.get(`${registry}-${ordering}-UCS2`);
  32227. const ucs2CMap = await CMapFactory.create({
  32228. encoding: ucs2CMapName,
  32229. fetchBuiltInCMap: this._fetchBuiltInCMapBound,
  32230. useCMap: null
  32231. });
  32232. const toUnicode = [],
  32233. buf = [];
  32234. properties.cMap.forEach(function (charcode, cid) {
  32235. if (cid > 0xffff) {
  32236. throw new FormatError("Max size of CID is 65,535");
  32237. }
  32238. const ucs2 = ucs2CMap.lookup(cid);
  32239. if (ucs2) {
  32240. buf.length = 0;
  32241. for (let i = 0, ii = ucs2.length; i < ii; i += 2) {
  32242. buf.push((ucs2.charCodeAt(i) << 8) + ucs2.charCodeAt(i + 1));
  32243. }
  32244. toUnicode[charcode] = String.fromCharCode(...buf);
  32245. }
  32246. });
  32247. return new ToUnicodeMap(toUnicode);
  32248. }
  32249. return new IdentityToUnicodeMap(properties.firstChar, properties.lastChar);
  32250. }
  32251. async readToUnicode(cmapObj) {
  32252. if (!cmapObj) {
  32253. return null;
  32254. }
  32255. if (cmapObj instanceof Name) {
  32256. const cmap = await CMapFactory.create({
  32257. encoding: cmapObj,
  32258. fetchBuiltInCMap: this._fetchBuiltInCMapBound,
  32259. useCMap: null
  32260. });
  32261. if (cmap instanceof IdentityCMap) {
  32262. return new IdentityToUnicodeMap(0, 0xffff);
  32263. }
  32264. return new ToUnicodeMap(cmap.getMap());
  32265. }
  32266. if (cmapObj instanceof BaseStream) {
  32267. try {
  32268. const cmap = await CMapFactory.create({
  32269. encoding: cmapObj,
  32270. fetchBuiltInCMap: this._fetchBuiltInCMapBound,
  32271. useCMap: null
  32272. });
  32273. if (cmap instanceof IdentityCMap) {
  32274. return new IdentityToUnicodeMap(0, 0xffff);
  32275. }
  32276. const map = new Array(cmap.length);
  32277. cmap.forEach(function (charCode, token) {
  32278. if (typeof token === "number") {
  32279. map[charCode] = String.fromCodePoint(token);
  32280. return;
  32281. }
  32282. if (token.length % 2 !== 0) {
  32283. token = "\u0000" + token;
  32284. }
  32285. const str = [];
  32286. for (let k = 0; k < token.length; k += 2) {
  32287. const w1 = token.charCodeAt(k) << 8 | token.charCodeAt(k + 1);
  32288. if ((w1 & 0xf800) !== 0xd800) {
  32289. str.push(w1);
  32290. continue;
  32291. }
  32292. k += 2;
  32293. const w2 = token.charCodeAt(k) << 8 | token.charCodeAt(k + 1);
  32294. str.push(((w1 & 0x3ff) << 10) + (w2 & 0x3ff) + 0x10000);
  32295. }
  32296. map[charCode] = String.fromCodePoint(...str);
  32297. });
  32298. return new ToUnicodeMap(map);
  32299. } catch (reason) {
  32300. if (reason instanceof AbortException) {
  32301. return null;
  32302. }
  32303. if (this.options.ignoreErrors) {
  32304. warn(`readToUnicode - ignoring ToUnicode data: "${reason}".`);
  32305. return null;
  32306. }
  32307. throw reason;
  32308. }
  32309. }
  32310. return null;
  32311. }
  32312. readCidToGidMap(glyphsData, toUnicode) {
  32313. const result = [];
  32314. for (let j = 0, jj = glyphsData.length; j < jj; j++) {
  32315. const glyphID = glyphsData[j++] << 8 | glyphsData[j];
  32316. const code = j >> 1;
  32317. if (glyphID === 0 && !toUnicode.has(code)) {
  32318. continue;
  32319. }
  32320. result[code] = glyphID;
  32321. }
  32322. return result;
  32323. }
  32324. extractWidths(dict, descriptor, properties) {
  32325. const xref = this.xref;
  32326. let glyphsWidths = [];
  32327. let defaultWidth = 0;
  32328. const glyphsVMetrics = [];
  32329. let defaultVMetrics;
  32330. if (properties.composite) {
  32331. const dw = dict.get("DW");
  32332. defaultWidth = typeof dw === "number" ? Math.ceil(dw) : 1000;
  32333. const widths = dict.get("W");
  32334. if (Array.isArray(widths)) {
  32335. for (let i = 0, ii = widths.length; i < ii; i++) {
  32336. let start = xref.fetchIfRef(widths[i++]);
  32337. if (!Number.isInteger(start)) {
  32338. break;
  32339. }
  32340. const code = xref.fetchIfRef(widths[i]);
  32341. if (Array.isArray(code)) {
  32342. for (const c of code) {
  32343. const width = xref.fetchIfRef(c);
  32344. if (typeof width === "number") {
  32345. glyphsWidths[start] = width;
  32346. }
  32347. start++;
  32348. }
  32349. } else if (Number.isInteger(code)) {
  32350. const width = xref.fetchIfRef(widths[++i]);
  32351. if (typeof width !== "number") {
  32352. continue;
  32353. }
  32354. for (let j = start; j <= code; j++) {
  32355. glyphsWidths[j] = width;
  32356. }
  32357. } else {
  32358. break;
  32359. }
  32360. }
  32361. }
  32362. if (properties.vertical) {
  32363. const dw2 = dict.getArray("DW2");
  32364. let vmetrics = isNumberArray(dw2, 2) ? dw2 : [880, -1000];
  32365. defaultVMetrics = [vmetrics[1], defaultWidth * 0.5, vmetrics[0]];
  32366. vmetrics = dict.get("W2");
  32367. if (Array.isArray(vmetrics)) {
  32368. for (let i = 0, ii = vmetrics.length; i < ii; i++) {
  32369. let start = xref.fetchIfRef(vmetrics[i++]);
  32370. if (!Number.isInteger(start)) {
  32371. break;
  32372. }
  32373. const code = xref.fetchIfRef(vmetrics[i]);
  32374. if (Array.isArray(code)) {
  32375. for (let j = 0, jj = code.length; j < jj; j++) {
  32376. const vmetric = [xref.fetchIfRef(code[j++]), xref.fetchIfRef(code[j++]), xref.fetchIfRef(code[j])];
  32377. if (isNumberArray(vmetric, null)) {
  32378. glyphsVMetrics[start] = vmetric;
  32379. }
  32380. start++;
  32381. }
  32382. } else if (Number.isInteger(code)) {
  32383. const vmetric = [xref.fetchIfRef(vmetrics[++i]), xref.fetchIfRef(vmetrics[++i]), xref.fetchIfRef(vmetrics[++i])];
  32384. if (!isNumberArray(vmetric, null)) {
  32385. continue;
  32386. }
  32387. for (let j = start; j <= code; j++) {
  32388. glyphsVMetrics[j] = vmetric;
  32389. }
  32390. } else {
  32391. break;
  32392. }
  32393. }
  32394. }
  32395. }
  32396. } else {
  32397. const widths = dict.get("Widths");
  32398. if (Array.isArray(widths)) {
  32399. let j = properties.firstChar;
  32400. for (const w of widths) {
  32401. const width = xref.fetchIfRef(w);
  32402. if (typeof width === "number") {
  32403. glyphsWidths[j] = width;
  32404. }
  32405. j++;
  32406. }
  32407. const missingWidth = descriptor.get("MissingWidth");
  32408. defaultWidth = typeof missingWidth === "number" ? missingWidth : 0;
  32409. } else {
  32410. const baseFontName = dict.get("BaseFont");
  32411. if (baseFontName instanceof Name) {
  32412. const metrics = this.getBaseFontMetrics(baseFontName.name);
  32413. glyphsWidths = this.buildCharCodeToWidth(metrics.widths, properties);
  32414. defaultWidth = metrics.defaultWidth;
  32415. }
  32416. }
  32417. }
  32418. let isMonospace = true;
  32419. let firstWidth = defaultWidth;
  32420. for (const glyph in glyphsWidths) {
  32421. const glyphWidth = glyphsWidths[glyph];
  32422. if (!glyphWidth) {
  32423. continue;
  32424. }
  32425. if (!firstWidth) {
  32426. firstWidth = glyphWidth;
  32427. continue;
  32428. }
  32429. if (firstWidth !== glyphWidth) {
  32430. isMonospace = false;
  32431. break;
  32432. }
  32433. }
  32434. if (isMonospace) {
  32435. properties.flags |= FontFlags.FixedPitch;
  32436. } else {
  32437. properties.flags &= ~FontFlags.FixedPitch;
  32438. }
  32439. properties.defaultWidth = defaultWidth;
  32440. properties.widths = glyphsWidths;
  32441. properties.defaultVMetrics = defaultVMetrics;
  32442. properties.vmetrics = glyphsVMetrics;
  32443. }
  32444. isSerifFont(baseFontName) {
  32445. const fontNameWoStyle = baseFontName.split("-", 1)[0];
  32446. return fontNameWoStyle in getSerifFonts() || /serif/gi.test(fontNameWoStyle);
  32447. }
  32448. getBaseFontMetrics(name) {
  32449. let defaultWidth = 0;
  32450. let widths = Object.create(null);
  32451. let monospace = false;
  32452. const stdFontMap = getStdFontMap();
  32453. let lookupName = stdFontMap[name] || name;
  32454. const Metrics = getMetrics();
  32455. if (!(lookupName in Metrics)) {
  32456. lookupName = this.isSerifFont(name) ? "Times-Roman" : "Helvetica";
  32457. }
  32458. const glyphWidths = Metrics[lookupName];
  32459. if (typeof glyphWidths === "number") {
  32460. defaultWidth = glyphWidths;
  32461. monospace = true;
  32462. } else {
  32463. widths = glyphWidths();
  32464. }
  32465. return {
  32466. defaultWidth,
  32467. monospace,
  32468. widths
  32469. };
  32470. }
  32471. buildCharCodeToWidth(widthsByGlyphName, properties) {
  32472. const widths = Object.create(null);
  32473. const differences = properties.differences;
  32474. const encoding = properties.defaultEncoding;
  32475. for (let charCode = 0; charCode < 256; charCode++) {
  32476. if (charCode in differences && widthsByGlyphName[differences[charCode]]) {
  32477. widths[charCode] = widthsByGlyphName[differences[charCode]];
  32478. continue;
  32479. }
  32480. if (charCode in encoding && widthsByGlyphName[encoding[charCode]]) {
  32481. widths[charCode] = widthsByGlyphName[encoding[charCode]];
  32482. continue;
  32483. }
  32484. }
  32485. return widths;
  32486. }
  32487. preEvaluateFont(dict) {
  32488. const baseDict = dict;
  32489. let type = dict.get("Subtype");
  32490. if (!(type instanceof Name)) {
  32491. throw new FormatError("invalid font Subtype");
  32492. }
  32493. let composite = false;
  32494. let hash;
  32495. if (type.name === "Type0") {
  32496. const df = dict.get("DescendantFonts");
  32497. if (!df) {
  32498. throw new FormatError("Descendant fonts are not specified");
  32499. }
  32500. dict = Array.isArray(df) ? this.xref.fetchIfRef(df[0]) : df;
  32501. if (!(dict instanceof Dict)) {
  32502. throw new FormatError("Descendant font is not a dictionary.");
  32503. }
  32504. type = dict.get("Subtype");
  32505. if (!(type instanceof Name)) {
  32506. throw new FormatError("invalid font Subtype");
  32507. }
  32508. composite = true;
  32509. }
  32510. let firstChar = dict.get("FirstChar");
  32511. if (!Number.isInteger(firstChar)) {
  32512. firstChar = 0;
  32513. }
  32514. let lastChar = dict.get("LastChar");
  32515. if (!Number.isInteger(lastChar)) {
  32516. lastChar = composite ? 0xffff : 0xff;
  32517. }
  32518. const descriptor = dict.get("FontDescriptor");
  32519. const toUnicode = dict.get("ToUnicode") || baseDict.get("ToUnicode");
  32520. if (descriptor) {
  32521. hash = new MurmurHash3_64();
  32522. const encoding = baseDict.getRaw("Encoding");
  32523. if (encoding instanceof Name) {
  32524. hash.update(encoding.name);
  32525. } else if (encoding instanceof Ref) {
  32526. hash.update(encoding.toString());
  32527. } else if (encoding instanceof Dict) {
  32528. for (const entry of encoding.getRawValues()) {
  32529. if (entry instanceof Name) {
  32530. hash.update(entry.name);
  32531. } else if (entry instanceof Ref) {
  32532. hash.update(entry.toString());
  32533. } else if (Array.isArray(entry)) {
  32534. const diffLength = entry.length,
  32535. diffBuf = new Array(diffLength);
  32536. for (let j = 0; j < diffLength; j++) {
  32537. const diffEntry = entry[j];
  32538. if (diffEntry instanceof Name) {
  32539. diffBuf[j] = diffEntry.name;
  32540. } else if (typeof diffEntry === "number" || diffEntry instanceof Ref) {
  32541. diffBuf[j] = diffEntry.toString();
  32542. }
  32543. }
  32544. hash.update(diffBuf.join());
  32545. }
  32546. }
  32547. }
  32548. hash.update(`${firstChar}-${lastChar}`);
  32549. if (toUnicode instanceof BaseStream) {
  32550. const stream = toUnicode.str || toUnicode;
  32551. const uint8array = stream.buffer ? new Uint8Array(stream.buffer.buffer, 0, stream.bufferLength) : new Uint8Array(stream.bytes.buffer, stream.start, stream.end - stream.start);
  32552. hash.update(uint8array);
  32553. } else if (toUnicode instanceof Name) {
  32554. hash.update(toUnicode.name);
  32555. }
  32556. const widths = dict.get("Widths") || baseDict.get("Widths");
  32557. if (Array.isArray(widths)) {
  32558. const widthsBuf = [];
  32559. for (const entry of widths) {
  32560. if (typeof entry === "number" || entry instanceof Ref) {
  32561. widthsBuf.push(entry.toString());
  32562. }
  32563. }
  32564. hash.update(widthsBuf.join());
  32565. }
  32566. if (composite) {
  32567. hash.update("compositeFont");
  32568. const compositeWidths = dict.get("W") || baseDict.get("W");
  32569. if (Array.isArray(compositeWidths)) {
  32570. const widthsBuf = [];
  32571. for (const entry of compositeWidths) {
  32572. if (typeof entry === "number" || entry instanceof Ref) {
  32573. widthsBuf.push(entry.toString());
  32574. } else if (Array.isArray(entry)) {
  32575. const subWidthsBuf = [];
  32576. for (const element of entry) {
  32577. if (typeof element === "number" || element instanceof Ref) {
  32578. subWidthsBuf.push(element.toString());
  32579. }
  32580. }
  32581. widthsBuf.push(`[${subWidthsBuf.join()}]`);
  32582. }
  32583. }
  32584. hash.update(widthsBuf.join());
  32585. }
  32586. const cidToGidMap = dict.getRaw("CIDToGIDMap") || baseDict.getRaw("CIDToGIDMap");
  32587. if (cidToGidMap instanceof Name) {
  32588. hash.update(cidToGidMap.name);
  32589. } else if (cidToGidMap instanceof Ref) {
  32590. hash.update(cidToGidMap.toString());
  32591. } else if (cidToGidMap instanceof BaseStream) {
  32592. hash.update(cidToGidMap.peekBytes());
  32593. }
  32594. }
  32595. }
  32596. return {
  32597. descriptor,
  32598. dict,
  32599. baseDict,
  32600. composite,
  32601. type: type.name,
  32602. firstChar,
  32603. lastChar,
  32604. toUnicode,
  32605. hash: hash ? hash.hexdigest() : ""
  32606. };
  32607. }
  32608. async translateFont({
  32609. descriptor,
  32610. dict,
  32611. baseDict,
  32612. composite,
  32613. type,
  32614. firstChar,
  32615. lastChar,
  32616. toUnicode,
  32617. cssFontInfo
  32618. }) {
  32619. const isType3Font = type === "Type3";
  32620. if (!descriptor) {
  32621. if (isType3Font) {
  32622. const bbox = lookupNormalRect(dict.getArray("FontBBox"), [0, 0, 0, 0]);
  32623. descriptor = new Dict(null);
  32624. descriptor.set("FontName", Name.get(type));
  32625. descriptor.set("FontBBox", bbox);
  32626. } else {
  32627. let baseFontName = dict.get("BaseFont");
  32628. if (!(baseFontName instanceof Name)) {
  32629. throw new FormatError("Base font is not specified");
  32630. }
  32631. baseFontName = baseFontName.name.replaceAll(/[,_]/g, "-");
  32632. const metrics = this.getBaseFontMetrics(baseFontName);
  32633. const fontNameWoStyle = baseFontName.split("-", 1)[0];
  32634. const flags = (this.isSerifFont(fontNameWoStyle) ? FontFlags.Serif : 0) | (metrics.monospace ? FontFlags.FixedPitch : 0) | (getSymbolsFonts()[fontNameWoStyle] ? FontFlags.Symbolic : FontFlags.Nonsymbolic);
  32635. const properties = {
  32636. type,
  32637. name: baseFontName,
  32638. loadedName: baseDict.loadedName,
  32639. systemFontInfo: null,
  32640. widths: metrics.widths,
  32641. defaultWidth: metrics.defaultWidth,
  32642. isSimulatedFlags: true,
  32643. flags,
  32644. firstChar,
  32645. lastChar,
  32646. toUnicode,
  32647. xHeight: 0,
  32648. capHeight: 0,
  32649. italicAngle: 0,
  32650. isType3Font
  32651. };
  32652. const widths = dict.get("Widths");
  32653. const standardFontName = getStandardFontName(baseFontName);
  32654. let file = null;
  32655. if (standardFontName) {
  32656. file = await this.fetchStandardFontData(standardFontName);
  32657. properties.isInternalFont = !!file;
  32658. }
  32659. if (!properties.isInternalFont && this.options.useSystemFonts) {
  32660. properties.systemFontInfo = getFontSubstitution(this.systemFontCache, this.idFactory, this.options.standardFontDataUrl, baseFontName, standardFontName, type);
  32661. }
  32662. const newProperties = await this.extractDataStructures(dict, properties);
  32663. if (Array.isArray(widths)) {
  32664. const glyphWidths = [];
  32665. let j = firstChar;
  32666. for (const w of widths) {
  32667. const width = this.xref.fetchIfRef(w);
  32668. if (typeof width === "number") {
  32669. glyphWidths[j] = width;
  32670. }
  32671. j++;
  32672. }
  32673. newProperties.widths = glyphWidths;
  32674. } else {
  32675. newProperties.widths = this.buildCharCodeToWidth(metrics.widths, newProperties);
  32676. }
  32677. return new Font(baseFontName, file, newProperties);
  32678. }
  32679. }
  32680. let fontName = descriptor.get("FontName");
  32681. let baseFont = dict.get("BaseFont");
  32682. if (typeof fontName === "string") {
  32683. fontName = Name.get(fontName);
  32684. }
  32685. if (typeof baseFont === "string") {
  32686. baseFont = Name.get(baseFont);
  32687. }
  32688. const fontNameStr = fontName?.name;
  32689. const baseFontStr = baseFont?.name;
  32690. if (!isType3Font && fontNameStr !== baseFontStr) {
  32691. info(`The FontDescriptor's FontName is "${fontNameStr}" but ` + `should be the same as the Font's BaseFont "${baseFontStr}".`);
  32692. if (fontNameStr && baseFontStr && (baseFontStr.startsWith(fontNameStr) || !isKnownFontName(fontNameStr) && isKnownFontName(baseFontStr))) {
  32693. fontName = null;
  32694. }
  32695. }
  32696. fontName ||= baseFont;
  32697. if (!(fontName instanceof Name)) {
  32698. throw new FormatError("invalid font name");
  32699. }
  32700. let fontFile, subtype, length1, length2, length3;
  32701. try {
  32702. fontFile = descriptor.get("FontFile", "FontFile2", "FontFile3");
  32703. } catch (ex) {
  32704. if (!this.options.ignoreErrors) {
  32705. throw ex;
  32706. }
  32707. warn(`translateFont - fetching "${fontName.name}" font file: "${ex}".`);
  32708. fontFile = new NullStream();
  32709. }
  32710. let isInternalFont = false;
  32711. let glyphScaleFactors = null;
  32712. let systemFontInfo = null;
  32713. if (fontFile) {
  32714. if (fontFile.dict) {
  32715. const subtypeEntry = fontFile.dict.get("Subtype");
  32716. if (subtypeEntry instanceof Name) {
  32717. subtype = subtypeEntry.name;
  32718. }
  32719. length1 = fontFile.dict.get("Length1");
  32720. length2 = fontFile.dict.get("Length2");
  32721. length3 = fontFile.dict.get("Length3");
  32722. }
  32723. } else if (cssFontInfo) {
  32724. const standardFontName = getXfaFontName(fontName.name);
  32725. if (standardFontName) {
  32726. cssFontInfo.fontFamily = `${cssFontInfo.fontFamily}-PdfJS-XFA`;
  32727. cssFontInfo.metrics = standardFontName.metrics || null;
  32728. glyphScaleFactors = standardFontName.factors || null;
  32729. fontFile = await this.fetchStandardFontData(standardFontName.name);
  32730. isInternalFont = !!fontFile;
  32731. baseDict = dict = getXfaFontDict(fontName.name);
  32732. composite = true;
  32733. }
  32734. } else if (!isType3Font) {
  32735. const standardFontName = getStandardFontName(fontName.name);
  32736. if (standardFontName) {
  32737. fontFile = await this.fetchStandardFontData(standardFontName);
  32738. isInternalFont = !!fontFile;
  32739. }
  32740. if (!isInternalFont && this.options.useSystemFonts) {
  32741. systemFontInfo = getFontSubstitution(this.systemFontCache, this.idFactory, this.options.standardFontDataUrl, fontName.name, standardFontName, type);
  32742. }
  32743. }
  32744. const fontMatrix = lookupMatrix(dict.getArray("FontMatrix"), FONT_IDENTITY_MATRIX);
  32745. const bbox = lookupNormalRect(descriptor.getArray("FontBBox") || dict.getArray("FontBBox"), undefined);
  32746. let ascent = descriptor.get("Ascent");
  32747. if (typeof ascent !== "number") {
  32748. ascent = undefined;
  32749. }
  32750. let descent = descriptor.get("Descent");
  32751. if (typeof descent !== "number") {
  32752. descent = undefined;
  32753. }
  32754. let xHeight = descriptor.get("XHeight");
  32755. if (typeof xHeight !== "number") {
  32756. xHeight = 0;
  32757. }
  32758. let capHeight = descriptor.get("CapHeight");
  32759. if (typeof capHeight !== "number") {
  32760. capHeight = 0;
  32761. }
  32762. let flags = descriptor.get("Flags");
  32763. if (!Number.isInteger(flags)) {
  32764. flags = 0;
  32765. }
  32766. let italicAngle = descriptor.get("ItalicAngle");
  32767. if (typeof italicAngle !== "number") {
  32768. italicAngle = 0;
  32769. }
  32770. const properties = {
  32771. type,
  32772. name: fontName.name,
  32773. subtype,
  32774. file: fontFile,
  32775. length1,
  32776. length2,
  32777. length3,
  32778. isInternalFont,
  32779. loadedName: baseDict.loadedName,
  32780. composite,
  32781. fixedPitch: false,
  32782. fontMatrix,
  32783. firstChar,
  32784. lastChar,
  32785. toUnicode,
  32786. bbox,
  32787. ascent,
  32788. descent,
  32789. xHeight,
  32790. capHeight,
  32791. flags,
  32792. italicAngle,
  32793. isType3Font,
  32794. cssFontInfo,
  32795. scaleFactors: glyphScaleFactors,
  32796. systemFontInfo
  32797. };
  32798. if (composite) {
  32799. const cidEncoding = baseDict.get("Encoding");
  32800. if (cidEncoding instanceof Name) {
  32801. properties.cidEncoding = cidEncoding.name;
  32802. }
  32803. const cMap = await CMapFactory.create({
  32804. encoding: cidEncoding,
  32805. fetchBuiltInCMap: this._fetchBuiltInCMapBound,
  32806. useCMap: null
  32807. });
  32808. properties.cMap = cMap;
  32809. properties.vertical = properties.cMap.vertical;
  32810. }
  32811. const newProperties = await this.extractDataStructures(dict, properties);
  32812. this.extractWidths(dict, descriptor, newProperties);
  32813. return new Font(fontName.name, fontFile, newProperties);
  32814. }
  32815. static buildFontPaths(font, glyphs, handler, evaluatorOptions) {
  32816. function buildPath(fontChar) {
  32817. const glyphName = `${font.loadedName}_path_${fontChar}`;
  32818. try {
  32819. if (font.renderer.hasBuiltPath(fontChar)) {
  32820. return;
  32821. }
  32822. handler.send("commonobj", [glyphName, "FontPath", font.renderer.getPathJs(fontChar)]);
  32823. } catch (reason) {
  32824. if (evaluatorOptions.ignoreErrors) {
  32825. warn(`buildFontPaths - ignoring ${glyphName} glyph: "${reason}".`);
  32826. return;
  32827. }
  32828. throw reason;
  32829. }
  32830. }
  32831. for (const glyph of glyphs) {
  32832. buildPath(glyph.fontChar);
  32833. const accent = glyph.accent;
  32834. if (accent?.fontChar) {
  32835. buildPath(accent.fontChar);
  32836. }
  32837. }
  32838. }
  32839. static get fallbackFontDict() {
  32840. const dict = new Dict();
  32841. dict.set("BaseFont", Name.get("Helvetica"));
  32842. dict.set("Type", Name.get("FallbackType"));
  32843. dict.set("Subtype", Name.get("FallbackType"));
  32844. dict.set("Encoding", Name.get("WinAnsiEncoding"));
  32845. return shadow(this, "fallbackFontDict", dict);
  32846. }
  32847. }
  32848. class TranslatedFont {
  32849. constructor({
  32850. loadedName,
  32851. font,
  32852. dict,
  32853. evaluatorOptions
  32854. }) {
  32855. this.loadedName = loadedName;
  32856. this.font = font;
  32857. this.dict = dict;
  32858. this._evaluatorOptions = evaluatorOptions || DefaultPartialEvaluatorOptions;
  32859. this.type3Loaded = null;
  32860. this.type3Dependencies = font.isType3Font ? new Set() : null;
  32861. this.sent = false;
  32862. }
  32863. send(handler) {
  32864. if (this.sent) {
  32865. return;
  32866. }
  32867. this.sent = true;
  32868. handler.send("commonobj", [this.loadedName, "Font", this.font.exportData(this._evaluatorOptions.fontExtraProperties)]);
  32869. }
  32870. fallback(handler) {
  32871. if (!this.font.data) {
  32872. return;
  32873. }
  32874. this.font.disableFontFace = true;
  32875. PartialEvaluator.buildFontPaths(this.font, this.font.glyphCacheValues, handler, this._evaluatorOptions);
  32876. }
  32877. loadType3Data(evaluator, resources, task) {
  32878. if (this.type3Loaded) {
  32879. return this.type3Loaded;
  32880. }
  32881. if (!this.font.isType3Font) {
  32882. throw new Error("Must be a Type3 font.");
  32883. }
  32884. const type3Evaluator = evaluator.clone({
  32885. ignoreErrors: false
  32886. });
  32887. const type3FontRefs = new RefSet(evaluator.type3FontRefs);
  32888. if (this.dict.objId && !type3FontRefs.has(this.dict.objId)) {
  32889. type3FontRefs.put(this.dict.objId);
  32890. }
  32891. type3Evaluator.type3FontRefs = type3FontRefs;
  32892. const translatedFont = this.font,
  32893. type3Dependencies = this.type3Dependencies;
  32894. let loadCharProcsPromise = Promise.resolve();
  32895. const charProcs = this.dict.get("CharProcs");
  32896. const fontResources = this.dict.get("Resources") || resources;
  32897. const charProcOperatorList = Object.create(null);
  32898. const fontBBox = Util.normalizeRect(translatedFont.bbox || [0, 0, 0, 0]),
  32899. width = fontBBox[2] - fontBBox[0],
  32900. height = fontBBox[3] - fontBBox[1];
  32901. const fontBBoxSize = Math.hypot(width, height);
  32902. for (const key of charProcs.getKeys()) {
  32903. loadCharProcsPromise = loadCharProcsPromise.then(() => {
  32904. const glyphStream = charProcs.get(key);
  32905. const operatorList = new OperatorList();
  32906. return type3Evaluator.getOperatorList({
  32907. stream: glyphStream,
  32908. task,
  32909. resources: fontResources,
  32910. operatorList
  32911. }).then(() => {
  32912. if (operatorList.fnArray[0] === OPS.setCharWidthAndBounds) {
  32913. this._removeType3ColorOperators(operatorList, fontBBoxSize);
  32914. }
  32915. charProcOperatorList[key] = operatorList.getIR();
  32916. for (const dependency of operatorList.dependencies) {
  32917. type3Dependencies.add(dependency);
  32918. }
  32919. }).catch(function (reason) {
  32920. warn(`Type3 font resource "${key}" is not available.`);
  32921. const dummyOperatorList = new OperatorList();
  32922. charProcOperatorList[key] = dummyOperatorList.getIR();
  32923. });
  32924. });
  32925. }
  32926. this.type3Loaded = loadCharProcsPromise.then(() => {
  32927. translatedFont.charProcOperatorList = charProcOperatorList;
  32928. if (this._bbox) {
  32929. translatedFont.isCharBBox = true;
  32930. translatedFont.bbox = this._bbox;
  32931. }
  32932. });
  32933. return this.type3Loaded;
  32934. }
  32935. _removeType3ColorOperators(operatorList, fontBBoxSize = NaN) {
  32936. const charBBox = Util.normalizeRect(operatorList.argsArray[0].slice(2)),
  32937. width = charBBox[2] - charBBox[0],
  32938. height = charBBox[3] - charBBox[1];
  32939. const charBBoxSize = Math.hypot(width, height);
  32940. if (width === 0 || height === 0) {
  32941. operatorList.fnArray.splice(0, 1);
  32942. operatorList.argsArray.splice(0, 1);
  32943. } else if (fontBBoxSize === 0 || Math.round(charBBoxSize / fontBBoxSize) >= 10) {
  32944. if (!this._bbox) {
  32945. this._bbox = [Infinity, Infinity, -Infinity, -Infinity];
  32946. }
  32947. this._bbox[0] = Math.min(this._bbox[0], charBBox[0]);
  32948. this._bbox[1] = Math.min(this._bbox[1], charBBox[1]);
  32949. this._bbox[2] = Math.max(this._bbox[2], charBBox[2]);
  32950. this._bbox[3] = Math.max(this._bbox[3], charBBox[3]);
  32951. }
  32952. let i = 0,
  32953. ii = operatorList.length;
  32954. while (i < ii) {
  32955. switch (operatorList.fnArray[i]) {
  32956. case OPS.setCharWidthAndBounds:
  32957. break;
  32958. case OPS.setStrokeColorSpace:
  32959. case OPS.setFillColorSpace:
  32960. case OPS.setStrokeColor:
  32961. case OPS.setStrokeColorN:
  32962. case OPS.setFillColor:
  32963. case OPS.setFillColorN:
  32964. case OPS.setStrokeGray:
  32965. case OPS.setFillGray:
  32966. case OPS.setStrokeRGBColor:
  32967. case OPS.setFillRGBColor:
  32968. case OPS.setStrokeCMYKColor:
  32969. case OPS.setFillCMYKColor:
  32970. case OPS.shadingFill:
  32971. case OPS.setRenderingIntent:
  32972. operatorList.fnArray.splice(i, 1);
  32973. operatorList.argsArray.splice(i, 1);
  32974. ii--;
  32975. continue;
  32976. case OPS.setGState:
  32977. const [gStateObj] = operatorList.argsArray[i];
  32978. let j = 0,
  32979. jj = gStateObj.length;
  32980. while (j < jj) {
  32981. const [gStateKey] = gStateObj[j];
  32982. switch (gStateKey) {
  32983. case "TR":
  32984. case "TR2":
  32985. case "HT":
  32986. case "BG":
  32987. case "BG2":
  32988. case "UCR":
  32989. case "UCR2":
  32990. gStateObj.splice(j, 1);
  32991. jj--;
  32992. continue;
  32993. }
  32994. j++;
  32995. }
  32996. break;
  32997. }
  32998. i++;
  32999. }
  33000. }
  33001. }
  33002. class StateManager {
  33003. constructor(initialState = new EvalState()) {
  33004. this.state = initialState;
  33005. this.stateStack = [];
  33006. }
  33007. save() {
  33008. const old = this.state;
  33009. this.stateStack.push(this.state);
  33010. this.state = old.clone();
  33011. }
  33012. restore() {
  33013. const prev = this.stateStack.pop();
  33014. if (prev) {
  33015. this.state = prev;
  33016. }
  33017. }
  33018. transform(args) {
  33019. this.state.ctm = Util.transform(this.state.ctm, args);
  33020. }
  33021. }
  33022. class TextState {
  33023. constructor() {
  33024. this.ctm = new Float32Array(IDENTITY_MATRIX);
  33025. this.fontName = null;
  33026. this.fontSize = 0;
  33027. this.loadedName = null;
  33028. this.font = null;
  33029. this.fontMatrix = FONT_IDENTITY_MATRIX;
  33030. this.textMatrix = IDENTITY_MATRIX.slice();
  33031. this.textLineMatrix = IDENTITY_MATRIX.slice();
  33032. this.charSpacing = 0;
  33033. this.wordSpacing = 0;
  33034. this.leading = 0;
  33035. this.textHScale = 1;
  33036. this.textRise = 0;
  33037. }
  33038. setTextMatrix(a, b, c, d, e, f) {
  33039. const m = this.textMatrix;
  33040. m[0] = a;
  33041. m[1] = b;
  33042. m[2] = c;
  33043. m[3] = d;
  33044. m[4] = e;
  33045. m[5] = f;
  33046. }
  33047. setTextLineMatrix(a, b, c, d, e, f) {
  33048. const m = this.textLineMatrix;
  33049. m[0] = a;
  33050. m[1] = b;
  33051. m[2] = c;
  33052. m[3] = d;
  33053. m[4] = e;
  33054. m[5] = f;
  33055. }
  33056. translateTextMatrix(x, y) {
  33057. const m = this.textMatrix;
  33058. m[4] = m[0] * x + m[2] * y + m[4];
  33059. m[5] = m[1] * x + m[3] * y + m[5];
  33060. }
  33061. translateTextLineMatrix(x, y) {
  33062. const m = this.textLineMatrix;
  33063. m[4] = m[0] * x + m[2] * y + m[4];
  33064. m[5] = m[1] * x + m[3] * y + m[5];
  33065. }
  33066. carriageReturn() {
  33067. this.translateTextLineMatrix(0, -this.leading);
  33068. this.textMatrix = this.textLineMatrix.slice();
  33069. }
  33070. clone() {
  33071. const clone = Object.create(this);
  33072. clone.textMatrix = this.textMatrix.slice();
  33073. clone.textLineMatrix = this.textLineMatrix.slice();
  33074. clone.fontMatrix = this.fontMatrix.slice();
  33075. return clone;
  33076. }
  33077. }
  33078. class EvalState {
  33079. constructor() {
  33080. this.ctm = new Float32Array(IDENTITY_MATRIX);
  33081. this.font = null;
  33082. this.textRenderingMode = TextRenderingMode.FILL;
  33083. this._fillColorSpace = ColorSpace.singletons.gray;
  33084. this._strokeColorSpace = ColorSpace.singletons.gray;
  33085. this.patternFillColorSpace = null;
  33086. this.patternStrokeColorSpace = null;
  33087. }
  33088. get fillColorSpace() {
  33089. return this._fillColorSpace;
  33090. }
  33091. set fillColorSpace(colorSpace) {
  33092. this._fillColorSpace = this.patternFillColorSpace = colorSpace;
  33093. }
  33094. get strokeColorSpace() {
  33095. return this._strokeColorSpace;
  33096. }
  33097. set strokeColorSpace(colorSpace) {
  33098. this._strokeColorSpace = this.patternStrokeColorSpace = colorSpace;
  33099. }
  33100. clone() {
  33101. return Object.create(this);
  33102. }
  33103. }
  33104. class EvaluatorPreprocessor {
  33105. static get opMap() {
  33106. return shadow(this, "opMap", Object.assign(Object.create(null), {
  33107. w: {
  33108. id: OPS.setLineWidth,
  33109. numArgs: 1,
  33110. variableArgs: false
  33111. },
  33112. J: {
  33113. id: OPS.setLineCap,
  33114. numArgs: 1,
  33115. variableArgs: false
  33116. },
  33117. j: {
  33118. id: OPS.setLineJoin,
  33119. numArgs: 1,
  33120. variableArgs: false
  33121. },
  33122. M: {
  33123. id: OPS.setMiterLimit,
  33124. numArgs: 1,
  33125. variableArgs: false
  33126. },
  33127. d: {
  33128. id: OPS.setDash,
  33129. numArgs: 2,
  33130. variableArgs: false
  33131. },
  33132. ri: {
  33133. id: OPS.setRenderingIntent,
  33134. numArgs: 1,
  33135. variableArgs: false
  33136. },
  33137. i: {
  33138. id: OPS.setFlatness,
  33139. numArgs: 1,
  33140. variableArgs: false
  33141. },
  33142. gs: {
  33143. id: OPS.setGState,
  33144. numArgs: 1,
  33145. variableArgs: false
  33146. },
  33147. q: {
  33148. id: OPS.save,
  33149. numArgs: 0,
  33150. variableArgs: false
  33151. },
  33152. Q: {
  33153. id: OPS.restore,
  33154. numArgs: 0,
  33155. variableArgs: false
  33156. },
  33157. cm: {
  33158. id: OPS.transform,
  33159. numArgs: 6,
  33160. variableArgs: false
  33161. },
  33162. m: {
  33163. id: OPS.moveTo,
  33164. numArgs: 2,
  33165. variableArgs: false
  33166. },
  33167. l: {
  33168. id: OPS.lineTo,
  33169. numArgs: 2,
  33170. variableArgs: false
  33171. },
  33172. c: {
  33173. id: OPS.curveTo,
  33174. numArgs: 6,
  33175. variableArgs: false
  33176. },
  33177. v: {
  33178. id: OPS.curveTo2,
  33179. numArgs: 4,
  33180. variableArgs: false
  33181. },
  33182. y: {
  33183. id: OPS.curveTo3,
  33184. numArgs: 4,
  33185. variableArgs: false
  33186. },
  33187. h: {
  33188. id: OPS.closePath,
  33189. numArgs: 0,
  33190. variableArgs: false
  33191. },
  33192. re: {
  33193. id: OPS.rectangle,
  33194. numArgs: 4,
  33195. variableArgs: false
  33196. },
  33197. S: {
  33198. id: OPS.stroke,
  33199. numArgs: 0,
  33200. variableArgs: false
  33201. },
  33202. s: {
  33203. id: OPS.closeStroke,
  33204. numArgs: 0,
  33205. variableArgs: false
  33206. },
  33207. f: {
  33208. id: OPS.fill,
  33209. numArgs: 0,
  33210. variableArgs: false
  33211. },
  33212. F: {
  33213. id: OPS.fill,
  33214. numArgs: 0,
  33215. variableArgs: false
  33216. },
  33217. "f*": {
  33218. id: OPS.eoFill,
  33219. numArgs: 0,
  33220. variableArgs: false
  33221. },
  33222. B: {
  33223. id: OPS.fillStroke,
  33224. numArgs: 0,
  33225. variableArgs: false
  33226. },
  33227. "B*": {
  33228. id: OPS.eoFillStroke,
  33229. numArgs: 0,
  33230. variableArgs: false
  33231. },
  33232. b: {
  33233. id: OPS.closeFillStroke,
  33234. numArgs: 0,
  33235. variableArgs: false
  33236. },
  33237. "b*": {
  33238. id: OPS.closeEOFillStroke,
  33239. numArgs: 0,
  33240. variableArgs: false
  33241. },
  33242. n: {
  33243. id: OPS.endPath,
  33244. numArgs: 0,
  33245. variableArgs: false
  33246. },
  33247. W: {
  33248. id: OPS.clip,
  33249. numArgs: 0,
  33250. variableArgs: false
  33251. },
  33252. "W*": {
  33253. id: OPS.eoClip,
  33254. numArgs: 0,
  33255. variableArgs: false
  33256. },
  33257. BT: {
  33258. id: OPS.beginText,
  33259. numArgs: 0,
  33260. variableArgs: false
  33261. },
  33262. ET: {
  33263. id: OPS.endText,
  33264. numArgs: 0,
  33265. variableArgs: false
  33266. },
  33267. Tc: {
  33268. id: OPS.setCharSpacing,
  33269. numArgs: 1,
  33270. variableArgs: false
  33271. },
  33272. Tw: {
  33273. id: OPS.setWordSpacing,
  33274. numArgs: 1,
  33275. variableArgs: false
  33276. },
  33277. Tz: {
  33278. id: OPS.setHScale,
  33279. numArgs: 1,
  33280. variableArgs: false
  33281. },
  33282. TL: {
  33283. id: OPS.setLeading,
  33284. numArgs: 1,
  33285. variableArgs: false
  33286. },
  33287. Tf: {
  33288. id: OPS.setFont,
  33289. numArgs: 2,
  33290. variableArgs: false
  33291. },
  33292. Tr: {
  33293. id: OPS.setTextRenderingMode,
  33294. numArgs: 1,
  33295. variableArgs: false
  33296. },
  33297. Ts: {
  33298. id: OPS.setTextRise,
  33299. numArgs: 1,
  33300. variableArgs: false
  33301. },
  33302. Td: {
  33303. id: OPS.moveText,
  33304. numArgs: 2,
  33305. variableArgs: false
  33306. },
  33307. TD: {
  33308. id: OPS.setLeadingMoveText,
  33309. numArgs: 2,
  33310. variableArgs: false
  33311. },
  33312. Tm: {
  33313. id: OPS.setTextMatrix,
  33314. numArgs: 6,
  33315. variableArgs: false
  33316. },
  33317. "T*": {
  33318. id: OPS.nextLine,
  33319. numArgs: 0,
  33320. variableArgs: false
  33321. },
  33322. Tj: {
  33323. id: OPS.showText,
  33324. numArgs: 1,
  33325. variableArgs: false
  33326. },
  33327. TJ: {
  33328. id: OPS.showSpacedText,
  33329. numArgs: 1,
  33330. variableArgs: false
  33331. },
  33332. "'": {
  33333. id: OPS.nextLineShowText,
  33334. numArgs: 1,
  33335. variableArgs: false
  33336. },
  33337. '"': {
  33338. id: OPS.nextLineSetSpacingShowText,
  33339. numArgs: 3,
  33340. variableArgs: false
  33341. },
  33342. d0: {
  33343. id: OPS.setCharWidth,
  33344. numArgs: 2,
  33345. variableArgs: false
  33346. },
  33347. d1: {
  33348. id: OPS.setCharWidthAndBounds,
  33349. numArgs: 6,
  33350. variableArgs: false
  33351. },
  33352. CS: {
  33353. id: OPS.setStrokeColorSpace,
  33354. numArgs: 1,
  33355. variableArgs: false
  33356. },
  33357. cs: {
  33358. id: OPS.setFillColorSpace,
  33359. numArgs: 1,
  33360. variableArgs: false
  33361. },
  33362. SC: {
  33363. id: OPS.setStrokeColor,
  33364. numArgs: 4,
  33365. variableArgs: true
  33366. },
  33367. SCN: {
  33368. id: OPS.setStrokeColorN,
  33369. numArgs: 33,
  33370. variableArgs: true
  33371. },
  33372. sc: {
  33373. id: OPS.setFillColor,
  33374. numArgs: 4,
  33375. variableArgs: true
  33376. },
  33377. scn: {
  33378. id: OPS.setFillColorN,
  33379. numArgs: 33,
  33380. variableArgs: true
  33381. },
  33382. G: {
  33383. id: OPS.setStrokeGray,
  33384. numArgs: 1,
  33385. variableArgs: false
  33386. },
  33387. g: {
  33388. id: OPS.setFillGray,
  33389. numArgs: 1,
  33390. variableArgs: false
  33391. },
  33392. RG: {
  33393. id: OPS.setStrokeRGBColor,
  33394. numArgs: 3,
  33395. variableArgs: false
  33396. },
  33397. rg: {
  33398. id: OPS.setFillRGBColor,
  33399. numArgs: 3,
  33400. variableArgs: false
  33401. },
  33402. K: {
  33403. id: OPS.setStrokeCMYKColor,
  33404. numArgs: 4,
  33405. variableArgs: false
  33406. },
  33407. k: {
  33408. id: OPS.setFillCMYKColor,
  33409. numArgs: 4,
  33410. variableArgs: false
  33411. },
  33412. sh: {
  33413. id: OPS.shadingFill,
  33414. numArgs: 1,
  33415. variableArgs: false
  33416. },
  33417. BI: {
  33418. id: OPS.beginInlineImage,
  33419. numArgs: 0,
  33420. variableArgs: false
  33421. },
  33422. ID: {
  33423. id: OPS.beginImageData,
  33424. numArgs: 0,
  33425. variableArgs: false
  33426. },
  33427. EI: {
  33428. id: OPS.endInlineImage,
  33429. numArgs: 1,
  33430. variableArgs: false
  33431. },
  33432. Do: {
  33433. id: OPS.paintXObject,
  33434. numArgs: 1,
  33435. variableArgs: false
  33436. },
  33437. MP: {
  33438. id: OPS.markPoint,
  33439. numArgs: 1,
  33440. variableArgs: false
  33441. },
  33442. DP: {
  33443. id: OPS.markPointProps,
  33444. numArgs: 2,
  33445. variableArgs: false
  33446. },
  33447. BMC: {
  33448. id: OPS.beginMarkedContent,
  33449. numArgs: 1,
  33450. variableArgs: false
  33451. },
  33452. BDC: {
  33453. id: OPS.beginMarkedContentProps,
  33454. numArgs: 2,
  33455. variableArgs: false
  33456. },
  33457. EMC: {
  33458. id: OPS.endMarkedContent,
  33459. numArgs: 0,
  33460. variableArgs: false
  33461. },
  33462. BX: {
  33463. id: OPS.beginCompat,
  33464. numArgs: 0,
  33465. variableArgs: false
  33466. },
  33467. EX: {
  33468. id: OPS.endCompat,
  33469. numArgs: 0,
  33470. variableArgs: false
  33471. },
  33472. BM: null,
  33473. BD: null,
  33474. true: null,
  33475. fa: null,
  33476. fal: null,
  33477. fals: null,
  33478. false: null,
  33479. nu: null,
  33480. nul: null,
  33481. null: null
  33482. }));
  33483. }
  33484. static MAX_INVALID_PATH_OPS = 10;
  33485. constructor(stream, xref, stateManager = new StateManager()) {
  33486. this.parser = new Parser({
  33487. lexer: new Lexer(stream, EvaluatorPreprocessor.opMap),
  33488. xref
  33489. });
  33490. this.stateManager = stateManager;
  33491. this.nonProcessedArgs = [];
  33492. this._isPathOp = false;
  33493. this._numInvalidPathOPS = 0;
  33494. }
  33495. get savedStatesDepth() {
  33496. return this.stateManager.stateStack.length;
  33497. }
  33498. read(operation) {
  33499. let args = operation.args;
  33500. while (true) {
  33501. const obj = this.parser.getObj();
  33502. if (obj instanceof Cmd) {
  33503. const cmd = obj.cmd;
  33504. const opSpec = EvaluatorPreprocessor.opMap[cmd];
  33505. if (!opSpec) {
  33506. warn(`Unknown command "${cmd}".`);
  33507. continue;
  33508. }
  33509. const fn = opSpec.id;
  33510. const numArgs = opSpec.numArgs;
  33511. let argsLength = args !== null ? args.length : 0;
  33512. if (!this._isPathOp) {
  33513. this._numInvalidPathOPS = 0;
  33514. }
  33515. this._isPathOp = fn >= OPS.moveTo && fn <= OPS.endPath;
  33516. if (!opSpec.variableArgs) {
  33517. if (argsLength !== numArgs) {
  33518. const nonProcessedArgs = this.nonProcessedArgs;
  33519. while (argsLength > numArgs) {
  33520. nonProcessedArgs.push(args.shift());
  33521. argsLength--;
  33522. }
  33523. while (argsLength < numArgs && nonProcessedArgs.length !== 0) {
  33524. if (args === null) {
  33525. args = [];
  33526. }
  33527. args.unshift(nonProcessedArgs.pop());
  33528. argsLength++;
  33529. }
  33530. }
  33531. if (argsLength < numArgs) {
  33532. const partialMsg = `command ${cmd}: expected ${numArgs} args, ` + `but received ${argsLength} args.`;
  33533. if (this._isPathOp && ++this._numInvalidPathOPS > EvaluatorPreprocessor.MAX_INVALID_PATH_OPS) {
  33534. throw new FormatError(`Invalid ${partialMsg}`);
  33535. }
  33536. warn(`Skipping ${partialMsg}`);
  33537. if (args !== null) {
  33538. args.length = 0;
  33539. }
  33540. continue;
  33541. }
  33542. } else if (argsLength > numArgs) {
  33543. info(`Command ${cmd}: expected [0, ${numArgs}] args, ` + `but received ${argsLength} args.`);
  33544. }
  33545. this.preprocessCommand(fn, args);
  33546. operation.fn = fn;
  33547. operation.args = args;
  33548. return true;
  33549. }
  33550. if (obj === EOF) {
  33551. return false;
  33552. }
  33553. if (obj !== null) {
  33554. if (args === null) {
  33555. args = [];
  33556. }
  33557. args.push(obj);
  33558. if (args.length > 33) {
  33559. throw new FormatError("Too many arguments");
  33560. }
  33561. }
  33562. }
  33563. }
  33564. preprocessCommand(fn, args) {
  33565. switch (fn | 0) {
  33566. case OPS.save:
  33567. this.stateManager.save();
  33568. break;
  33569. case OPS.restore:
  33570. this.stateManager.restore();
  33571. break;
  33572. case OPS.transform:
  33573. this.stateManager.transform(args);
  33574. break;
  33575. }
  33576. }
  33577. }
  33578. ;// CONCATENATED MODULE: ./src/core/default_appearance.js
  33579. class DefaultAppearanceEvaluator extends EvaluatorPreprocessor {
  33580. constructor(str) {
  33581. super(new StringStream(str));
  33582. }
  33583. parse() {
  33584. const operation = {
  33585. fn: 0,
  33586. args: []
  33587. };
  33588. const result = {
  33589. fontSize: 0,
  33590. fontName: "",
  33591. fontColor: new Uint8ClampedArray(3)
  33592. };
  33593. try {
  33594. while (true) {
  33595. operation.args.length = 0;
  33596. if (!this.read(operation)) {
  33597. break;
  33598. }
  33599. if (this.savedStatesDepth !== 0) {
  33600. continue;
  33601. }
  33602. const {
  33603. fn,
  33604. args
  33605. } = operation;
  33606. switch (fn | 0) {
  33607. case OPS.setFont:
  33608. const [fontName, fontSize] = args;
  33609. if (fontName instanceof Name) {
  33610. result.fontName = fontName.name;
  33611. }
  33612. if (typeof fontSize === "number" && fontSize > 0) {
  33613. result.fontSize = fontSize;
  33614. }
  33615. break;
  33616. case OPS.setFillRGBColor:
  33617. ColorSpace.singletons.rgb.getRgbItem(args, 0, result.fontColor, 0);
  33618. break;
  33619. case OPS.setFillGray:
  33620. ColorSpace.singletons.gray.getRgbItem(args, 0, result.fontColor, 0);
  33621. break;
  33622. case OPS.setFillCMYKColor:
  33623. ColorSpace.singletons.cmyk.getRgbItem(args, 0, result.fontColor, 0);
  33624. break;
  33625. }
  33626. }
  33627. } catch (reason) {
  33628. warn(`parseDefaultAppearance - ignoring errors: "${reason}".`);
  33629. }
  33630. return result;
  33631. }
  33632. }
  33633. function parseDefaultAppearance(str) {
  33634. return new DefaultAppearanceEvaluator(str).parse();
  33635. }
  33636. class AppearanceStreamEvaluator extends EvaluatorPreprocessor {
  33637. constructor(stream, evaluatorOptions, xref) {
  33638. super(stream);
  33639. this.stream = stream;
  33640. this.evaluatorOptions = evaluatorOptions;
  33641. this.xref = xref;
  33642. this.resources = stream.dict?.get("Resources");
  33643. }
  33644. parse() {
  33645. const operation = {
  33646. fn: 0,
  33647. args: []
  33648. };
  33649. let result = {
  33650. scaleFactor: 1,
  33651. fontSize: 0,
  33652. fontName: "",
  33653. fontColor: new Uint8ClampedArray(3),
  33654. fillColorSpace: ColorSpace.singletons.gray
  33655. };
  33656. let breakLoop = false;
  33657. const stack = [];
  33658. try {
  33659. while (true) {
  33660. operation.args.length = 0;
  33661. if (breakLoop || !this.read(operation)) {
  33662. break;
  33663. }
  33664. const {
  33665. fn,
  33666. args
  33667. } = operation;
  33668. switch (fn | 0) {
  33669. case OPS.save:
  33670. stack.push({
  33671. scaleFactor: result.scaleFactor,
  33672. fontSize: result.fontSize,
  33673. fontName: result.fontName,
  33674. fontColor: result.fontColor.slice(),
  33675. fillColorSpace: result.fillColorSpace
  33676. });
  33677. break;
  33678. case OPS.restore:
  33679. result = stack.pop() || result;
  33680. break;
  33681. case OPS.setTextMatrix:
  33682. result.scaleFactor *= Math.hypot(args[0], args[1]);
  33683. break;
  33684. case OPS.setFont:
  33685. const [fontName, fontSize] = args;
  33686. if (fontName instanceof Name) {
  33687. result.fontName = fontName.name;
  33688. }
  33689. if (typeof fontSize === "number" && fontSize > 0) {
  33690. result.fontSize = fontSize * result.scaleFactor;
  33691. }
  33692. break;
  33693. case OPS.setFillColorSpace:
  33694. result.fillColorSpace = ColorSpace.parse({
  33695. cs: args[0],
  33696. xref: this.xref,
  33697. resources: this.resources,
  33698. pdfFunctionFactory: this._pdfFunctionFactory,
  33699. localColorSpaceCache: this._localColorSpaceCache
  33700. });
  33701. break;
  33702. case OPS.setFillColor:
  33703. const cs = result.fillColorSpace;
  33704. cs.getRgbItem(args, 0, result.fontColor, 0);
  33705. break;
  33706. case OPS.setFillRGBColor:
  33707. ColorSpace.singletons.rgb.getRgbItem(args, 0, result.fontColor, 0);
  33708. break;
  33709. case OPS.setFillGray:
  33710. ColorSpace.singletons.gray.getRgbItem(args, 0, result.fontColor, 0);
  33711. break;
  33712. case OPS.setFillCMYKColor:
  33713. ColorSpace.singletons.cmyk.getRgbItem(args, 0, result.fontColor, 0);
  33714. break;
  33715. case OPS.showText:
  33716. case OPS.showSpacedText:
  33717. case OPS.nextLineShowText:
  33718. case OPS.nextLineSetSpacingShowText:
  33719. breakLoop = true;
  33720. break;
  33721. }
  33722. }
  33723. } catch (reason) {
  33724. warn(`parseAppearanceStream - ignoring errors: "${reason}".`);
  33725. }
  33726. this.stream.reset();
  33727. delete result.scaleFactor;
  33728. delete result.fillColorSpace;
  33729. return result;
  33730. }
  33731. get _localColorSpaceCache() {
  33732. return shadow(this, "_localColorSpaceCache", new LocalColorSpaceCache());
  33733. }
  33734. get _pdfFunctionFactory() {
  33735. const pdfFunctionFactory = new PDFFunctionFactory({
  33736. xref: this.xref,
  33737. isEvalSupported: this.evaluatorOptions.isEvalSupported
  33738. });
  33739. return shadow(this, "_pdfFunctionFactory", pdfFunctionFactory);
  33740. }
  33741. }
  33742. function parseAppearanceStream(stream, evaluatorOptions, xref) {
  33743. return new AppearanceStreamEvaluator(stream, evaluatorOptions, xref).parse();
  33744. }
  33745. function getPdfColor(color, isFill) {
  33746. if (color[0] === color[1] && color[1] === color[2]) {
  33747. const gray = color[0] / 255;
  33748. return `${numberToString(gray)} ${isFill ? "g" : "G"}`;
  33749. }
  33750. return Array.from(color, c => numberToString(c / 255)).join(" ") + ` ${isFill ? "rg" : "RG"}`;
  33751. }
  33752. function createDefaultAppearance({
  33753. fontSize,
  33754. fontName,
  33755. fontColor
  33756. }) {
  33757. return `/${escapePDFName(fontName)} ${fontSize} Tf ${getPdfColor(fontColor, true)}`;
  33758. }
  33759. class FakeUnicodeFont {
  33760. constructor(xref, fontFamily) {
  33761. this.xref = xref;
  33762. this.widths = null;
  33763. this.firstChar = Infinity;
  33764. this.lastChar = -Infinity;
  33765. this.fontFamily = fontFamily;
  33766. const canvas = new OffscreenCanvas(1, 1);
  33767. this.ctxMeasure = canvas.getContext("2d", {
  33768. willReadFrequently: true
  33769. });
  33770. if (!FakeUnicodeFont._fontNameId) {
  33771. FakeUnicodeFont._fontNameId = 1;
  33772. }
  33773. this.fontName = Name.get(`InvalidPDFjsFont_${fontFamily}_${FakeUnicodeFont._fontNameId++}`);
  33774. }
  33775. get fontDescriptorRef() {
  33776. if (!FakeUnicodeFont._fontDescriptorRef) {
  33777. const fontDescriptor = new Dict(this.xref);
  33778. fontDescriptor.set("Type", Name.get("FontDescriptor"));
  33779. fontDescriptor.set("FontName", this.fontName);
  33780. fontDescriptor.set("FontFamily", "MyriadPro Regular");
  33781. fontDescriptor.set("FontBBox", [0, 0, 0, 0]);
  33782. fontDescriptor.set("FontStretch", Name.get("Normal"));
  33783. fontDescriptor.set("FontWeight", 400);
  33784. fontDescriptor.set("ItalicAngle", 0);
  33785. FakeUnicodeFont._fontDescriptorRef = this.xref.getNewPersistentRef(fontDescriptor);
  33786. }
  33787. return FakeUnicodeFont._fontDescriptorRef;
  33788. }
  33789. get descendantFontRef() {
  33790. const descendantFont = new Dict(this.xref);
  33791. descendantFont.set("BaseFont", this.fontName);
  33792. descendantFont.set("Type", Name.get("Font"));
  33793. descendantFont.set("Subtype", Name.get("CIDFontType0"));
  33794. descendantFont.set("CIDToGIDMap", Name.get("Identity"));
  33795. descendantFont.set("FirstChar", this.firstChar);
  33796. descendantFont.set("LastChar", this.lastChar);
  33797. descendantFont.set("FontDescriptor", this.fontDescriptorRef);
  33798. descendantFont.set("DW", 1000);
  33799. const widths = [];
  33800. const chars = [...this.widths.entries()].sort();
  33801. let currentChar = null;
  33802. let currentWidths = null;
  33803. for (const [char, width] of chars) {
  33804. if (!currentChar) {
  33805. currentChar = char;
  33806. currentWidths = [width];
  33807. continue;
  33808. }
  33809. if (char === currentChar + currentWidths.length) {
  33810. currentWidths.push(width);
  33811. } else {
  33812. widths.push(currentChar, currentWidths);
  33813. currentChar = char;
  33814. currentWidths = [width];
  33815. }
  33816. }
  33817. if (currentChar) {
  33818. widths.push(currentChar, currentWidths);
  33819. }
  33820. descendantFont.set("W", widths);
  33821. const cidSystemInfo = new Dict(this.xref);
  33822. cidSystemInfo.set("Ordering", "Identity");
  33823. cidSystemInfo.set("Registry", "Adobe");
  33824. cidSystemInfo.set("Supplement", 0);
  33825. descendantFont.set("CIDSystemInfo", cidSystemInfo);
  33826. return this.xref.getNewPersistentRef(descendantFont);
  33827. }
  33828. get baseFontRef() {
  33829. const baseFont = new Dict(this.xref);
  33830. baseFont.set("BaseFont", this.fontName);
  33831. baseFont.set("Type", Name.get("Font"));
  33832. baseFont.set("Subtype", Name.get("Type0"));
  33833. baseFont.set("Encoding", Name.get("Identity-H"));
  33834. baseFont.set("DescendantFonts", [this.descendantFontRef]);
  33835. baseFont.set("ToUnicode", Name.get("Identity-H"));
  33836. return this.xref.getNewPersistentRef(baseFont);
  33837. }
  33838. get resources() {
  33839. const resources = new Dict(this.xref);
  33840. const font = new Dict(this.xref);
  33841. font.set(this.fontName.name, this.baseFontRef);
  33842. resources.set("Font", font);
  33843. return resources;
  33844. }
  33845. _createContext() {
  33846. this.widths = new Map();
  33847. this.ctxMeasure.font = `1000px ${this.fontFamily}`;
  33848. return this.ctxMeasure;
  33849. }
  33850. createFontResources(text) {
  33851. const ctx = this._createContext();
  33852. for (const line of text.split(/\r\n?|\n/)) {
  33853. for (const char of line.split("")) {
  33854. const code = char.charCodeAt(0);
  33855. if (this.widths.has(code)) {
  33856. continue;
  33857. }
  33858. const metrics = ctx.measureText(char);
  33859. const width = Math.ceil(metrics.width);
  33860. this.widths.set(code, width);
  33861. this.firstChar = Math.min(code, this.firstChar);
  33862. this.lastChar = Math.max(code, this.lastChar);
  33863. }
  33864. }
  33865. return this.resources;
  33866. }
  33867. static getFirstPositionInfo(rect, rotation, fontSize) {
  33868. const [x1, y1, x2, y2] = rect;
  33869. let w = x2 - x1;
  33870. let h = y2 - y1;
  33871. if (rotation % 180 !== 0) {
  33872. [w, h] = [h, w];
  33873. }
  33874. const lineHeight = LINE_FACTOR * fontSize;
  33875. const lineDescent = LINE_DESCENT_FACTOR * fontSize;
  33876. return {
  33877. coords: [0, h + lineDescent - lineHeight],
  33878. bbox: [0, 0, w, h],
  33879. matrix: rotation !== 0 ? getRotationMatrix(rotation, h, lineHeight) : undefined
  33880. };
  33881. }
  33882. createAppearance(text, rect, rotation, fontSize, bgColor, strokeAlpha) {
  33883. const ctx = this._createContext();
  33884. const lines = [];
  33885. let maxWidth = -Infinity;
  33886. for (const line of text.split(/\r\n?|\n/)) {
  33887. lines.push(line);
  33888. const lineWidth = ctx.measureText(line).width;
  33889. maxWidth = Math.max(maxWidth, lineWidth);
  33890. for (const code of codePointIter(line)) {
  33891. const char = String.fromCodePoint(code);
  33892. let width = this.widths.get(code);
  33893. if (width === undefined) {
  33894. const metrics = ctx.measureText(char);
  33895. width = Math.ceil(metrics.width);
  33896. this.widths.set(code, width);
  33897. this.firstChar = Math.min(code, this.firstChar);
  33898. this.lastChar = Math.max(code, this.lastChar);
  33899. }
  33900. }
  33901. }
  33902. maxWidth *= fontSize / 1000;
  33903. const [x1, y1, x2, y2] = rect;
  33904. let w = x2 - x1;
  33905. let h = y2 - y1;
  33906. if (rotation % 180 !== 0) {
  33907. [w, h] = [h, w];
  33908. }
  33909. let hscale = 1;
  33910. if (maxWidth > w) {
  33911. hscale = w / maxWidth;
  33912. }
  33913. let vscale = 1;
  33914. const lineHeight = LINE_FACTOR * fontSize;
  33915. const lineDescent = LINE_DESCENT_FACTOR * fontSize;
  33916. const maxHeight = lineHeight * lines.length;
  33917. if (maxHeight > h) {
  33918. vscale = h / maxHeight;
  33919. }
  33920. const fscale = Math.min(hscale, vscale);
  33921. const newFontSize = fontSize * fscale;
  33922. 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`];
  33923. const {
  33924. resources
  33925. } = this;
  33926. strokeAlpha = typeof strokeAlpha === "number" && strokeAlpha >= 0 && strokeAlpha <= 1 ? strokeAlpha : 1;
  33927. if (strokeAlpha !== 1) {
  33928. buffer.push("/R0 gs");
  33929. const extGState = new Dict(this.xref);
  33930. const r0 = new Dict(this.xref);
  33931. r0.set("ca", strokeAlpha);
  33932. r0.set("CA", strokeAlpha);
  33933. r0.set("Type", Name.get("ExtGState"));
  33934. extGState.set("R0", r0);
  33935. resources.set("ExtGState", extGState);
  33936. }
  33937. const vShift = numberToString(lineHeight);
  33938. for (const line of lines) {
  33939. buffer.push(`0 -${vShift} Td <${stringToUTF16HexString(line)}> Tj`);
  33940. }
  33941. buffer.push("ET", "Q");
  33942. const appearance = buffer.join("\n");
  33943. const appearanceStreamDict = new Dict(this.xref);
  33944. appearanceStreamDict.set("Subtype", Name.get("Form"));
  33945. appearanceStreamDict.set("Type", Name.get("XObject"));
  33946. appearanceStreamDict.set("BBox", [0, 0, w, h]);
  33947. appearanceStreamDict.set("Length", appearance.length);
  33948. appearanceStreamDict.set("Resources", resources);
  33949. if (rotation) {
  33950. const matrix = getRotationMatrix(rotation, w, h);
  33951. appearanceStreamDict.set("Matrix", matrix);
  33952. }
  33953. const ap = new StringStream(appearance);
  33954. ap.dict = appearanceStreamDict;
  33955. return ap;
  33956. }
  33957. }
  33958. ;// CONCATENATED MODULE: ./src/core/name_number_tree.js
  33959. class NameOrNumberTree {
  33960. constructor(root, xref, type) {
  33961. if (this.constructor === NameOrNumberTree) {
  33962. unreachable("Cannot initialize NameOrNumberTree.");
  33963. }
  33964. this.root = root;
  33965. this.xref = xref;
  33966. this._type = type;
  33967. }
  33968. getAll() {
  33969. const map = new Map();
  33970. if (!this.root) {
  33971. return map;
  33972. }
  33973. const xref = this.xref;
  33974. const processed = new RefSet();
  33975. processed.put(this.root);
  33976. const queue = [this.root];
  33977. while (queue.length > 0) {
  33978. const obj = xref.fetchIfRef(queue.shift());
  33979. if (!(obj instanceof Dict)) {
  33980. continue;
  33981. }
  33982. if (obj.has("Kids")) {
  33983. const kids = obj.get("Kids");
  33984. if (!Array.isArray(kids)) {
  33985. continue;
  33986. }
  33987. for (const kid of kids) {
  33988. if (processed.has(kid)) {
  33989. throw new FormatError(`Duplicate entry in "${this._type}" tree.`);
  33990. }
  33991. queue.push(kid);
  33992. processed.put(kid);
  33993. }
  33994. continue;
  33995. }
  33996. const entries = obj.get(this._type);
  33997. if (!Array.isArray(entries)) {
  33998. continue;
  33999. }
  34000. for (let i = 0, ii = entries.length; i < ii; i += 2) {
  34001. map.set(xref.fetchIfRef(entries[i]), xref.fetchIfRef(entries[i + 1]));
  34002. }
  34003. }
  34004. return map;
  34005. }
  34006. get(key) {
  34007. if (!this.root) {
  34008. return null;
  34009. }
  34010. const xref = this.xref;
  34011. let kidsOrEntries = xref.fetchIfRef(this.root);
  34012. let loopCount = 0;
  34013. const MAX_LEVELS = 10;
  34014. while (kidsOrEntries.has("Kids")) {
  34015. if (++loopCount > MAX_LEVELS) {
  34016. warn(`Search depth limit reached for "${this._type}" tree.`);
  34017. return null;
  34018. }
  34019. const kids = kidsOrEntries.get("Kids");
  34020. if (!Array.isArray(kids)) {
  34021. return null;
  34022. }
  34023. let l = 0,
  34024. r = kids.length - 1;
  34025. while (l <= r) {
  34026. const m = l + r >> 1;
  34027. const kid = xref.fetchIfRef(kids[m]);
  34028. const limits = kid.get("Limits");
  34029. if (key < xref.fetchIfRef(limits[0])) {
  34030. r = m - 1;
  34031. } else if (key > xref.fetchIfRef(limits[1])) {
  34032. l = m + 1;
  34033. } else {
  34034. kidsOrEntries = kid;
  34035. break;
  34036. }
  34037. }
  34038. if (l > r) {
  34039. return null;
  34040. }
  34041. }
  34042. const entries = kidsOrEntries.get(this._type);
  34043. if (Array.isArray(entries)) {
  34044. let l = 0,
  34045. r = entries.length - 2;
  34046. while (l <= r) {
  34047. const tmp = l + r >> 1,
  34048. m = tmp + (tmp & 1);
  34049. const currentKey = xref.fetchIfRef(entries[m]);
  34050. if (key < currentKey) {
  34051. r = m - 2;
  34052. } else if (key > currentKey) {
  34053. l = m + 2;
  34054. } else {
  34055. return xref.fetchIfRef(entries[m + 1]);
  34056. }
  34057. }
  34058. }
  34059. return null;
  34060. }
  34061. }
  34062. class NameTree extends NameOrNumberTree {
  34063. constructor(root, xref) {
  34064. super(root, xref, "Names");
  34065. }
  34066. }
  34067. class NumberTree extends NameOrNumberTree {
  34068. constructor(root, xref) {
  34069. super(root, xref, "Nums");
  34070. }
  34071. }
  34072. ;// CONCATENATED MODULE: ./src/core/cleanup_helper.js
  34073. function clearGlobalCaches() {
  34074. clearPatternCaches();
  34075. clearPrimitiveCaches();
  34076. clearUnicodeCaches();
  34077. JpxImage.cleanup();
  34078. }
  34079. ;// CONCATENATED MODULE: ./src/core/file_spec.js
  34080. function pickPlatformItem(dict) {
  34081. if (!(dict instanceof Dict)) {
  34082. return null;
  34083. }
  34084. if (dict.has("UF")) {
  34085. return dict.get("UF");
  34086. } else if (dict.has("F")) {
  34087. return dict.get("F");
  34088. } else if (dict.has("Unix")) {
  34089. return dict.get("Unix");
  34090. } else if (dict.has("Mac")) {
  34091. return dict.get("Mac");
  34092. } else if (dict.has("DOS")) {
  34093. return dict.get("DOS");
  34094. }
  34095. return null;
  34096. }
  34097. function stripPath(str) {
  34098. return str.substring(str.lastIndexOf("/") + 1);
  34099. }
  34100. class FileSpec {
  34101. #contentAvailable = false;
  34102. constructor(root, xref, skipContent = false) {
  34103. if (!(root instanceof Dict)) {
  34104. return;
  34105. }
  34106. this.xref = xref;
  34107. this.root = root;
  34108. if (root.has("FS")) {
  34109. this.fs = root.get("FS");
  34110. }
  34111. if (root.has("RF")) {
  34112. warn("Related file specifications are not supported");
  34113. }
  34114. if (!skipContent) {
  34115. if (root.has("EF")) {
  34116. this.#contentAvailable = true;
  34117. } else {
  34118. warn("Non-embedded file specifications are not supported");
  34119. }
  34120. }
  34121. }
  34122. get filename() {
  34123. let filename = "";
  34124. const item = pickPlatformItem(this.root);
  34125. if (item && typeof item === "string") {
  34126. filename = stringToPDFString(item).replaceAll("\\\\", "\\").replaceAll("\\/", "/").replaceAll("\\", "/");
  34127. }
  34128. return shadow(this, "filename", filename || "unnamed");
  34129. }
  34130. get content() {
  34131. if (!this.#contentAvailable) {
  34132. return null;
  34133. }
  34134. this._contentRef ||= pickPlatformItem(this.root?.get("EF"));
  34135. let content = null;
  34136. if (this._contentRef) {
  34137. const fileObj = this.xref.fetchIfRef(this._contentRef);
  34138. if (fileObj instanceof BaseStream) {
  34139. content = fileObj.getBytes();
  34140. } else {
  34141. warn("Embedded file specification points to non-existing/invalid content");
  34142. }
  34143. } else {
  34144. warn("Embedded file specification does not have any content");
  34145. }
  34146. return content;
  34147. }
  34148. get description() {
  34149. let description = "";
  34150. const desc = this.root?.get("Desc");
  34151. if (desc && typeof desc === "string") {
  34152. description = stringToPDFString(desc);
  34153. }
  34154. return shadow(this, "description", description);
  34155. }
  34156. get serializable() {
  34157. return {
  34158. rawFilename: this.filename,
  34159. filename: stripPath(this.filename),
  34160. content: this.content,
  34161. description: this.description
  34162. };
  34163. }
  34164. }
  34165. ;// CONCATENATED MODULE: ./src/core/xml_parser.js
  34166. const XMLParserErrorCode = {
  34167. NoError: 0,
  34168. EndOfDocument: -1,
  34169. UnterminatedCdat: -2,
  34170. UnterminatedXmlDeclaration: -3,
  34171. UnterminatedDoctypeDeclaration: -4,
  34172. UnterminatedComment: -5,
  34173. MalformedElement: -6,
  34174. OutOfMemory: -7,
  34175. UnterminatedAttributeValue: -8,
  34176. UnterminatedElement: -9,
  34177. ElementNeverBegun: -10
  34178. };
  34179. function isWhitespace(s, index) {
  34180. const ch = s[index];
  34181. return ch === " " || ch === "\n" || ch === "\r" || ch === "\t";
  34182. }
  34183. function isWhitespaceString(s) {
  34184. for (let i = 0, ii = s.length; i < ii; i++) {
  34185. if (!isWhitespace(s, i)) {
  34186. return false;
  34187. }
  34188. }
  34189. return true;
  34190. }
  34191. class XMLParserBase {
  34192. _resolveEntities(s) {
  34193. return s.replaceAll(/&([^;]+);/g, (all, entity) => {
  34194. if (entity.substring(0, 2) === "#x") {
  34195. return String.fromCodePoint(parseInt(entity.substring(2), 16));
  34196. } else if (entity.substring(0, 1) === "#") {
  34197. return String.fromCodePoint(parseInt(entity.substring(1), 10));
  34198. }
  34199. switch (entity) {
  34200. case "lt":
  34201. return "<";
  34202. case "gt":
  34203. return ">";
  34204. case "amp":
  34205. return "&";
  34206. case "quot":
  34207. return '"';
  34208. case "apos":
  34209. return "'";
  34210. }
  34211. return this.onResolveEntity(entity);
  34212. });
  34213. }
  34214. _parseContent(s, start) {
  34215. const attributes = [];
  34216. let pos = start;
  34217. function skipWs() {
  34218. while (pos < s.length && isWhitespace(s, pos)) {
  34219. ++pos;
  34220. }
  34221. }
  34222. while (pos < s.length && !isWhitespace(s, pos) && s[pos] !== ">" && s[pos] !== "/") {
  34223. ++pos;
  34224. }
  34225. const name = s.substring(start, pos);
  34226. skipWs();
  34227. while (pos < s.length && s[pos] !== ">" && s[pos] !== "/" && s[pos] !== "?") {
  34228. skipWs();
  34229. let attrName = "",
  34230. attrValue = "";
  34231. while (pos < s.length && !isWhitespace(s, pos) && s[pos] !== "=") {
  34232. attrName += s[pos];
  34233. ++pos;
  34234. }
  34235. skipWs();
  34236. if (s[pos] !== "=") {
  34237. return null;
  34238. }
  34239. ++pos;
  34240. skipWs();
  34241. const attrEndChar = s[pos];
  34242. if (attrEndChar !== '"' && attrEndChar !== "'") {
  34243. return null;
  34244. }
  34245. const attrEndIndex = s.indexOf(attrEndChar, ++pos);
  34246. if (attrEndIndex < 0) {
  34247. return null;
  34248. }
  34249. attrValue = s.substring(pos, attrEndIndex);
  34250. attributes.push({
  34251. name: attrName,
  34252. value: this._resolveEntities(attrValue)
  34253. });
  34254. pos = attrEndIndex + 1;
  34255. skipWs();
  34256. }
  34257. return {
  34258. name,
  34259. attributes,
  34260. parsed: pos - start
  34261. };
  34262. }
  34263. _parseProcessingInstruction(s, start) {
  34264. let pos = start;
  34265. function skipWs() {
  34266. while (pos < s.length && isWhitespace(s, pos)) {
  34267. ++pos;
  34268. }
  34269. }
  34270. while (pos < s.length && !isWhitespace(s, pos) && s[pos] !== ">" && s[pos] !== "?" && s[pos] !== "/") {
  34271. ++pos;
  34272. }
  34273. const name = s.substring(start, pos);
  34274. skipWs();
  34275. const attrStart = pos;
  34276. while (pos < s.length && (s[pos] !== "?" || s[pos + 1] !== ">")) {
  34277. ++pos;
  34278. }
  34279. const value = s.substring(attrStart, pos);
  34280. return {
  34281. name,
  34282. value,
  34283. parsed: pos - start
  34284. };
  34285. }
  34286. parseXml(s) {
  34287. let i = 0;
  34288. while (i < s.length) {
  34289. const ch = s[i];
  34290. let j = i;
  34291. if (ch === "<") {
  34292. ++j;
  34293. const ch2 = s[j];
  34294. let q;
  34295. switch (ch2) {
  34296. case "/":
  34297. ++j;
  34298. q = s.indexOf(">", j);
  34299. if (q < 0) {
  34300. this.onError(XMLParserErrorCode.UnterminatedElement);
  34301. return;
  34302. }
  34303. this.onEndElement(s.substring(j, q));
  34304. j = q + 1;
  34305. break;
  34306. case "?":
  34307. ++j;
  34308. const pi = this._parseProcessingInstruction(s, j);
  34309. if (s.substring(j + pi.parsed, j + pi.parsed + 2) !== "?>") {
  34310. this.onError(XMLParserErrorCode.UnterminatedXmlDeclaration);
  34311. return;
  34312. }
  34313. this.onPi(pi.name, pi.value);
  34314. j += pi.parsed + 2;
  34315. break;
  34316. case "!":
  34317. if (s.substring(j + 1, j + 3) === "--") {
  34318. q = s.indexOf("-->", j + 3);
  34319. if (q < 0) {
  34320. this.onError(XMLParserErrorCode.UnterminatedComment);
  34321. return;
  34322. }
  34323. this.onComment(s.substring(j + 3, q));
  34324. j = q + 3;
  34325. } else if (s.substring(j + 1, j + 8) === "[CDATA[") {
  34326. q = s.indexOf("]]>", j + 8);
  34327. if (q < 0) {
  34328. this.onError(XMLParserErrorCode.UnterminatedCdat);
  34329. return;
  34330. }
  34331. this.onCdata(s.substring(j + 8, q));
  34332. j = q + 3;
  34333. } else if (s.substring(j + 1, j + 8) === "DOCTYPE") {
  34334. const q2 = s.indexOf("[", j + 8);
  34335. let complexDoctype = false;
  34336. q = s.indexOf(">", j + 8);
  34337. if (q < 0) {
  34338. this.onError(XMLParserErrorCode.UnterminatedDoctypeDeclaration);
  34339. return;
  34340. }
  34341. if (q2 > 0 && q > q2) {
  34342. q = s.indexOf("]>", j + 8);
  34343. if (q < 0) {
  34344. this.onError(XMLParserErrorCode.UnterminatedDoctypeDeclaration);
  34345. return;
  34346. }
  34347. complexDoctype = true;
  34348. }
  34349. const doctypeContent = s.substring(j + 8, q + (complexDoctype ? 1 : 0));
  34350. this.onDoctype(doctypeContent);
  34351. j = q + (complexDoctype ? 2 : 1);
  34352. } else {
  34353. this.onError(XMLParserErrorCode.MalformedElement);
  34354. return;
  34355. }
  34356. break;
  34357. default:
  34358. const content = this._parseContent(s, j);
  34359. if (content === null) {
  34360. this.onError(XMLParserErrorCode.MalformedElement);
  34361. return;
  34362. }
  34363. let isClosed = false;
  34364. if (s.substring(j + content.parsed, j + content.parsed + 2) === "/>") {
  34365. isClosed = true;
  34366. } else if (s.substring(j + content.parsed, j + content.parsed + 1) !== ">") {
  34367. this.onError(XMLParserErrorCode.UnterminatedElement);
  34368. return;
  34369. }
  34370. this.onBeginElement(content.name, content.attributes, isClosed);
  34371. j += content.parsed + (isClosed ? 2 : 1);
  34372. break;
  34373. }
  34374. } else {
  34375. while (j < s.length && s[j] !== "<") {
  34376. j++;
  34377. }
  34378. const text = s.substring(i, j);
  34379. this.onText(this._resolveEntities(text));
  34380. }
  34381. i = j;
  34382. }
  34383. }
  34384. onResolveEntity(name) {
  34385. return `&${name};`;
  34386. }
  34387. onPi(name, value) {}
  34388. onComment(text) {}
  34389. onCdata(text) {}
  34390. onDoctype(doctypeContent) {}
  34391. onText(text) {}
  34392. onBeginElement(name, attributes, isEmpty) {}
  34393. onEndElement(name) {}
  34394. onError(code) {}
  34395. }
  34396. class SimpleDOMNode {
  34397. constructor(nodeName, nodeValue) {
  34398. this.nodeName = nodeName;
  34399. this.nodeValue = nodeValue;
  34400. Object.defineProperty(this, "parentNode", {
  34401. value: null,
  34402. writable: true
  34403. });
  34404. }
  34405. get firstChild() {
  34406. return this.childNodes?.[0];
  34407. }
  34408. get nextSibling() {
  34409. const childNodes = this.parentNode.childNodes;
  34410. if (!childNodes) {
  34411. return undefined;
  34412. }
  34413. const index = childNodes.indexOf(this);
  34414. if (index === -1) {
  34415. return undefined;
  34416. }
  34417. return childNodes[index + 1];
  34418. }
  34419. get textContent() {
  34420. if (!this.childNodes) {
  34421. return this.nodeValue || "";
  34422. }
  34423. return this.childNodes.map(function (child) {
  34424. return child.textContent;
  34425. }).join("");
  34426. }
  34427. get children() {
  34428. return this.childNodes || [];
  34429. }
  34430. hasChildNodes() {
  34431. return this.childNodes?.length > 0;
  34432. }
  34433. searchNode(paths, pos) {
  34434. if (pos >= paths.length) {
  34435. return this;
  34436. }
  34437. const component = paths[pos];
  34438. if (component.name.startsWith("#") && pos < paths.length - 1) {
  34439. return this.searchNode(paths, pos + 1);
  34440. }
  34441. const stack = [];
  34442. let node = this;
  34443. while (true) {
  34444. if (component.name === node.nodeName) {
  34445. if (component.pos === 0) {
  34446. const res = node.searchNode(paths, pos + 1);
  34447. if (res !== null) {
  34448. return res;
  34449. }
  34450. } else if (stack.length === 0) {
  34451. return null;
  34452. } else {
  34453. const [parent] = stack.pop();
  34454. let siblingPos = 0;
  34455. for (const child of parent.childNodes) {
  34456. if (component.name === child.nodeName) {
  34457. if (siblingPos === component.pos) {
  34458. return child.searchNode(paths, pos + 1);
  34459. }
  34460. siblingPos++;
  34461. }
  34462. }
  34463. return node.searchNode(paths, pos + 1);
  34464. }
  34465. }
  34466. if (node.childNodes?.length > 0) {
  34467. stack.push([node, 0]);
  34468. node = node.childNodes[0];
  34469. } else if (stack.length === 0) {
  34470. return null;
  34471. } else {
  34472. while (stack.length !== 0) {
  34473. const [parent, currentPos] = stack.pop();
  34474. const newPos = currentPos + 1;
  34475. if (newPos < parent.childNodes.length) {
  34476. stack.push([parent, newPos]);
  34477. node = parent.childNodes[newPos];
  34478. break;
  34479. }
  34480. }
  34481. if (stack.length === 0) {
  34482. return null;
  34483. }
  34484. }
  34485. }
  34486. }
  34487. dump(buffer) {
  34488. if (this.nodeName === "#text") {
  34489. buffer.push(encodeToXmlString(this.nodeValue));
  34490. return;
  34491. }
  34492. buffer.push(`<${this.nodeName}`);
  34493. if (this.attributes) {
  34494. for (const attribute of this.attributes) {
  34495. buffer.push(` ${attribute.name}="${encodeToXmlString(attribute.value)}"`);
  34496. }
  34497. }
  34498. if (this.hasChildNodes()) {
  34499. buffer.push(">");
  34500. for (const child of this.childNodes) {
  34501. child.dump(buffer);
  34502. }
  34503. buffer.push(`</${this.nodeName}>`);
  34504. } else if (this.nodeValue) {
  34505. buffer.push(`>${encodeToXmlString(this.nodeValue)}</${this.nodeName}>`);
  34506. } else {
  34507. buffer.push("/>");
  34508. }
  34509. }
  34510. }
  34511. class SimpleXMLParser extends XMLParserBase {
  34512. constructor({
  34513. hasAttributes = false,
  34514. lowerCaseName = false
  34515. }) {
  34516. super();
  34517. this._currentFragment = null;
  34518. this._stack = null;
  34519. this._errorCode = XMLParserErrorCode.NoError;
  34520. this._hasAttributes = hasAttributes;
  34521. this._lowerCaseName = lowerCaseName;
  34522. }
  34523. parseFromString(data) {
  34524. this._currentFragment = [];
  34525. this._stack = [];
  34526. this._errorCode = XMLParserErrorCode.NoError;
  34527. this.parseXml(data);
  34528. if (this._errorCode !== XMLParserErrorCode.NoError) {
  34529. return undefined;
  34530. }
  34531. const [documentElement] = this._currentFragment;
  34532. if (!documentElement) {
  34533. return undefined;
  34534. }
  34535. return {
  34536. documentElement
  34537. };
  34538. }
  34539. onText(text) {
  34540. if (isWhitespaceString(text)) {
  34541. return;
  34542. }
  34543. const node = new SimpleDOMNode("#text", text);
  34544. this._currentFragment.push(node);
  34545. }
  34546. onCdata(text) {
  34547. const node = new SimpleDOMNode("#text", text);
  34548. this._currentFragment.push(node);
  34549. }
  34550. onBeginElement(name, attributes, isEmpty) {
  34551. if (this._lowerCaseName) {
  34552. name = name.toLowerCase();
  34553. }
  34554. const node = new SimpleDOMNode(name);
  34555. node.childNodes = [];
  34556. if (this._hasAttributes) {
  34557. node.attributes = attributes;
  34558. }
  34559. this._currentFragment.push(node);
  34560. if (isEmpty) {
  34561. return;
  34562. }
  34563. this._stack.push(this._currentFragment);
  34564. this._currentFragment = node.childNodes;
  34565. }
  34566. onEndElement(name) {
  34567. this._currentFragment = this._stack.pop() || [];
  34568. const lastElement = this._currentFragment.at(-1);
  34569. if (!lastElement) {
  34570. return null;
  34571. }
  34572. for (const childNode of lastElement.childNodes) {
  34573. childNode.parentNode = lastElement;
  34574. }
  34575. return lastElement;
  34576. }
  34577. onError(code) {
  34578. this._errorCode = code;
  34579. }
  34580. }
  34581. ;// CONCATENATED MODULE: ./src/core/metadata_parser.js
  34582. class MetadataParser {
  34583. constructor(data) {
  34584. data = this._repair(data);
  34585. const parser = new SimpleXMLParser({
  34586. lowerCaseName: true
  34587. });
  34588. const xmlDocument = parser.parseFromString(data);
  34589. this._metadataMap = new Map();
  34590. this._data = data;
  34591. if (xmlDocument) {
  34592. this._parse(xmlDocument);
  34593. }
  34594. }
  34595. _repair(data) {
  34596. return data.replace(/^[^<]+/, "").replaceAll(/>\\376\\377([^<]+)/g, function (all, codes) {
  34597. const bytes = codes.replaceAll(/\\([0-3])([0-7])([0-7])/g, function (code, d1, d2, d3) {
  34598. return String.fromCharCode(d1 * 64 + d2 * 8 + d3 * 1);
  34599. }).replaceAll(/&(amp|apos|gt|lt|quot);/g, function (str, name) {
  34600. switch (name) {
  34601. case "amp":
  34602. return "&";
  34603. case "apos":
  34604. return "'";
  34605. case "gt":
  34606. return ">";
  34607. case "lt":
  34608. return "<";
  34609. case "quot":
  34610. return '"';
  34611. }
  34612. throw new Error(`_repair: ${name} isn't defined.`);
  34613. });
  34614. const charBuf = [">"];
  34615. for (let i = 0, ii = bytes.length; i < ii; i += 2) {
  34616. const code = bytes.charCodeAt(i) * 256 + bytes.charCodeAt(i + 1);
  34617. if (code >= 32 && code < 127 && code !== 60 && code !== 62 && code !== 38) {
  34618. charBuf.push(String.fromCharCode(code));
  34619. } else {
  34620. charBuf.push("&#x" + (0x10000 + code).toString(16).substring(1) + ";");
  34621. }
  34622. }
  34623. return charBuf.join("");
  34624. });
  34625. }
  34626. _getSequence(entry) {
  34627. const name = entry.nodeName;
  34628. if (name !== "rdf:bag" && name !== "rdf:seq" && name !== "rdf:alt") {
  34629. return null;
  34630. }
  34631. return entry.childNodes.filter(node => node.nodeName === "rdf:li");
  34632. }
  34633. _parseArray(entry) {
  34634. if (!entry.hasChildNodes()) {
  34635. return;
  34636. }
  34637. const [seqNode] = entry.childNodes;
  34638. const sequence = this._getSequence(seqNode) || [];
  34639. this._metadataMap.set(entry.nodeName, sequence.map(node => node.textContent.trim()));
  34640. }
  34641. _parse(xmlDocument) {
  34642. let rdf = xmlDocument.documentElement;
  34643. if (rdf.nodeName !== "rdf:rdf") {
  34644. rdf = rdf.firstChild;
  34645. while (rdf && rdf.nodeName !== "rdf:rdf") {
  34646. rdf = rdf.nextSibling;
  34647. }
  34648. }
  34649. if (!rdf || rdf.nodeName !== "rdf:rdf" || !rdf.hasChildNodes()) {
  34650. return;
  34651. }
  34652. for (const desc of rdf.childNodes) {
  34653. if (desc.nodeName !== "rdf:description") {
  34654. continue;
  34655. }
  34656. for (const entry of desc.childNodes) {
  34657. const name = entry.nodeName;
  34658. switch (name) {
  34659. case "#text":
  34660. continue;
  34661. case "dc:creator":
  34662. case "dc:subject":
  34663. this._parseArray(entry);
  34664. continue;
  34665. }
  34666. this._metadataMap.set(name, entry.textContent.trim());
  34667. }
  34668. }
  34669. }
  34670. get serializable() {
  34671. return {
  34672. parsedData: this._metadataMap,
  34673. rawData: this._data
  34674. };
  34675. }
  34676. }
  34677. ;// CONCATENATED MODULE: ./src/core/decrypt_stream.js
  34678. const chunkSize = 512;
  34679. class DecryptStream extends DecodeStream {
  34680. constructor(str, maybeLength, decrypt) {
  34681. super(maybeLength);
  34682. this.str = str;
  34683. this.dict = str.dict;
  34684. this.decrypt = decrypt;
  34685. this.nextChunk = null;
  34686. this.initialized = false;
  34687. }
  34688. readBlock() {
  34689. let chunk;
  34690. if (this.initialized) {
  34691. chunk = this.nextChunk;
  34692. } else {
  34693. chunk = this.str.getBytes(chunkSize);
  34694. this.initialized = true;
  34695. }
  34696. if (!chunk || chunk.length === 0) {
  34697. this.eof = true;
  34698. return;
  34699. }
  34700. this.nextChunk = this.str.getBytes(chunkSize);
  34701. const hasMoreData = this.nextChunk?.length > 0;
  34702. const decrypt = this.decrypt;
  34703. chunk = decrypt(chunk, !hasMoreData);
  34704. const bufferLength = this.bufferLength,
  34705. newLength = bufferLength + chunk.length,
  34706. buffer = this.ensureBuffer(newLength);
  34707. buffer.set(chunk, bufferLength);
  34708. this.bufferLength = newLength;
  34709. }
  34710. }
  34711. ;// CONCATENATED MODULE: ./src/core/crypto.js
  34712. class ARCFourCipher {
  34713. constructor(key) {
  34714. this.a = 0;
  34715. this.b = 0;
  34716. const s = new Uint8Array(256);
  34717. const keyLength = key.length;
  34718. for (let i = 0; i < 256; ++i) {
  34719. s[i] = i;
  34720. }
  34721. for (let i = 0, j = 0; i < 256; ++i) {
  34722. const tmp = s[i];
  34723. j = j + tmp + key[i % keyLength] & 0xff;
  34724. s[i] = s[j];
  34725. s[j] = tmp;
  34726. }
  34727. this.s = s;
  34728. }
  34729. encryptBlock(data) {
  34730. let a = this.a,
  34731. b = this.b;
  34732. const s = this.s;
  34733. const n = data.length;
  34734. const output = new Uint8Array(n);
  34735. for (let i = 0; i < n; ++i) {
  34736. a = a + 1 & 0xff;
  34737. const tmp = s[a];
  34738. b = b + tmp & 0xff;
  34739. const tmp2 = s[b];
  34740. s[a] = tmp2;
  34741. s[b] = tmp;
  34742. output[i] = data[i] ^ s[tmp + tmp2 & 0xff];
  34743. }
  34744. this.a = a;
  34745. this.b = b;
  34746. return output;
  34747. }
  34748. decryptBlock(data) {
  34749. return this.encryptBlock(data);
  34750. }
  34751. encrypt(data) {
  34752. return this.encryptBlock(data);
  34753. }
  34754. }
  34755. const calculateMD5 = function calculateMD5Closure() {
  34756. 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]);
  34757. 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]);
  34758. function hash(data, offset, length) {
  34759. let h0 = 1732584193,
  34760. h1 = -271733879,
  34761. h2 = -1732584194,
  34762. h3 = 271733878;
  34763. const paddedLength = length + 72 & ~63;
  34764. const padded = new Uint8Array(paddedLength);
  34765. let i, j;
  34766. for (i = 0; i < length; ++i) {
  34767. padded[i] = data[offset++];
  34768. }
  34769. padded[i++] = 0x80;
  34770. const n = paddedLength - 8;
  34771. while (i < n) {
  34772. padded[i++] = 0;
  34773. }
  34774. padded[i++] = length << 3 & 0xff;
  34775. padded[i++] = length >> 5 & 0xff;
  34776. padded[i++] = length >> 13 & 0xff;
  34777. padded[i++] = length >> 21 & 0xff;
  34778. padded[i++] = length >>> 29 & 0xff;
  34779. padded[i++] = 0;
  34780. padded[i++] = 0;
  34781. padded[i++] = 0;
  34782. const w = new Int32Array(16);
  34783. for (i = 0; i < paddedLength;) {
  34784. for (j = 0; j < 16; ++j, i += 4) {
  34785. w[j] = padded[i] | padded[i + 1] << 8 | padded[i + 2] << 16 | padded[i + 3] << 24;
  34786. }
  34787. let a = h0,
  34788. b = h1,
  34789. c = h2,
  34790. d = h3,
  34791. f,
  34792. g;
  34793. for (j = 0; j < 64; ++j) {
  34794. if (j < 16) {
  34795. f = b & c | ~b & d;
  34796. g = j;
  34797. } else if (j < 32) {
  34798. f = d & b | ~d & c;
  34799. g = 5 * j + 1 & 15;
  34800. } else if (j < 48) {
  34801. f = b ^ c ^ d;
  34802. g = 3 * j + 5 & 15;
  34803. } else {
  34804. f = c ^ (b | ~d);
  34805. g = 7 * j & 15;
  34806. }
  34807. const tmp = d,
  34808. rotateArg = a + f + k[j] + w[g] | 0,
  34809. rotate = r[j];
  34810. d = c;
  34811. c = b;
  34812. b = b + (rotateArg << rotate | rotateArg >>> 32 - rotate) | 0;
  34813. a = tmp;
  34814. }
  34815. h0 = h0 + a | 0;
  34816. h1 = h1 + b | 0;
  34817. h2 = h2 + c | 0;
  34818. h3 = h3 + d | 0;
  34819. }
  34820. 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]);
  34821. }
  34822. return hash;
  34823. }();
  34824. class Word64 {
  34825. constructor(highInteger, lowInteger) {
  34826. this.high = highInteger | 0;
  34827. this.low = lowInteger | 0;
  34828. }
  34829. and(word) {
  34830. this.high &= word.high;
  34831. this.low &= word.low;
  34832. }
  34833. xor(word) {
  34834. this.high ^= word.high;
  34835. this.low ^= word.low;
  34836. }
  34837. or(word) {
  34838. this.high |= word.high;
  34839. this.low |= word.low;
  34840. }
  34841. shiftRight(places) {
  34842. if (places >= 32) {
  34843. this.low = this.high >>> places - 32 | 0;
  34844. this.high = 0;
  34845. } else {
  34846. this.low = this.low >>> places | this.high << 32 - places;
  34847. this.high = this.high >>> places | 0;
  34848. }
  34849. }
  34850. shiftLeft(places) {
  34851. if (places >= 32) {
  34852. this.high = this.low << places - 32;
  34853. this.low = 0;
  34854. } else {
  34855. this.high = this.high << places | this.low >>> 32 - places;
  34856. this.low <<= places;
  34857. }
  34858. }
  34859. rotateRight(places) {
  34860. let low, high;
  34861. if (places & 32) {
  34862. high = this.low;
  34863. low = this.high;
  34864. } else {
  34865. low = this.low;
  34866. high = this.high;
  34867. }
  34868. places &= 31;
  34869. this.low = low >>> places | high << 32 - places;
  34870. this.high = high >>> places | low << 32 - places;
  34871. }
  34872. not() {
  34873. this.high = ~this.high;
  34874. this.low = ~this.low;
  34875. }
  34876. add(word) {
  34877. const lowAdd = (this.low >>> 0) + (word.low >>> 0);
  34878. let highAdd = (this.high >>> 0) + (word.high >>> 0);
  34879. if (lowAdd > 0xffffffff) {
  34880. highAdd += 1;
  34881. }
  34882. this.low = lowAdd | 0;
  34883. this.high = highAdd | 0;
  34884. }
  34885. copyTo(bytes, offset) {
  34886. bytes[offset] = this.high >>> 24 & 0xff;
  34887. bytes[offset + 1] = this.high >> 16 & 0xff;
  34888. bytes[offset + 2] = this.high >> 8 & 0xff;
  34889. bytes[offset + 3] = this.high & 0xff;
  34890. bytes[offset + 4] = this.low >>> 24 & 0xff;
  34891. bytes[offset + 5] = this.low >> 16 & 0xff;
  34892. bytes[offset + 6] = this.low >> 8 & 0xff;
  34893. bytes[offset + 7] = this.low & 0xff;
  34894. }
  34895. assign(word) {
  34896. this.high = word.high;
  34897. this.low = word.low;
  34898. }
  34899. }
  34900. const calculateSHA256 = function calculateSHA256Closure() {
  34901. function rotr(x, n) {
  34902. return x >>> n | x << 32 - n;
  34903. }
  34904. function ch(x, y, z) {
  34905. return x & y ^ ~x & z;
  34906. }
  34907. function maj(x, y, z) {
  34908. return x & y ^ x & z ^ y & z;
  34909. }
  34910. function sigma(x) {
  34911. return rotr(x, 2) ^ rotr(x, 13) ^ rotr(x, 22);
  34912. }
  34913. function sigmaPrime(x) {
  34914. return rotr(x, 6) ^ rotr(x, 11) ^ rotr(x, 25);
  34915. }
  34916. function littleSigma(x) {
  34917. return rotr(x, 7) ^ rotr(x, 18) ^ x >>> 3;
  34918. }
  34919. function littleSigmaPrime(x) {
  34920. return rotr(x, 17) ^ rotr(x, 19) ^ x >>> 10;
  34921. }
  34922. 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];
  34923. function hash(data, offset, length) {
  34924. let h0 = 0x6a09e667,
  34925. h1 = 0xbb67ae85,
  34926. h2 = 0x3c6ef372,
  34927. h3 = 0xa54ff53a,
  34928. h4 = 0x510e527f,
  34929. h5 = 0x9b05688c,
  34930. h6 = 0x1f83d9ab,
  34931. h7 = 0x5be0cd19;
  34932. const paddedLength = Math.ceil((length + 9) / 64) * 64;
  34933. const padded = new Uint8Array(paddedLength);
  34934. let i, j;
  34935. for (i = 0; i < length; ++i) {
  34936. padded[i] = data[offset++];
  34937. }
  34938. padded[i++] = 0x80;
  34939. const n = paddedLength - 8;
  34940. while (i < n) {
  34941. padded[i++] = 0;
  34942. }
  34943. padded[i++] = 0;
  34944. padded[i++] = 0;
  34945. padded[i++] = 0;
  34946. padded[i++] = length >>> 29 & 0xff;
  34947. padded[i++] = length >> 21 & 0xff;
  34948. padded[i++] = length >> 13 & 0xff;
  34949. padded[i++] = length >> 5 & 0xff;
  34950. padded[i++] = length << 3 & 0xff;
  34951. const w = new Uint32Array(64);
  34952. for (i = 0; i < paddedLength;) {
  34953. for (j = 0; j < 16; ++j) {
  34954. w[j] = padded[i] << 24 | padded[i + 1] << 16 | padded[i + 2] << 8 | padded[i + 3];
  34955. i += 4;
  34956. }
  34957. for (j = 16; j < 64; ++j) {
  34958. w[j] = littleSigmaPrime(w[j - 2]) + w[j - 7] + littleSigma(w[j - 15]) + w[j - 16] | 0;
  34959. }
  34960. let a = h0,
  34961. b = h1,
  34962. c = h2,
  34963. d = h3,
  34964. e = h4,
  34965. f = h5,
  34966. g = h6,
  34967. h = h7,
  34968. t1,
  34969. t2;
  34970. for (j = 0; j < 64; ++j) {
  34971. t1 = h + sigmaPrime(e) + ch(e, f, g) + k[j] + w[j];
  34972. t2 = sigma(a) + maj(a, b, c);
  34973. h = g;
  34974. g = f;
  34975. f = e;
  34976. e = d + t1 | 0;
  34977. d = c;
  34978. c = b;
  34979. b = a;
  34980. a = t1 + t2 | 0;
  34981. }
  34982. h0 = h0 + a | 0;
  34983. h1 = h1 + b | 0;
  34984. h2 = h2 + c | 0;
  34985. h3 = h3 + d | 0;
  34986. h4 = h4 + e | 0;
  34987. h5 = h5 + f | 0;
  34988. h6 = h6 + g | 0;
  34989. h7 = h7 + h | 0;
  34990. }
  34991. 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]);
  34992. }
  34993. return hash;
  34994. }();
  34995. const calculateSHA512 = function calculateSHA512Closure() {
  34996. function ch(result, x, y, z, tmp) {
  34997. result.assign(x);
  34998. result.and(y);
  34999. tmp.assign(x);
  35000. tmp.not();
  35001. tmp.and(z);
  35002. result.xor(tmp);
  35003. }
  35004. function maj(result, x, y, z, tmp) {
  35005. result.assign(x);
  35006. result.and(y);
  35007. tmp.assign(x);
  35008. tmp.and(z);
  35009. result.xor(tmp);
  35010. tmp.assign(y);
  35011. tmp.and(z);
  35012. result.xor(tmp);
  35013. }
  35014. function sigma(result, x, tmp) {
  35015. result.assign(x);
  35016. result.rotateRight(28);
  35017. tmp.assign(x);
  35018. tmp.rotateRight(34);
  35019. result.xor(tmp);
  35020. tmp.assign(x);
  35021. tmp.rotateRight(39);
  35022. result.xor(tmp);
  35023. }
  35024. function sigmaPrime(result, x, tmp) {
  35025. result.assign(x);
  35026. result.rotateRight(14);
  35027. tmp.assign(x);
  35028. tmp.rotateRight(18);
  35029. result.xor(tmp);
  35030. tmp.assign(x);
  35031. tmp.rotateRight(41);
  35032. result.xor(tmp);
  35033. }
  35034. function littleSigma(result, x, tmp) {
  35035. result.assign(x);
  35036. result.rotateRight(1);
  35037. tmp.assign(x);
  35038. tmp.rotateRight(8);
  35039. result.xor(tmp);
  35040. tmp.assign(x);
  35041. tmp.shiftRight(7);
  35042. result.xor(tmp);
  35043. }
  35044. function littleSigmaPrime(result, x, tmp) {
  35045. result.assign(x);
  35046. result.rotateRight(19);
  35047. tmp.assign(x);
  35048. tmp.rotateRight(61);
  35049. result.xor(tmp);
  35050. tmp.assign(x);
  35051. tmp.shiftRight(6);
  35052. result.xor(tmp);
  35053. }
  35054. 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)];
  35055. function hash(data, offset, length, mode384 = false) {
  35056. let h0, h1, h2, h3, h4, h5, h6, h7;
  35057. if (!mode384) {
  35058. h0 = new Word64(0x6a09e667, 0xf3bcc908);
  35059. h1 = new Word64(0xbb67ae85, 0x84caa73b);
  35060. h2 = new Word64(0x3c6ef372, 0xfe94f82b);
  35061. h3 = new Word64(0xa54ff53a, 0x5f1d36f1);
  35062. h4 = new Word64(0x510e527f, 0xade682d1);
  35063. h5 = new Word64(0x9b05688c, 0x2b3e6c1f);
  35064. h6 = new Word64(0x1f83d9ab, 0xfb41bd6b);
  35065. h7 = new Word64(0x5be0cd19, 0x137e2179);
  35066. } else {
  35067. h0 = new Word64(0xcbbb9d5d, 0xc1059ed8);
  35068. h1 = new Word64(0x629a292a, 0x367cd507);
  35069. h2 = new Word64(0x9159015a, 0x3070dd17);
  35070. h3 = new Word64(0x152fecd8, 0xf70e5939);
  35071. h4 = new Word64(0x67332667, 0xffc00b31);
  35072. h5 = new Word64(0x8eb44a87, 0x68581511);
  35073. h6 = new Word64(0xdb0c2e0d, 0x64f98fa7);
  35074. h7 = new Word64(0x47b5481d, 0xbefa4fa4);
  35075. }
  35076. const paddedLength = Math.ceil((length + 17) / 128) * 128;
  35077. const padded = new Uint8Array(paddedLength);
  35078. let i, j;
  35079. for (i = 0; i < length; ++i) {
  35080. padded[i] = data[offset++];
  35081. }
  35082. padded[i++] = 0x80;
  35083. const n = paddedLength - 16;
  35084. while (i < n) {
  35085. padded[i++] = 0;
  35086. }
  35087. padded[i++] = 0;
  35088. padded[i++] = 0;
  35089. padded[i++] = 0;
  35090. padded[i++] = 0;
  35091. padded[i++] = 0;
  35092. padded[i++] = 0;
  35093. padded[i++] = 0;
  35094. padded[i++] = 0;
  35095. padded[i++] = 0;
  35096. padded[i++] = 0;
  35097. padded[i++] = 0;
  35098. padded[i++] = length >>> 29 & 0xff;
  35099. padded[i++] = length >> 21 & 0xff;
  35100. padded[i++] = length >> 13 & 0xff;
  35101. padded[i++] = length >> 5 & 0xff;
  35102. padded[i++] = length << 3 & 0xff;
  35103. const w = new Array(80);
  35104. for (i = 0; i < 80; i++) {
  35105. w[i] = new Word64(0, 0);
  35106. }
  35107. let a = new Word64(0, 0),
  35108. b = new Word64(0, 0),
  35109. c = new Word64(0, 0);
  35110. let d = new Word64(0, 0),
  35111. e = new Word64(0, 0),
  35112. f = new Word64(0, 0);
  35113. let g = new Word64(0, 0),
  35114. h = new Word64(0, 0);
  35115. const t1 = new Word64(0, 0),
  35116. t2 = new Word64(0, 0);
  35117. const tmp1 = new Word64(0, 0),
  35118. tmp2 = new Word64(0, 0);
  35119. let tmp3;
  35120. for (i = 0; i < paddedLength;) {
  35121. for (j = 0; j < 16; ++j) {
  35122. w[j].high = padded[i] << 24 | padded[i + 1] << 16 | padded[i + 2] << 8 | padded[i + 3];
  35123. w[j].low = padded[i + 4] << 24 | padded[i + 5] << 16 | padded[i + 6] << 8 | padded[i + 7];
  35124. i += 8;
  35125. }
  35126. for (j = 16; j < 80; ++j) {
  35127. tmp3 = w[j];
  35128. littleSigmaPrime(tmp3, w[j - 2], tmp2);
  35129. tmp3.add(w[j - 7]);
  35130. littleSigma(tmp1, w[j - 15], tmp2);
  35131. tmp3.add(tmp1);
  35132. tmp3.add(w[j - 16]);
  35133. }
  35134. a.assign(h0);
  35135. b.assign(h1);
  35136. c.assign(h2);
  35137. d.assign(h3);
  35138. e.assign(h4);
  35139. f.assign(h5);
  35140. g.assign(h6);
  35141. h.assign(h7);
  35142. for (j = 0; j < 80; ++j) {
  35143. t1.assign(h);
  35144. sigmaPrime(tmp1, e, tmp2);
  35145. t1.add(tmp1);
  35146. ch(tmp1, e, f, g, tmp2);
  35147. t1.add(tmp1);
  35148. t1.add(k[j]);
  35149. t1.add(w[j]);
  35150. sigma(t2, a, tmp2);
  35151. maj(tmp1, a, b, c, tmp2);
  35152. t2.add(tmp1);
  35153. tmp3 = h;
  35154. h = g;
  35155. g = f;
  35156. f = e;
  35157. d.add(t1);
  35158. e = d;
  35159. d = c;
  35160. c = b;
  35161. b = a;
  35162. tmp3.assign(t1);
  35163. tmp3.add(t2);
  35164. a = tmp3;
  35165. }
  35166. h0.add(a);
  35167. h1.add(b);
  35168. h2.add(c);
  35169. h3.add(d);
  35170. h4.add(e);
  35171. h5.add(f);
  35172. h6.add(g);
  35173. h7.add(h);
  35174. }
  35175. let result;
  35176. if (!mode384) {
  35177. result = new Uint8Array(64);
  35178. h0.copyTo(result, 0);
  35179. h1.copyTo(result, 8);
  35180. h2.copyTo(result, 16);
  35181. h3.copyTo(result, 24);
  35182. h4.copyTo(result, 32);
  35183. h5.copyTo(result, 40);
  35184. h6.copyTo(result, 48);
  35185. h7.copyTo(result, 56);
  35186. } else {
  35187. result = new Uint8Array(48);
  35188. h0.copyTo(result, 0);
  35189. h1.copyTo(result, 8);
  35190. h2.copyTo(result, 16);
  35191. h3.copyTo(result, 24);
  35192. h4.copyTo(result, 32);
  35193. h5.copyTo(result, 40);
  35194. }
  35195. return result;
  35196. }
  35197. return hash;
  35198. }();
  35199. function calculateSHA384(data, offset, length) {
  35200. return calculateSHA512(data, offset, length, true);
  35201. }
  35202. class NullCipher {
  35203. decryptBlock(data) {
  35204. return data;
  35205. }
  35206. encrypt(data) {
  35207. return data;
  35208. }
  35209. }
  35210. class AESBaseCipher {
  35211. constructor() {
  35212. if (this.constructor === AESBaseCipher) {
  35213. unreachable("Cannot initialize AESBaseCipher.");
  35214. }
  35215. 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,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, 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]);
  35216. 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, 0x44, 0xc4, 0xde, 0xe9, 0xcb, 0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e, 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, 0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25, 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92, 0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda, 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84, 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06, 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b, 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73, 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e, 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f, 0x60, 0x51, 0x7f, 0xa9, 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]);
  35217. 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]);
  35218. this._mixCol = new Uint8Array(256);
  35219. for (let i = 0; i < 256; i++) {
  35220. this._mixCol[i] = i < 128 ? i << 1 : i << 1 ^ 0x1b;
  35221. }
  35222. this.buffer = new Uint8Array(16);
  35223. this.bufferPosition = 0;
  35224. }
  35225. _expandKey(cipherKey) {
  35226. unreachable("Cannot call `_expandKey` on the base class");
  35227. }
  35228. _decrypt(input, key) {
  35229. let t, u, v;
  35230. const state = new Uint8Array(16);
  35231. state.set(input);
  35232. for (let j = 0, k = this._keySize; j < 16; ++j, ++k) {
  35233. state[j] ^= key[k];
  35234. }
  35235. for (let i = this._cyclesOfRepetition - 1; i >= 1; --i) {
  35236. t = state[13];
  35237. state[13] = state[9];
  35238. state[9] = state[5];
  35239. state[5] = state[1];
  35240. state[1] = t;
  35241. t = state[14];
  35242. u = state[10];
  35243. state[14] = state[6];
  35244. state[10] = state[2];
  35245. state[6] = t;
  35246. state[2] = u;
  35247. t = state[15];
  35248. u = state[11];
  35249. v = state[7];
  35250. state[15] = state[3];
  35251. state[11] = t;
  35252. state[7] = u;
  35253. state[3] = v;
  35254. for (let j = 0; j < 16; ++j) {
  35255. state[j] = this._inv_s[state[j]];
  35256. }
  35257. for (let j = 0, k = i * 16; j < 16; ++j, ++k) {
  35258. state[j] ^= key[k];
  35259. }
  35260. for (let j = 0; j < 16; j += 4) {
  35261. const s0 = this._mix[state[j]];
  35262. const s1 = this._mix[state[j + 1]];
  35263. const s2 = this._mix[state[j + 2]];
  35264. const s3 = this._mix[state[j + 3]];
  35265. t = s0 ^ s1 >>> 8 ^ s1 << 24 ^ s2 >>> 16 ^ s2 << 16 ^ s3 >>> 24 ^ s3 << 8;
  35266. state[j] = t >>> 24 & 0xff;
  35267. state[j + 1] = t >> 16 & 0xff;
  35268. state[j + 2] = t >> 8 & 0xff;
  35269. state[j + 3] = t & 0xff;
  35270. }
  35271. }
  35272. t = state[13];
  35273. state[13] = state[9];
  35274. state[9] = state[5];
  35275. state[5] = state[1];
  35276. state[1] = t;
  35277. t = state[14];
  35278. u = state[10];
  35279. state[14] = state[6];
  35280. state[10] = state[2];
  35281. state[6] = t;
  35282. state[2] = u;
  35283. t = state[15];
  35284. u = state[11];
  35285. v = state[7];
  35286. state[15] = state[3];
  35287. state[11] = t;
  35288. state[7] = u;
  35289. state[3] = v;
  35290. for (let j = 0; j < 16; ++j) {
  35291. state[j] = this._inv_s[state[j]];
  35292. state[j] ^= key[j];
  35293. }
  35294. return state;
  35295. }
  35296. _encrypt(input, key) {
  35297. const s = this._s;
  35298. let t, u, v;
  35299. const state = new Uint8Array(16);
  35300. state.set(input);
  35301. for (let j = 0; j < 16; ++j) {
  35302. state[j] ^= key[j];
  35303. }
  35304. for (let i = 1; i < this._cyclesOfRepetition; i++) {
  35305. for (let j = 0; j < 16; ++j) {
  35306. state[j] = s[state[j]];
  35307. }
  35308. v = state[1];
  35309. state[1] = state[5];
  35310. state[5] = state[9];
  35311. state[9] = state[13];
  35312. state[13] = v;
  35313. v = state[2];
  35314. u = state[6];
  35315. state[2] = state[10];
  35316. state[6] = state[14];
  35317. state[10] = v;
  35318. state[14] = u;
  35319. v = state[3];
  35320. u = state[7];
  35321. t = state[11];
  35322. state[3] = state[15];
  35323. state[7] = v;
  35324. state[11] = u;
  35325. state[15] = t;
  35326. for (let j = 0; j < 16; j += 4) {
  35327. const s0 = state[j + 0];
  35328. const s1 = state[j + 1];
  35329. const s2 = state[j + 2];
  35330. const s3 = state[j + 3];
  35331. t = s0 ^ s1 ^ s2 ^ s3;
  35332. state[j + 0] ^= t ^ this._mixCol[s0 ^ s1];
  35333. state[j + 1] ^= t ^ this._mixCol[s1 ^ s2];
  35334. state[j + 2] ^= t ^ this._mixCol[s2 ^ s3];
  35335. state[j + 3] ^= t ^ this._mixCol[s3 ^ s0];
  35336. }
  35337. for (let j = 0, k = i * 16; j < 16; ++j, ++k) {
  35338. state[j] ^= key[k];
  35339. }
  35340. }
  35341. for (let j = 0; j < 16; ++j) {
  35342. state[j] = s[state[j]];
  35343. }
  35344. v = state[1];
  35345. state[1] = state[5];
  35346. state[5] = state[9];
  35347. state[9] = state[13];
  35348. state[13] = v;
  35349. v = state[2];
  35350. u = state[6];
  35351. state[2] = state[10];
  35352. state[6] = state[14];
  35353. state[10] = v;
  35354. state[14] = u;
  35355. v = state[3];
  35356. u = state[7];
  35357. t = state[11];
  35358. state[3] = state[15];
  35359. state[7] = v;
  35360. state[11] = u;
  35361. state[15] = t;
  35362. for (let j = 0, k = this._keySize; j < 16; ++j, ++k) {
  35363. state[j] ^= key[k];
  35364. }
  35365. return state;
  35366. }
  35367. _decryptBlock2(data, finalize) {
  35368. const sourceLength = data.length;
  35369. let buffer = this.buffer,
  35370. bufferLength = this.bufferPosition;
  35371. const result = [];
  35372. let iv = this.iv;
  35373. for (let i = 0; i < sourceLength; ++i) {
  35374. buffer[bufferLength] = data[i];
  35375. ++bufferLength;
  35376. if (bufferLength < 16) {
  35377. continue;
  35378. }
  35379. const plain = this._decrypt(buffer, this._key);
  35380. for (let j = 0; j < 16; ++j) {
  35381. plain[j] ^= iv[j];
  35382. }
  35383. iv = buffer;
  35384. result.push(plain);
  35385. buffer = new Uint8Array(16);
  35386. bufferLength = 0;
  35387. }
  35388. this.buffer = buffer;
  35389. this.bufferLength = bufferLength;
  35390. this.iv = iv;
  35391. if (result.length === 0) {
  35392. return new Uint8Array(0);
  35393. }
  35394. let outputLength = 16 * result.length;
  35395. if (finalize) {
  35396. const lastBlock = result.at(-1);
  35397. let psLen = lastBlock[15];
  35398. if (psLen <= 16) {
  35399. for (let i = 15, ii = 16 - psLen; i >= ii; --i) {
  35400. if (lastBlock[i] !== psLen) {
  35401. psLen = 0;
  35402. break;
  35403. }
  35404. }
  35405. outputLength -= psLen;
  35406. result[result.length - 1] = lastBlock.subarray(0, 16 - psLen);
  35407. }
  35408. }
  35409. const output = new Uint8Array(outputLength);
  35410. for (let i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) {
  35411. output.set(result[i], j);
  35412. }
  35413. return output;
  35414. }
  35415. decryptBlock(data, finalize, iv = null) {
  35416. const sourceLength = data.length;
  35417. const buffer = this.buffer;
  35418. let bufferLength = this.bufferPosition;
  35419. if (iv) {
  35420. this.iv = iv;
  35421. } else {
  35422. for (let i = 0; bufferLength < 16 && i < sourceLength; ++i, ++bufferLength) {
  35423. buffer[bufferLength] = data[i];
  35424. }
  35425. if (bufferLength < 16) {
  35426. this.bufferLength = bufferLength;
  35427. return new Uint8Array(0);
  35428. }
  35429. this.iv = buffer;
  35430. data = data.subarray(16);
  35431. }
  35432. this.buffer = new Uint8Array(16);
  35433. this.bufferLength = 0;
  35434. this.decryptBlock = this._decryptBlock2;
  35435. return this.decryptBlock(data, finalize);
  35436. }
  35437. encrypt(data, iv) {
  35438. const sourceLength = data.length;
  35439. let buffer = this.buffer,
  35440. bufferLength = this.bufferPosition;
  35441. const result = [];
  35442. if (!iv) {
  35443. iv = new Uint8Array(16);
  35444. }
  35445. for (let i = 0; i < sourceLength; ++i) {
  35446. buffer[bufferLength] = data[i];
  35447. ++bufferLength;
  35448. if (bufferLength < 16) {
  35449. continue;
  35450. }
  35451. for (let j = 0; j < 16; ++j) {
  35452. buffer[j] ^= iv[j];
  35453. }
  35454. const cipher = this._encrypt(buffer, this._key);
  35455. iv = cipher;
  35456. result.push(cipher);
  35457. buffer = new Uint8Array(16);
  35458. bufferLength = 0;
  35459. }
  35460. this.buffer = buffer;
  35461. this.bufferLength = bufferLength;
  35462. this.iv = iv;
  35463. if (result.length === 0) {
  35464. return new Uint8Array(0);
  35465. }
  35466. const outputLength = 16 * result.length;
  35467. const output = new Uint8Array(outputLength);
  35468. for (let i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) {
  35469. output.set(result[i], j);
  35470. }
  35471. return output;
  35472. }
  35473. }
  35474. class AES128Cipher extends AESBaseCipher {
  35475. constructor(key) {
  35476. super();
  35477. this._cyclesOfRepetition = 10;
  35478. this._keySize = 160;
  35479. this._rcon = new Uint8Array([0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80,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4a, 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]);
  35480. this._key = this._expandKey(key);
  35481. }
  35482. _expandKey(cipherKey) {
  35483. const b = 176;
  35484. const s = this._s;
  35485. const rcon = this._rcon;
  35486. const result = new Uint8Array(b);
  35487. result.set(cipherKey);
  35488. for (let j = 16, i = 1; j < b; ++i) {
  35489. let t1 = result[j - 3];
  35490. let t2 = result[j - 2];
  35491. let t3 = result[j - 1];
  35492. let t4 = result[j - 4];
  35493. t1 = s[t1];
  35494. t2 = s[t2];
  35495. t3 = s[t3];
  35496. t4 = s[t4];
  35497. t1 ^= rcon[i];
  35498. for (let n = 0; n < 4; ++n) {
  35499. result[j] = t1 ^= result[j - 16];
  35500. j++;
  35501. result[j] = t2 ^= result[j - 16];
  35502. j++;
  35503. result[j] = t3 ^= result[j - 16];
  35504. j++;
  35505. result[j] = t4 ^= result[j - 16];
  35506. j++;
  35507. }
  35508. }
  35509. return result;
  35510. }
  35511. }
  35512. class AES256Cipher extends AESBaseCipher {
  35513. constructor(key) {
  35514. super();
  35515. this._cyclesOfRepetition = 14;
  35516. this._keySize = 224;
  35517. this._key = this._expandKey(key);
  35518. }
  35519. _expandKey(cipherKey) {
  35520. const b = 240;
  35521. const s = this._s;
  35522. const result = new Uint8Array(b);
  35523. result.set(cipherKey);
  35524. let r = 1;
  35525. let t1, t2, t3, t4;
  35526. for (let j = 32, i = 1; j < b; ++i) {
  35527. if (j % 32 === 16) {
  35528. t1 = s[t1];
  35529. t2 = s[t2];
  35530. t3 = s[t3];
  35531. t4 = s[t4];
  35532. } else if (j % 32 === 0) {
  35533. t1 = result[j - 3];
  35534. t2 = result[j - 2];
  35535. t3 = result[j - 1];
  35536. t4 = result[j - 4];
  35537. t1 = s[t1];
  35538. t2 = s[t2];
  35539. t3 = s[t3];
  35540. t4 = s[t4];
  35541. t1 ^= r;
  35542. if ((r <<= 1) >= 256) {
  35543. r = (r ^ 0x1b) & 0xff;
  35544. }
  35545. }
  35546. for (let n = 0; n < 4; ++n) {
  35547. result[j] = t1 ^= result[j - 32];
  35548. j++;
  35549. result[j] = t2 ^= result[j - 32];
  35550. j++;
  35551. result[j] = t3 ^= result[j - 32];
  35552. j++;
  35553. result[j] = t4 ^= result[j - 32];
  35554. j++;
  35555. }
  35556. }
  35557. return result;
  35558. }
  35559. }
  35560. class PDF17 {
  35561. checkOwnerPassword(password, ownerValidationSalt, userBytes, ownerPassword) {
  35562. const hashData = new Uint8Array(password.length + 56);
  35563. hashData.set(password, 0);
  35564. hashData.set(ownerValidationSalt, password.length);
  35565. hashData.set(userBytes, password.length + ownerValidationSalt.length);
  35566. const result = calculateSHA256(hashData, 0, hashData.length);
  35567. return isArrayEqual(result, ownerPassword);
  35568. }
  35569. checkUserPassword(password, userValidationSalt, userPassword) {
  35570. const hashData = new Uint8Array(password.length + 8);
  35571. hashData.set(password, 0);
  35572. hashData.set(userValidationSalt, password.length);
  35573. const result = calculateSHA256(hashData, 0, hashData.length);
  35574. return isArrayEqual(result, userPassword);
  35575. }
  35576. getOwnerKey(password, ownerKeySalt, userBytes, ownerEncryption) {
  35577. const hashData = new Uint8Array(password.length + 56);
  35578. hashData.set(password, 0);
  35579. hashData.set(ownerKeySalt, password.length);
  35580. hashData.set(userBytes, password.length + ownerKeySalt.length);
  35581. const key = calculateSHA256(hashData, 0, hashData.length);
  35582. const cipher = new AES256Cipher(key);
  35583. return cipher.decryptBlock(ownerEncryption, false, new Uint8Array(16));
  35584. }
  35585. getUserKey(password, userKeySalt, userEncryption) {
  35586. const hashData = new Uint8Array(password.length + 8);
  35587. hashData.set(password, 0);
  35588. hashData.set(userKeySalt, password.length);
  35589. const key = calculateSHA256(hashData, 0, hashData.length);
  35590. const cipher = new AES256Cipher(key);
  35591. return cipher.decryptBlock(userEncryption, false, new Uint8Array(16));
  35592. }
  35593. }
  35594. class PDF20 {
  35595. _hash(password, input, userBytes) {
  35596. let k = calculateSHA256(input, 0, input.length).subarray(0, 32);
  35597. let e = [0];
  35598. let i = 0;
  35599. while (i < 64 || e.at(-1) > i - 32) {
  35600. const combinedLength = password.length + k.length + userBytes.length,
  35601. combinedArray = new Uint8Array(combinedLength);
  35602. let writeOffset = 0;
  35603. combinedArray.set(password, writeOffset);
  35604. writeOffset += password.length;
  35605. combinedArray.set(k, writeOffset);
  35606. writeOffset += k.length;
  35607. combinedArray.set(userBytes, writeOffset);
  35608. const k1 = new Uint8Array(combinedLength * 64);
  35609. for (let j = 0, pos = 0; j < 64; j++, pos += combinedLength) {
  35610. k1.set(combinedArray, pos);
  35611. }
  35612. const cipher = new AES128Cipher(k.subarray(0, 16));
  35613. e = cipher.encrypt(k1, k.subarray(16, 32));
  35614. const remainder = e.slice(0, 16).reduce((a, b) => a + b, 0) % 3;
  35615. if (remainder === 0) {
  35616. k = calculateSHA256(e, 0, e.length);
  35617. } else if (remainder === 1) {
  35618. k = calculateSHA384(e, 0, e.length);
  35619. } else if (remainder === 2) {
  35620. k = calculateSHA512(e, 0, e.length);
  35621. }
  35622. i++;
  35623. }
  35624. return k.subarray(0, 32);
  35625. }
  35626. checkOwnerPassword(password, ownerValidationSalt, userBytes, ownerPassword) {
  35627. const hashData = new Uint8Array(password.length + 56);
  35628. hashData.set(password, 0);
  35629. hashData.set(ownerValidationSalt, password.length);
  35630. hashData.set(userBytes, password.length + ownerValidationSalt.length);
  35631. const result = this._hash(password, hashData, userBytes);
  35632. return isArrayEqual(result, ownerPassword);
  35633. }
  35634. checkUserPassword(password, userValidationSalt, userPassword) {
  35635. const hashData = new Uint8Array(password.length + 8);
  35636. hashData.set(password, 0);
  35637. hashData.set(userValidationSalt, password.length);
  35638. const result = this._hash(password, hashData, []);
  35639. return isArrayEqual(result, userPassword);
  35640. }
  35641. getOwnerKey(password, ownerKeySalt, userBytes, ownerEncryption) {
  35642. const hashData = new Uint8Array(password.length + 56);
  35643. hashData.set(password, 0);
  35644. hashData.set(ownerKeySalt, password.length);
  35645. hashData.set(userBytes, password.length + ownerKeySalt.length);
  35646. const key = this._hash(password, hashData, userBytes);
  35647. const cipher = new AES256Cipher(key);
  35648. return cipher.decryptBlock(ownerEncryption, false, new Uint8Array(16));
  35649. }
  35650. getUserKey(password, userKeySalt, userEncryption) {
  35651. const hashData = new Uint8Array(password.length + 8);
  35652. hashData.set(password, 0);
  35653. hashData.set(userKeySalt, password.length);
  35654. const key = this._hash(password, hashData, []);
  35655. const cipher = new AES256Cipher(key);
  35656. return cipher.decryptBlock(userEncryption, false, new Uint8Array(16));
  35657. }
  35658. }
  35659. class CipherTransform {
  35660. constructor(stringCipherConstructor, streamCipherConstructor) {
  35661. this.StringCipherConstructor = stringCipherConstructor;
  35662. this.StreamCipherConstructor = streamCipherConstructor;
  35663. }
  35664. createStream(stream, length) {
  35665. const cipher = new this.StreamCipherConstructor();
  35666. return new DecryptStream(stream, length, function cipherTransformDecryptStream(data, finalize) {
  35667. return cipher.decryptBlock(data, finalize);
  35668. });
  35669. }
  35670. decryptString(s) {
  35671. const cipher = new this.StringCipherConstructor();
  35672. let data = stringToBytes(s);
  35673. data = cipher.decryptBlock(data, true);
  35674. return bytesToString(data);
  35675. }
  35676. encryptString(s) {
  35677. const cipher = new this.StringCipherConstructor();
  35678. if (cipher instanceof AESBaseCipher) {
  35679. const strLen = s.length;
  35680. const pad = 16 - strLen % 16;
  35681. s += String.fromCharCode(pad).repeat(pad);
  35682. const iv = new Uint8Array(16);
  35683. if (typeof crypto !== "undefined") {
  35684. crypto.getRandomValues(iv);
  35685. } else {
  35686. for (let i = 0; i < 16; i++) {
  35687. iv[i] = Math.floor(256 * Math.random());
  35688. }
  35689. }
  35690. let data = stringToBytes(s);
  35691. data = cipher.encrypt(data, iv);
  35692. const buf = new Uint8Array(16 + data.length);
  35693. buf.set(iv);
  35694. buf.set(data, 16);
  35695. return bytesToString(buf);
  35696. }
  35697. let data = stringToBytes(s);
  35698. data = cipher.encrypt(data);
  35699. return bytesToString(data);
  35700. }
  35701. }
  35702. class CipherTransformFactory {
  35703. 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]);
  35704. #createEncryptionKey20(revision, password, ownerPassword, ownerValidationSalt, ownerKeySalt, uBytes, userPassword, userValidationSalt, userKeySalt, ownerEncryption, userEncryption, perms) {
  35705. if (password) {
  35706. const passwordLength = Math.min(127, password.length);
  35707. password = password.subarray(0, passwordLength);
  35708. } else {
  35709. password = [];
  35710. }
  35711. const pdfAlgorithm = revision === 6 ? new PDF20() : new PDF17();
  35712. if (pdfAlgorithm.checkUserPassword(password, userValidationSalt, userPassword)) {
  35713. return pdfAlgorithm.getUserKey(password, userKeySalt, userEncryption);
  35714. } else if (password.length && pdfAlgorithm.checkOwnerPassword(password, ownerValidationSalt, uBytes, ownerPassword)) {
  35715. return pdfAlgorithm.getOwnerKey(password, ownerKeySalt, uBytes, ownerEncryption);
  35716. }
  35717. return null;
  35718. }
  35719. #prepareKeyData(fileId, password, ownerPassword, userPassword, flags, revision, keyLength, encryptMetadata) {
  35720. const hashDataSize = 40 + ownerPassword.length + fileId.length;
  35721. const hashData = new Uint8Array(hashDataSize);
  35722. let i = 0,
  35723. j,
  35724. n;
  35725. if (password) {
  35726. n = Math.min(32, password.length);
  35727. for (; i < n; ++i) {
  35728. hashData[i] = password[i];
  35729. }
  35730. }
  35731. j = 0;
  35732. while (i < 32) {
  35733. hashData[i++] = CipherTransformFactory.#defaultPasswordBytes[j++];
  35734. }
  35735. for (j = 0, n = ownerPassword.length; j < n; ++j) {
  35736. hashData[i++] = ownerPassword[j];
  35737. }
  35738. hashData[i++] = flags & 0xff;
  35739. hashData[i++] = flags >> 8 & 0xff;
  35740. hashData[i++] = flags >> 16 & 0xff;
  35741. hashData[i++] = flags >>> 24 & 0xff;
  35742. for (j = 0, n = fileId.length; j < n; ++j) {
  35743. hashData[i++] = fileId[j];
  35744. }
  35745. if (revision >= 4 && !encryptMetadata) {
  35746. hashData[i++] = 0xff;
  35747. hashData[i++] = 0xff;
  35748. hashData[i++] = 0xff;
  35749. hashData[i++] = 0xff;
  35750. }
  35751. let hash = calculateMD5(hashData, 0, i);
  35752. const keyLengthInBytes = keyLength >> 3;
  35753. if (revision >= 3) {
  35754. for (j = 0; j < 50; ++j) {
  35755. hash = calculateMD5(hash, 0, keyLengthInBytes);
  35756. }
  35757. }
  35758. const encryptionKey = hash.subarray(0, keyLengthInBytes);
  35759. let cipher, checkData;
  35760. if (revision >= 3) {
  35761. for (i = 0; i < 32; ++i) {
  35762. hashData[i] = CipherTransformFactory.#defaultPasswordBytes[i];
  35763. }
  35764. for (j = 0, n = fileId.length; j < n; ++j) {
  35765. hashData[i++] = fileId[j];
  35766. }
  35767. cipher = new ARCFourCipher(encryptionKey);
  35768. checkData = cipher.encryptBlock(calculateMD5(hashData, 0, i));
  35769. n = encryptionKey.length;
  35770. const derivedKey = new Uint8Array(n);
  35771. for (j = 1; j <= 19; ++j) {
  35772. for (let k = 0; k < n; ++k) {
  35773. derivedKey[k] = encryptionKey[k] ^ j;
  35774. }
  35775. cipher = new ARCFourCipher(derivedKey);
  35776. checkData = cipher.encryptBlock(checkData);
  35777. }
  35778. for (j = 0, n = checkData.length; j < n; ++j) {
  35779. if (userPassword[j] !== checkData[j]) {
  35780. return null;
  35781. }
  35782. }
  35783. } else {
  35784. cipher = new ARCFourCipher(encryptionKey);
  35785. checkData = cipher.encryptBlock(CipherTransformFactory.#defaultPasswordBytes);
  35786. for (j = 0, n = checkData.length; j < n; ++j) {
  35787. if (userPassword[j] !== checkData[j]) {
  35788. return null;
  35789. }
  35790. }
  35791. }
  35792. return encryptionKey;
  35793. }
  35794. #decodeUserPassword(password, ownerPassword, revision, keyLength) {
  35795. const hashData = new Uint8Array(32);
  35796. let i = 0;
  35797. const n = Math.min(32, password.length);
  35798. for (; i < n; ++i) {
  35799. hashData[i] = password[i];
  35800. }
  35801. let j = 0;
  35802. while (i < 32) {
  35803. hashData[i++] = CipherTransformFactory.#defaultPasswordBytes[j++];
  35804. }
  35805. let hash = calculateMD5(hashData, 0, i);
  35806. const keyLengthInBytes = keyLength >> 3;
  35807. if (revision >= 3) {
  35808. for (j = 0; j < 50; ++j) {
  35809. hash = calculateMD5(hash, 0, hash.length);
  35810. }
  35811. }
  35812. let cipher, userPassword;
  35813. if (revision >= 3) {
  35814. userPassword = ownerPassword;
  35815. const derivedKey = new Uint8Array(keyLengthInBytes);
  35816. for (j = 19; j >= 0; j--) {
  35817. for (let k = 0; k < keyLengthInBytes; ++k) {
  35818. derivedKey[k] = hash[k] ^ j;
  35819. }
  35820. cipher = new ARCFourCipher(derivedKey);
  35821. userPassword = cipher.encryptBlock(userPassword);
  35822. }
  35823. } else {
  35824. cipher = new ARCFourCipher(hash.subarray(0, keyLengthInBytes));
  35825. userPassword = cipher.encryptBlock(ownerPassword);
  35826. }
  35827. return userPassword;
  35828. }
  35829. #buildObjectKey(num, gen, encryptionKey, isAes = false) {
  35830. const key = new Uint8Array(encryptionKey.length + 9);
  35831. const n = encryptionKey.length;
  35832. let i;
  35833. for (i = 0; i < n; ++i) {
  35834. key[i] = encryptionKey[i];
  35835. }
  35836. key[i++] = num & 0xff;
  35837. key[i++] = num >> 8 & 0xff;
  35838. key[i++] = num >> 16 & 0xff;
  35839. key[i++] = gen & 0xff;
  35840. key[i++] = gen >> 8 & 0xff;
  35841. if (isAes) {
  35842. key[i++] = 0x73;
  35843. key[i++] = 0x41;
  35844. key[i++] = 0x6c;
  35845. key[i++] = 0x54;
  35846. }
  35847. const hash = calculateMD5(key, 0, i);
  35848. return hash.subarray(0, Math.min(encryptionKey.length + 5, 16));
  35849. }
  35850. #buildCipherConstructor(cf, name, num, gen, key) {
  35851. if (!(name instanceof Name)) {
  35852. throw new FormatError("Invalid crypt filter name.");
  35853. }
  35854. const self = this;
  35855. const cryptFilter = cf.get(name.name);
  35856. const cfm = cryptFilter?.get("CFM");
  35857. if (!cfm || cfm.name === "None") {
  35858. return function () {
  35859. return new NullCipher();
  35860. };
  35861. }
  35862. if (cfm.name === "V2") {
  35863. return function () {
  35864. return new ARCFourCipher(self.#buildObjectKey(num, gen, key, false));
  35865. };
  35866. }
  35867. if (cfm.name === "AESV2") {
  35868. return function () {
  35869. return new AES128Cipher(self.#buildObjectKey(num, gen, key, true));
  35870. };
  35871. }
  35872. if (cfm.name === "AESV3") {
  35873. return function () {
  35874. return new AES256Cipher(key);
  35875. };
  35876. }
  35877. throw new FormatError("Unknown crypto method");
  35878. }
  35879. constructor(dict, fileId, password) {
  35880. const filter = dict.get("Filter");
  35881. if (!isName(filter, "Standard")) {
  35882. throw new FormatError("unknown encryption method");
  35883. }
  35884. this.filterName = filter.name;
  35885. this.dict = dict;
  35886. const algorithm = dict.get("V");
  35887. if (!Number.isInteger(algorithm) || algorithm !== 1 && algorithm !== 2 && algorithm !== 4 && algorithm !== 5) {
  35888. throw new FormatError("unsupported encryption algorithm");
  35889. }
  35890. this.algorithm = algorithm;
  35891. let keyLength = dict.get("Length");
  35892. if (!keyLength) {
  35893. if (algorithm <= 3) {
  35894. keyLength = 40;
  35895. } else {
  35896. const cfDict = dict.get("CF");
  35897. const streamCryptoName = dict.get("StmF");
  35898. if (cfDict instanceof Dict && streamCryptoName instanceof Name) {
  35899. cfDict.suppressEncryption = true;
  35900. const handlerDict = cfDict.get(streamCryptoName.name);
  35901. keyLength = handlerDict?.get("Length") || 128;
  35902. if (keyLength < 40) {
  35903. keyLength <<= 3;
  35904. }
  35905. }
  35906. }
  35907. }
  35908. if (!Number.isInteger(keyLength) || keyLength < 40 || keyLength % 8 !== 0) {
  35909. throw new FormatError("invalid key length");
  35910. }
  35911. const ownerBytes = stringToBytes(dict.get("O")),
  35912. userBytes = stringToBytes(dict.get("U"));
  35913. const ownerPassword = ownerBytes.subarray(0, 32);
  35914. const userPassword = userBytes.subarray(0, 32);
  35915. const flags = dict.get("P");
  35916. const revision = dict.get("R");
  35917. const encryptMetadata = (algorithm === 4 || algorithm === 5) && dict.get("EncryptMetadata") !== false;
  35918. this.encryptMetadata = encryptMetadata;
  35919. const fileIdBytes = stringToBytes(fileId);
  35920. let passwordBytes;
  35921. if (password) {
  35922. if (revision === 6) {
  35923. try {
  35924. password = utf8StringToString(password);
  35925. } catch {
  35926. warn("CipherTransformFactory: Unable to convert UTF8 encoded password.");
  35927. }
  35928. }
  35929. passwordBytes = stringToBytes(password);
  35930. }
  35931. let encryptionKey;
  35932. if (algorithm !== 5) {
  35933. encryptionKey = this.#prepareKeyData(fileIdBytes, passwordBytes, ownerPassword, userPassword, flags, revision, keyLength, encryptMetadata);
  35934. } else {
  35935. const ownerValidationSalt = ownerBytes.subarray(32, 40);
  35936. const ownerKeySalt = ownerBytes.subarray(40, 48);
  35937. const uBytes = userBytes.subarray(0, 48);
  35938. const userValidationSalt = userBytes.subarray(32, 40);
  35939. const userKeySalt = userBytes.subarray(40, 48);
  35940. const ownerEncryption = stringToBytes(dict.get("OE"));
  35941. const userEncryption = stringToBytes(dict.get("UE"));
  35942. const perms = stringToBytes(dict.get("Perms"));
  35943. encryptionKey = this.#createEncryptionKey20(revision, passwordBytes, ownerPassword, ownerValidationSalt, ownerKeySalt, uBytes, userPassword, userValidationSalt, userKeySalt, ownerEncryption, userEncryption, perms);
  35944. }
  35945. if (!encryptionKey && !password) {
  35946. throw new PasswordException("No password given", PasswordResponses.NEED_PASSWORD);
  35947. } else if (!encryptionKey && password) {
  35948. const decodedPassword = this.#decodeUserPassword(passwordBytes, ownerPassword, revision, keyLength);
  35949. encryptionKey = this.#prepareKeyData(fileIdBytes, decodedPassword, ownerPassword, userPassword, flags, revision, keyLength, encryptMetadata);
  35950. }
  35951. if (!encryptionKey) {
  35952. throw new PasswordException("Incorrect Password", PasswordResponses.INCORRECT_PASSWORD);
  35953. }
  35954. this.encryptionKey = encryptionKey;
  35955. if (algorithm >= 4) {
  35956. const cf = dict.get("CF");
  35957. if (cf instanceof Dict) {
  35958. cf.suppressEncryption = true;
  35959. }
  35960. this.cf = cf;
  35961. this.stmf = dict.get("StmF") || Name.get("Identity");
  35962. this.strf = dict.get("StrF") || Name.get("Identity");
  35963. this.eff = dict.get("EFF") || this.stmf;
  35964. }
  35965. }
  35966. createCipherTransform(num, gen) {
  35967. if (this.algorithm === 4 || this.algorithm === 5) {
  35968. return new CipherTransform(this.#buildCipherConstructor(this.cf, this.strf, num, gen, this.encryptionKey), this.#buildCipherConstructor(this.cf, this.stmf, num, gen, this.encryptionKey));
  35969. }
  35970. const key = this.#buildObjectKey(num, gen, this.encryptionKey, false);
  35971. const cipherConstructor = function () {
  35972. return new ARCFourCipher(key);
  35973. };
  35974. return new CipherTransform(cipherConstructor, cipherConstructor);
  35975. }
  35976. }
  35977. ;// CONCATENATED MODULE: ./src/core/writer.js
  35978. async function writeObject(ref, obj, buffer, {
  35979. encrypt = null
  35980. }) {
  35981. const transform = encrypt?.createCipherTransform(ref.num, ref.gen);
  35982. buffer.push(`${ref.num} ${ref.gen} obj\n`);
  35983. if (obj instanceof Dict) {
  35984. await writeDict(obj, buffer, transform);
  35985. } else if (obj instanceof BaseStream) {
  35986. await writeStream(obj, buffer, transform);
  35987. } else if (Array.isArray(obj) || ArrayBuffer.isView(obj)) {
  35988. await writeArray(obj, buffer, transform);
  35989. }
  35990. buffer.push("\nendobj\n");
  35991. }
  35992. async function writeDict(dict, buffer, transform) {
  35993. buffer.push("<<");
  35994. for (const key of dict.getKeys()) {
  35995. buffer.push(` /${escapePDFName(key)} `);
  35996. await writeValue(dict.getRaw(key), buffer, transform);
  35997. }
  35998. buffer.push(">>");
  35999. }
  36000. async function writeStream(stream, buffer, transform) {
  36001. let bytes = stream.getBytes();
  36002. const {
  36003. dict
  36004. } = stream;
  36005. const [filter, params] = await Promise.all([dict.getAsync("Filter"), dict.getAsync("DecodeParms")]);
  36006. const filterZero = Array.isArray(filter) ? await dict.xref.fetchIfRefAsync(filter[0]) : filter;
  36007. const isFilterZeroFlateDecode = isName(filterZero, "FlateDecode");
  36008. const MIN_LENGTH_FOR_COMPRESSING = 256;
  36009. if (bytes.length >= MIN_LENGTH_FOR_COMPRESSING || isFilterZeroFlateDecode) {
  36010. try {
  36011. const cs = new CompressionStream("deflate");
  36012. const writer = cs.writable.getWriter();
  36013. writer.write(bytes);
  36014. writer.close();
  36015. const buf = await new Response(cs.readable).arrayBuffer();
  36016. bytes = new Uint8Array(buf);
  36017. let newFilter, newParams;
  36018. if (!filter) {
  36019. newFilter = Name.get("FlateDecode");
  36020. } else if (!isFilterZeroFlateDecode) {
  36021. newFilter = Array.isArray(filter) ? [Name.get("FlateDecode"), ...filter] : [Name.get("FlateDecode"), filter];
  36022. if (params) {
  36023. newParams = Array.isArray(params) ? [null, ...params] : [null, params];
  36024. }
  36025. }
  36026. if (newFilter) {
  36027. dict.set("Filter", newFilter);
  36028. }
  36029. if (newParams) {
  36030. dict.set("DecodeParms", newParams);
  36031. }
  36032. } catch (ex) {
  36033. info(`writeStream - cannot compress data: "${ex}".`);
  36034. }
  36035. }
  36036. let string = bytesToString(bytes);
  36037. if (transform) {
  36038. string = transform.encryptString(string);
  36039. }
  36040. dict.set("Length", string.length);
  36041. await writeDict(dict, buffer, transform);
  36042. buffer.push(" stream\n", string, "\nendstream");
  36043. }
  36044. async function writeArray(array, buffer, transform) {
  36045. buffer.push("[");
  36046. let first = true;
  36047. for (const val of array) {
  36048. if (!first) {
  36049. buffer.push(" ");
  36050. } else {
  36051. first = false;
  36052. }
  36053. await writeValue(val, buffer, transform);
  36054. }
  36055. buffer.push("]");
  36056. }
  36057. async function writeValue(value, buffer, transform) {
  36058. if (value instanceof Name) {
  36059. buffer.push(`/${escapePDFName(value.name)}`);
  36060. } else if (value instanceof Ref) {
  36061. buffer.push(`${value.num} ${value.gen} R`);
  36062. } else if (Array.isArray(value) || ArrayBuffer.isView(value)) {
  36063. await writeArray(value, buffer, transform);
  36064. } else if (typeof value === "string") {
  36065. if (transform) {
  36066. value = transform.encryptString(value);
  36067. }
  36068. buffer.push(`(${escapeString(value)})`);
  36069. } else if (typeof value === "number") {
  36070. buffer.push(numberToString(value));
  36071. } else if (typeof value === "boolean") {
  36072. buffer.push(value.toString());
  36073. } else if (value instanceof Dict) {
  36074. await writeDict(value, buffer, transform);
  36075. } else if (value instanceof BaseStream) {
  36076. await writeStream(value, buffer, transform);
  36077. } else if (value === null) {
  36078. buffer.push("null");
  36079. } else {
  36080. warn(`Unhandled value in writer: ${typeof value}, please file a bug.`);
  36081. }
  36082. }
  36083. function writeInt(number, size, offset, buffer) {
  36084. for (let i = size + offset - 1; i > offset - 1; i--) {
  36085. buffer[i] = number & 0xff;
  36086. number >>= 8;
  36087. }
  36088. return offset + size;
  36089. }
  36090. function writeString(string, offset, buffer) {
  36091. for (let i = 0, len = string.length; i < len; i++) {
  36092. buffer[offset + i] = string.charCodeAt(i) & 0xff;
  36093. }
  36094. }
  36095. function computeMD5(filesize, xrefInfo) {
  36096. const time = Math.floor(Date.now() / 1000);
  36097. const filename = xrefInfo.filename || "";
  36098. const md5Buffer = [time.toString(), filename, filesize.toString()];
  36099. let md5BufferLen = md5Buffer.reduce((a, str) => a + str.length, 0);
  36100. for (const value of Object.values(xrefInfo.info)) {
  36101. md5Buffer.push(value);
  36102. md5BufferLen += value.length;
  36103. }
  36104. const array = new Uint8Array(md5BufferLen);
  36105. let offset = 0;
  36106. for (const str of md5Buffer) {
  36107. writeString(str, offset, array);
  36108. offset += str.length;
  36109. }
  36110. return bytesToString(calculateMD5(array));
  36111. }
  36112. function writeXFADataForAcroform(str, newRefs) {
  36113. const xml = new SimpleXMLParser({
  36114. hasAttributes: true
  36115. }).parseFromString(str);
  36116. for (const {
  36117. xfa
  36118. } of newRefs) {
  36119. if (!xfa) {
  36120. continue;
  36121. }
  36122. const {
  36123. path,
  36124. value
  36125. } = xfa;
  36126. if (!path) {
  36127. continue;
  36128. }
  36129. const nodePath = parseXFAPath(path);
  36130. let node = xml.documentElement.searchNode(nodePath, 0);
  36131. if (!node && nodePath.length > 1) {
  36132. node = xml.documentElement.searchNode([nodePath.at(-1)], 0);
  36133. }
  36134. if (node) {
  36135. node.childNodes = Array.isArray(value) ? value.map(val => new SimpleDOMNode("value", val)) : [new SimpleDOMNode("#text", value)];
  36136. } else {
  36137. warn(`Node not found for path: ${path}`);
  36138. }
  36139. }
  36140. const buffer = [];
  36141. xml.documentElement.dump(buffer);
  36142. return buffer.join("");
  36143. }
  36144. async function updateAcroform({
  36145. xref,
  36146. acroForm,
  36147. acroFormRef,
  36148. hasXfa,
  36149. hasXfaDatasetsEntry,
  36150. xfaDatasetsRef,
  36151. needAppearances,
  36152. newRefs
  36153. }) {
  36154. if (hasXfa && !hasXfaDatasetsEntry && !xfaDatasetsRef) {
  36155. warn("XFA - Cannot save it");
  36156. }
  36157. if (!needAppearances && (!hasXfa || !xfaDatasetsRef || hasXfaDatasetsEntry)) {
  36158. return;
  36159. }
  36160. const dict = acroForm.clone();
  36161. if (hasXfa && !hasXfaDatasetsEntry) {
  36162. const newXfa = acroForm.get("XFA").slice();
  36163. newXfa.splice(2, 0, "datasets");
  36164. newXfa.splice(3, 0, xfaDatasetsRef);
  36165. dict.set("XFA", newXfa);
  36166. }
  36167. if (needAppearances) {
  36168. dict.set("NeedAppearances", true);
  36169. }
  36170. const buffer = [];
  36171. await writeObject(acroFormRef, dict, buffer, xref);
  36172. newRefs.push({
  36173. ref: acroFormRef,
  36174. data: buffer.join("")
  36175. });
  36176. }
  36177. function updateXFA({
  36178. xfaData,
  36179. xfaDatasetsRef,
  36180. newRefs,
  36181. xref
  36182. }) {
  36183. if (xfaData === null) {
  36184. const datasets = xref.fetchIfRef(xfaDatasetsRef);
  36185. xfaData = writeXFADataForAcroform(datasets.getString(), newRefs);
  36186. }
  36187. const encrypt = xref.encrypt;
  36188. if (encrypt) {
  36189. const transform = encrypt.createCipherTransform(xfaDatasetsRef.num, xfaDatasetsRef.gen);
  36190. xfaData = transform.encryptString(xfaData);
  36191. }
  36192. const data = `${xfaDatasetsRef.num} ${xfaDatasetsRef.gen} obj\n` + `<< /Type /EmbeddedFile /Length ${xfaData.length}>>\nstream\n` + xfaData + "\nendstream\nendobj\n";
  36193. newRefs.push({
  36194. ref: xfaDatasetsRef,
  36195. data
  36196. });
  36197. }
  36198. async function getXRefTable(xrefInfo, baseOffset, newRefs, newXref, buffer) {
  36199. buffer.push("xref\n");
  36200. const indexes = getIndexes(newRefs);
  36201. let indexesPosition = 0;
  36202. for (const {
  36203. ref,
  36204. data
  36205. } of newRefs) {
  36206. if (ref.num === indexes[indexesPosition]) {
  36207. buffer.push(`${indexes[indexesPosition]} ${indexes[indexesPosition + 1]}\n`);
  36208. indexesPosition += 2;
  36209. }
  36210. if (data !== null) {
  36211. buffer.push(`${baseOffset.toString().padStart(10, "0")} ${Math.min(ref.gen, 0xffff).toString().padStart(5, "0")} n\r\n`);
  36212. baseOffset += data.length;
  36213. } else {
  36214. buffer.push(`0000000000 ${Math.min(ref.gen + 1, 0xffff).toString().padStart(5, "0")} f\r\n`);
  36215. }
  36216. }
  36217. computeIDs(baseOffset, xrefInfo, newXref);
  36218. buffer.push("trailer\n");
  36219. await writeDict(newXref, buffer);
  36220. buffer.push("\nstartxref\n", baseOffset.toString(), "\n%%EOF\n");
  36221. }
  36222. function getIndexes(newRefs) {
  36223. const indexes = [];
  36224. for (const {
  36225. ref
  36226. } of newRefs) {
  36227. if (ref.num === indexes.at(-2) + indexes.at(-1)) {
  36228. indexes[indexes.length - 1] += 1;
  36229. } else {
  36230. indexes.push(ref.num, 1);
  36231. }
  36232. }
  36233. return indexes;
  36234. }
  36235. async function getXRefStreamTable(xrefInfo, baseOffset, newRefs, newXref, buffer) {
  36236. const xrefTableData = [];
  36237. let maxOffset = 0;
  36238. let maxGen = 0;
  36239. for (const {
  36240. ref,
  36241. data
  36242. } of newRefs) {
  36243. let gen;
  36244. maxOffset = Math.max(maxOffset, baseOffset);
  36245. if (data !== null) {
  36246. gen = Math.min(ref.gen, 0xffff);
  36247. xrefTableData.push([1, baseOffset, gen]);
  36248. baseOffset += data.length;
  36249. } else {
  36250. gen = Math.min(ref.gen + 1, 0xffff);
  36251. xrefTableData.push([0, 0, gen]);
  36252. }
  36253. maxGen = Math.max(maxGen, gen);
  36254. }
  36255. newXref.set("Index", getIndexes(newRefs));
  36256. const offsetSize = getSizeInBytes(maxOffset);
  36257. const maxGenSize = getSizeInBytes(maxGen);
  36258. const sizes = [1, offsetSize, maxGenSize];
  36259. newXref.set("W", sizes);
  36260. computeIDs(baseOffset, xrefInfo, newXref);
  36261. const structSize = sizes.reduce((a, x) => a + x, 0);
  36262. const data = new Uint8Array(structSize * xrefTableData.length);
  36263. const stream = new Stream(data);
  36264. stream.dict = newXref;
  36265. let offset = 0;
  36266. for (const [type, objOffset, gen] of xrefTableData) {
  36267. offset = writeInt(type, sizes[0], offset, data);
  36268. offset = writeInt(objOffset, sizes[1], offset, data);
  36269. offset = writeInt(gen, sizes[2], offset, data);
  36270. }
  36271. await writeObject(xrefInfo.newRef, stream, buffer, {});
  36272. buffer.push("startxref\n", baseOffset.toString(), "\n%%EOF\n");
  36273. }
  36274. function computeIDs(baseOffset, xrefInfo, newXref) {
  36275. if (Array.isArray(xrefInfo.fileIds) && xrefInfo.fileIds.length > 0) {
  36276. const md5 = computeMD5(baseOffset, xrefInfo);
  36277. newXref.set("ID", [xrefInfo.fileIds[0], md5]);
  36278. }
  36279. }
  36280. function getTrailerDict(xrefInfo, newRefs, useXrefStream) {
  36281. const newXref = new Dict(null);
  36282. newXref.set("Prev", xrefInfo.startXRef);
  36283. const refForXrefTable = xrefInfo.newRef;
  36284. if (useXrefStream) {
  36285. newRefs.push({
  36286. ref: refForXrefTable,
  36287. data: ""
  36288. });
  36289. newXref.set("Size", refForXrefTable.num + 1);
  36290. newXref.set("Type", Name.get("XRef"));
  36291. } else {
  36292. newXref.set("Size", refForXrefTable.num);
  36293. }
  36294. if (xrefInfo.rootRef !== null) {
  36295. newXref.set("Root", xrefInfo.rootRef);
  36296. }
  36297. if (xrefInfo.infoRef !== null) {
  36298. newXref.set("Info", xrefInfo.infoRef);
  36299. }
  36300. if (xrefInfo.encryptRef !== null) {
  36301. newXref.set("Encrypt", xrefInfo.encryptRef);
  36302. }
  36303. return newXref;
  36304. }
  36305. async function incrementalUpdate({
  36306. originalData,
  36307. xrefInfo,
  36308. newRefs,
  36309. xref = null,
  36310. hasXfa = false,
  36311. xfaDatasetsRef = null,
  36312. hasXfaDatasetsEntry = false,
  36313. needAppearances,
  36314. acroFormRef = null,
  36315. acroForm = null,
  36316. xfaData = null,
  36317. useXrefStream = false
  36318. }) {
  36319. await updateAcroform({
  36320. xref,
  36321. acroForm,
  36322. acroFormRef,
  36323. hasXfa,
  36324. hasXfaDatasetsEntry,
  36325. xfaDatasetsRef,
  36326. needAppearances,
  36327. newRefs
  36328. });
  36329. if (hasXfa) {
  36330. updateXFA({
  36331. xfaData,
  36332. xfaDatasetsRef,
  36333. newRefs,
  36334. xref
  36335. });
  36336. }
  36337. const buffer = [];
  36338. let baseOffset = originalData.length;
  36339. const lastByte = originalData.at(-1);
  36340. if (lastByte !== 0x0a && lastByte !== 0x0d) {
  36341. buffer.push("\n");
  36342. baseOffset += 1;
  36343. }
  36344. const newXref = getTrailerDict(xrefInfo, newRefs, useXrefStream);
  36345. newRefs = newRefs.sort((a, b) => a.ref.num - b.ref.num);
  36346. for (const {
  36347. data
  36348. } of newRefs) {
  36349. if (data !== null) {
  36350. buffer.push(data);
  36351. }
  36352. }
  36353. await (useXrefStream ? getXRefStreamTable(xrefInfo, baseOffset, newRefs, newXref, buffer) : getXRefTable(xrefInfo, baseOffset, newRefs, newXref, buffer));
  36354. const totalLength = buffer.reduce((a, str) => a + str.length, originalData.length);
  36355. const array = new Uint8Array(totalLength);
  36356. array.set(originalData);
  36357. let offset = originalData.length;
  36358. for (const str of buffer) {
  36359. writeString(str, offset, array);
  36360. offset += str.length;
  36361. }
  36362. return array;
  36363. }
  36364. ;// CONCATENATED MODULE: ./src/core/struct_tree.js
  36365. const MAX_DEPTH = 40;
  36366. const StructElementType = {
  36367. PAGE_CONTENT: 1,
  36368. STREAM_CONTENT: 2,
  36369. OBJECT: 3,
  36370. ANNOTATION: 4,
  36371. ELEMENT: 5
  36372. };
  36373. class StructTreeRoot {
  36374. constructor(rootDict, rootRef) {
  36375. this.dict = rootDict;
  36376. this.ref = rootRef instanceof Ref ? rootRef : null;
  36377. this.roleMap = new Map();
  36378. this.structParentIds = null;
  36379. }
  36380. init() {
  36381. this.readRoleMap();
  36382. }
  36383. #addIdToPage(pageRef, id, type) {
  36384. if (!(pageRef instanceof Ref) || id < 0) {
  36385. return;
  36386. }
  36387. this.structParentIds ||= new RefSetCache();
  36388. let ids = this.structParentIds.get(pageRef);
  36389. if (!ids) {
  36390. ids = [];
  36391. this.structParentIds.put(pageRef, ids);
  36392. }
  36393. ids.push([id, type]);
  36394. }
  36395. addAnnotationIdToPage(pageRef, id) {
  36396. this.#addIdToPage(pageRef, id, StructElementType.ANNOTATION);
  36397. }
  36398. readRoleMap() {
  36399. const roleMapDict = this.dict.get("RoleMap");
  36400. if (!(roleMapDict instanceof Dict)) {
  36401. return;
  36402. }
  36403. roleMapDict.forEach((key, value) => {
  36404. if (!(value instanceof Name)) {
  36405. return;
  36406. }
  36407. this.roleMap.set(key, value.name);
  36408. });
  36409. }
  36410. static async canCreateStructureTree({
  36411. catalogRef,
  36412. pdfManager,
  36413. newAnnotationsByPage
  36414. }) {
  36415. if (!(catalogRef instanceof Ref)) {
  36416. warn("Cannot save the struct tree: no catalog reference.");
  36417. return false;
  36418. }
  36419. let nextKey = 0;
  36420. let hasNothingToUpdate = true;
  36421. for (const [pageIndex, elements] of newAnnotationsByPage) {
  36422. const {
  36423. ref: pageRef
  36424. } = await pdfManager.getPage(pageIndex);
  36425. if (!(pageRef instanceof Ref)) {
  36426. warn(`Cannot save the struct tree: page ${pageIndex} has no ref.`);
  36427. hasNothingToUpdate = true;
  36428. break;
  36429. }
  36430. for (const element of elements) {
  36431. if (element.accessibilityData?.type) {
  36432. element.parentTreeId = nextKey++;
  36433. hasNothingToUpdate = false;
  36434. }
  36435. }
  36436. }
  36437. if (hasNothingToUpdate) {
  36438. for (const elements of newAnnotationsByPage.values()) {
  36439. for (const element of elements) {
  36440. delete element.parentTreeId;
  36441. }
  36442. }
  36443. return false;
  36444. }
  36445. return true;
  36446. }
  36447. static async createStructureTree({
  36448. newAnnotationsByPage,
  36449. xref,
  36450. catalogRef,
  36451. pdfManager,
  36452. newRefs
  36453. }) {
  36454. const root = pdfManager.catalog.cloneDict();
  36455. const cache = new RefSetCache();
  36456. cache.put(catalogRef, root);
  36457. const structTreeRootRef = xref.getNewTemporaryRef();
  36458. root.set("StructTreeRoot", structTreeRootRef);
  36459. const structTreeRoot = new Dict(xref);
  36460. structTreeRoot.set("Type", Name.get("StructTreeRoot"));
  36461. const parentTreeRef = xref.getNewTemporaryRef();
  36462. structTreeRoot.set("ParentTree", parentTreeRef);
  36463. const kids = [];
  36464. structTreeRoot.set("K", kids);
  36465. cache.put(structTreeRootRef, structTreeRoot);
  36466. const parentTree = new Dict(xref);
  36467. const nums = [];
  36468. parentTree.set("Nums", nums);
  36469. const nextKey = await this.#writeKids({
  36470. newAnnotationsByPage,
  36471. structTreeRootRef,
  36472. kids,
  36473. nums,
  36474. xref,
  36475. pdfManager,
  36476. cache
  36477. });
  36478. structTreeRoot.set("ParentTreeNextKey", nextKey);
  36479. cache.put(parentTreeRef, parentTree);
  36480. const buffer = [];
  36481. for (const [ref, obj] of cache.items()) {
  36482. buffer.length = 0;
  36483. await writeObject(ref, obj, buffer, xref);
  36484. newRefs.push({
  36485. ref,
  36486. data: buffer.join("")
  36487. });
  36488. }
  36489. }
  36490. async canUpdateStructTree({
  36491. pdfManager,
  36492. xref,
  36493. newAnnotationsByPage
  36494. }) {
  36495. if (!this.ref) {
  36496. warn("Cannot update the struct tree: no root reference.");
  36497. return false;
  36498. }
  36499. let nextKey = this.dict.get("ParentTreeNextKey");
  36500. if (!Number.isInteger(nextKey) || nextKey < 0) {
  36501. warn("Cannot update the struct tree: invalid next key.");
  36502. return false;
  36503. }
  36504. const parentTree = this.dict.get("ParentTree");
  36505. if (!(parentTree instanceof Dict)) {
  36506. warn("Cannot update the struct tree: ParentTree isn't a dict.");
  36507. return false;
  36508. }
  36509. const nums = parentTree.get("Nums");
  36510. if (!Array.isArray(nums)) {
  36511. warn("Cannot update the struct tree: nums isn't an array.");
  36512. return false;
  36513. }
  36514. const numberTree = new NumberTree(parentTree, xref);
  36515. for (const pageIndex of newAnnotationsByPage.keys()) {
  36516. const {
  36517. pageDict
  36518. } = await pdfManager.getPage(pageIndex);
  36519. if (!pageDict.has("StructParents")) {
  36520. continue;
  36521. }
  36522. const id = pageDict.get("StructParents");
  36523. if (!Number.isInteger(id) || !Array.isArray(numberTree.get(id))) {
  36524. warn(`Cannot save the struct tree: page ${pageIndex} has a wrong id.`);
  36525. return false;
  36526. }
  36527. }
  36528. let hasNothingToUpdate = true;
  36529. for (const [pageIndex, elements] of newAnnotationsByPage) {
  36530. const {
  36531. pageDict
  36532. } = await pdfManager.getPage(pageIndex);
  36533. StructTreeRoot.#collectParents({
  36534. elements,
  36535. xref: this.dict.xref,
  36536. pageDict,
  36537. numberTree
  36538. });
  36539. for (const element of elements) {
  36540. if (element.accessibilityData?.type) {
  36541. element.parentTreeId = nextKey++;
  36542. hasNothingToUpdate = false;
  36543. }
  36544. }
  36545. }
  36546. if (hasNothingToUpdate) {
  36547. for (const elements of newAnnotationsByPage.values()) {
  36548. for (const element of elements) {
  36549. delete element.parentTreeId;
  36550. delete element.structTreeParent;
  36551. }
  36552. }
  36553. return false;
  36554. }
  36555. return true;
  36556. }
  36557. async updateStructureTree({
  36558. newAnnotationsByPage,
  36559. pdfManager,
  36560. newRefs
  36561. }) {
  36562. const xref = this.dict.xref;
  36563. const structTreeRoot = this.dict.clone();
  36564. const structTreeRootRef = this.ref;
  36565. const cache = new RefSetCache();
  36566. cache.put(structTreeRootRef, structTreeRoot);
  36567. let parentTreeRef = structTreeRoot.getRaw("ParentTree");
  36568. let parentTree;
  36569. if (parentTreeRef instanceof Ref) {
  36570. parentTree = xref.fetch(parentTreeRef);
  36571. } else {
  36572. parentTree = parentTreeRef;
  36573. parentTreeRef = xref.getNewTemporaryRef();
  36574. structTreeRoot.set("ParentTree", parentTreeRef);
  36575. }
  36576. parentTree = parentTree.clone();
  36577. cache.put(parentTreeRef, parentTree);
  36578. let nums = parentTree.getRaw("Nums");
  36579. let numsRef = null;
  36580. if (nums instanceof Ref) {
  36581. numsRef = nums;
  36582. nums = xref.fetch(numsRef);
  36583. }
  36584. nums = nums.slice();
  36585. if (!numsRef) {
  36586. parentTree.set("Nums", nums);
  36587. }
  36588. const newNextkey = await StructTreeRoot.#writeKids({
  36589. newAnnotationsByPage,
  36590. structTreeRootRef,
  36591. kids: null,
  36592. nums,
  36593. xref,
  36594. pdfManager,
  36595. cache
  36596. });
  36597. structTreeRoot.set("ParentTreeNextKey", newNextkey);
  36598. if (numsRef) {
  36599. cache.put(numsRef, nums);
  36600. }
  36601. const buffer = [];
  36602. for (const [ref, obj] of cache.items()) {
  36603. buffer.length = 0;
  36604. await writeObject(ref, obj, buffer, xref);
  36605. newRefs.push({
  36606. ref,
  36607. data: buffer.join("")
  36608. });
  36609. }
  36610. }
  36611. static async #writeKids({
  36612. newAnnotationsByPage,
  36613. structTreeRootRef,
  36614. kids,
  36615. nums,
  36616. xref,
  36617. pdfManager,
  36618. cache
  36619. }) {
  36620. const objr = Name.get("OBJR");
  36621. let nextKey = -Infinity;
  36622. for (const [pageIndex, elements] of newAnnotationsByPage) {
  36623. const {
  36624. ref: pageRef
  36625. } = await pdfManager.getPage(pageIndex);
  36626. const isPageRef = pageRef instanceof Ref;
  36627. for (const {
  36628. accessibilityData,
  36629. ref,
  36630. parentTreeId,
  36631. structTreeParent
  36632. } of elements) {
  36633. if (!accessibilityData?.type) {
  36634. continue;
  36635. }
  36636. const {
  36637. type,
  36638. title,
  36639. lang,
  36640. alt,
  36641. expanded,
  36642. actualText
  36643. } = accessibilityData;
  36644. nextKey = Math.max(nextKey, parentTreeId);
  36645. const tagRef = xref.getNewTemporaryRef();
  36646. const tagDict = new Dict(xref);
  36647. tagDict.set("S", Name.get(type));
  36648. if (title) {
  36649. tagDict.set("T", stringToAsciiOrUTF16BE(title));
  36650. }
  36651. if (lang) {
  36652. tagDict.set("Lang", lang);
  36653. }
  36654. if (alt) {
  36655. tagDict.set("Alt", stringToAsciiOrUTF16BE(alt));
  36656. }
  36657. if (expanded) {
  36658. tagDict.set("E", stringToAsciiOrUTF16BE(expanded));
  36659. }
  36660. if (actualText) {
  36661. tagDict.set("ActualText", stringToAsciiOrUTF16BE(actualText));
  36662. }
  36663. await this.#updateParentTag({
  36664. structTreeParent,
  36665. tagDict,
  36666. newTagRef: tagRef,
  36667. structTreeRootRef,
  36668. fallbackKids: kids,
  36669. xref,
  36670. cache
  36671. });
  36672. const objDict = new Dict(xref);
  36673. tagDict.set("K", objDict);
  36674. objDict.set("Type", objr);
  36675. if (isPageRef) {
  36676. objDict.set("Pg", pageRef);
  36677. }
  36678. objDict.set("Obj", ref);
  36679. cache.put(tagRef, tagDict);
  36680. nums.push(parentTreeId, tagRef);
  36681. }
  36682. }
  36683. return nextKey + 1;
  36684. }
  36685. static #collectParents({
  36686. elements,
  36687. xref,
  36688. pageDict,
  36689. numberTree
  36690. }) {
  36691. const idToElements = new Map();
  36692. for (const element of elements) {
  36693. if (element.structTreeParentId) {
  36694. const id = parseInt(element.structTreeParentId.split("_mc")[1], 10);
  36695. let elems = idToElements.get(id);
  36696. if (!elems) {
  36697. elems = [];
  36698. idToElements.set(id, elems);
  36699. }
  36700. elems.push(element);
  36701. }
  36702. }
  36703. const id = pageDict.get("StructParents");
  36704. if (!Number.isInteger(id)) {
  36705. return;
  36706. }
  36707. const parentArray = numberTree.get(id);
  36708. const updateElement = (kid, pageKid, kidRef) => {
  36709. const elems = idToElements.get(kid);
  36710. if (elems) {
  36711. const parentRef = pageKid.getRaw("P");
  36712. const parentDict = xref.fetchIfRef(parentRef);
  36713. if (parentRef instanceof Ref && parentDict instanceof Dict) {
  36714. const params = {
  36715. ref: kidRef,
  36716. dict: pageKid
  36717. };
  36718. for (const element of elems) {
  36719. element.structTreeParent = params;
  36720. }
  36721. }
  36722. return true;
  36723. }
  36724. return false;
  36725. };
  36726. for (const kidRef of parentArray) {
  36727. if (!(kidRef instanceof Ref)) {
  36728. continue;
  36729. }
  36730. const pageKid = xref.fetch(kidRef);
  36731. const k = pageKid.get("K");
  36732. if (Number.isInteger(k)) {
  36733. updateElement(k, pageKid, kidRef);
  36734. continue;
  36735. }
  36736. if (!Array.isArray(k)) {
  36737. continue;
  36738. }
  36739. for (let kid of k) {
  36740. kid = xref.fetchIfRef(kid);
  36741. if (Number.isInteger(kid) && updateElement(kid, pageKid, kidRef)) {
  36742. break;
  36743. }
  36744. if (!(kid instanceof Dict)) {
  36745. continue;
  36746. }
  36747. if (!isName(kid.get("Type"), "MCR")) {
  36748. break;
  36749. }
  36750. const mcid = kid.get("MCID");
  36751. if (Number.isInteger(mcid) && updateElement(mcid, pageKid, kidRef)) {
  36752. break;
  36753. }
  36754. }
  36755. }
  36756. }
  36757. static async #updateParentTag({
  36758. structTreeParent,
  36759. tagDict,
  36760. newTagRef,
  36761. structTreeRootRef,
  36762. fallbackKids,
  36763. xref,
  36764. cache
  36765. }) {
  36766. let ref = null;
  36767. let parentRef;
  36768. if (structTreeParent) {
  36769. ({
  36770. ref
  36771. } = structTreeParent);
  36772. parentRef = structTreeParent.dict.getRaw("P") || structTreeRootRef;
  36773. } else {
  36774. parentRef = structTreeRootRef;
  36775. }
  36776. tagDict.set("P", parentRef);
  36777. const parentDict = xref.fetchIfRef(parentRef);
  36778. if (!parentDict) {
  36779. fallbackKids.push(newTagRef);
  36780. return;
  36781. }
  36782. let cachedParentDict = cache.get(parentRef);
  36783. if (!cachedParentDict) {
  36784. cachedParentDict = parentDict.clone();
  36785. cache.put(parentRef, cachedParentDict);
  36786. }
  36787. const parentKidsRaw = cachedParentDict.getRaw("K");
  36788. let cachedParentKids = parentKidsRaw instanceof Ref ? cache.get(parentKidsRaw) : null;
  36789. if (!cachedParentKids) {
  36790. cachedParentKids = xref.fetchIfRef(parentKidsRaw);
  36791. cachedParentKids = Array.isArray(cachedParentKids) ? cachedParentKids.slice() : [parentKidsRaw];
  36792. const parentKidsRef = xref.getNewTemporaryRef();
  36793. cachedParentDict.set("K", parentKidsRef);
  36794. cache.put(parentKidsRef, cachedParentKids);
  36795. }
  36796. const index = cachedParentKids.indexOf(ref);
  36797. cachedParentKids.splice(index >= 0 ? index + 1 : cachedParentKids.length, 0, newTagRef);
  36798. }
  36799. }
  36800. class StructElementNode {
  36801. constructor(tree, dict) {
  36802. this.tree = tree;
  36803. this.dict = dict;
  36804. this.kids = [];
  36805. this.parseKids();
  36806. }
  36807. get role() {
  36808. const nameObj = this.dict.get("S");
  36809. const name = nameObj instanceof Name ? nameObj.name : "";
  36810. const {
  36811. root
  36812. } = this.tree;
  36813. if (root.roleMap.has(name)) {
  36814. return root.roleMap.get(name);
  36815. }
  36816. return name;
  36817. }
  36818. parseKids() {
  36819. let pageObjId = null;
  36820. const objRef = this.dict.getRaw("Pg");
  36821. if (objRef instanceof Ref) {
  36822. pageObjId = objRef.toString();
  36823. }
  36824. const kids = this.dict.get("K");
  36825. if (Array.isArray(kids)) {
  36826. for (const kid of kids) {
  36827. const element = this.parseKid(pageObjId, kid);
  36828. if (element) {
  36829. this.kids.push(element);
  36830. }
  36831. }
  36832. } else {
  36833. const element = this.parseKid(pageObjId, kids);
  36834. if (element) {
  36835. this.kids.push(element);
  36836. }
  36837. }
  36838. }
  36839. parseKid(pageObjId, kid) {
  36840. if (Number.isInteger(kid)) {
  36841. if (this.tree.pageDict.objId !== pageObjId) {
  36842. return null;
  36843. }
  36844. return new StructElement({
  36845. type: StructElementType.PAGE_CONTENT,
  36846. mcid: kid,
  36847. pageObjId
  36848. });
  36849. }
  36850. let kidDict = null;
  36851. if (kid instanceof Ref) {
  36852. kidDict = this.dict.xref.fetch(kid);
  36853. } else if (kid instanceof Dict) {
  36854. kidDict = kid;
  36855. }
  36856. if (!kidDict) {
  36857. return null;
  36858. }
  36859. const pageRef = kidDict.getRaw("Pg");
  36860. if (pageRef instanceof Ref) {
  36861. pageObjId = pageRef.toString();
  36862. }
  36863. const type = kidDict.get("Type") instanceof Name ? kidDict.get("Type").name : null;
  36864. if (type === "MCR") {
  36865. if (this.tree.pageDict.objId !== pageObjId) {
  36866. return null;
  36867. }
  36868. const kidRef = kidDict.getRaw("Stm");
  36869. return new StructElement({
  36870. type: StructElementType.STREAM_CONTENT,
  36871. refObjId: kidRef instanceof Ref ? kidRef.toString() : null,
  36872. pageObjId,
  36873. mcid: kidDict.get("MCID")
  36874. });
  36875. }
  36876. if (type === "OBJR") {
  36877. if (this.tree.pageDict.objId !== pageObjId) {
  36878. return null;
  36879. }
  36880. const kidRef = kidDict.getRaw("Obj");
  36881. return new StructElement({
  36882. type: StructElementType.OBJECT,
  36883. refObjId: kidRef instanceof Ref ? kidRef.toString() : null,
  36884. pageObjId
  36885. });
  36886. }
  36887. return new StructElement({
  36888. type: StructElementType.ELEMENT,
  36889. dict: kidDict
  36890. });
  36891. }
  36892. }
  36893. class StructElement {
  36894. constructor({
  36895. type,
  36896. dict = null,
  36897. mcid = null,
  36898. pageObjId = null,
  36899. refObjId = null
  36900. }) {
  36901. this.type = type;
  36902. this.dict = dict;
  36903. this.mcid = mcid;
  36904. this.pageObjId = pageObjId;
  36905. this.refObjId = refObjId;
  36906. this.parentNode = null;
  36907. }
  36908. }
  36909. class StructTreePage {
  36910. constructor(structTreeRoot, pageDict) {
  36911. this.root = structTreeRoot;
  36912. this.rootDict = structTreeRoot ? structTreeRoot.dict : null;
  36913. this.pageDict = pageDict;
  36914. this.nodes = [];
  36915. }
  36916. parse(pageRef) {
  36917. if (!this.root || !this.rootDict) {
  36918. return;
  36919. }
  36920. const parentTree = this.rootDict.get("ParentTree");
  36921. if (!parentTree) {
  36922. return;
  36923. }
  36924. const id = this.pageDict.get("StructParents");
  36925. const ids = pageRef instanceof Ref && this.root.structParentIds?.get(pageRef);
  36926. if (!Number.isInteger(id) && !ids) {
  36927. return;
  36928. }
  36929. const map = new Map();
  36930. const numberTree = new NumberTree(parentTree, this.rootDict.xref);
  36931. if (Number.isInteger(id)) {
  36932. const parentArray = numberTree.get(id);
  36933. if (Array.isArray(parentArray)) {
  36934. for (const ref of parentArray) {
  36935. if (ref instanceof Ref) {
  36936. this.addNode(this.rootDict.xref.fetch(ref), map);
  36937. }
  36938. }
  36939. }
  36940. }
  36941. if (!ids) {
  36942. return;
  36943. }
  36944. for (const [elemId, type] of ids) {
  36945. const obj = numberTree.get(elemId);
  36946. if (obj) {
  36947. const elem = this.addNode(this.rootDict.xref.fetchIfRef(obj), map);
  36948. if (elem?.kids?.length === 1 && elem.kids[0].type === StructElementType.OBJECT) {
  36949. elem.kids[0].type = type;
  36950. }
  36951. }
  36952. }
  36953. }
  36954. addNode(dict, map, level = 0) {
  36955. if (level > MAX_DEPTH) {
  36956. warn("StructTree MAX_DEPTH reached.");
  36957. return null;
  36958. }
  36959. if (map.has(dict)) {
  36960. return map.get(dict);
  36961. }
  36962. const element = new StructElementNode(this, dict);
  36963. map.set(dict, element);
  36964. const parent = dict.get("P");
  36965. if (!parent || isName(parent.get("Type"), "StructTreeRoot")) {
  36966. if (!this.addTopLevelNode(dict, element)) {
  36967. map.delete(dict);
  36968. }
  36969. return element;
  36970. }
  36971. const parentNode = this.addNode(parent, map, level + 1);
  36972. if (!parentNode) {
  36973. return element;
  36974. }
  36975. let save = false;
  36976. for (const kid of parentNode.kids) {
  36977. if (kid.type === StructElementType.ELEMENT && kid.dict === dict) {
  36978. kid.parentNode = element;
  36979. save = true;
  36980. }
  36981. }
  36982. if (!save) {
  36983. map.delete(dict);
  36984. }
  36985. return element;
  36986. }
  36987. addTopLevelNode(dict, element) {
  36988. const obj = this.rootDict.get("K");
  36989. if (!obj) {
  36990. return false;
  36991. }
  36992. if (obj instanceof Dict) {
  36993. if (obj.objId !== dict.objId) {
  36994. return false;
  36995. }
  36996. this.nodes[0] = element;
  36997. return true;
  36998. }
  36999. if (!Array.isArray(obj)) {
  37000. return true;
  37001. }
  37002. let save = false;
  37003. for (let i = 0; i < obj.length; i++) {
  37004. const kidRef = obj[i];
  37005. if (kidRef?.toString() === dict.objId) {
  37006. this.nodes[i] = element;
  37007. save = true;
  37008. }
  37009. }
  37010. return save;
  37011. }
  37012. get serializable() {
  37013. function nodeToSerializable(node, parent, level = 0) {
  37014. if (level > MAX_DEPTH) {
  37015. warn("StructTree too deep to be fully serialized.");
  37016. return;
  37017. }
  37018. const obj = Object.create(null);
  37019. obj.role = node.role;
  37020. obj.children = [];
  37021. parent.children.push(obj);
  37022. const alt = node.dict.get("Alt");
  37023. if (typeof alt === "string") {
  37024. obj.alt = stringToPDFString(alt);
  37025. }
  37026. const lang = node.dict.get("Lang");
  37027. if (typeof lang === "string") {
  37028. obj.lang = stringToPDFString(lang);
  37029. }
  37030. for (const kid of node.kids) {
  37031. const kidElement = kid.type === StructElementType.ELEMENT ? kid.parentNode : null;
  37032. if (kidElement) {
  37033. nodeToSerializable(kidElement, obj, level + 1);
  37034. continue;
  37035. } else if (kid.type === StructElementType.PAGE_CONTENT || kid.type === StructElementType.STREAM_CONTENT) {
  37036. obj.children.push({
  37037. type: "content",
  37038. id: `p${kid.pageObjId}_mc${kid.mcid}`
  37039. });
  37040. } else if (kid.type === StructElementType.OBJECT) {
  37041. obj.children.push({
  37042. type: "object",
  37043. id: kid.refObjId
  37044. });
  37045. } else if (kid.type === StructElementType.ANNOTATION) {
  37046. obj.children.push({
  37047. type: "annotation",
  37048. id: `${AnnotationPrefix}${kid.refObjId}`
  37049. });
  37050. }
  37051. }
  37052. }
  37053. const root = Object.create(null);
  37054. root.children = [];
  37055. root.role = "Root";
  37056. for (const child of this.nodes) {
  37057. if (!child) {
  37058. continue;
  37059. }
  37060. nodeToSerializable(child, root);
  37061. }
  37062. return root;
  37063. }
  37064. }
  37065. ;// CONCATENATED MODULE: ./src/core/catalog.js
  37066. function isValidExplicitDest(dest) {
  37067. if (!Array.isArray(dest) || dest.length < 2) {
  37068. return false;
  37069. }
  37070. const [page, zoom, ...args] = dest;
  37071. if (!(page instanceof Ref) && !Number.isInteger(page)) {
  37072. return false;
  37073. }
  37074. if (!(zoom instanceof Name)) {
  37075. return false;
  37076. }
  37077. const argsLen = args.length;
  37078. let allowNull = true;
  37079. switch (zoom.name) {
  37080. case "XYZ":
  37081. if (argsLen < 2 || argsLen > 3) {
  37082. return false;
  37083. }
  37084. break;
  37085. case "Fit":
  37086. case "FitB":
  37087. return argsLen === 0;
  37088. case "FitH":
  37089. case "FitBH":
  37090. case "FitV":
  37091. case "FitBV":
  37092. if (argsLen > 1) {
  37093. return false;
  37094. }
  37095. break;
  37096. case "FitR":
  37097. if (argsLen !== 4) {
  37098. return false;
  37099. }
  37100. allowNull = false;
  37101. break;
  37102. default:
  37103. return false;
  37104. }
  37105. for (const arg of args) {
  37106. if (!(typeof arg === "number" || allowNull && arg === null)) {
  37107. return false;
  37108. }
  37109. }
  37110. return true;
  37111. }
  37112. function fetchDest(dest) {
  37113. if (dest instanceof Dict) {
  37114. dest = dest.get("D");
  37115. }
  37116. return isValidExplicitDest(dest) ? dest : null;
  37117. }
  37118. function fetchRemoteDest(action) {
  37119. let dest = action.get("D");
  37120. if (dest) {
  37121. if (dest instanceof Name) {
  37122. dest = dest.name;
  37123. }
  37124. if (typeof dest === "string") {
  37125. return stringToPDFString(dest);
  37126. } else if (isValidExplicitDest(dest)) {
  37127. return JSON.stringify(dest);
  37128. }
  37129. }
  37130. return null;
  37131. }
  37132. class Catalog {
  37133. constructor(pdfManager, xref) {
  37134. this.pdfManager = pdfManager;
  37135. this.xref = xref;
  37136. this._catDict = xref.getCatalogObj();
  37137. if (!(this._catDict instanceof Dict)) {
  37138. throw new FormatError("Catalog object is not a dictionary.");
  37139. }
  37140. this.toplevelPagesDict;
  37141. this._actualNumPages = null;
  37142. this.fontCache = new RefSetCache();
  37143. this.builtInCMapCache = new Map();
  37144. this.standardFontDataCache = new Map();
  37145. this.globalImageCache = new GlobalImageCache();
  37146. this.pageKidsCountCache = new RefSetCache();
  37147. this.pageIndexCache = new RefSetCache();
  37148. this.nonBlendModesSet = new RefSet();
  37149. this.systemFontCache = new Map();
  37150. }
  37151. cloneDict() {
  37152. return this._catDict.clone();
  37153. }
  37154. get version() {
  37155. const version = this._catDict.get("Version");
  37156. if (version instanceof Name) {
  37157. if (PDF_VERSION_REGEXP.test(version.name)) {
  37158. return shadow(this, "version", version.name);
  37159. }
  37160. warn(`Invalid PDF catalog version: ${version.name}`);
  37161. }
  37162. return shadow(this, "version", null);
  37163. }
  37164. get lang() {
  37165. const lang = this._catDict.get("Lang");
  37166. return shadow(this, "lang", lang && typeof lang === "string" ? stringToPDFString(lang) : null);
  37167. }
  37168. get needsRendering() {
  37169. const needsRendering = this._catDict.get("NeedsRendering");
  37170. return shadow(this, "needsRendering", typeof needsRendering === "boolean" ? needsRendering : false);
  37171. }
  37172. get collection() {
  37173. let collection = null;
  37174. try {
  37175. const obj = this._catDict.get("Collection");
  37176. if (obj instanceof Dict && obj.size > 0) {
  37177. collection = obj;
  37178. }
  37179. } catch (ex) {
  37180. if (ex instanceof MissingDataException) {
  37181. throw ex;
  37182. }
  37183. info("Cannot fetch Collection entry; assuming no collection is present.");
  37184. }
  37185. return shadow(this, "collection", collection);
  37186. }
  37187. get acroForm() {
  37188. let acroForm = null;
  37189. try {
  37190. const obj = this._catDict.get("AcroForm");
  37191. if (obj instanceof Dict && obj.size > 0) {
  37192. acroForm = obj;
  37193. }
  37194. } catch (ex) {
  37195. if (ex instanceof MissingDataException) {
  37196. throw ex;
  37197. }
  37198. info("Cannot fetch AcroForm entry; assuming no forms are present.");
  37199. }
  37200. return shadow(this, "acroForm", acroForm);
  37201. }
  37202. get acroFormRef() {
  37203. const value = this._catDict.getRaw("AcroForm");
  37204. return shadow(this, "acroFormRef", value instanceof Ref ? value : null);
  37205. }
  37206. get metadata() {
  37207. const streamRef = this._catDict.getRaw("Metadata");
  37208. if (!(streamRef instanceof Ref)) {
  37209. return shadow(this, "metadata", null);
  37210. }
  37211. let metadata = null;
  37212. try {
  37213. const stream = this.xref.fetch(streamRef, !this.xref.encrypt?.encryptMetadata);
  37214. if (stream instanceof BaseStream && stream.dict instanceof Dict) {
  37215. const type = stream.dict.get("Type");
  37216. const subtype = stream.dict.get("Subtype");
  37217. if (isName(type, "Metadata") && isName(subtype, "XML")) {
  37218. const data = stringToUTF8String(stream.getString());
  37219. if (data) {
  37220. metadata = new MetadataParser(data).serializable;
  37221. }
  37222. }
  37223. }
  37224. } catch (ex) {
  37225. if (ex instanceof MissingDataException) {
  37226. throw ex;
  37227. }
  37228. info(`Skipping invalid Metadata: "${ex}".`);
  37229. }
  37230. return shadow(this, "metadata", metadata);
  37231. }
  37232. get markInfo() {
  37233. let markInfo = null;
  37234. try {
  37235. markInfo = this._readMarkInfo();
  37236. } catch (ex) {
  37237. if (ex instanceof MissingDataException) {
  37238. throw ex;
  37239. }
  37240. warn("Unable to read mark info.");
  37241. }
  37242. return shadow(this, "markInfo", markInfo);
  37243. }
  37244. _readMarkInfo() {
  37245. const obj = this._catDict.get("MarkInfo");
  37246. if (!(obj instanceof Dict)) {
  37247. return null;
  37248. }
  37249. const markInfo = {
  37250. Marked: false,
  37251. UserProperties: false,
  37252. Suspects: false
  37253. };
  37254. for (const key in markInfo) {
  37255. const value = obj.get(key);
  37256. if (typeof value === "boolean") {
  37257. markInfo[key] = value;
  37258. }
  37259. }
  37260. return markInfo;
  37261. }
  37262. get structTreeRoot() {
  37263. let structTree = null;
  37264. try {
  37265. structTree = this._readStructTreeRoot();
  37266. } catch (ex) {
  37267. if (ex instanceof MissingDataException) {
  37268. throw ex;
  37269. }
  37270. warn("Unable read to structTreeRoot info.");
  37271. }
  37272. return shadow(this, "structTreeRoot", structTree);
  37273. }
  37274. _readStructTreeRoot() {
  37275. const rawObj = this._catDict.getRaw("StructTreeRoot");
  37276. const obj = this.xref.fetchIfRef(rawObj);
  37277. if (!(obj instanceof Dict)) {
  37278. return null;
  37279. }
  37280. const root = new StructTreeRoot(obj, rawObj);
  37281. root.init();
  37282. return root;
  37283. }
  37284. get toplevelPagesDict() {
  37285. const pagesObj = this._catDict.get("Pages");
  37286. if (!(pagesObj instanceof Dict)) {
  37287. throw new FormatError("Invalid top-level pages dictionary.");
  37288. }
  37289. return shadow(this, "toplevelPagesDict", pagesObj);
  37290. }
  37291. get documentOutline() {
  37292. let obj = null;
  37293. try {
  37294. obj = this._readDocumentOutline();
  37295. } catch (ex) {
  37296. if (ex instanceof MissingDataException) {
  37297. throw ex;
  37298. }
  37299. warn("Unable to read document outline.");
  37300. }
  37301. return shadow(this, "documentOutline", obj);
  37302. }
  37303. _readDocumentOutline() {
  37304. let obj = this._catDict.get("Outlines");
  37305. if (!(obj instanceof Dict)) {
  37306. return null;
  37307. }
  37308. obj = obj.getRaw("First");
  37309. if (!(obj instanceof Ref)) {
  37310. return null;
  37311. }
  37312. const root = {
  37313. items: []
  37314. };
  37315. const queue = [{
  37316. obj,
  37317. parent: root
  37318. }];
  37319. const processed = new RefSet();
  37320. processed.put(obj);
  37321. const xref = this.xref,
  37322. blackColor = new Uint8ClampedArray(3);
  37323. while (queue.length > 0) {
  37324. const i = queue.shift();
  37325. const outlineDict = xref.fetchIfRef(i.obj);
  37326. if (outlineDict === null) {
  37327. continue;
  37328. }
  37329. if (!outlineDict.has("Title")) {
  37330. warn("Invalid outline item encountered.");
  37331. }
  37332. const data = {
  37333. url: null,
  37334. dest: null,
  37335. action: null
  37336. };
  37337. Catalog.parseDestDictionary({
  37338. destDict: outlineDict,
  37339. resultObj: data,
  37340. docBaseUrl: this.baseUrl,
  37341. docAttachments: this.attachments
  37342. });
  37343. const title = outlineDict.get("Title");
  37344. const flags = outlineDict.get("F") || 0;
  37345. const color = outlineDict.getArray("C");
  37346. const count = outlineDict.get("Count");
  37347. let rgbColor = blackColor;
  37348. if (isNumberArray(color, 3) && (color[0] !== 0 || color[1] !== 0 || color[2] !== 0)) {
  37349. rgbColor = ColorSpace.singletons.rgb.getRgb(color, 0);
  37350. }
  37351. const outlineItem = {
  37352. action: data.action,
  37353. attachment: data.attachment,
  37354. dest: data.dest,
  37355. url: data.url,
  37356. unsafeUrl: data.unsafeUrl,
  37357. newWindow: data.newWindow,
  37358. setOCGState: data.setOCGState,
  37359. title: typeof title === "string" ? stringToPDFString(title) : "",
  37360. color: rgbColor,
  37361. count: Number.isInteger(count) ? count : undefined,
  37362. bold: !!(flags & 2),
  37363. italic: !!(flags & 1),
  37364. items: []
  37365. };
  37366. i.parent.items.push(outlineItem);
  37367. obj = outlineDict.getRaw("First");
  37368. if (obj instanceof Ref && !processed.has(obj)) {
  37369. queue.push({
  37370. obj,
  37371. parent: outlineItem
  37372. });
  37373. processed.put(obj);
  37374. }
  37375. obj = outlineDict.getRaw("Next");
  37376. if (obj instanceof Ref && !processed.has(obj)) {
  37377. queue.push({
  37378. obj,
  37379. parent: i.parent
  37380. });
  37381. processed.put(obj);
  37382. }
  37383. }
  37384. return root.items.length > 0 ? root.items : null;
  37385. }
  37386. get permissions() {
  37387. let permissions = null;
  37388. try {
  37389. permissions = this._readPermissions();
  37390. } catch (ex) {
  37391. if (ex instanceof MissingDataException) {
  37392. throw ex;
  37393. }
  37394. warn("Unable to read permissions.");
  37395. }
  37396. return shadow(this, "permissions", permissions);
  37397. }
  37398. _readPermissions() {
  37399. const encrypt = this.xref.trailer.get("Encrypt");
  37400. if (!(encrypt instanceof Dict)) {
  37401. return null;
  37402. }
  37403. let flags = encrypt.get("P");
  37404. if (typeof flags !== "number") {
  37405. return null;
  37406. }
  37407. flags += 2 ** 32;
  37408. const permissions = [];
  37409. for (const key in PermissionFlag) {
  37410. const value = PermissionFlag[key];
  37411. if (flags & value) {
  37412. permissions.push(value);
  37413. }
  37414. }
  37415. return permissions;
  37416. }
  37417. get optionalContentConfig() {
  37418. let config = null;
  37419. try {
  37420. const properties = this._catDict.get("OCProperties");
  37421. if (!properties) {
  37422. return shadow(this, "optionalContentConfig", null);
  37423. }
  37424. const defaultConfig = properties.get("D");
  37425. if (!defaultConfig) {
  37426. return shadow(this, "optionalContentConfig", null);
  37427. }
  37428. const groupsData = properties.get("OCGs");
  37429. if (!Array.isArray(groupsData)) {
  37430. return shadow(this, "optionalContentConfig", null);
  37431. }
  37432. const groups = [];
  37433. const groupRefs = new RefSet();
  37434. for (const groupRef of groupsData) {
  37435. if (!(groupRef instanceof Ref) || groupRefs.has(groupRef)) {
  37436. continue;
  37437. }
  37438. groupRefs.put(groupRef);
  37439. groups.push(this.#readOptionalContentGroup(groupRef));
  37440. }
  37441. config = this.#readOptionalContentConfig(defaultConfig, groupRefs);
  37442. config.groups = groups;
  37443. } catch (ex) {
  37444. if (ex instanceof MissingDataException) {
  37445. throw ex;
  37446. }
  37447. warn(`Unable to read optional content config: ${ex}`);
  37448. }
  37449. return shadow(this, "optionalContentConfig", config);
  37450. }
  37451. #readOptionalContentGroup(groupRef) {
  37452. const group = this.xref.fetch(groupRef);
  37453. const obj = {
  37454. id: groupRef.toString(),
  37455. name: null,
  37456. intent: null,
  37457. usage: {
  37458. print: null,
  37459. view: null
  37460. }
  37461. };
  37462. const name = group.get("Name");
  37463. if (typeof name === "string") {
  37464. obj.name = stringToPDFString(name);
  37465. }
  37466. let intent = group.getArray("Intent");
  37467. if (!Array.isArray(intent)) {
  37468. intent = [intent];
  37469. }
  37470. if (intent.every(i => i instanceof Name)) {
  37471. obj.intent = intent.map(i => i.name);
  37472. }
  37473. const usage = group.get("Usage");
  37474. if (!(usage instanceof Dict)) {
  37475. return obj;
  37476. }
  37477. const usageObj = obj.usage;
  37478. const print = usage.get("Print");
  37479. if (print instanceof Dict) {
  37480. const printState = print.get("PrintState");
  37481. if (printState instanceof Name) {
  37482. switch (printState.name) {
  37483. case "ON":
  37484. case "OFF":
  37485. usageObj.print = {
  37486. printState: printState.name
  37487. };
  37488. }
  37489. }
  37490. }
  37491. const view = usage.get("View");
  37492. if (view instanceof Dict) {
  37493. const viewState = view.get("ViewState");
  37494. if (viewState instanceof Name) {
  37495. switch (viewState.name) {
  37496. case "ON":
  37497. case "OFF":
  37498. usageObj.view = {
  37499. viewState: viewState.name
  37500. };
  37501. }
  37502. }
  37503. }
  37504. return obj;
  37505. }
  37506. #readOptionalContentConfig(config, contentGroupRefs) {
  37507. function parseOnOff(refs) {
  37508. const onParsed = [];
  37509. if (Array.isArray(refs)) {
  37510. for (const value of refs) {
  37511. if (!(value instanceof Ref)) {
  37512. continue;
  37513. }
  37514. if (contentGroupRefs.has(value)) {
  37515. onParsed.push(value.toString());
  37516. }
  37517. }
  37518. }
  37519. return onParsed;
  37520. }
  37521. function parseOrder(refs, nestedLevels = 0) {
  37522. if (!Array.isArray(refs)) {
  37523. return null;
  37524. }
  37525. const order = [];
  37526. for (const value of refs) {
  37527. if (value instanceof Ref && contentGroupRefs.has(value)) {
  37528. parsedOrderRefs.put(value);
  37529. order.push(value.toString());
  37530. continue;
  37531. }
  37532. const nestedOrder = parseNestedOrder(value, nestedLevels);
  37533. if (nestedOrder) {
  37534. order.push(nestedOrder);
  37535. }
  37536. }
  37537. if (nestedLevels > 0) {
  37538. return order;
  37539. }
  37540. const hiddenGroups = [];
  37541. for (const groupRef of contentGroupRefs) {
  37542. if (parsedOrderRefs.has(groupRef)) {
  37543. continue;
  37544. }
  37545. hiddenGroups.push(groupRef.toString());
  37546. }
  37547. if (hiddenGroups.length) {
  37548. order.push({
  37549. name: null,
  37550. order: hiddenGroups
  37551. });
  37552. }
  37553. return order;
  37554. }
  37555. function parseNestedOrder(ref, nestedLevels) {
  37556. if (++nestedLevels > MAX_NESTED_LEVELS) {
  37557. warn("parseNestedOrder - reached MAX_NESTED_LEVELS.");
  37558. return null;
  37559. }
  37560. const value = xref.fetchIfRef(ref);
  37561. if (!Array.isArray(value)) {
  37562. return null;
  37563. }
  37564. const nestedName = xref.fetchIfRef(value[0]);
  37565. if (typeof nestedName !== "string") {
  37566. return null;
  37567. }
  37568. const nestedOrder = parseOrder(value.slice(1), nestedLevels);
  37569. if (!nestedOrder || !nestedOrder.length) {
  37570. return null;
  37571. }
  37572. return {
  37573. name: stringToPDFString(nestedName),
  37574. order: nestedOrder
  37575. };
  37576. }
  37577. const xref = this.xref,
  37578. parsedOrderRefs = new RefSet(),
  37579. MAX_NESTED_LEVELS = 10;
  37580. return {
  37581. name: typeof config.get("Name") === "string" ? stringToPDFString(config.get("Name")) : null,
  37582. creator: typeof config.get("Creator") === "string" ? stringToPDFString(config.get("Creator")) : null,
  37583. baseState: config.get("BaseState") instanceof Name ? config.get("BaseState").name : null,
  37584. on: parseOnOff(config.get("ON")),
  37585. off: parseOnOff(config.get("OFF")),
  37586. order: parseOrder(config.get("Order")),
  37587. groups: null
  37588. };
  37589. }
  37590. setActualNumPages(num = null) {
  37591. this._actualNumPages = num;
  37592. }
  37593. get hasActualNumPages() {
  37594. return this._actualNumPages !== null;
  37595. }
  37596. get _pagesCount() {
  37597. const obj = this.toplevelPagesDict.get("Count");
  37598. if (!Number.isInteger(obj)) {
  37599. throw new FormatError("Page count in top-level pages dictionary is not an integer.");
  37600. }
  37601. return shadow(this, "_pagesCount", obj);
  37602. }
  37603. get numPages() {
  37604. return this.hasActualNumPages ? this._actualNumPages : this._pagesCount;
  37605. }
  37606. get destinations() {
  37607. const obj = this._readDests(),
  37608. dests = Object.create(null);
  37609. if (obj instanceof NameTree) {
  37610. for (const [key, value] of obj.getAll()) {
  37611. const dest = fetchDest(value);
  37612. if (dest) {
  37613. dests[stringToPDFString(key)] = dest;
  37614. }
  37615. }
  37616. } else if (obj instanceof Dict) {
  37617. obj.forEach(function (key, value) {
  37618. const dest = fetchDest(value);
  37619. if (dest) {
  37620. dests[key] = dest;
  37621. }
  37622. });
  37623. }
  37624. return shadow(this, "destinations", dests);
  37625. }
  37626. getDestination(id) {
  37627. const obj = this._readDests();
  37628. if (obj instanceof NameTree) {
  37629. const dest = fetchDest(obj.get(id));
  37630. if (dest) {
  37631. return dest;
  37632. }
  37633. const allDest = this.destinations[id];
  37634. if (allDest) {
  37635. warn(`Found "${id}" at an incorrect position in the NameTree.`);
  37636. return allDest;
  37637. }
  37638. } else if (obj instanceof Dict) {
  37639. const dest = fetchDest(obj.get(id));
  37640. if (dest) {
  37641. return dest;
  37642. }
  37643. }
  37644. return null;
  37645. }
  37646. _readDests() {
  37647. const obj = this._catDict.get("Names");
  37648. if (obj?.has("Dests")) {
  37649. return new NameTree(obj.getRaw("Dests"), this.xref);
  37650. } else if (this._catDict.has("Dests")) {
  37651. return this._catDict.get("Dests");
  37652. }
  37653. return undefined;
  37654. }
  37655. get pageLabels() {
  37656. let obj = null;
  37657. try {
  37658. obj = this._readPageLabels();
  37659. } catch (ex) {
  37660. if (ex instanceof MissingDataException) {
  37661. throw ex;
  37662. }
  37663. warn("Unable to read page labels.");
  37664. }
  37665. return shadow(this, "pageLabels", obj);
  37666. }
  37667. _readPageLabels() {
  37668. const obj = this._catDict.getRaw("PageLabels");
  37669. if (!obj) {
  37670. return null;
  37671. }
  37672. const pageLabels = new Array(this.numPages);
  37673. let style = null,
  37674. prefix = "";
  37675. const numberTree = new NumberTree(obj, this.xref);
  37676. const nums = numberTree.getAll();
  37677. let currentLabel = "",
  37678. currentIndex = 1;
  37679. for (let i = 0, ii = this.numPages; i < ii; i++) {
  37680. const labelDict = nums.get(i);
  37681. if (labelDict !== undefined) {
  37682. if (!(labelDict instanceof Dict)) {
  37683. throw new FormatError("PageLabel is not a dictionary.");
  37684. }
  37685. if (labelDict.has("Type") && !isName(labelDict.get("Type"), "PageLabel")) {
  37686. throw new FormatError("Invalid type in PageLabel dictionary.");
  37687. }
  37688. if (labelDict.has("S")) {
  37689. const s = labelDict.get("S");
  37690. if (!(s instanceof Name)) {
  37691. throw new FormatError("Invalid style in PageLabel dictionary.");
  37692. }
  37693. style = s.name;
  37694. } else {
  37695. style = null;
  37696. }
  37697. if (labelDict.has("P")) {
  37698. const p = labelDict.get("P");
  37699. if (typeof p !== "string") {
  37700. throw new FormatError("Invalid prefix in PageLabel dictionary.");
  37701. }
  37702. prefix = stringToPDFString(p);
  37703. } else {
  37704. prefix = "";
  37705. }
  37706. if (labelDict.has("St")) {
  37707. const st = labelDict.get("St");
  37708. if (!(Number.isInteger(st) && st >= 1)) {
  37709. throw new FormatError("Invalid start in PageLabel dictionary.");
  37710. }
  37711. currentIndex = st;
  37712. } else {
  37713. currentIndex = 1;
  37714. }
  37715. }
  37716. switch (style) {
  37717. case "D":
  37718. currentLabel = currentIndex;
  37719. break;
  37720. case "R":
  37721. case "r":
  37722. currentLabel = toRomanNumerals(currentIndex, style === "r");
  37723. break;
  37724. case "A":
  37725. case "a":
  37726. const LIMIT = 26;
  37727. const A_UPPER_CASE = 0x41,
  37728. A_LOWER_CASE = 0x61;
  37729. const baseCharCode = style === "a" ? A_LOWER_CASE : A_UPPER_CASE;
  37730. const letterIndex = currentIndex - 1;
  37731. const character = String.fromCharCode(baseCharCode + letterIndex % LIMIT);
  37732. currentLabel = character.repeat(Math.floor(letterIndex / LIMIT) + 1);
  37733. break;
  37734. default:
  37735. if (style) {
  37736. throw new FormatError(`Invalid style "${style}" in PageLabel dictionary.`);
  37737. }
  37738. currentLabel = "";
  37739. }
  37740. pageLabels[i] = prefix + currentLabel;
  37741. currentIndex++;
  37742. }
  37743. return pageLabels;
  37744. }
  37745. get pageLayout() {
  37746. const obj = this._catDict.get("PageLayout");
  37747. let pageLayout = "";
  37748. if (obj instanceof Name) {
  37749. switch (obj.name) {
  37750. case "SinglePage":
  37751. case "OneColumn":
  37752. case "TwoColumnLeft":
  37753. case "TwoColumnRight":
  37754. case "TwoPageLeft":
  37755. case "TwoPageRight":
  37756. pageLayout = obj.name;
  37757. }
  37758. }
  37759. return shadow(this, "pageLayout", pageLayout);
  37760. }
  37761. get pageMode() {
  37762. const obj = this._catDict.get("PageMode");
  37763. let pageMode = "UseNone";
  37764. if (obj instanceof Name) {
  37765. switch (obj.name) {
  37766. case "UseNone":
  37767. case "UseOutlines":
  37768. case "UseThumbs":
  37769. case "FullScreen":
  37770. case "UseOC":
  37771. case "UseAttachments":
  37772. pageMode = obj.name;
  37773. }
  37774. }
  37775. return shadow(this, "pageMode", pageMode);
  37776. }
  37777. get viewerPreferences() {
  37778. const obj = this._catDict.get("ViewerPreferences");
  37779. if (!(obj instanceof Dict)) {
  37780. return shadow(this, "viewerPreferences", null);
  37781. }
  37782. let prefs = null;
  37783. for (const key of obj.getKeys()) {
  37784. const value = obj.get(key);
  37785. let prefValue;
  37786. switch (key) {
  37787. case "HideToolbar":
  37788. case "HideMenubar":
  37789. case "HideWindowUI":
  37790. case "FitWindow":
  37791. case "CenterWindow":
  37792. case "DisplayDocTitle":
  37793. case "PickTrayByPDFSize":
  37794. if (typeof value === "boolean") {
  37795. prefValue = value;
  37796. }
  37797. break;
  37798. case "NonFullScreenPageMode":
  37799. if (value instanceof Name) {
  37800. switch (value.name) {
  37801. case "UseNone":
  37802. case "UseOutlines":
  37803. case "UseThumbs":
  37804. case "UseOC":
  37805. prefValue = value.name;
  37806. break;
  37807. default:
  37808. prefValue = "UseNone";
  37809. }
  37810. }
  37811. break;
  37812. case "Direction":
  37813. if (value instanceof Name) {
  37814. switch (value.name) {
  37815. case "L2R":
  37816. case "R2L":
  37817. prefValue = value.name;
  37818. break;
  37819. default:
  37820. prefValue = "L2R";
  37821. }
  37822. }
  37823. break;
  37824. case "ViewArea":
  37825. case "ViewClip":
  37826. case "PrintArea":
  37827. case "PrintClip":
  37828. if (value instanceof Name) {
  37829. switch (value.name) {
  37830. case "MediaBox":
  37831. case "CropBox":
  37832. case "BleedBox":
  37833. case "TrimBox":
  37834. case "ArtBox":
  37835. prefValue = value.name;
  37836. break;
  37837. default:
  37838. prefValue = "CropBox";
  37839. }
  37840. }
  37841. break;
  37842. case "PrintScaling":
  37843. if (value instanceof Name) {
  37844. switch (value.name) {
  37845. case "None":
  37846. case "AppDefault":
  37847. prefValue = value.name;
  37848. break;
  37849. default:
  37850. prefValue = "AppDefault";
  37851. }
  37852. }
  37853. break;
  37854. case "Duplex":
  37855. if (value instanceof Name) {
  37856. switch (value.name) {
  37857. case "Simplex":
  37858. case "DuplexFlipShortEdge":
  37859. case "DuplexFlipLongEdge":
  37860. prefValue = value.name;
  37861. break;
  37862. default:
  37863. prefValue = "None";
  37864. }
  37865. }
  37866. break;
  37867. case "PrintPageRange":
  37868. if (Array.isArray(value) && value.length % 2 === 0) {
  37869. const isValid = value.every((page, i, arr) => Number.isInteger(page) && page > 0 && (i === 0 || page >= arr[i - 1]) && page <= this.numPages);
  37870. if (isValid) {
  37871. prefValue = value;
  37872. }
  37873. }
  37874. break;
  37875. case "NumCopies":
  37876. if (Number.isInteger(value) && value > 0) {
  37877. prefValue = value;
  37878. }
  37879. break;
  37880. default:
  37881. warn(`Ignoring non-standard key in ViewerPreferences: ${key}.`);
  37882. continue;
  37883. }
  37884. if (prefValue === undefined) {
  37885. warn(`Bad value, for key "${key}", in ViewerPreferences: ${value}.`);
  37886. continue;
  37887. }
  37888. if (!prefs) {
  37889. prefs = Object.create(null);
  37890. }
  37891. prefs[key] = prefValue;
  37892. }
  37893. return shadow(this, "viewerPreferences", prefs);
  37894. }
  37895. get openAction() {
  37896. const obj = this._catDict.get("OpenAction");
  37897. const openAction = Object.create(null);
  37898. if (obj instanceof Dict) {
  37899. const destDict = new Dict(this.xref);
  37900. destDict.set("A", obj);
  37901. const resultObj = {
  37902. url: null,
  37903. dest: null,
  37904. action: null
  37905. };
  37906. Catalog.parseDestDictionary({
  37907. destDict,
  37908. resultObj
  37909. });
  37910. if (Array.isArray(resultObj.dest)) {
  37911. openAction.dest = resultObj.dest;
  37912. } else if (resultObj.action) {
  37913. openAction.action = resultObj.action;
  37914. }
  37915. } else if (Array.isArray(obj)) {
  37916. openAction.dest = obj;
  37917. }
  37918. return shadow(this, "openAction", objectSize(openAction) > 0 ? openAction : null);
  37919. }
  37920. get attachments() {
  37921. const obj = this._catDict.get("Names");
  37922. let attachments = null;
  37923. if (obj instanceof Dict && obj.has("EmbeddedFiles")) {
  37924. const nameTree = new NameTree(obj.getRaw("EmbeddedFiles"), this.xref);
  37925. for (const [key, value] of nameTree.getAll()) {
  37926. const fs = new FileSpec(value, this.xref);
  37927. if (!attachments) {
  37928. attachments = Object.create(null);
  37929. }
  37930. attachments[stringToPDFString(key)] = fs.serializable;
  37931. }
  37932. }
  37933. return shadow(this, "attachments", attachments);
  37934. }
  37935. get xfaImages() {
  37936. const obj = this._catDict.get("Names");
  37937. let xfaImages = null;
  37938. if (obj instanceof Dict && obj.has("XFAImages")) {
  37939. const nameTree = new NameTree(obj.getRaw("XFAImages"), this.xref);
  37940. for (const [key, value] of nameTree.getAll()) {
  37941. if (!xfaImages) {
  37942. xfaImages = new Dict(this.xref);
  37943. }
  37944. xfaImages.set(stringToPDFString(key), value);
  37945. }
  37946. }
  37947. return shadow(this, "xfaImages", xfaImages);
  37948. }
  37949. _collectJavaScript() {
  37950. const obj = this._catDict.get("Names");
  37951. let javaScript = null;
  37952. function appendIfJavaScriptDict(name, jsDict) {
  37953. if (!(jsDict instanceof Dict)) {
  37954. return;
  37955. }
  37956. if (!isName(jsDict.get("S"), "JavaScript")) {
  37957. return;
  37958. }
  37959. let js = jsDict.get("JS");
  37960. if (js instanceof BaseStream) {
  37961. js = js.getString();
  37962. } else if (typeof js !== "string") {
  37963. return;
  37964. }
  37965. js = stringToPDFString(js).replaceAll("\x00", "");
  37966. if (js) {
  37967. (javaScript ||= new Map()).set(name, js);
  37968. }
  37969. }
  37970. if (obj instanceof Dict && obj.has("JavaScript")) {
  37971. const nameTree = new NameTree(obj.getRaw("JavaScript"), this.xref);
  37972. for (const [key, value] of nameTree.getAll()) {
  37973. appendIfJavaScriptDict(stringToPDFString(key), value);
  37974. }
  37975. }
  37976. const openAction = this._catDict.get("OpenAction");
  37977. if (openAction) {
  37978. appendIfJavaScriptDict("OpenAction", openAction);
  37979. }
  37980. return javaScript;
  37981. }
  37982. get jsActions() {
  37983. const javaScript = this._collectJavaScript();
  37984. let actions = collectActions(this.xref, this._catDict, DocumentActionEventType);
  37985. if (javaScript) {
  37986. actions ||= Object.create(null);
  37987. for (const [key, val] of javaScript) {
  37988. if (key in actions) {
  37989. actions[key].push(val);
  37990. } else {
  37991. actions[key] = [val];
  37992. }
  37993. }
  37994. }
  37995. return shadow(this, "jsActions", actions);
  37996. }
  37997. async fontFallback(id, handler) {
  37998. const translatedFonts = await Promise.all(this.fontCache);
  37999. for (const translatedFont of translatedFonts) {
  38000. if (translatedFont.loadedName === id) {
  38001. translatedFont.fallback(handler);
  38002. return;
  38003. }
  38004. }
  38005. }
  38006. async cleanup(manuallyTriggered = false) {
  38007. clearGlobalCaches();
  38008. this.globalImageCache.clear(manuallyTriggered);
  38009. this.pageKidsCountCache.clear();
  38010. this.pageIndexCache.clear();
  38011. this.nonBlendModesSet.clear();
  38012. const translatedFonts = await Promise.all(this.fontCache);
  38013. for (const {
  38014. dict
  38015. } of translatedFonts) {
  38016. delete dict.cacheKey;
  38017. }
  38018. this.fontCache.clear();
  38019. this.builtInCMapCache.clear();
  38020. this.standardFontDataCache.clear();
  38021. this.systemFontCache.clear();
  38022. }
  38023. async getPageDict(pageIndex) {
  38024. const nodesToVisit = [this.toplevelPagesDict];
  38025. const visitedNodes = new RefSet();
  38026. const pagesRef = this._catDict.getRaw("Pages");
  38027. if (pagesRef instanceof Ref) {
  38028. visitedNodes.put(pagesRef);
  38029. }
  38030. const xref = this.xref,
  38031. pageKidsCountCache = this.pageKidsCountCache,
  38032. pageIndexCache = this.pageIndexCache;
  38033. let currentPageIndex = 0;
  38034. while (nodesToVisit.length) {
  38035. const currentNode = nodesToVisit.pop();
  38036. if (currentNode instanceof Ref) {
  38037. const count = pageKidsCountCache.get(currentNode);
  38038. if (count >= 0 && currentPageIndex + count <= pageIndex) {
  38039. currentPageIndex += count;
  38040. continue;
  38041. }
  38042. if (visitedNodes.has(currentNode)) {
  38043. throw new FormatError("Pages tree contains circular reference.");
  38044. }
  38045. visitedNodes.put(currentNode);
  38046. const obj = await xref.fetchAsync(currentNode);
  38047. if (obj instanceof Dict) {
  38048. let type = obj.getRaw("Type");
  38049. if (type instanceof Ref) {
  38050. type = await xref.fetchAsync(type);
  38051. }
  38052. if (isName(type, "Page") || !obj.has("Kids")) {
  38053. if (!pageKidsCountCache.has(currentNode)) {
  38054. pageKidsCountCache.put(currentNode, 1);
  38055. }
  38056. if (!pageIndexCache.has(currentNode)) {
  38057. pageIndexCache.put(currentNode, currentPageIndex);
  38058. }
  38059. if (currentPageIndex === pageIndex) {
  38060. return [obj, currentNode];
  38061. }
  38062. currentPageIndex++;
  38063. continue;
  38064. }
  38065. }
  38066. nodesToVisit.push(obj);
  38067. continue;
  38068. }
  38069. if (!(currentNode instanceof Dict)) {
  38070. throw new FormatError("Page dictionary kid reference points to wrong type of object.");
  38071. }
  38072. const {
  38073. objId
  38074. } = currentNode;
  38075. let count = currentNode.getRaw("Count");
  38076. if (count instanceof Ref) {
  38077. count = await xref.fetchAsync(count);
  38078. }
  38079. if (Number.isInteger(count) && count >= 0) {
  38080. if (objId && !pageKidsCountCache.has(objId)) {
  38081. pageKidsCountCache.put(objId, count);
  38082. }
  38083. if (currentPageIndex + count <= pageIndex) {
  38084. currentPageIndex += count;
  38085. continue;
  38086. }
  38087. }
  38088. let kids = currentNode.getRaw("Kids");
  38089. if (kids instanceof Ref) {
  38090. kids = await xref.fetchAsync(kids);
  38091. }
  38092. if (!Array.isArray(kids)) {
  38093. let type = currentNode.getRaw("Type");
  38094. if (type instanceof Ref) {
  38095. type = await xref.fetchAsync(type);
  38096. }
  38097. if (isName(type, "Page") || !currentNode.has("Kids")) {
  38098. if (currentPageIndex === pageIndex) {
  38099. return [currentNode, null];
  38100. }
  38101. currentPageIndex++;
  38102. continue;
  38103. }
  38104. throw new FormatError("Page dictionary kids object is not an array.");
  38105. }
  38106. for (let last = kids.length - 1; last >= 0; last--) {
  38107. nodesToVisit.push(kids[last]);
  38108. }
  38109. }
  38110. throw new Error(`Page index ${pageIndex} not found.`);
  38111. }
  38112. async getAllPageDicts(recoveryMode = false) {
  38113. const {
  38114. ignoreErrors
  38115. } = this.pdfManager.evaluatorOptions;
  38116. const queue = [{
  38117. currentNode: this.toplevelPagesDict,
  38118. posInKids: 0
  38119. }];
  38120. const visitedNodes = new RefSet();
  38121. const pagesRef = this._catDict.getRaw("Pages");
  38122. if (pagesRef instanceof Ref) {
  38123. visitedNodes.put(pagesRef);
  38124. }
  38125. const map = new Map(),
  38126. xref = this.xref,
  38127. pageIndexCache = this.pageIndexCache;
  38128. let pageIndex = 0;
  38129. function addPageDict(pageDict, pageRef) {
  38130. if (pageRef && !pageIndexCache.has(pageRef)) {
  38131. pageIndexCache.put(pageRef, pageIndex);
  38132. }
  38133. map.set(pageIndex++, [pageDict, pageRef]);
  38134. }
  38135. function addPageError(error) {
  38136. if (error instanceof XRefEntryException && !recoveryMode) {
  38137. throw error;
  38138. }
  38139. if (recoveryMode && ignoreErrors && pageIndex === 0) {
  38140. warn(`getAllPageDicts - Skipping invalid first page: "${error}".`);
  38141. error = Dict.empty;
  38142. }
  38143. map.set(pageIndex++, [error, null]);
  38144. }
  38145. while (queue.length > 0) {
  38146. const queueItem = queue.at(-1);
  38147. const {
  38148. currentNode,
  38149. posInKids
  38150. } = queueItem;
  38151. let kids = currentNode.getRaw("Kids");
  38152. if (kids instanceof Ref) {
  38153. try {
  38154. kids = await xref.fetchAsync(kids);
  38155. } catch (ex) {
  38156. addPageError(ex);
  38157. break;
  38158. }
  38159. }
  38160. if (!Array.isArray(kids)) {
  38161. addPageError(new FormatError("Page dictionary kids object is not an array."));
  38162. break;
  38163. }
  38164. if (posInKids >= kids.length) {
  38165. queue.pop();
  38166. continue;
  38167. }
  38168. const kidObj = kids[posInKids];
  38169. let obj;
  38170. if (kidObj instanceof Ref) {
  38171. if (visitedNodes.has(kidObj)) {
  38172. addPageError(new FormatError("Pages tree contains circular reference."));
  38173. break;
  38174. }
  38175. visitedNodes.put(kidObj);
  38176. try {
  38177. obj = await xref.fetchAsync(kidObj);
  38178. } catch (ex) {
  38179. addPageError(ex);
  38180. break;
  38181. }
  38182. } else {
  38183. obj = kidObj;
  38184. }
  38185. if (!(obj instanceof Dict)) {
  38186. addPageError(new FormatError("Page dictionary kid reference points to wrong type of object."));
  38187. break;
  38188. }
  38189. let type = obj.getRaw("Type");
  38190. if (type instanceof Ref) {
  38191. try {
  38192. type = await xref.fetchAsync(type);
  38193. } catch (ex) {
  38194. addPageError(ex);
  38195. break;
  38196. }
  38197. }
  38198. if (isName(type, "Page") || !obj.has("Kids")) {
  38199. addPageDict(obj, kidObj instanceof Ref ? kidObj : null);
  38200. } else {
  38201. queue.push({
  38202. currentNode: obj,
  38203. posInKids: 0
  38204. });
  38205. }
  38206. queueItem.posInKids++;
  38207. }
  38208. return map;
  38209. }
  38210. getPageIndex(pageRef) {
  38211. const cachedPageIndex = this.pageIndexCache.get(pageRef);
  38212. if (cachedPageIndex !== undefined) {
  38213. return Promise.resolve(cachedPageIndex);
  38214. }
  38215. const xref = this.xref;
  38216. function pagesBeforeRef(kidRef) {
  38217. let total = 0,
  38218. parentRef;
  38219. return xref.fetchAsync(kidRef).then(function (node) {
  38220. if (isRefsEqual(kidRef, pageRef) && !isDict(node, "Page") && !(node instanceof Dict && !node.has("Type") && node.has("Contents"))) {
  38221. throw new FormatError("The reference does not point to a /Page dictionary.");
  38222. }
  38223. if (!node) {
  38224. return null;
  38225. }
  38226. if (!(node instanceof Dict)) {
  38227. throw new FormatError("Node must be a dictionary.");
  38228. }
  38229. parentRef = node.getRaw("Parent");
  38230. return node.getAsync("Parent");
  38231. }).then(function (parent) {
  38232. if (!parent) {
  38233. return null;
  38234. }
  38235. if (!(parent instanceof Dict)) {
  38236. throw new FormatError("Parent must be a dictionary.");
  38237. }
  38238. return parent.getAsync("Kids");
  38239. }).then(function (kids) {
  38240. if (!kids) {
  38241. return null;
  38242. }
  38243. const kidPromises = [];
  38244. let found = false;
  38245. for (const kid of kids) {
  38246. if (!(kid instanceof Ref)) {
  38247. throw new FormatError("Kid must be a reference.");
  38248. }
  38249. if (isRefsEqual(kid, kidRef)) {
  38250. found = true;
  38251. break;
  38252. }
  38253. kidPromises.push(xref.fetchAsync(kid).then(function (obj) {
  38254. if (!(obj instanceof Dict)) {
  38255. throw new FormatError("Kid node must be a dictionary.");
  38256. }
  38257. if (obj.has("Count")) {
  38258. total += obj.get("Count");
  38259. } else {
  38260. total++;
  38261. }
  38262. }));
  38263. }
  38264. if (!found) {
  38265. throw new FormatError("Kid reference not found in parent's kids.");
  38266. }
  38267. return Promise.all(kidPromises).then(function () {
  38268. return [total, parentRef];
  38269. });
  38270. });
  38271. }
  38272. let total = 0;
  38273. const next = ref => pagesBeforeRef(ref).then(args => {
  38274. if (!args) {
  38275. this.pageIndexCache.put(pageRef, total);
  38276. return total;
  38277. }
  38278. const [count, parentRef] = args;
  38279. total += count;
  38280. return next(parentRef);
  38281. });
  38282. return next(pageRef);
  38283. }
  38284. get baseUrl() {
  38285. const uri = this._catDict.get("URI");
  38286. if (uri instanceof Dict) {
  38287. const base = uri.get("Base");
  38288. if (typeof base === "string") {
  38289. const absoluteUrl = createValidAbsoluteUrl(base, null, {
  38290. tryConvertEncoding: true
  38291. });
  38292. if (absoluteUrl) {
  38293. return shadow(this, "baseUrl", absoluteUrl.href);
  38294. }
  38295. }
  38296. }
  38297. return shadow(this, "baseUrl", this.pdfManager.docBaseUrl);
  38298. }
  38299. static parseDestDictionary({
  38300. destDict,
  38301. resultObj,
  38302. docBaseUrl = null,
  38303. docAttachments = null
  38304. }) {
  38305. if (!(destDict instanceof Dict)) {
  38306. warn("parseDestDictionary: `destDict` must be a dictionary.");
  38307. return;
  38308. }
  38309. let action = destDict.get("A"),
  38310. url,
  38311. dest;
  38312. if (!(action instanceof Dict)) {
  38313. if (destDict.has("Dest")) {
  38314. action = destDict.get("Dest");
  38315. } else {
  38316. action = destDict.get("AA");
  38317. if (action instanceof Dict) {
  38318. if (action.has("D")) {
  38319. action = action.get("D");
  38320. } else if (action.has("U")) {
  38321. action = action.get("U");
  38322. }
  38323. }
  38324. }
  38325. }
  38326. if (action instanceof Dict) {
  38327. const actionType = action.get("S");
  38328. if (!(actionType instanceof Name)) {
  38329. warn("parseDestDictionary: Invalid type in Action dictionary.");
  38330. return;
  38331. }
  38332. const actionName = actionType.name;
  38333. switch (actionName) {
  38334. case "ResetForm":
  38335. const flags = action.get("Flags");
  38336. const include = ((typeof flags === "number" ? flags : 0) & 1) === 0;
  38337. const fields = [];
  38338. const refs = [];
  38339. for (const obj of action.get("Fields") || []) {
  38340. if (obj instanceof Ref) {
  38341. refs.push(obj.toString());
  38342. } else if (typeof obj === "string") {
  38343. fields.push(stringToPDFString(obj));
  38344. }
  38345. }
  38346. resultObj.resetForm = {
  38347. fields,
  38348. refs,
  38349. include
  38350. };
  38351. break;
  38352. case "URI":
  38353. url = action.get("URI");
  38354. if (url instanceof Name) {
  38355. url = "/" + url.name;
  38356. }
  38357. break;
  38358. case "GoTo":
  38359. dest = action.get("D");
  38360. break;
  38361. case "Launch":
  38362. case "GoToR":
  38363. const urlDict = action.get("F");
  38364. if (urlDict instanceof Dict) {
  38365. const fs = new FileSpec(urlDict, null, true);
  38366. const {
  38367. rawFilename
  38368. } = fs.serializable;
  38369. url = rawFilename;
  38370. } else if (typeof urlDict === "string") {
  38371. url = urlDict;
  38372. }
  38373. const remoteDest = fetchRemoteDest(action);
  38374. if (remoteDest && typeof url === "string") {
  38375. url = url.split("#", 1)[0] + "#" + remoteDest;
  38376. }
  38377. const newWindow = action.get("NewWindow");
  38378. if (typeof newWindow === "boolean") {
  38379. resultObj.newWindow = newWindow;
  38380. }
  38381. break;
  38382. case "GoToE":
  38383. const target = action.get("T");
  38384. let attachment;
  38385. if (docAttachments && target instanceof Dict) {
  38386. const relationship = target.get("R");
  38387. const name = target.get("N");
  38388. if (isName(relationship, "C") && typeof name === "string") {
  38389. attachment = docAttachments[stringToPDFString(name)];
  38390. }
  38391. }
  38392. if (attachment) {
  38393. resultObj.attachment = attachment;
  38394. const attachmentDest = fetchRemoteDest(action);
  38395. if (attachmentDest) {
  38396. resultObj.attachmentDest = attachmentDest;
  38397. }
  38398. } else {
  38399. warn(`parseDestDictionary - unimplemented "GoToE" action.`);
  38400. }
  38401. break;
  38402. case "Named":
  38403. const namedAction = action.get("N");
  38404. if (namedAction instanceof Name) {
  38405. resultObj.action = namedAction.name;
  38406. }
  38407. break;
  38408. case "SetOCGState":
  38409. const state = action.get("State");
  38410. const preserveRB = action.get("PreserveRB");
  38411. if (!Array.isArray(state) || state.length === 0) {
  38412. break;
  38413. }
  38414. const stateArr = [];
  38415. for (const elem of state) {
  38416. if (elem instanceof Name) {
  38417. switch (elem.name) {
  38418. case "ON":
  38419. case "OFF":
  38420. case "Toggle":
  38421. stateArr.push(elem.name);
  38422. break;
  38423. }
  38424. } else if (elem instanceof Ref) {
  38425. stateArr.push(elem.toString());
  38426. }
  38427. }
  38428. if (stateArr.length !== state.length) {
  38429. break;
  38430. }
  38431. resultObj.setOCGState = {
  38432. state: stateArr,
  38433. preserveRB: typeof preserveRB === "boolean" ? preserveRB : true
  38434. };
  38435. break;
  38436. case "JavaScript":
  38437. const jsAction = action.get("JS");
  38438. let js;
  38439. if (jsAction instanceof BaseStream) {
  38440. js = jsAction.getString();
  38441. } else if (typeof jsAction === "string") {
  38442. js = jsAction;
  38443. }
  38444. const jsURL = js && recoverJsURL(stringToPDFString(js));
  38445. if (jsURL) {
  38446. url = jsURL.url;
  38447. resultObj.newWindow = jsURL.newWindow;
  38448. break;
  38449. }
  38450. default:
  38451. if (actionName === "JavaScript" || actionName === "SubmitForm") {
  38452. break;
  38453. }
  38454. warn(`parseDestDictionary - unsupported action: "${actionName}".`);
  38455. break;
  38456. }
  38457. } else if (destDict.has("Dest")) {
  38458. dest = destDict.get("Dest");
  38459. }
  38460. if (typeof url === "string") {
  38461. const absoluteUrl = createValidAbsoluteUrl(url, docBaseUrl, {
  38462. addDefaultProtocol: true,
  38463. tryConvertEncoding: true
  38464. });
  38465. if (absoluteUrl) {
  38466. resultObj.url = absoluteUrl.href;
  38467. }
  38468. resultObj.unsafeUrl = url;
  38469. }
  38470. if (dest) {
  38471. if (dest instanceof Name) {
  38472. dest = dest.name;
  38473. }
  38474. if (typeof dest === "string") {
  38475. resultObj.dest = stringToPDFString(dest);
  38476. } else if (isValidExplicitDest(dest)) {
  38477. resultObj.dest = dest;
  38478. }
  38479. }
  38480. }
  38481. }
  38482. ;// CONCATENATED MODULE: ./src/core/object_loader.js
  38483. function mayHaveChildren(value) {
  38484. return value instanceof Ref || value instanceof Dict || value instanceof BaseStream || Array.isArray(value);
  38485. }
  38486. function addChildren(node, nodesToVisit) {
  38487. if (node instanceof Dict) {
  38488. node = node.getRawValues();
  38489. } else if (node instanceof BaseStream) {
  38490. node = node.dict.getRawValues();
  38491. } else if (!Array.isArray(node)) {
  38492. return;
  38493. }
  38494. for (const rawValue of node) {
  38495. if (mayHaveChildren(rawValue)) {
  38496. nodesToVisit.push(rawValue);
  38497. }
  38498. }
  38499. }
  38500. class ObjectLoader {
  38501. constructor(dict, keys, xref) {
  38502. this.dict = dict;
  38503. this.keys = keys;
  38504. this.xref = xref;
  38505. this.refSet = null;
  38506. }
  38507. async load() {
  38508. if (this.xref.stream.isDataLoaded) {
  38509. return undefined;
  38510. }
  38511. const {
  38512. keys,
  38513. dict
  38514. } = this;
  38515. this.refSet = new RefSet();
  38516. const nodesToVisit = [];
  38517. for (const key of keys) {
  38518. const rawValue = dict.getRaw(key);
  38519. if (rawValue !== undefined) {
  38520. nodesToVisit.push(rawValue);
  38521. }
  38522. }
  38523. return this._walk(nodesToVisit);
  38524. }
  38525. async _walk(nodesToVisit) {
  38526. const nodesToRevisit = [];
  38527. const pendingRequests = [];
  38528. while (nodesToVisit.length) {
  38529. let currentNode = nodesToVisit.pop();
  38530. if (currentNode instanceof Ref) {
  38531. if (this.refSet.has(currentNode)) {
  38532. continue;
  38533. }
  38534. try {
  38535. this.refSet.put(currentNode);
  38536. currentNode = this.xref.fetch(currentNode);
  38537. } catch (ex) {
  38538. if (!(ex instanceof MissingDataException)) {
  38539. warn(`ObjectLoader._walk - requesting all data: "${ex}".`);
  38540. this.refSet = null;
  38541. const {
  38542. manager
  38543. } = this.xref.stream;
  38544. return manager.requestAllChunks();
  38545. }
  38546. nodesToRevisit.push(currentNode);
  38547. pendingRequests.push({
  38548. begin: ex.begin,
  38549. end: ex.end
  38550. });
  38551. }
  38552. }
  38553. if (currentNode instanceof BaseStream) {
  38554. const baseStreams = currentNode.getBaseStreams();
  38555. if (baseStreams) {
  38556. let foundMissingData = false;
  38557. for (const stream of baseStreams) {
  38558. if (stream.isDataLoaded) {
  38559. continue;
  38560. }
  38561. foundMissingData = true;
  38562. pendingRequests.push({
  38563. begin: stream.start,
  38564. end: stream.end
  38565. });
  38566. }
  38567. if (foundMissingData) {
  38568. nodesToRevisit.push(currentNode);
  38569. }
  38570. }
  38571. }
  38572. addChildren(currentNode, nodesToVisit);
  38573. }
  38574. if (pendingRequests.length) {
  38575. await this.xref.stream.manager.requestRanges(pendingRequests);
  38576. for (const node of nodesToRevisit) {
  38577. if (node instanceof Ref) {
  38578. this.refSet.remove(node);
  38579. }
  38580. }
  38581. return this._walk(nodesToRevisit);
  38582. }
  38583. this.refSet = null;
  38584. return undefined;
  38585. }
  38586. }
  38587. ;// CONCATENATED MODULE: ./src/core/xfa/symbol_utils.js
  38588. const $acceptWhitespace = Symbol();
  38589. const $addHTML = Symbol();
  38590. const $appendChild = Symbol();
  38591. const $childrenToHTML = Symbol();
  38592. const $clean = Symbol();
  38593. const $cleanPage = Symbol();
  38594. const $cleanup = Symbol();
  38595. const $clone = Symbol();
  38596. const $consumed = Symbol();
  38597. const $content = Symbol("content");
  38598. const $data = Symbol("data");
  38599. const $dump = Symbol();
  38600. const $extra = Symbol("extra");
  38601. const $finalize = Symbol();
  38602. const $flushHTML = Symbol();
  38603. const $getAttributeIt = Symbol();
  38604. const $getAttributes = Symbol();
  38605. const $getAvailableSpace = Symbol();
  38606. const $getChildrenByClass = Symbol();
  38607. const $getChildrenByName = Symbol();
  38608. const $getChildrenByNameIt = Symbol();
  38609. const $getDataValue = Symbol();
  38610. const $getExtra = Symbol();
  38611. const $getRealChildrenByNameIt = Symbol();
  38612. const $getChildren = Symbol();
  38613. const $getContainedChildren = Symbol();
  38614. const $getNextPage = Symbol();
  38615. const $getSubformParent = Symbol();
  38616. const $getParent = Symbol();
  38617. const $getTemplateRoot = Symbol();
  38618. const $globalData = Symbol();
  38619. const $hasSettableValue = Symbol();
  38620. const $ids = Symbol();
  38621. const $indexOf = Symbol();
  38622. const $insertAt = Symbol();
  38623. const $isCDATAXml = Symbol();
  38624. const $isBindable = Symbol();
  38625. const $isDataValue = Symbol();
  38626. const $isDescendent = Symbol();
  38627. const $isNsAgnostic = Symbol();
  38628. const $isSplittable = Symbol();
  38629. const $isThereMoreWidth = Symbol();
  38630. const $isTransparent = Symbol();
  38631. const $isUsable = Symbol();
  38632. const $lastAttribute = Symbol();
  38633. const $namespaceId = Symbol("namespaceId");
  38634. const $nodeName = Symbol("nodeName");
  38635. const $nsAttributes = Symbol();
  38636. const $onChild = Symbol();
  38637. const $onChildCheck = Symbol();
  38638. const $onText = Symbol();
  38639. const $pushGlyphs = Symbol();
  38640. const $popPara = Symbol();
  38641. const $pushPara = Symbol();
  38642. const $removeChild = Symbol();
  38643. const $root = Symbol("root");
  38644. const $resolvePrototypes = Symbol();
  38645. const $searchNode = Symbol();
  38646. const $setId = Symbol();
  38647. const $setSetAttributes = Symbol();
  38648. const $setValue = Symbol();
  38649. const $tabIndex = Symbol();
  38650. const $text = Symbol();
  38651. const $toPages = Symbol();
  38652. const $toHTML = Symbol();
  38653. const $toString = Symbol();
  38654. const $toStyle = Symbol();
  38655. const $uid = Symbol("uid");
  38656. ;// CONCATENATED MODULE: ./src/core/xfa/namespaces.js
  38657. const $buildXFAObject = Symbol();
  38658. const NamespaceIds = {
  38659. config: {
  38660. id: 0,
  38661. check: ns => ns.startsWith("http://www.xfa.org/schema/xci/")
  38662. },
  38663. connectionSet: {
  38664. id: 1,
  38665. check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-connection-set/")
  38666. },
  38667. datasets: {
  38668. id: 2,
  38669. check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-data/")
  38670. },
  38671. form: {
  38672. id: 3,
  38673. check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-form/")
  38674. },
  38675. localeSet: {
  38676. id: 4,
  38677. check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-locale-set/")
  38678. },
  38679. pdf: {
  38680. id: 5,
  38681. check: ns => ns === "http://ns.adobe.com/xdp/pdf/"
  38682. },
  38683. signature: {
  38684. id: 6,
  38685. check: ns => ns === "http://www.w3.org/2000/09/xmldsig#"
  38686. },
  38687. sourceSet: {
  38688. id: 7,
  38689. check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-source-set/")
  38690. },
  38691. stylesheet: {
  38692. id: 8,
  38693. check: ns => ns === "http://www.w3.org/1999/XSL/Transform"
  38694. },
  38695. template: {
  38696. id: 9,
  38697. check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-template/")
  38698. },
  38699. xdc: {
  38700. id: 10,
  38701. check: ns => ns.startsWith("http://www.xfa.org/schema/xdc/")
  38702. },
  38703. xdp: {
  38704. id: 11,
  38705. check: ns => ns === "http://ns.adobe.com/xdp/"
  38706. },
  38707. xfdf: {
  38708. id: 12,
  38709. check: ns => ns === "http://ns.adobe.com/xfdf/"
  38710. },
  38711. xhtml: {
  38712. id: 13,
  38713. check: ns => ns === "http://www.w3.org/1999/xhtml"
  38714. },
  38715. xmpmeta: {
  38716. id: 14,
  38717. check: ns => ns === "http://ns.adobe.com/xmpmeta/"
  38718. }
  38719. };
  38720. ;// CONCATENATED MODULE: ./src/core/xfa/utils.js
  38721. const dimConverters = {
  38722. pt: x => x,
  38723. cm: x => x / 2.54 * 72,
  38724. mm: x => x / (10 * 2.54) * 72,
  38725. in: x => x * 72,
  38726. px: x => x
  38727. };
  38728. const measurementPattern = /([+-]?\d+\.?\d*)(.*)/;
  38729. function stripQuotes(str) {
  38730. if (str.startsWith("'") || str.startsWith('"')) {
  38731. return str.slice(1, -1);
  38732. }
  38733. return str;
  38734. }
  38735. function getInteger({
  38736. data,
  38737. defaultValue,
  38738. validate
  38739. }) {
  38740. if (!data) {
  38741. return defaultValue;
  38742. }
  38743. data = data.trim();
  38744. const n = parseInt(data, 10);
  38745. if (!isNaN(n) && validate(n)) {
  38746. return n;
  38747. }
  38748. return defaultValue;
  38749. }
  38750. function getFloat({
  38751. data,
  38752. defaultValue,
  38753. validate
  38754. }) {
  38755. if (!data) {
  38756. return defaultValue;
  38757. }
  38758. data = data.trim();
  38759. const n = parseFloat(data);
  38760. if (!isNaN(n) && validate(n)) {
  38761. return n;
  38762. }
  38763. return defaultValue;
  38764. }
  38765. function getKeyword({
  38766. data,
  38767. defaultValue,
  38768. validate
  38769. }) {
  38770. if (!data) {
  38771. return defaultValue;
  38772. }
  38773. data = data.trim();
  38774. if (validate(data)) {
  38775. return data;
  38776. }
  38777. return defaultValue;
  38778. }
  38779. function getStringOption(data, options) {
  38780. return getKeyword({
  38781. data,
  38782. defaultValue: options[0],
  38783. validate: k => options.includes(k)
  38784. });
  38785. }
  38786. function getMeasurement(str, def = "0") {
  38787. def ||= "0";
  38788. if (!str) {
  38789. return getMeasurement(def);
  38790. }
  38791. const match = str.trim().match(measurementPattern);
  38792. if (!match) {
  38793. return getMeasurement(def);
  38794. }
  38795. const [, valueStr, unit] = match;
  38796. const value = parseFloat(valueStr);
  38797. if (isNaN(value)) {
  38798. return getMeasurement(def);
  38799. }
  38800. if (value === 0) {
  38801. return 0;
  38802. }
  38803. const conv = dimConverters[unit];
  38804. if (conv) {
  38805. return conv(value);
  38806. }
  38807. return value;
  38808. }
  38809. function getRatio(data) {
  38810. if (!data) {
  38811. return {
  38812. num: 1,
  38813. den: 1
  38814. };
  38815. }
  38816. const ratio = data.trim().split(/\s*:\s*/).map(x => parseFloat(x)).filter(x => !isNaN(x));
  38817. if (ratio.length === 1) {
  38818. ratio.push(1);
  38819. }
  38820. if (ratio.length === 0) {
  38821. return {
  38822. num: 1,
  38823. den: 1
  38824. };
  38825. }
  38826. const [num, den] = ratio;
  38827. return {
  38828. num,
  38829. den
  38830. };
  38831. }
  38832. function getRelevant(data) {
  38833. if (!data) {
  38834. return [];
  38835. }
  38836. return data.trim().split(/\s+/).map(e => ({
  38837. excluded: e[0] === "-",
  38838. viewname: e.substring(1)
  38839. }));
  38840. }
  38841. function getColor(data, def = [0, 0, 0]) {
  38842. let [r, g, b] = def;
  38843. if (!data) {
  38844. return {
  38845. r,
  38846. g,
  38847. b
  38848. };
  38849. }
  38850. 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);
  38851. if (color.length < 3) {
  38852. return {
  38853. r,
  38854. g,
  38855. b
  38856. };
  38857. }
  38858. [r, g, b] = color;
  38859. return {
  38860. r,
  38861. g,
  38862. b
  38863. };
  38864. }
  38865. function getBBox(data) {
  38866. const def = -1;
  38867. if (!data) {
  38868. return {
  38869. x: def,
  38870. y: def,
  38871. width: def,
  38872. height: def
  38873. };
  38874. }
  38875. const bbox = data.trim().split(/\s*,\s*/).map(m => getMeasurement(m, "-1"));
  38876. if (bbox.length < 4 || bbox[2] < 0 || bbox[3] < 0) {
  38877. return {
  38878. x: def,
  38879. y: def,
  38880. width: def,
  38881. height: def
  38882. };
  38883. }
  38884. const [x, y, width, height] = bbox;
  38885. return {
  38886. x,
  38887. y,
  38888. width,
  38889. height
  38890. };
  38891. }
  38892. class HTMLResult {
  38893. static get FAILURE() {
  38894. return shadow(this, "FAILURE", new HTMLResult(false, null, null, null));
  38895. }
  38896. static get EMPTY() {
  38897. return shadow(this, "EMPTY", new HTMLResult(true, null, null, null));
  38898. }
  38899. constructor(success, html, bbox, breakNode) {
  38900. this.success = success;
  38901. this.html = html;
  38902. this.bbox = bbox;
  38903. this.breakNode = breakNode;
  38904. }
  38905. isBreak() {
  38906. return !!this.breakNode;
  38907. }
  38908. static breakNode(node) {
  38909. return new HTMLResult(false, null, null, node);
  38910. }
  38911. static success(html, bbox = null) {
  38912. return new HTMLResult(true, html, bbox, null);
  38913. }
  38914. }
  38915. ;// CONCATENATED MODULE: ./src/core/xfa/fonts.js
  38916. class FontFinder {
  38917. constructor(pdfFonts) {
  38918. this.fonts = new Map();
  38919. this.cache = new Map();
  38920. this.warned = new Set();
  38921. this.defaultFont = null;
  38922. this.add(pdfFonts);
  38923. }
  38924. add(pdfFonts, reallyMissingFonts = null) {
  38925. for (const pdfFont of pdfFonts) {
  38926. this.addPdfFont(pdfFont);
  38927. }
  38928. for (const pdfFont of this.fonts.values()) {
  38929. if (!pdfFont.regular) {
  38930. pdfFont.regular = pdfFont.italic || pdfFont.bold || pdfFont.bolditalic;
  38931. }
  38932. }
  38933. if (!reallyMissingFonts || reallyMissingFonts.size === 0) {
  38934. return;
  38935. }
  38936. const myriad = this.fonts.get("PdfJS-Fallback-PdfJS-XFA");
  38937. for (const missing of reallyMissingFonts) {
  38938. this.fonts.set(missing, myriad);
  38939. }
  38940. }
  38941. addPdfFont(pdfFont) {
  38942. const cssFontInfo = pdfFont.cssFontInfo;
  38943. const name = cssFontInfo.fontFamily;
  38944. let font = this.fonts.get(name);
  38945. if (!font) {
  38946. font = Object.create(null);
  38947. this.fonts.set(name, font);
  38948. if (!this.defaultFont) {
  38949. this.defaultFont = font;
  38950. }
  38951. }
  38952. let property = "";
  38953. const fontWeight = parseFloat(cssFontInfo.fontWeight);
  38954. if (parseFloat(cssFontInfo.italicAngle) !== 0) {
  38955. property = fontWeight >= 700 ? "bolditalic" : "italic";
  38956. } else if (fontWeight >= 700) {
  38957. property = "bold";
  38958. }
  38959. if (!property) {
  38960. if (pdfFont.name.includes("Bold") || pdfFont.psName?.includes("Bold")) {
  38961. property = "bold";
  38962. }
  38963. if (pdfFont.name.includes("Italic") || pdfFont.name.endsWith("It") || pdfFont.psName?.includes("Italic") || pdfFont.psName?.endsWith("It")) {
  38964. property += "italic";
  38965. }
  38966. }
  38967. if (!property) {
  38968. property = "regular";
  38969. }
  38970. font[property] = pdfFont;
  38971. }
  38972. getDefault() {
  38973. return this.defaultFont;
  38974. }
  38975. find(fontName, mustWarn = true) {
  38976. let font = this.fonts.get(fontName) || this.cache.get(fontName);
  38977. if (font) {
  38978. return font;
  38979. }
  38980. const pattern = /,|-|_| |bolditalic|bold|italic|regular|it/gi;
  38981. let name = fontName.replaceAll(pattern, "");
  38982. font = this.fonts.get(name);
  38983. if (font) {
  38984. this.cache.set(fontName, font);
  38985. return font;
  38986. }
  38987. name = name.toLowerCase();
  38988. const maybe = [];
  38989. for (const [family, pdfFont] of this.fonts.entries()) {
  38990. if (family.replaceAll(pattern, "").toLowerCase().startsWith(name)) {
  38991. maybe.push(pdfFont);
  38992. }
  38993. }
  38994. if (maybe.length === 0) {
  38995. for (const [, pdfFont] of this.fonts.entries()) {
  38996. if (pdfFont.regular.name?.replaceAll(pattern, "").toLowerCase().startsWith(name)) {
  38997. maybe.push(pdfFont);
  38998. }
  38999. }
  39000. }
  39001. if (maybe.length === 0) {
  39002. name = name.replaceAll(/psmt|mt/gi, "");
  39003. for (const [family, pdfFont] of this.fonts.entries()) {
  39004. if (family.replaceAll(pattern, "").toLowerCase().startsWith(name)) {
  39005. maybe.push(pdfFont);
  39006. }
  39007. }
  39008. }
  39009. if (maybe.length === 0) {
  39010. for (const pdfFont of this.fonts.values()) {
  39011. if (pdfFont.regular.name?.replaceAll(pattern, "").toLowerCase().startsWith(name)) {
  39012. maybe.push(pdfFont);
  39013. }
  39014. }
  39015. }
  39016. if (maybe.length >= 1) {
  39017. if (maybe.length !== 1 && mustWarn) {
  39018. warn(`XFA - Too many choices to guess the correct font: ${fontName}`);
  39019. }
  39020. this.cache.set(fontName, maybe[0]);
  39021. return maybe[0];
  39022. }
  39023. if (mustWarn && !this.warned.has(fontName)) {
  39024. this.warned.add(fontName);
  39025. warn(`XFA - Cannot find the font: ${fontName}`);
  39026. }
  39027. return null;
  39028. }
  39029. }
  39030. function selectFont(xfaFont, typeface) {
  39031. if (xfaFont.posture === "italic") {
  39032. if (xfaFont.weight === "bold") {
  39033. return typeface.bolditalic;
  39034. }
  39035. return typeface.italic;
  39036. } else if (xfaFont.weight === "bold") {
  39037. return typeface.bold;
  39038. }
  39039. return typeface.regular;
  39040. }
  39041. function fonts_getMetrics(xfaFont, real = false) {
  39042. let pdfFont = null;
  39043. if (xfaFont) {
  39044. const name = stripQuotes(xfaFont.typeface);
  39045. const typeface = xfaFont[$globalData].fontFinder.find(name);
  39046. pdfFont = selectFont(xfaFont, typeface);
  39047. }
  39048. if (!pdfFont) {
  39049. return {
  39050. lineHeight: 12,
  39051. lineGap: 2,
  39052. lineNoGap: 10
  39053. };
  39054. }
  39055. const size = xfaFont.size || 10;
  39056. const lineHeight = pdfFont.lineHeight ? Math.max(real ? 0 : 1.2, pdfFont.lineHeight) : 1.2;
  39057. const lineGap = pdfFont.lineGap === undefined ? 0.2 : pdfFont.lineGap;
  39058. return {
  39059. lineHeight: lineHeight * size,
  39060. lineGap: lineGap * size,
  39061. lineNoGap: Math.max(1, lineHeight - lineGap) * size
  39062. };
  39063. }
  39064. ;// CONCATENATED MODULE: ./src/core/xfa/text.js
  39065. const WIDTH_FACTOR = 1.02;
  39066. class FontInfo {
  39067. constructor(xfaFont, margin, lineHeight, fontFinder) {
  39068. this.lineHeight = lineHeight;
  39069. this.paraMargin = margin || {
  39070. top: 0,
  39071. bottom: 0,
  39072. left: 0,
  39073. right: 0
  39074. };
  39075. if (!xfaFont) {
  39076. [this.pdfFont, this.xfaFont] = this.defaultFont(fontFinder);
  39077. return;
  39078. }
  39079. this.xfaFont = {
  39080. typeface: xfaFont.typeface,
  39081. posture: xfaFont.posture,
  39082. weight: xfaFont.weight,
  39083. size: xfaFont.size,
  39084. letterSpacing: xfaFont.letterSpacing
  39085. };
  39086. const typeface = fontFinder.find(xfaFont.typeface);
  39087. if (!typeface) {
  39088. [this.pdfFont, this.xfaFont] = this.defaultFont(fontFinder);
  39089. return;
  39090. }
  39091. this.pdfFont = selectFont(xfaFont, typeface);
  39092. if (!this.pdfFont) {
  39093. [this.pdfFont, this.xfaFont] = this.defaultFont(fontFinder);
  39094. }
  39095. }
  39096. defaultFont(fontFinder) {
  39097. const font = fontFinder.find("Helvetica", false) || fontFinder.find("Myriad Pro", false) || fontFinder.find("Arial", false) || fontFinder.getDefault();
  39098. if (font?.regular) {
  39099. const pdfFont = font.regular;
  39100. const info = pdfFont.cssFontInfo;
  39101. const xfaFont = {
  39102. typeface: info.fontFamily,
  39103. posture: "normal",
  39104. weight: "normal",
  39105. size: 10,
  39106. letterSpacing: 0
  39107. };
  39108. return [pdfFont, xfaFont];
  39109. }
  39110. const xfaFont = {
  39111. typeface: "Courier",
  39112. posture: "normal",
  39113. weight: "normal",
  39114. size: 10,
  39115. letterSpacing: 0
  39116. };
  39117. return [null, xfaFont];
  39118. }
  39119. }
  39120. class FontSelector {
  39121. constructor(defaultXfaFont, defaultParaMargin, defaultLineHeight, fontFinder) {
  39122. this.fontFinder = fontFinder;
  39123. this.stack = [new FontInfo(defaultXfaFont, defaultParaMargin, defaultLineHeight, fontFinder)];
  39124. }
  39125. pushData(xfaFont, margin, lineHeight) {
  39126. const lastFont = this.stack.at(-1);
  39127. for (const name of ["typeface", "posture", "weight", "size", "letterSpacing"]) {
  39128. if (!xfaFont[name]) {
  39129. xfaFont[name] = lastFont.xfaFont[name];
  39130. }
  39131. }
  39132. for (const name of ["top", "bottom", "left", "right"]) {
  39133. if (isNaN(margin[name])) {
  39134. margin[name] = lastFont.paraMargin[name];
  39135. }
  39136. }
  39137. const fontInfo = new FontInfo(xfaFont, margin, lineHeight || lastFont.lineHeight, this.fontFinder);
  39138. if (!fontInfo.pdfFont) {
  39139. fontInfo.pdfFont = lastFont.pdfFont;
  39140. }
  39141. this.stack.push(fontInfo);
  39142. }
  39143. popFont() {
  39144. this.stack.pop();
  39145. }
  39146. topFont() {
  39147. return this.stack.at(-1);
  39148. }
  39149. }
  39150. class TextMeasure {
  39151. constructor(defaultXfaFont, defaultParaMargin, defaultLineHeight, fonts) {
  39152. this.glyphs = [];
  39153. this.fontSelector = new FontSelector(defaultXfaFont, defaultParaMargin, defaultLineHeight, fonts);
  39154. this.extraHeight = 0;
  39155. }
  39156. pushData(xfaFont, margin, lineHeight) {
  39157. this.fontSelector.pushData(xfaFont, margin, lineHeight);
  39158. }
  39159. popFont(xfaFont) {
  39160. return this.fontSelector.popFont();
  39161. }
  39162. addPara() {
  39163. const lastFont = this.fontSelector.topFont();
  39164. this.extraHeight += lastFont.paraMargin.top + lastFont.paraMargin.bottom;
  39165. }
  39166. addString(str) {
  39167. if (!str) {
  39168. return;
  39169. }
  39170. const lastFont = this.fontSelector.topFont();
  39171. const fontSize = lastFont.xfaFont.size;
  39172. if (lastFont.pdfFont) {
  39173. const letterSpacing = lastFont.xfaFont.letterSpacing;
  39174. const pdfFont = lastFont.pdfFont;
  39175. const fontLineHeight = pdfFont.lineHeight || 1.2;
  39176. const lineHeight = lastFont.lineHeight || Math.max(1.2, fontLineHeight) * fontSize;
  39177. const lineGap = pdfFont.lineGap === undefined ? 0.2 : pdfFont.lineGap;
  39178. const noGap = fontLineHeight - lineGap;
  39179. const firstLineHeight = Math.max(1, noGap) * fontSize;
  39180. const scale = fontSize / 1000;
  39181. const fallbackWidth = pdfFont.defaultWidth || pdfFont.charsToGlyphs(" ")[0].width;
  39182. for (const line of str.split(/[\u2029\n]/)) {
  39183. const encodedLine = pdfFont.encodeString(line).join("");
  39184. const glyphs = pdfFont.charsToGlyphs(encodedLine);
  39185. for (const glyph of glyphs) {
  39186. const width = glyph.width || fallbackWidth;
  39187. this.glyphs.push([width * scale + letterSpacing, lineHeight, firstLineHeight, glyph.unicode, false]);
  39188. }
  39189. this.glyphs.push([0, 0, 0, "\n", true]);
  39190. }
  39191. this.glyphs.pop();
  39192. return;
  39193. }
  39194. for (const line of str.split(/[\u2029\n]/)) {
  39195. for (const char of line.split("")) {
  39196. this.glyphs.push([fontSize, 1.2 * fontSize, fontSize, char, false]);
  39197. }
  39198. this.glyphs.push([0, 0, 0, "\n", true]);
  39199. }
  39200. this.glyphs.pop();
  39201. }
  39202. compute(maxWidth) {
  39203. let lastSpacePos = -1,
  39204. lastSpaceWidth = 0,
  39205. width = 0,
  39206. height = 0,
  39207. currentLineWidth = 0,
  39208. currentLineHeight = 0;
  39209. let isBroken = false;
  39210. let isFirstLine = true;
  39211. for (let i = 0, ii = this.glyphs.length; i < ii; i++) {
  39212. const [glyphWidth, lineHeight, firstLineHeight, char, isEOL] = this.glyphs[i];
  39213. const isSpace = char === " ";
  39214. const glyphHeight = isFirstLine ? firstLineHeight : lineHeight;
  39215. if (isEOL) {
  39216. width = Math.max(width, currentLineWidth);
  39217. currentLineWidth = 0;
  39218. height += currentLineHeight;
  39219. currentLineHeight = glyphHeight;
  39220. lastSpacePos = -1;
  39221. lastSpaceWidth = 0;
  39222. isFirstLine = false;
  39223. continue;
  39224. }
  39225. if (isSpace) {
  39226. if (currentLineWidth + glyphWidth > maxWidth) {
  39227. width = Math.max(width, currentLineWidth);
  39228. currentLineWidth = 0;
  39229. height += currentLineHeight;
  39230. currentLineHeight = glyphHeight;
  39231. lastSpacePos = -1;
  39232. lastSpaceWidth = 0;
  39233. isBroken = true;
  39234. isFirstLine = false;
  39235. } else {
  39236. currentLineHeight = Math.max(glyphHeight, currentLineHeight);
  39237. lastSpaceWidth = currentLineWidth;
  39238. currentLineWidth += glyphWidth;
  39239. lastSpacePos = i;
  39240. }
  39241. continue;
  39242. }
  39243. if (currentLineWidth + glyphWidth > maxWidth) {
  39244. height += currentLineHeight;
  39245. currentLineHeight = glyphHeight;
  39246. if (lastSpacePos !== -1) {
  39247. i = lastSpacePos;
  39248. width = Math.max(width, lastSpaceWidth);
  39249. currentLineWidth = 0;
  39250. lastSpacePos = -1;
  39251. lastSpaceWidth = 0;
  39252. } else {
  39253. width = Math.max(width, currentLineWidth);
  39254. currentLineWidth = glyphWidth;
  39255. }
  39256. isBroken = true;
  39257. isFirstLine = false;
  39258. continue;
  39259. }
  39260. currentLineWidth += glyphWidth;
  39261. currentLineHeight = Math.max(glyphHeight, currentLineHeight);
  39262. }
  39263. width = Math.max(width, currentLineWidth);
  39264. height += currentLineHeight + this.extraHeight;
  39265. return {
  39266. width: WIDTH_FACTOR * width,
  39267. height,
  39268. isBroken
  39269. };
  39270. }
  39271. }
  39272. ;// CONCATENATED MODULE: ./src/core/xfa/som.js
  39273. const namePattern = /^[^.[]+/;
  39274. const indexPattern = /^[^\]]+/;
  39275. const operators = {
  39276. dot: 0,
  39277. dotDot: 1,
  39278. dotHash: 2,
  39279. dotBracket: 3,
  39280. dotParen: 4
  39281. };
  39282. 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]]);
  39283. const somCache = new WeakMap();
  39284. function parseIndex(index) {
  39285. index = index.trim();
  39286. if (index === "*") {
  39287. return Infinity;
  39288. }
  39289. return parseInt(index, 10) || 0;
  39290. }
  39291. function parseExpression(expr, dotDotAllowed, noExpr = true) {
  39292. let match = expr.match(namePattern);
  39293. if (!match) {
  39294. return null;
  39295. }
  39296. let [name] = match;
  39297. const parsed = [{
  39298. name,
  39299. cacheName: "." + name,
  39300. index: 0,
  39301. js: null,
  39302. formCalc: null,
  39303. operator: operators.dot
  39304. }];
  39305. let pos = name.length;
  39306. while (pos < expr.length) {
  39307. const spos = pos;
  39308. const char = expr.charAt(pos++);
  39309. if (char === "[") {
  39310. match = expr.slice(pos).match(indexPattern);
  39311. if (!match) {
  39312. warn("XFA - Invalid index in SOM expression");
  39313. return null;
  39314. }
  39315. parsed.at(-1).index = parseIndex(match[0]);
  39316. pos += match[0].length + 1;
  39317. continue;
  39318. }
  39319. let operator;
  39320. switch (expr.charAt(pos)) {
  39321. case ".":
  39322. if (!dotDotAllowed) {
  39323. return null;
  39324. }
  39325. pos++;
  39326. operator = operators.dotDot;
  39327. break;
  39328. case "#":
  39329. pos++;
  39330. operator = operators.dotHash;
  39331. break;
  39332. case "[":
  39333. if (noExpr) {
  39334. warn("XFA - SOM expression contains a FormCalc subexpression which is not supported for now.");
  39335. return null;
  39336. }
  39337. operator = operators.dotBracket;
  39338. break;
  39339. case "(":
  39340. if (noExpr) {
  39341. warn("XFA - SOM expression contains a JavaScript subexpression which is not supported for now.");
  39342. return null;
  39343. }
  39344. operator = operators.dotParen;
  39345. break;
  39346. default:
  39347. operator = operators.dot;
  39348. break;
  39349. }
  39350. match = expr.slice(pos).match(namePattern);
  39351. if (!match) {
  39352. break;
  39353. }
  39354. [name] = match;
  39355. pos += name.length;
  39356. parsed.push({
  39357. name,
  39358. cacheName: expr.slice(spos, pos),
  39359. operator,
  39360. index: 0,
  39361. js: null,
  39362. formCalc: null
  39363. });
  39364. }
  39365. return parsed;
  39366. }
  39367. function searchNode(root, container, expr, dotDotAllowed = true, useCache = true) {
  39368. const parsed = parseExpression(expr, dotDotAllowed);
  39369. if (!parsed) {
  39370. return null;
  39371. }
  39372. const fn = shortcuts.get(parsed[0].name);
  39373. let i = 0;
  39374. let isQualified;
  39375. if (fn) {
  39376. isQualified = true;
  39377. root = [fn(root, container)];
  39378. i = 1;
  39379. } else {
  39380. isQualified = container === null;
  39381. root = [container || root];
  39382. }
  39383. for (let ii = parsed.length; i < ii; i++) {
  39384. const {
  39385. name,
  39386. cacheName,
  39387. operator,
  39388. index
  39389. } = parsed[i];
  39390. const nodes = [];
  39391. for (const node of root) {
  39392. if (!node.isXFAObject) {
  39393. continue;
  39394. }
  39395. let children, cached;
  39396. if (useCache) {
  39397. cached = somCache.get(node);
  39398. if (!cached) {
  39399. cached = new Map();
  39400. somCache.set(node, cached);
  39401. }
  39402. children = cached.get(cacheName);
  39403. }
  39404. if (!children) {
  39405. switch (operator) {
  39406. case operators.dot:
  39407. children = node[$getChildrenByName](name, false);
  39408. break;
  39409. case operators.dotDot:
  39410. children = node[$getChildrenByName](name, true);
  39411. break;
  39412. case operators.dotHash:
  39413. children = node[$getChildrenByClass](name);
  39414. children = children.isXFAObjectArray ? children.children : [children];
  39415. break;
  39416. default:
  39417. break;
  39418. }
  39419. if (useCache) {
  39420. cached.set(cacheName, children);
  39421. }
  39422. }
  39423. if (children.length > 0) {
  39424. nodes.push(children);
  39425. }
  39426. }
  39427. if (nodes.length === 0 && !isQualified && i === 0) {
  39428. const parent = container[$getParent]();
  39429. container = parent;
  39430. if (!container) {
  39431. return null;
  39432. }
  39433. i = -1;
  39434. root = [container];
  39435. continue;
  39436. }
  39437. root = isFinite(index) ? nodes.filter(node => index < node.length).map(node => node[index]) : nodes.flat();
  39438. }
  39439. if (root.length === 0) {
  39440. return null;
  39441. }
  39442. return root;
  39443. }
  39444. function createDataNode(root, container, expr) {
  39445. const parsed = parseExpression(expr);
  39446. if (!parsed) {
  39447. return null;
  39448. }
  39449. if (parsed.some(x => x.operator === operators.dotDot)) {
  39450. return null;
  39451. }
  39452. const fn = shortcuts.get(parsed[0].name);
  39453. let i = 0;
  39454. if (fn) {
  39455. root = fn(root, container);
  39456. i = 1;
  39457. } else {
  39458. root = container || root;
  39459. }
  39460. for (let ii = parsed.length; i < ii; i++) {
  39461. const {
  39462. name,
  39463. operator,
  39464. index
  39465. } = parsed[i];
  39466. if (!isFinite(index)) {
  39467. parsed[i].index = 0;
  39468. return root.createNodes(parsed.slice(i));
  39469. }
  39470. let children;
  39471. switch (operator) {
  39472. case operators.dot:
  39473. children = root[$getChildrenByName](name, false);
  39474. break;
  39475. case operators.dotDot:
  39476. children = root[$getChildrenByName](name, true);
  39477. break;
  39478. case operators.dotHash:
  39479. children = root[$getChildrenByClass](name);
  39480. children = children.isXFAObjectArray ? children.children : [children];
  39481. break;
  39482. default:
  39483. break;
  39484. }
  39485. if (children.length === 0) {
  39486. return root.createNodes(parsed.slice(i));
  39487. }
  39488. if (index < children.length) {
  39489. const child = children[index];
  39490. if (!child.isXFAObject) {
  39491. warn(`XFA - Cannot create a node.`);
  39492. return null;
  39493. }
  39494. root = child;
  39495. } else {
  39496. parsed[i].index = index - children.length;
  39497. return root.createNodes(parsed.slice(i));
  39498. }
  39499. }
  39500. return null;
  39501. }
  39502. ;// CONCATENATED MODULE: ./src/core/xfa/xfa_object.js
  39503. const _applyPrototype = Symbol();
  39504. const _attributes = Symbol();
  39505. const _attributeNames = Symbol();
  39506. const _children = Symbol("_children");
  39507. const _cloneAttribute = Symbol();
  39508. const _dataValue = Symbol();
  39509. const _defaultValue = Symbol();
  39510. const _filteredChildrenGenerator = Symbol();
  39511. const _getPrototype = Symbol();
  39512. const _getUnsetAttributes = Symbol();
  39513. const _hasChildren = Symbol();
  39514. const _max = Symbol();
  39515. const _options = Symbol();
  39516. const _parent = Symbol("parent");
  39517. const _resolvePrototypesHelper = Symbol();
  39518. const _setAttributes = Symbol();
  39519. const _validator = Symbol();
  39520. let uid = 0;
  39521. const NS_DATASETS = NamespaceIds.datasets.id;
  39522. class XFAObject {
  39523. constructor(nsId, name, hasChildren = false) {
  39524. this[$namespaceId] = nsId;
  39525. this[$nodeName] = name;
  39526. this[_hasChildren] = hasChildren;
  39527. this[_parent] = null;
  39528. this[_children] = [];
  39529. this[$uid] = `${name}${uid++}`;
  39530. this[$globalData] = null;
  39531. }
  39532. get isXFAObject() {
  39533. return true;
  39534. }
  39535. get isXFAObjectArray() {
  39536. return false;
  39537. }
  39538. createNodes(path) {
  39539. let root = this,
  39540. node = null;
  39541. for (const {
  39542. name,
  39543. index
  39544. } of path) {
  39545. for (let i = 0, ii = isFinite(index) ? index : 0; i <= ii; i++) {
  39546. const nsId = root[$namespaceId] === NS_DATASETS ? -1 : root[$namespaceId];
  39547. node = new XmlObject(nsId, name);
  39548. root[$appendChild](node);
  39549. }
  39550. root = node;
  39551. }
  39552. return node;
  39553. }
  39554. [$onChild](child) {
  39555. if (!this[_hasChildren] || !this[$onChildCheck](child)) {
  39556. return false;
  39557. }
  39558. const name = child[$nodeName];
  39559. const node = this[name];
  39560. if (node instanceof XFAObjectArray) {
  39561. if (node.push(child)) {
  39562. this[$appendChild](child);
  39563. return true;
  39564. }
  39565. } else {
  39566. if (node !== null) {
  39567. this[$removeChild](node);
  39568. }
  39569. this[name] = child;
  39570. this[$appendChild](child);
  39571. return true;
  39572. }
  39573. let id = "";
  39574. if (this.id) {
  39575. id = ` (id: ${this.id})`;
  39576. } else if (this.name) {
  39577. id = ` (name: ${this.name} ${this.h.value})`;
  39578. }
  39579. warn(`XFA - node "${this[$nodeName]}"${id} has already enough "${name}"!`);
  39580. return false;
  39581. }
  39582. [$onChildCheck](child) {
  39583. return this.hasOwnProperty(child[$nodeName]) && child[$namespaceId] === this[$namespaceId];
  39584. }
  39585. [$isNsAgnostic]() {
  39586. return false;
  39587. }
  39588. [$acceptWhitespace]() {
  39589. return false;
  39590. }
  39591. [$isCDATAXml]() {
  39592. return false;
  39593. }
  39594. [$isBindable]() {
  39595. return false;
  39596. }
  39597. [$popPara]() {
  39598. if (this.para) {
  39599. this[$getTemplateRoot]()[$extra].paraStack.pop();
  39600. }
  39601. }
  39602. [$pushPara]() {
  39603. this[$getTemplateRoot]()[$extra].paraStack.push(this.para);
  39604. }
  39605. [$setId](ids) {
  39606. if (this.id && this[$namespaceId] === NamespaceIds.template.id) {
  39607. ids.set(this.id, this);
  39608. }
  39609. }
  39610. [$getTemplateRoot]() {
  39611. return this[$globalData].template;
  39612. }
  39613. [$isSplittable]() {
  39614. return false;
  39615. }
  39616. [$isThereMoreWidth]() {
  39617. return false;
  39618. }
  39619. [$appendChild](child) {
  39620. child[_parent] = this;
  39621. this[_children].push(child);
  39622. if (!child[$globalData] && this[$globalData]) {
  39623. child[$globalData] = this[$globalData];
  39624. }
  39625. }
  39626. [$removeChild](child) {
  39627. const i = this[_children].indexOf(child);
  39628. this[_children].splice(i, 1);
  39629. }
  39630. [$hasSettableValue]() {
  39631. return this.hasOwnProperty("value");
  39632. }
  39633. [$setValue](_) {}
  39634. [$onText](_) {}
  39635. [$finalize]() {}
  39636. [$clean](builder) {
  39637. delete this[_hasChildren];
  39638. if (this[$cleanup]) {
  39639. builder.clean(this[$cleanup]);
  39640. delete this[$cleanup];
  39641. }
  39642. }
  39643. [$indexOf](child) {
  39644. return this[_children].indexOf(child);
  39645. }
  39646. [$insertAt](i, child) {
  39647. child[_parent] = this;
  39648. this[_children].splice(i, 0, child);
  39649. if (!child[$globalData] && this[$globalData]) {
  39650. child[$globalData] = this[$globalData];
  39651. }
  39652. }
  39653. [$isTransparent]() {
  39654. return !this.name;
  39655. }
  39656. [$lastAttribute]() {
  39657. return "";
  39658. }
  39659. [$text]() {
  39660. if (this[_children].length === 0) {
  39661. return this[$content];
  39662. }
  39663. return this[_children].map(c => c[$text]()).join("");
  39664. }
  39665. get [_attributeNames]() {
  39666. const proto = Object.getPrototypeOf(this);
  39667. if (!proto._attributes) {
  39668. const attributes = proto._attributes = new Set();
  39669. for (const name of Object.getOwnPropertyNames(this)) {
  39670. if (this[name] === null || this[name] instanceof XFAObject || this[name] instanceof XFAObjectArray) {
  39671. break;
  39672. }
  39673. attributes.add(name);
  39674. }
  39675. }
  39676. return shadow(this, _attributeNames, proto._attributes);
  39677. }
  39678. [$isDescendent](parent) {
  39679. let node = this;
  39680. while (node) {
  39681. if (node === parent) {
  39682. return true;
  39683. }
  39684. node = node[$getParent]();
  39685. }
  39686. return false;
  39687. }
  39688. [$getParent]() {
  39689. return this[_parent];
  39690. }
  39691. [$getSubformParent]() {
  39692. return this[$getParent]();
  39693. }
  39694. [$getChildren](name = null) {
  39695. if (!name) {
  39696. return this[_children];
  39697. }
  39698. return this[name];
  39699. }
  39700. [$dump]() {
  39701. const dumped = Object.create(null);
  39702. if (this[$content]) {
  39703. dumped.$content = this[$content];
  39704. }
  39705. for (const name of Object.getOwnPropertyNames(this)) {
  39706. const value = this[name];
  39707. if (value === null) {
  39708. continue;
  39709. }
  39710. if (value instanceof XFAObject) {
  39711. dumped[name] = value[$dump]();
  39712. } else if (value instanceof XFAObjectArray) {
  39713. if (!value.isEmpty()) {
  39714. dumped[name] = value.dump();
  39715. }
  39716. } else {
  39717. dumped[name] = value;
  39718. }
  39719. }
  39720. return dumped;
  39721. }
  39722. [$toStyle]() {
  39723. return null;
  39724. }
  39725. [$toHTML]() {
  39726. return HTMLResult.EMPTY;
  39727. }
  39728. *[$getContainedChildren]() {
  39729. for (const node of this[$getChildren]()) {
  39730. yield node;
  39731. }
  39732. }
  39733. *[_filteredChildrenGenerator](filter, include) {
  39734. for (const node of this[$getContainedChildren]()) {
  39735. if (!filter || include === filter.has(node[$nodeName])) {
  39736. const availableSpace = this[$getAvailableSpace]();
  39737. const res = node[$toHTML](availableSpace);
  39738. if (!res.success) {
  39739. this[$extra].failingNode = node;
  39740. }
  39741. yield res;
  39742. }
  39743. }
  39744. }
  39745. [$flushHTML]() {
  39746. return null;
  39747. }
  39748. [$addHTML](html, bbox) {
  39749. this[$extra].children.push(html);
  39750. }
  39751. [$getAvailableSpace]() {}
  39752. [$childrenToHTML]({
  39753. filter = null,
  39754. include = true
  39755. }) {
  39756. if (!this[$extra].generator) {
  39757. this[$extra].generator = this[_filteredChildrenGenerator](filter, include);
  39758. } else {
  39759. const availableSpace = this[$getAvailableSpace]();
  39760. const res = this[$extra].failingNode[$toHTML](availableSpace);
  39761. if (!res.success) {
  39762. return res;
  39763. }
  39764. if (res.html) {
  39765. this[$addHTML](res.html, res.bbox);
  39766. }
  39767. delete this[$extra].failingNode;
  39768. }
  39769. while (true) {
  39770. const gen = this[$extra].generator.next();
  39771. if (gen.done) {
  39772. break;
  39773. }
  39774. const res = gen.value;
  39775. if (!res.success) {
  39776. return res;
  39777. }
  39778. if (res.html) {
  39779. this[$addHTML](res.html, res.bbox);
  39780. }
  39781. }
  39782. this[$extra].generator = null;
  39783. return HTMLResult.EMPTY;
  39784. }
  39785. [$setSetAttributes](attributes) {
  39786. this[_setAttributes] = new Set(Object.keys(attributes));
  39787. }
  39788. [_getUnsetAttributes](protoAttributes) {
  39789. const allAttr = this[_attributeNames];
  39790. const setAttr = this[_setAttributes];
  39791. return [...protoAttributes].filter(x => allAttr.has(x) && !setAttr.has(x));
  39792. }
  39793. [$resolvePrototypes](ids, ancestors = new Set()) {
  39794. for (const child of this[_children]) {
  39795. child[_resolvePrototypesHelper](ids, ancestors);
  39796. }
  39797. }
  39798. [_resolvePrototypesHelper](ids, ancestors) {
  39799. const proto = this[_getPrototype](ids, ancestors);
  39800. if (proto) {
  39801. this[_applyPrototype](proto, ids, ancestors);
  39802. } else {
  39803. this[$resolvePrototypes](ids, ancestors);
  39804. }
  39805. }
  39806. [_getPrototype](ids, ancestors) {
  39807. const {
  39808. use,
  39809. usehref
  39810. } = this;
  39811. if (!use && !usehref) {
  39812. return null;
  39813. }
  39814. let proto = null;
  39815. let somExpression = null;
  39816. let id = null;
  39817. let ref = use;
  39818. if (usehref) {
  39819. ref = usehref;
  39820. if (usehref.startsWith("#som(") && usehref.endsWith(")")) {
  39821. somExpression = usehref.slice("#som(".length, -1);
  39822. } else if (usehref.startsWith(".#som(") && usehref.endsWith(")")) {
  39823. somExpression = usehref.slice(".#som(".length, -1);
  39824. } else if (usehref.startsWith("#")) {
  39825. id = usehref.slice(1);
  39826. } else if (usehref.startsWith(".#")) {
  39827. id = usehref.slice(2);
  39828. }
  39829. } else if (use.startsWith("#")) {
  39830. id = use.slice(1);
  39831. } else {
  39832. somExpression = use;
  39833. }
  39834. this.use = this.usehref = "";
  39835. if (id) {
  39836. proto = ids.get(id);
  39837. } else {
  39838. proto = searchNode(ids.get($root), this, somExpression, true, false);
  39839. if (proto) {
  39840. proto = proto[0];
  39841. }
  39842. }
  39843. if (!proto) {
  39844. warn(`XFA - Invalid prototype reference: ${ref}.`);
  39845. return null;
  39846. }
  39847. if (proto[$nodeName] !== this[$nodeName]) {
  39848. warn(`XFA - Incompatible prototype: ${proto[$nodeName]} !== ${this[$nodeName]}.`);
  39849. return null;
  39850. }
  39851. if (ancestors.has(proto)) {
  39852. warn(`XFA - Cycle detected in prototypes use.`);
  39853. return null;
  39854. }
  39855. ancestors.add(proto);
  39856. const protoProto = proto[_getPrototype](ids, ancestors);
  39857. if (protoProto) {
  39858. proto[_applyPrototype](protoProto, ids, ancestors);
  39859. }
  39860. proto[$resolvePrototypes](ids, ancestors);
  39861. ancestors.delete(proto);
  39862. return proto;
  39863. }
  39864. [_applyPrototype](proto, ids, ancestors) {
  39865. if (ancestors.has(proto)) {
  39866. warn(`XFA - Cycle detected in prototypes use.`);
  39867. return;
  39868. }
  39869. if (!this[$content] && proto[$content]) {
  39870. this[$content] = proto[$content];
  39871. }
  39872. const newAncestors = new Set(ancestors);
  39873. newAncestors.add(proto);
  39874. for (const unsetAttrName of this[_getUnsetAttributes](proto[_setAttributes])) {
  39875. this[unsetAttrName] = proto[unsetAttrName];
  39876. if (this[_setAttributes]) {
  39877. this[_setAttributes].add(unsetAttrName);
  39878. }
  39879. }
  39880. for (const name of Object.getOwnPropertyNames(this)) {
  39881. if (this[_attributeNames].has(name)) {
  39882. continue;
  39883. }
  39884. const value = this[name];
  39885. const protoValue = proto[name];
  39886. if (value instanceof XFAObjectArray) {
  39887. for (const child of value[_children]) {
  39888. child[_resolvePrototypesHelper](ids, ancestors);
  39889. }
  39890. for (let i = value[_children].length, ii = protoValue[_children].length; i < ii; i++) {
  39891. const child = proto[_children][i][$clone]();
  39892. if (value.push(child)) {
  39893. child[_parent] = this;
  39894. this[_children].push(child);
  39895. child[_resolvePrototypesHelper](ids, ancestors);
  39896. } else {
  39897. break;
  39898. }
  39899. }
  39900. continue;
  39901. }
  39902. if (value !== null) {
  39903. value[$resolvePrototypes](ids, ancestors);
  39904. if (protoValue) {
  39905. value[_applyPrototype](protoValue, ids, ancestors);
  39906. }
  39907. continue;
  39908. }
  39909. if (protoValue !== null) {
  39910. const child = protoValue[$clone]();
  39911. child[_parent] = this;
  39912. this[name] = child;
  39913. this[_children].push(child);
  39914. child[_resolvePrototypesHelper](ids, ancestors);
  39915. }
  39916. }
  39917. }
  39918. static [_cloneAttribute](obj) {
  39919. if (Array.isArray(obj)) {
  39920. return obj.map(x => XFAObject[_cloneAttribute](x));
  39921. }
  39922. if (typeof obj === "object" && obj !== null) {
  39923. return Object.assign({}, obj);
  39924. }
  39925. return obj;
  39926. }
  39927. [$clone]() {
  39928. const clone = Object.create(Object.getPrototypeOf(this));
  39929. for (const $symbol of Object.getOwnPropertySymbols(this)) {
  39930. try {
  39931. clone[$symbol] = this[$symbol];
  39932. } catch {
  39933. shadow(clone, $symbol, this[$symbol]);
  39934. }
  39935. }
  39936. clone[$uid] = `${clone[$nodeName]}${uid++}`;
  39937. clone[_children] = [];
  39938. for (const name of Object.getOwnPropertyNames(this)) {
  39939. if (this[_attributeNames].has(name)) {
  39940. clone[name] = XFAObject[_cloneAttribute](this[name]);
  39941. continue;
  39942. }
  39943. const value = this[name];
  39944. clone[name] = value instanceof XFAObjectArray ? new XFAObjectArray(value[_max]) : null;
  39945. }
  39946. for (const child of this[_children]) {
  39947. const name = child[$nodeName];
  39948. const clonedChild = child[$clone]();
  39949. clone[_children].push(clonedChild);
  39950. clonedChild[_parent] = clone;
  39951. if (clone[name] === null) {
  39952. clone[name] = clonedChild;
  39953. } else {
  39954. clone[name][_children].push(clonedChild);
  39955. }
  39956. }
  39957. return clone;
  39958. }
  39959. [$getChildren](name = null) {
  39960. if (!name) {
  39961. return this[_children];
  39962. }
  39963. return this[_children].filter(c => c[$nodeName] === name);
  39964. }
  39965. [$getChildrenByClass](name) {
  39966. return this[name];
  39967. }
  39968. [$getChildrenByName](name, allTransparent, first = true) {
  39969. return Array.from(this[$getChildrenByNameIt](name, allTransparent, first));
  39970. }
  39971. *[$getChildrenByNameIt](name, allTransparent, first = true) {
  39972. if (name === "parent") {
  39973. yield this[_parent];
  39974. return;
  39975. }
  39976. for (const child of this[_children]) {
  39977. if (child[$nodeName] === name) {
  39978. yield child;
  39979. }
  39980. if (child.name === name) {
  39981. yield child;
  39982. }
  39983. if (allTransparent || child[$isTransparent]()) {
  39984. yield* child[$getChildrenByNameIt](name, allTransparent, false);
  39985. }
  39986. }
  39987. if (first && this[_attributeNames].has(name)) {
  39988. yield new XFAAttribute(this, name, this[name]);
  39989. }
  39990. }
  39991. }
  39992. class XFAObjectArray {
  39993. constructor(max = Infinity) {
  39994. this[_max] = max;
  39995. this[_children] = [];
  39996. }
  39997. get isXFAObject() {
  39998. return false;
  39999. }
  40000. get isXFAObjectArray() {
  40001. return true;
  40002. }
  40003. push(child) {
  40004. const len = this[_children].length;
  40005. if (len <= this[_max]) {
  40006. this[_children].push(child);
  40007. return true;
  40008. }
  40009. warn(`XFA - node "${child[$nodeName]}" accepts no more than ${this[_max]} children`);
  40010. return false;
  40011. }
  40012. isEmpty() {
  40013. return this[_children].length === 0;
  40014. }
  40015. dump() {
  40016. return this[_children].length === 1 ? this[_children][0][$dump]() : this[_children].map(x => x[$dump]());
  40017. }
  40018. [$clone]() {
  40019. const clone = new XFAObjectArray(this[_max]);
  40020. clone[_children] = this[_children].map(c => c[$clone]());
  40021. return clone;
  40022. }
  40023. get children() {
  40024. return this[_children];
  40025. }
  40026. clear() {
  40027. this[_children].length = 0;
  40028. }
  40029. }
  40030. class XFAAttribute {
  40031. constructor(node, name, value) {
  40032. this[_parent] = node;
  40033. this[$nodeName] = name;
  40034. this[$content] = value;
  40035. this[$consumed] = false;
  40036. this[$uid] = `attribute${uid++}`;
  40037. }
  40038. [$getParent]() {
  40039. return this[_parent];
  40040. }
  40041. [$isDataValue]() {
  40042. return true;
  40043. }
  40044. [$getDataValue]() {
  40045. return this[$content].trim();
  40046. }
  40047. [$setValue](value) {
  40048. value = value.value || "";
  40049. this[$content] = value.toString();
  40050. }
  40051. [$text]() {
  40052. return this[$content];
  40053. }
  40054. [$isDescendent](parent) {
  40055. return this[_parent] === parent || this[_parent][$isDescendent](parent);
  40056. }
  40057. }
  40058. class XmlObject extends XFAObject {
  40059. constructor(nsId, name, attributes = {}) {
  40060. super(nsId, name);
  40061. this[$content] = "";
  40062. this[_dataValue] = null;
  40063. if (name !== "#text") {
  40064. const map = new Map();
  40065. this[_attributes] = map;
  40066. for (const [attrName, value] of Object.entries(attributes)) {
  40067. map.set(attrName, new XFAAttribute(this, attrName, value));
  40068. }
  40069. if (attributes.hasOwnProperty($nsAttributes)) {
  40070. const dataNode = attributes[$nsAttributes].xfa.dataNode;
  40071. if (dataNode !== undefined) {
  40072. if (dataNode === "dataGroup") {
  40073. this[_dataValue] = false;
  40074. } else if (dataNode === "dataValue") {
  40075. this[_dataValue] = true;
  40076. }
  40077. }
  40078. }
  40079. }
  40080. this[$consumed] = false;
  40081. }
  40082. [$toString](buf) {
  40083. const tagName = this[$nodeName];
  40084. if (tagName === "#text") {
  40085. buf.push(encodeToXmlString(this[$content]));
  40086. return;
  40087. }
  40088. const utf8TagName = utf8StringToString(tagName);
  40089. const prefix = this[$namespaceId] === NS_DATASETS ? "xfa:" : "";
  40090. buf.push(`<${prefix}${utf8TagName}`);
  40091. for (const [name, value] of this[_attributes].entries()) {
  40092. const utf8Name = utf8StringToString(name);
  40093. buf.push(` ${utf8Name}="${encodeToXmlString(value[$content])}"`);
  40094. }
  40095. if (this[_dataValue] !== null) {
  40096. if (this[_dataValue]) {
  40097. buf.push(` xfa:dataNode="dataValue"`);
  40098. } else {
  40099. buf.push(` xfa:dataNode="dataGroup"`);
  40100. }
  40101. }
  40102. if (!this[$content] && this[_children].length === 0) {
  40103. buf.push("/>");
  40104. return;
  40105. }
  40106. buf.push(">");
  40107. if (this[$content]) {
  40108. if (typeof this[$content] === "string") {
  40109. buf.push(encodeToXmlString(this[$content]));
  40110. } else {
  40111. this[$content][$toString](buf);
  40112. }
  40113. } else {
  40114. for (const child of this[_children]) {
  40115. child[$toString](buf);
  40116. }
  40117. }
  40118. buf.push(`</${prefix}${utf8TagName}>`);
  40119. }
  40120. [$onChild](child) {
  40121. if (this[$content]) {
  40122. const node = new XmlObject(this[$namespaceId], "#text");
  40123. this[$appendChild](node);
  40124. node[$content] = this[$content];
  40125. this[$content] = "";
  40126. }
  40127. this[$appendChild](child);
  40128. return true;
  40129. }
  40130. [$onText](str) {
  40131. this[$content] += str;
  40132. }
  40133. [$finalize]() {
  40134. if (this[$content] && this[_children].length > 0) {
  40135. const node = new XmlObject(this[$namespaceId], "#text");
  40136. this[$appendChild](node);
  40137. node[$content] = this[$content];
  40138. delete this[$content];
  40139. }
  40140. }
  40141. [$toHTML]() {
  40142. if (this[$nodeName] === "#text") {
  40143. return HTMLResult.success({
  40144. name: "#text",
  40145. value: this[$content]
  40146. });
  40147. }
  40148. return HTMLResult.EMPTY;
  40149. }
  40150. [$getChildren](name = null) {
  40151. if (!name) {
  40152. return this[_children];
  40153. }
  40154. return this[_children].filter(c => c[$nodeName] === name);
  40155. }
  40156. [$getAttributes]() {
  40157. return this[_attributes];
  40158. }
  40159. [$getChildrenByClass](name) {
  40160. const value = this[_attributes].get(name);
  40161. if (value !== undefined) {
  40162. return value;
  40163. }
  40164. return this[$getChildren](name);
  40165. }
  40166. *[$getChildrenByNameIt](name, allTransparent) {
  40167. const value = this[_attributes].get(name);
  40168. if (value) {
  40169. yield value;
  40170. }
  40171. for (const child of this[_children]) {
  40172. if (child[$nodeName] === name) {
  40173. yield child;
  40174. }
  40175. if (allTransparent) {
  40176. yield* child[$getChildrenByNameIt](name, allTransparent);
  40177. }
  40178. }
  40179. }
  40180. *[$getAttributeIt](name, skipConsumed) {
  40181. const value = this[_attributes].get(name);
  40182. if (value && (!skipConsumed || !value[$consumed])) {
  40183. yield value;
  40184. }
  40185. for (const child of this[_children]) {
  40186. yield* child[$getAttributeIt](name, skipConsumed);
  40187. }
  40188. }
  40189. *[$getRealChildrenByNameIt](name, allTransparent, skipConsumed) {
  40190. for (const child of this[_children]) {
  40191. if (child[$nodeName] === name && (!skipConsumed || !child[$consumed])) {
  40192. yield child;
  40193. }
  40194. if (allTransparent) {
  40195. yield* child[$getRealChildrenByNameIt](name, allTransparent, skipConsumed);
  40196. }
  40197. }
  40198. }
  40199. [$isDataValue]() {
  40200. if (this[_dataValue] === null) {
  40201. return this[_children].length === 0 || this[_children][0][$namespaceId] === NamespaceIds.xhtml.id;
  40202. }
  40203. return this[_dataValue];
  40204. }
  40205. [$getDataValue]() {
  40206. if (this[_dataValue] === null) {
  40207. if (this[_children].length === 0) {
  40208. return this[$content].trim();
  40209. }
  40210. if (this[_children][0][$namespaceId] === NamespaceIds.xhtml.id) {
  40211. return this[_children][0][$text]().trim();
  40212. }
  40213. return null;
  40214. }
  40215. return this[$content].trim();
  40216. }
  40217. [$setValue](value) {
  40218. value = value.value || "";
  40219. this[$content] = value.toString();
  40220. }
  40221. [$dump](hasNS = false) {
  40222. const dumped = Object.create(null);
  40223. if (hasNS) {
  40224. dumped.$ns = this[$namespaceId];
  40225. }
  40226. if (this[$content]) {
  40227. dumped.$content = this[$content];
  40228. }
  40229. dumped.$name = this[$nodeName];
  40230. dumped.children = [];
  40231. for (const child of this[_children]) {
  40232. dumped.children.push(child[$dump](hasNS));
  40233. }
  40234. dumped.attributes = Object.create(null);
  40235. for (const [name, value] of this[_attributes]) {
  40236. dumped.attributes[name] = value[$content];
  40237. }
  40238. return dumped;
  40239. }
  40240. }
  40241. class ContentObject extends XFAObject {
  40242. constructor(nsId, name) {
  40243. super(nsId, name);
  40244. this[$content] = "";
  40245. }
  40246. [$onText](text) {
  40247. this[$content] += text;
  40248. }
  40249. [$finalize]() {}
  40250. }
  40251. class OptionObject extends ContentObject {
  40252. constructor(nsId, name, options) {
  40253. super(nsId, name);
  40254. this[_options] = options;
  40255. }
  40256. [$finalize]() {
  40257. this[$content] = getKeyword({
  40258. data: this[$content],
  40259. defaultValue: this[_options][0],
  40260. validate: k => this[_options].includes(k)
  40261. });
  40262. }
  40263. [$clean](builder) {
  40264. super[$clean](builder);
  40265. delete this[_options];
  40266. }
  40267. }
  40268. class StringObject extends ContentObject {
  40269. [$finalize]() {
  40270. this[$content] = this[$content].trim();
  40271. }
  40272. }
  40273. class IntegerObject extends ContentObject {
  40274. constructor(nsId, name, defaultValue, validator) {
  40275. super(nsId, name);
  40276. this[_defaultValue] = defaultValue;
  40277. this[_validator] = validator;
  40278. }
  40279. [$finalize]() {
  40280. this[$content] = getInteger({
  40281. data: this[$content],
  40282. defaultValue: this[_defaultValue],
  40283. validate: this[_validator]
  40284. });
  40285. }
  40286. [$clean](builder) {
  40287. super[$clean](builder);
  40288. delete this[_defaultValue];
  40289. delete this[_validator];
  40290. }
  40291. }
  40292. class Option01 extends IntegerObject {
  40293. constructor(nsId, name) {
  40294. super(nsId, name, 0, n => n === 1);
  40295. }
  40296. }
  40297. class Option10 extends IntegerObject {
  40298. constructor(nsId, name) {
  40299. super(nsId, name, 1, n => n === 0);
  40300. }
  40301. }
  40302. ;// CONCATENATED MODULE: ./src/core/xfa/html_utils.js
  40303. function measureToString(m) {
  40304. if (typeof m === "string") {
  40305. return "0px";
  40306. }
  40307. return Number.isInteger(m) ? `${m}px` : `${m.toFixed(2)}px`;
  40308. }
  40309. const converters = {
  40310. anchorType(node, style) {
  40311. const parent = node[$getSubformParent]();
  40312. if (!parent || parent.layout && parent.layout !== "position") {
  40313. return;
  40314. }
  40315. if (!("transform" in style)) {
  40316. style.transform = "";
  40317. }
  40318. switch (node.anchorType) {
  40319. case "bottomCenter":
  40320. style.transform += "translate(-50%, -100%)";
  40321. break;
  40322. case "bottomLeft":
  40323. style.transform += "translate(0,-100%)";
  40324. break;
  40325. case "bottomRight":
  40326. style.transform += "translate(-100%,-100%)";
  40327. break;
  40328. case "middleCenter":
  40329. style.transform += "translate(-50%,-50%)";
  40330. break;
  40331. case "middleLeft":
  40332. style.transform += "translate(0,-50%)";
  40333. break;
  40334. case "middleRight":
  40335. style.transform += "translate(-100%,-50%)";
  40336. break;
  40337. case "topCenter":
  40338. style.transform += "translate(-50%,0)";
  40339. break;
  40340. case "topRight":
  40341. style.transform += "translate(-100%,0)";
  40342. break;
  40343. }
  40344. },
  40345. dimensions(node, style) {
  40346. const parent = node[$getSubformParent]();
  40347. let width = node.w;
  40348. const height = node.h;
  40349. if (parent.layout?.includes("row")) {
  40350. const extra = parent[$extra];
  40351. const colSpan = node.colSpan;
  40352. let w;
  40353. if (colSpan === -1) {
  40354. w = extra.columnWidths.slice(extra.currentColumn).reduce((a, x) => a + x, 0);
  40355. extra.currentColumn = 0;
  40356. } else {
  40357. w = extra.columnWidths.slice(extra.currentColumn, extra.currentColumn + colSpan).reduce((a, x) => a + x, 0);
  40358. extra.currentColumn = (extra.currentColumn + node.colSpan) % extra.columnWidths.length;
  40359. }
  40360. if (!isNaN(w)) {
  40361. width = node.w = w;
  40362. }
  40363. }
  40364. style.width = width !== "" ? measureToString(width) : "auto";
  40365. style.height = height !== "" ? measureToString(height) : "auto";
  40366. },
  40367. position(node, style) {
  40368. const parent = node[$getSubformParent]();
  40369. if (parent?.layout && parent.layout !== "position") {
  40370. return;
  40371. }
  40372. style.position = "absolute";
  40373. style.left = measureToString(node.x);
  40374. style.top = measureToString(node.y);
  40375. },
  40376. rotate(node, style) {
  40377. if (node.rotate) {
  40378. if (!("transform" in style)) {
  40379. style.transform = "";
  40380. }
  40381. style.transform += `rotate(-${node.rotate}deg)`;
  40382. style.transformOrigin = "top left";
  40383. }
  40384. },
  40385. presence(node, style) {
  40386. switch (node.presence) {
  40387. case "invisible":
  40388. style.visibility = "hidden";
  40389. break;
  40390. case "hidden":
  40391. case "inactive":
  40392. style.display = "none";
  40393. break;
  40394. }
  40395. },
  40396. hAlign(node, style) {
  40397. if (node[$nodeName] === "para") {
  40398. switch (node.hAlign) {
  40399. case "justifyAll":
  40400. style.textAlign = "justify-all";
  40401. break;
  40402. case "radix":
  40403. style.textAlign = "left";
  40404. break;
  40405. default:
  40406. style.textAlign = node.hAlign;
  40407. }
  40408. } else {
  40409. switch (node.hAlign) {
  40410. case "left":
  40411. style.alignSelf = "start";
  40412. break;
  40413. case "center":
  40414. style.alignSelf = "center";
  40415. break;
  40416. case "right":
  40417. style.alignSelf = "end";
  40418. break;
  40419. }
  40420. }
  40421. },
  40422. margin(node, style) {
  40423. if (node.margin) {
  40424. style.margin = node.margin[$toStyle]().margin;
  40425. }
  40426. }
  40427. };
  40428. function setMinMaxDimensions(node, style) {
  40429. const parent = node[$getSubformParent]();
  40430. if (parent.layout === "position") {
  40431. if (node.minW > 0) {
  40432. style.minWidth = measureToString(node.minW);
  40433. }
  40434. if (node.maxW > 0) {
  40435. style.maxWidth = measureToString(node.maxW);
  40436. }
  40437. if (node.minH > 0) {
  40438. style.minHeight = measureToString(node.minH);
  40439. }
  40440. if (node.maxH > 0) {
  40441. style.maxHeight = measureToString(node.maxH);
  40442. }
  40443. }
  40444. }
  40445. function layoutText(text, xfaFont, margin, lineHeight, fontFinder, width) {
  40446. const measure = new TextMeasure(xfaFont, margin, lineHeight, fontFinder);
  40447. if (typeof text === "string") {
  40448. measure.addString(text);
  40449. } else {
  40450. text[$pushGlyphs](measure);
  40451. }
  40452. return measure.compute(width);
  40453. }
  40454. function layoutNode(node, availableSpace) {
  40455. let height = null;
  40456. let width = null;
  40457. let isBroken = false;
  40458. if ((!node.w || !node.h) && node.value) {
  40459. let marginH = 0;
  40460. let marginV = 0;
  40461. if (node.margin) {
  40462. marginH = node.margin.leftInset + node.margin.rightInset;
  40463. marginV = node.margin.topInset + node.margin.bottomInset;
  40464. }
  40465. let lineHeight = null;
  40466. let margin = null;
  40467. if (node.para) {
  40468. margin = Object.create(null);
  40469. lineHeight = node.para.lineHeight === "" ? null : node.para.lineHeight;
  40470. margin.top = node.para.spaceAbove === "" ? 0 : node.para.spaceAbove;
  40471. margin.bottom = node.para.spaceBelow === "" ? 0 : node.para.spaceBelow;
  40472. margin.left = node.para.marginLeft === "" ? 0 : node.para.marginLeft;
  40473. margin.right = node.para.marginRight === "" ? 0 : node.para.marginRight;
  40474. }
  40475. let font = node.font;
  40476. if (!font) {
  40477. const root = node[$getTemplateRoot]();
  40478. let parent = node[$getParent]();
  40479. while (parent && parent !== root) {
  40480. if (parent.font) {
  40481. font = parent.font;
  40482. break;
  40483. }
  40484. parent = parent[$getParent]();
  40485. }
  40486. }
  40487. const maxWidth = (node.w || availableSpace.width) - marginH;
  40488. const fontFinder = node[$globalData].fontFinder;
  40489. if (node.value.exData && node.value.exData[$content] && node.value.exData.contentType === "text/html") {
  40490. const res = layoutText(node.value.exData[$content], font, margin, lineHeight, fontFinder, maxWidth);
  40491. width = res.width;
  40492. height = res.height;
  40493. isBroken = res.isBroken;
  40494. } else {
  40495. const text = node.value[$text]();
  40496. if (text) {
  40497. const res = layoutText(text, font, margin, lineHeight, fontFinder, maxWidth);
  40498. width = res.width;
  40499. height = res.height;
  40500. isBroken = res.isBroken;
  40501. }
  40502. }
  40503. if (width !== null && !node.w) {
  40504. width += marginH;
  40505. }
  40506. if (height !== null && !node.h) {
  40507. height += marginV;
  40508. }
  40509. }
  40510. return {
  40511. w: width,
  40512. h: height,
  40513. isBroken
  40514. };
  40515. }
  40516. function computeBbox(node, html, availableSpace) {
  40517. let bbox;
  40518. if (node.w !== "" && node.h !== "") {
  40519. bbox = [node.x, node.y, node.w, node.h];
  40520. } else {
  40521. if (!availableSpace) {
  40522. return null;
  40523. }
  40524. let width = node.w;
  40525. if (width === "") {
  40526. if (node.maxW === 0) {
  40527. const parent = node[$getSubformParent]();
  40528. width = parent.layout === "position" && parent.w !== "" ? 0 : node.minW;
  40529. } else {
  40530. width = Math.min(node.maxW, availableSpace.width);
  40531. }
  40532. html.attributes.style.width = measureToString(width);
  40533. }
  40534. let height = node.h;
  40535. if (height === "") {
  40536. if (node.maxH === 0) {
  40537. const parent = node[$getSubformParent]();
  40538. height = parent.layout === "position" && parent.h !== "" ? 0 : node.minH;
  40539. } else {
  40540. height = Math.min(node.maxH, availableSpace.height);
  40541. }
  40542. html.attributes.style.height = measureToString(height);
  40543. }
  40544. bbox = [node.x, node.y, width, height];
  40545. }
  40546. return bbox;
  40547. }
  40548. function fixDimensions(node) {
  40549. const parent = node[$getSubformParent]();
  40550. if (parent.layout?.includes("row")) {
  40551. const extra = parent[$extra];
  40552. const colSpan = node.colSpan;
  40553. let width;
  40554. if (colSpan === -1) {
  40555. width = extra.columnWidths.slice(extra.currentColumn).reduce((a, w) => a + w, 0);
  40556. } else {
  40557. width = extra.columnWidths.slice(extra.currentColumn, extra.currentColumn + colSpan).reduce((a, w) => a + w, 0);
  40558. }
  40559. if (!isNaN(width)) {
  40560. node.w = width;
  40561. }
  40562. }
  40563. if (parent.layout && parent.layout !== "position") {
  40564. node.x = node.y = 0;
  40565. }
  40566. if (node.layout === "table") {
  40567. if (node.w === "" && Array.isArray(node.columnWidths)) {
  40568. node.w = node.columnWidths.reduce((a, x) => a + x, 0);
  40569. }
  40570. }
  40571. }
  40572. function layoutClass(node) {
  40573. switch (node.layout) {
  40574. case "position":
  40575. return "xfaPosition";
  40576. case "lr-tb":
  40577. return "xfaLrTb";
  40578. case "rl-row":
  40579. return "xfaRlRow";
  40580. case "rl-tb":
  40581. return "xfaRlTb";
  40582. case "row":
  40583. return "xfaRow";
  40584. case "table":
  40585. return "xfaTable";
  40586. case "tb":
  40587. return "xfaTb";
  40588. default:
  40589. return "xfaPosition";
  40590. }
  40591. }
  40592. function toStyle(node, ...names) {
  40593. const style = Object.create(null);
  40594. for (const name of names) {
  40595. const value = node[name];
  40596. if (value === null) {
  40597. continue;
  40598. }
  40599. if (converters.hasOwnProperty(name)) {
  40600. converters[name](node, style);
  40601. continue;
  40602. }
  40603. if (value instanceof XFAObject) {
  40604. const newStyle = value[$toStyle]();
  40605. if (newStyle) {
  40606. Object.assign(style, newStyle);
  40607. } else {
  40608. warn(`(DEBUG) - XFA - style for ${name} not implemented yet`);
  40609. }
  40610. }
  40611. }
  40612. return style;
  40613. }
  40614. function createWrapper(node, html) {
  40615. const {
  40616. attributes
  40617. } = html;
  40618. const {
  40619. style
  40620. } = attributes;
  40621. const wrapper = {
  40622. name: "div",
  40623. attributes: {
  40624. class: ["xfaWrapper"],
  40625. style: Object.create(null)
  40626. },
  40627. children: []
  40628. };
  40629. attributes.class.push("xfaWrapped");
  40630. if (node.border) {
  40631. const {
  40632. widths,
  40633. insets
  40634. } = node.border[$extra];
  40635. let width, height;
  40636. let top = insets[0];
  40637. let left = insets[3];
  40638. const insetsH = insets[0] + insets[2];
  40639. const insetsW = insets[1] + insets[3];
  40640. switch (node.border.hand) {
  40641. case "even":
  40642. top -= widths[0] / 2;
  40643. left -= widths[3] / 2;
  40644. width = `calc(100% + ${(widths[1] + widths[3]) / 2 - insetsW}px)`;
  40645. height = `calc(100% + ${(widths[0] + widths[2]) / 2 - insetsH}px)`;
  40646. break;
  40647. case "left":
  40648. top -= widths[0];
  40649. left -= widths[3];
  40650. width = `calc(100% + ${widths[1] + widths[3] - insetsW}px)`;
  40651. height = `calc(100% + ${widths[0] + widths[2] - insetsH}px)`;
  40652. break;
  40653. case "right":
  40654. width = insetsW ? `calc(100% - ${insetsW}px)` : "100%";
  40655. height = insetsH ? `calc(100% - ${insetsH}px)` : "100%";
  40656. break;
  40657. }
  40658. const classNames = ["xfaBorder"];
  40659. if (isPrintOnly(node.border)) {
  40660. classNames.push("xfaPrintOnly");
  40661. }
  40662. const border = {
  40663. name: "div",
  40664. attributes: {
  40665. class: classNames,
  40666. style: {
  40667. top: `${top}px`,
  40668. left: `${left}px`,
  40669. width,
  40670. height
  40671. }
  40672. },
  40673. children: []
  40674. };
  40675. for (const key of ["border", "borderWidth", "borderColor", "borderRadius", "borderStyle"]) {
  40676. if (style[key] !== undefined) {
  40677. border.attributes.style[key] = style[key];
  40678. delete style[key];
  40679. }
  40680. }
  40681. wrapper.children.push(border, html);
  40682. } else {
  40683. wrapper.children.push(html);
  40684. }
  40685. for (const key of ["background", "backgroundClip", "top", "left", "width", "height", "minWidth", "minHeight", "maxWidth", "maxHeight", "transform", "transformOrigin", "visibility"]) {
  40686. if (style[key] !== undefined) {
  40687. wrapper.attributes.style[key] = style[key];
  40688. delete style[key];
  40689. }
  40690. }
  40691. wrapper.attributes.style.position = style.position === "absolute" ? "absolute" : "relative";
  40692. delete style.position;
  40693. if (style.alignSelf) {
  40694. wrapper.attributes.style.alignSelf = style.alignSelf;
  40695. delete style.alignSelf;
  40696. }
  40697. return wrapper;
  40698. }
  40699. function fixTextIndent(styles) {
  40700. const indent = getMeasurement(styles.textIndent, "0px");
  40701. if (indent >= 0) {
  40702. return;
  40703. }
  40704. const align = styles.textAlign === "right" ? "right" : "left";
  40705. const name = "padding" + (align === "left" ? "Left" : "Right");
  40706. const padding = getMeasurement(styles[name], "0px");
  40707. styles[name] = `${padding - indent}px`;
  40708. }
  40709. function setAccess(node, classNames) {
  40710. switch (node.access) {
  40711. case "nonInteractive":
  40712. classNames.push("xfaNonInteractive");
  40713. break;
  40714. case "readOnly":
  40715. classNames.push("xfaReadOnly");
  40716. break;
  40717. case "protected":
  40718. classNames.push("xfaDisabled");
  40719. break;
  40720. }
  40721. }
  40722. function isPrintOnly(node) {
  40723. return node.relevant.length > 0 && !node.relevant[0].excluded && node.relevant[0].viewname === "print";
  40724. }
  40725. function getCurrentPara(node) {
  40726. const stack = node[$getTemplateRoot]()[$extra].paraStack;
  40727. return stack.length ? stack.at(-1) : null;
  40728. }
  40729. function setPara(node, nodeStyle, value) {
  40730. if (value.attributes.class?.includes("xfaRich")) {
  40731. if (nodeStyle) {
  40732. if (node.h === "") {
  40733. nodeStyle.height = "auto";
  40734. }
  40735. if (node.w === "") {
  40736. nodeStyle.width = "auto";
  40737. }
  40738. }
  40739. const para = getCurrentPara(node);
  40740. if (para) {
  40741. const valueStyle = value.attributes.style;
  40742. valueStyle.display = "flex";
  40743. valueStyle.flexDirection = "column";
  40744. switch (para.vAlign) {
  40745. case "top":
  40746. valueStyle.justifyContent = "start";
  40747. break;
  40748. case "bottom":
  40749. valueStyle.justifyContent = "end";
  40750. break;
  40751. case "middle":
  40752. valueStyle.justifyContent = "center";
  40753. break;
  40754. }
  40755. const paraStyle = para[$toStyle]();
  40756. for (const [key, val] of Object.entries(paraStyle)) {
  40757. if (!(key in valueStyle)) {
  40758. valueStyle[key] = val;
  40759. }
  40760. }
  40761. }
  40762. }
  40763. }
  40764. function setFontFamily(xfaFont, node, fontFinder, style) {
  40765. if (!fontFinder) {
  40766. delete style.fontFamily;
  40767. return;
  40768. }
  40769. const name = stripQuotes(xfaFont.typeface);
  40770. style.fontFamily = `"${name}"`;
  40771. const typeface = fontFinder.find(name);
  40772. if (typeface) {
  40773. const {
  40774. fontFamily
  40775. } = typeface.regular.cssFontInfo;
  40776. if (fontFamily !== name) {
  40777. style.fontFamily = `"${fontFamily}"`;
  40778. }
  40779. const para = getCurrentPara(node);
  40780. if (para && para.lineHeight !== "") {
  40781. return;
  40782. }
  40783. if (style.lineHeight) {
  40784. return;
  40785. }
  40786. const pdfFont = selectFont(xfaFont, typeface);
  40787. if (pdfFont) {
  40788. style.lineHeight = Math.max(1.2, pdfFont.lineHeight);
  40789. }
  40790. }
  40791. }
  40792. function fixURL(str) {
  40793. const absoluteUrl = createValidAbsoluteUrl(str, null, {
  40794. addDefaultProtocol: true,
  40795. tryConvertEncoding: true
  40796. });
  40797. return absoluteUrl ? absoluteUrl.href : null;
  40798. }
  40799. ;// CONCATENATED MODULE: ./src/core/xfa/layout.js
  40800. function createLine(node, children) {
  40801. return {
  40802. name: "div",
  40803. attributes: {
  40804. class: [node.layout === "lr-tb" ? "xfaLr" : "xfaRl"]
  40805. },
  40806. children
  40807. };
  40808. }
  40809. function flushHTML(node) {
  40810. if (!node[$extra]) {
  40811. return null;
  40812. }
  40813. const attributes = node[$extra].attributes;
  40814. const html = {
  40815. name: "div",
  40816. attributes,
  40817. children: node[$extra].children
  40818. };
  40819. if (node[$extra].failingNode) {
  40820. const htmlFromFailing = node[$extra].failingNode[$flushHTML]();
  40821. if (htmlFromFailing) {
  40822. if (node.layout.endsWith("-tb")) {
  40823. html.children.push(createLine(node, [htmlFromFailing]));
  40824. } else {
  40825. html.children.push(htmlFromFailing);
  40826. }
  40827. }
  40828. }
  40829. if (html.children.length === 0) {
  40830. return null;
  40831. }
  40832. return html;
  40833. }
  40834. function addHTML(node, html, bbox) {
  40835. const extra = node[$extra];
  40836. const availableSpace = extra.availableSpace;
  40837. const [x, y, w, h] = bbox;
  40838. switch (node.layout) {
  40839. case "position":
  40840. {
  40841. extra.width = Math.max(extra.width, x + w);
  40842. extra.height = Math.max(extra.height, y + h);
  40843. extra.children.push(html);
  40844. break;
  40845. }
  40846. case "lr-tb":
  40847. case "rl-tb":
  40848. if (!extra.line || extra.attempt === 1) {
  40849. extra.line = createLine(node, []);
  40850. extra.children.push(extra.line);
  40851. extra.numberInLine = 0;
  40852. }
  40853. extra.numberInLine += 1;
  40854. extra.line.children.push(html);
  40855. if (extra.attempt === 0) {
  40856. extra.currentWidth += w;
  40857. extra.height = Math.max(extra.height, extra.prevHeight + h);
  40858. } else {
  40859. extra.currentWidth = w;
  40860. extra.prevHeight = extra.height;
  40861. extra.height += h;
  40862. extra.attempt = 0;
  40863. }
  40864. extra.width = Math.max(extra.width, extra.currentWidth);
  40865. break;
  40866. case "rl-row":
  40867. case "row":
  40868. {
  40869. extra.children.push(html);
  40870. extra.width += w;
  40871. extra.height = Math.max(extra.height, h);
  40872. const height = measureToString(extra.height);
  40873. for (const child of extra.children) {
  40874. child.attributes.style.height = height;
  40875. }
  40876. break;
  40877. }
  40878. case "table":
  40879. {
  40880. extra.width = Math.min(availableSpace.width, Math.max(extra.width, w));
  40881. extra.height += h;
  40882. extra.children.push(html);
  40883. break;
  40884. }
  40885. case "tb":
  40886. {
  40887. extra.width = Math.min(availableSpace.width, Math.max(extra.width, w));
  40888. extra.height += h;
  40889. extra.children.push(html);
  40890. break;
  40891. }
  40892. }
  40893. }
  40894. function getAvailableSpace(node) {
  40895. const availableSpace = node[$extra].availableSpace;
  40896. const marginV = node.margin ? node.margin.topInset + node.margin.bottomInset : 0;
  40897. const marginH = node.margin ? node.margin.leftInset + node.margin.rightInset : 0;
  40898. switch (node.layout) {
  40899. case "lr-tb":
  40900. case "rl-tb":
  40901. if (node[$extra].attempt === 0) {
  40902. return {
  40903. width: availableSpace.width - marginH - node[$extra].currentWidth,
  40904. height: availableSpace.height - marginV - node[$extra].prevHeight
  40905. };
  40906. }
  40907. return {
  40908. width: availableSpace.width - marginH,
  40909. height: availableSpace.height - marginV - node[$extra].height
  40910. };
  40911. case "rl-row":
  40912. case "row":
  40913. const width = node[$extra].columnWidths.slice(node[$extra].currentColumn).reduce((a, x) => a + x);
  40914. return {
  40915. width,
  40916. height: availableSpace.height - marginH
  40917. };
  40918. case "table":
  40919. case "tb":
  40920. return {
  40921. width: availableSpace.width - marginH,
  40922. height: availableSpace.height - marginV - node[$extra].height
  40923. };
  40924. case "position":
  40925. default:
  40926. return availableSpace;
  40927. }
  40928. }
  40929. function getTransformedBBox(node) {
  40930. let w = node.w === "" ? NaN : node.w;
  40931. let h = node.h === "" ? NaN : node.h;
  40932. let [centerX, centerY] = [0, 0];
  40933. switch (node.anchorType || "") {
  40934. case "bottomCenter":
  40935. [centerX, centerY] = [w / 2, h];
  40936. break;
  40937. case "bottomLeft":
  40938. [centerX, centerY] = [0, h];
  40939. break;
  40940. case "bottomRight":
  40941. [centerX, centerY] = [w, h];
  40942. break;
  40943. case "middleCenter":
  40944. [centerX, centerY] = [w / 2, h / 2];
  40945. break;
  40946. case "middleLeft":
  40947. [centerX, centerY] = [0, h / 2];
  40948. break;
  40949. case "middleRight":
  40950. [centerX, centerY] = [w, h / 2];
  40951. break;
  40952. case "topCenter":
  40953. [centerX, centerY] = [w / 2, 0];
  40954. break;
  40955. case "topRight":
  40956. [centerX, centerY] = [w, 0];
  40957. break;
  40958. }
  40959. let x, y;
  40960. switch (node.rotate || 0) {
  40961. case 0:
  40962. [x, y] = [-centerX, -centerY];
  40963. break;
  40964. case 90:
  40965. [x, y] = [-centerY, centerX];
  40966. [w, h] = [h, -w];
  40967. break;
  40968. case 180:
  40969. [x, y] = [centerX, centerY];
  40970. [w, h] = [-w, -h];
  40971. break;
  40972. case 270:
  40973. [x, y] = [centerY, -centerX];
  40974. [w, h] = [-h, w];
  40975. break;
  40976. }
  40977. return [node.x + x + Math.min(0, w), node.y + y + Math.min(0, h), Math.abs(w), Math.abs(h)];
  40978. }
  40979. function checkDimensions(node, space) {
  40980. if (node[$getTemplateRoot]()[$extra].firstUnsplittable === null) {
  40981. return true;
  40982. }
  40983. if (node.w === 0 || node.h === 0) {
  40984. return true;
  40985. }
  40986. const ERROR = 2;
  40987. const parent = node[$getSubformParent]();
  40988. const attempt = parent[$extra]?.attempt || 0;
  40989. const [, y, w, h] = getTransformedBBox(node);
  40990. switch (parent.layout) {
  40991. case "lr-tb":
  40992. case "rl-tb":
  40993. if (attempt === 0) {
  40994. if (!node[$getTemplateRoot]()[$extra].noLayoutFailure) {
  40995. if (node.h !== "" && Math.round(h - space.height) > ERROR) {
  40996. return false;
  40997. }
  40998. if (node.w !== "") {
  40999. if (Math.round(w - space.width) <= ERROR) {
  41000. return true;
  41001. }
  41002. if (parent[$extra].numberInLine === 0) {
  41003. return space.height > ERROR;
  41004. }
  41005. return false;
  41006. }
  41007. return space.width > ERROR;
  41008. }
  41009. if (node.w !== "") {
  41010. return Math.round(w - space.width) <= ERROR;
  41011. }
  41012. return space.width > ERROR;
  41013. }
  41014. if (node[$getTemplateRoot]()[$extra].noLayoutFailure) {
  41015. return true;
  41016. }
  41017. if (node.h !== "" && Math.round(h - space.height) > ERROR) {
  41018. return false;
  41019. }
  41020. if (node.w === "" || Math.round(w - space.width) <= ERROR) {
  41021. return space.height > ERROR;
  41022. }
  41023. if (parent[$isThereMoreWidth]()) {
  41024. return false;
  41025. }
  41026. return space.height > ERROR;
  41027. case "table":
  41028. case "tb":
  41029. if (node[$getTemplateRoot]()[$extra].noLayoutFailure) {
  41030. return true;
  41031. }
  41032. if (node.h !== "" && !node[$isSplittable]()) {
  41033. return Math.round(h - space.height) <= ERROR;
  41034. }
  41035. if (node.w === "" || Math.round(w - space.width) <= ERROR) {
  41036. return space.height > ERROR;
  41037. }
  41038. if (parent[$isThereMoreWidth]()) {
  41039. return false;
  41040. }
  41041. return space.height > ERROR;
  41042. case "position":
  41043. if (node[$getTemplateRoot]()[$extra].noLayoutFailure) {
  41044. return true;
  41045. }
  41046. if (node.h === "" || Math.round(h + y - space.height) <= ERROR) {
  41047. return true;
  41048. }
  41049. const area = node[$getTemplateRoot]()[$extra].currentContentArea;
  41050. return h + y > area.h;
  41051. case "rl-row":
  41052. case "row":
  41053. if (node[$getTemplateRoot]()[$extra].noLayoutFailure) {
  41054. return true;
  41055. }
  41056. if (node.h !== "") {
  41057. return Math.round(h - space.height) <= ERROR;
  41058. }
  41059. return true;
  41060. default:
  41061. return true;
  41062. }
  41063. }
  41064. ;// CONCATENATED MODULE: ./src/core/xfa/template.js
  41065. const TEMPLATE_NS_ID = NamespaceIds.template.id;
  41066. const SVG_NS = "http://www.w3.org/2000/svg";
  41067. const MAX_ATTEMPTS_FOR_LRTB_LAYOUT = 2;
  41068. const MAX_EMPTY_PAGES = 3;
  41069. const DEFAULT_TAB_INDEX = 5000;
  41070. const HEADING_PATTERN = /^H(\d+)$/;
  41071. 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"]);
  41072. 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"]];
  41073. function getBorderDims(node) {
  41074. if (!node || !node.border) {
  41075. return {
  41076. w: 0,
  41077. h: 0
  41078. };
  41079. }
  41080. const borderExtra = node.border[$getExtra]();
  41081. if (!borderExtra) {
  41082. return {
  41083. w: 0,
  41084. h: 0
  41085. };
  41086. }
  41087. return {
  41088. w: borderExtra.widths[0] + borderExtra.widths[2] + borderExtra.insets[0] + borderExtra.insets[2],
  41089. h: borderExtra.widths[1] + borderExtra.widths[3] + borderExtra.insets[1] + borderExtra.insets[3]
  41090. };
  41091. }
  41092. function hasMargin(node) {
  41093. return node.margin && (node.margin.topInset || node.margin.rightInset || node.margin.bottomInset || node.margin.leftInset);
  41094. }
  41095. function _setValue(templateNode, value) {
  41096. if (!templateNode.value) {
  41097. const nodeValue = new Value({});
  41098. templateNode[$appendChild](nodeValue);
  41099. templateNode.value = nodeValue;
  41100. }
  41101. templateNode.value[$setValue](value);
  41102. }
  41103. function* getContainedChildren(node) {
  41104. for (const child of node[$getChildren]()) {
  41105. if (child instanceof SubformSet) {
  41106. yield* child[$getContainedChildren]();
  41107. continue;
  41108. }
  41109. yield child;
  41110. }
  41111. }
  41112. function isRequired(node) {
  41113. return node.validate?.nullTest === "error";
  41114. }
  41115. function setTabIndex(node) {
  41116. while (node) {
  41117. if (!node.traversal) {
  41118. node[$tabIndex] = node[$getParent]()[$tabIndex];
  41119. return;
  41120. }
  41121. if (node[$tabIndex]) {
  41122. return;
  41123. }
  41124. let next = null;
  41125. for (const child of node.traversal[$getChildren]()) {
  41126. if (child.operation === "next") {
  41127. next = child;
  41128. break;
  41129. }
  41130. }
  41131. if (!next || !next.ref) {
  41132. node[$tabIndex] = node[$getParent]()[$tabIndex];
  41133. return;
  41134. }
  41135. const root = node[$getTemplateRoot]();
  41136. node[$tabIndex] = ++root[$tabIndex];
  41137. const ref = root[$searchNode](next.ref, node);
  41138. if (!ref) {
  41139. return;
  41140. }
  41141. node = ref[0];
  41142. }
  41143. }
  41144. function applyAssist(obj, attributes) {
  41145. const assist = obj.assist;
  41146. if (assist) {
  41147. const assistTitle = assist[$toHTML]();
  41148. if (assistTitle) {
  41149. attributes.title = assistTitle;
  41150. }
  41151. const role = assist.role;
  41152. const match = role.match(HEADING_PATTERN);
  41153. if (match) {
  41154. const ariaRole = "heading";
  41155. const ariaLevel = match[1];
  41156. attributes.role = ariaRole;
  41157. attributes["aria-level"] = ariaLevel;
  41158. }
  41159. }
  41160. if (obj.layout === "table") {
  41161. attributes.role = "table";
  41162. } else if (obj.layout === "row") {
  41163. attributes.role = "row";
  41164. } else {
  41165. const parent = obj[$getParent]();
  41166. if (parent.layout === "row") {
  41167. attributes.role = parent.assist?.role === "TH" ? "columnheader" : "cell";
  41168. }
  41169. }
  41170. }
  41171. function ariaLabel(obj) {
  41172. if (!obj.assist) {
  41173. return null;
  41174. }
  41175. const assist = obj.assist;
  41176. if (assist.speak && assist.speak[$content] !== "") {
  41177. return assist.speak[$content];
  41178. }
  41179. if (assist.toolTip) {
  41180. return assist.toolTip[$content];
  41181. }
  41182. return null;
  41183. }
  41184. function valueToHtml(value) {
  41185. return HTMLResult.success({
  41186. name: "div",
  41187. attributes: {
  41188. class: ["xfaRich"],
  41189. style: Object.create(null)
  41190. },
  41191. children: [{
  41192. name: "span",
  41193. attributes: {
  41194. style: Object.create(null)
  41195. },
  41196. value
  41197. }]
  41198. });
  41199. }
  41200. function setFirstUnsplittable(node) {
  41201. const root = node[$getTemplateRoot]();
  41202. if (root[$extra].firstUnsplittable === null) {
  41203. root[$extra].firstUnsplittable = node;
  41204. root[$extra].noLayoutFailure = true;
  41205. }
  41206. }
  41207. function unsetFirstUnsplittable(node) {
  41208. const root = node[$getTemplateRoot]();
  41209. if (root[$extra].firstUnsplittable === node) {
  41210. root[$extra].noLayoutFailure = false;
  41211. }
  41212. }
  41213. function handleBreak(node) {
  41214. if (node[$extra]) {
  41215. return false;
  41216. }
  41217. node[$extra] = Object.create(null);
  41218. if (node.targetType === "auto") {
  41219. return false;
  41220. }
  41221. const root = node[$getTemplateRoot]();
  41222. let target = null;
  41223. if (node.target) {
  41224. target = root[$searchNode](node.target, node[$getParent]());
  41225. if (!target) {
  41226. return false;
  41227. }
  41228. target = target[0];
  41229. }
  41230. const {
  41231. currentPageArea,
  41232. currentContentArea
  41233. } = root[$extra];
  41234. if (node.targetType === "pageArea") {
  41235. if (!(target instanceof PageArea)) {
  41236. target = null;
  41237. }
  41238. if (node.startNew) {
  41239. node[$extra].target = target || currentPageArea;
  41240. return true;
  41241. } else if (target && target !== currentPageArea) {
  41242. node[$extra].target = target;
  41243. return true;
  41244. }
  41245. return false;
  41246. }
  41247. if (!(target instanceof ContentArea)) {
  41248. target = null;
  41249. }
  41250. const pageArea = target && target[$getParent]();
  41251. let index;
  41252. let nextPageArea = pageArea;
  41253. if (node.startNew) {
  41254. if (target) {
  41255. const contentAreas = pageArea.contentArea.children;
  41256. const indexForCurrent = contentAreas.indexOf(currentContentArea);
  41257. const indexForTarget = contentAreas.indexOf(target);
  41258. if (indexForCurrent !== -1 && indexForCurrent < indexForTarget) {
  41259. nextPageArea = null;
  41260. }
  41261. index = indexForTarget - 1;
  41262. } else {
  41263. index = currentPageArea.contentArea.children.indexOf(currentContentArea);
  41264. }
  41265. } else if (target && target !== currentContentArea) {
  41266. const contentAreas = pageArea.contentArea.children;
  41267. index = contentAreas.indexOf(target) - 1;
  41268. nextPageArea = pageArea === currentPageArea ? null : pageArea;
  41269. } else {
  41270. return false;
  41271. }
  41272. node[$extra].target = nextPageArea;
  41273. node[$extra].index = index;
  41274. return true;
  41275. }
  41276. function handleOverflow(node, extraNode, space) {
  41277. const root = node[$getTemplateRoot]();
  41278. const saved = root[$extra].noLayoutFailure;
  41279. const savedMethod = extraNode[$getSubformParent];
  41280. extraNode[$getSubformParent] = () => node;
  41281. root[$extra].noLayoutFailure = true;
  41282. const res = extraNode[$toHTML](space);
  41283. node[$addHTML](res.html, res.bbox);
  41284. root[$extra].noLayoutFailure = saved;
  41285. extraNode[$getSubformParent] = savedMethod;
  41286. }
  41287. class AppearanceFilter extends StringObject {
  41288. constructor(attributes) {
  41289. super(TEMPLATE_NS_ID, "appearanceFilter");
  41290. this.id = attributes.id || "";
  41291. this.type = getStringOption(attributes.type, ["optional", "required"]);
  41292. this.use = attributes.use || "";
  41293. this.usehref = attributes.usehref || "";
  41294. }
  41295. }
  41296. class Arc extends XFAObject {
  41297. constructor(attributes) {
  41298. super(TEMPLATE_NS_ID, "arc", true);
  41299. this.circular = getInteger({
  41300. data: attributes.circular,
  41301. defaultValue: 0,
  41302. validate: x => x === 1
  41303. });
  41304. this.hand = getStringOption(attributes.hand, ["even", "left", "right"]);
  41305. this.id = attributes.id || "";
  41306. this.startAngle = getFloat({
  41307. data: attributes.startAngle,
  41308. defaultValue: 0,
  41309. validate: x => true
  41310. });
  41311. this.sweepAngle = getFloat({
  41312. data: attributes.sweepAngle,
  41313. defaultValue: 360,
  41314. validate: x => true
  41315. });
  41316. this.use = attributes.use || "";
  41317. this.usehref = attributes.usehref || "";
  41318. this.edge = null;
  41319. this.fill = null;
  41320. }
  41321. [$toHTML]() {
  41322. const edge = this.edge || new Edge({});
  41323. const edgeStyle = edge[$toStyle]();
  41324. const style = Object.create(null);
  41325. if (this.fill?.presence === "visible") {
  41326. Object.assign(style, this.fill[$toStyle]());
  41327. } else {
  41328. style.fill = "transparent";
  41329. }
  41330. style.strokeWidth = measureToString(edge.presence === "visible" ? edge.thickness : 0);
  41331. style.stroke = edgeStyle.color;
  41332. let arc;
  41333. const attributes = {
  41334. xmlns: SVG_NS,
  41335. style: {
  41336. width: "100%",
  41337. height: "100%",
  41338. overflow: "visible"
  41339. }
  41340. };
  41341. if (this.sweepAngle === 360) {
  41342. arc = {
  41343. name: "ellipse",
  41344. attributes: {
  41345. xmlns: SVG_NS,
  41346. cx: "50%",
  41347. cy: "50%",
  41348. rx: "50%",
  41349. ry: "50%",
  41350. style
  41351. }
  41352. };
  41353. } else {
  41354. const startAngle = this.startAngle * Math.PI / 180;
  41355. const sweepAngle = this.sweepAngle * Math.PI / 180;
  41356. const largeArc = this.sweepAngle > 180 ? 1 : 0;
  41357. 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))];
  41358. arc = {
  41359. name: "path",
  41360. attributes: {
  41361. xmlns: SVG_NS,
  41362. d: `M ${x1} ${y1} A 50 50 0 ${largeArc} 0 ${x2} ${y2}`,
  41363. vectorEffect: "non-scaling-stroke",
  41364. style
  41365. }
  41366. };
  41367. Object.assign(attributes, {
  41368. viewBox: "0 0 100 100",
  41369. preserveAspectRatio: "none"
  41370. });
  41371. }
  41372. const svg = {
  41373. name: "svg",
  41374. children: [arc],
  41375. attributes
  41376. };
  41377. const parent = this[$getParent]()[$getParent]();
  41378. if (hasMargin(parent)) {
  41379. return HTMLResult.success({
  41380. name: "div",
  41381. attributes: {
  41382. style: {
  41383. display: "inline",
  41384. width: "100%",
  41385. height: "100%"
  41386. }
  41387. },
  41388. children: [svg]
  41389. });
  41390. }
  41391. svg.attributes.style.position = "absolute";
  41392. return HTMLResult.success(svg);
  41393. }
  41394. }
  41395. class Area extends XFAObject {
  41396. constructor(attributes) {
  41397. super(TEMPLATE_NS_ID, "area", true);
  41398. this.colSpan = getInteger({
  41399. data: attributes.colSpan,
  41400. defaultValue: 1,
  41401. validate: n => n >= 1 || n === -1
  41402. });
  41403. this.id = attributes.id || "";
  41404. this.name = attributes.name || "";
  41405. this.relevant = getRelevant(attributes.relevant);
  41406. this.use = attributes.use || "";
  41407. this.usehref = attributes.usehref || "";
  41408. this.x = getMeasurement(attributes.x, "0pt");
  41409. this.y = getMeasurement(attributes.y, "0pt");
  41410. this.desc = null;
  41411. this.extras = null;
  41412. this.area = new XFAObjectArray();
  41413. this.draw = new XFAObjectArray();
  41414. this.exObject = new XFAObjectArray();
  41415. this.exclGroup = new XFAObjectArray();
  41416. this.field = new XFAObjectArray();
  41417. this.subform = new XFAObjectArray();
  41418. this.subformSet = new XFAObjectArray();
  41419. }
  41420. *[$getContainedChildren]() {
  41421. yield* getContainedChildren(this);
  41422. }
  41423. [$isTransparent]() {
  41424. return true;
  41425. }
  41426. [$isBindable]() {
  41427. return true;
  41428. }
  41429. [$addHTML](html, bbox) {
  41430. const [x, y, w, h] = bbox;
  41431. this[$extra].width = Math.max(this[$extra].width, x + w);
  41432. this[$extra].height = Math.max(this[$extra].height, y + h);
  41433. this[$extra].children.push(html);
  41434. }
  41435. [$getAvailableSpace]() {
  41436. return this[$extra].availableSpace;
  41437. }
  41438. [$toHTML](availableSpace) {
  41439. const style = toStyle(this, "position");
  41440. const attributes = {
  41441. style,
  41442. id: this[$uid],
  41443. class: ["xfaArea"]
  41444. };
  41445. if (isPrintOnly(this)) {
  41446. attributes.class.push("xfaPrintOnly");
  41447. }
  41448. if (this.name) {
  41449. attributes.xfaName = this.name;
  41450. }
  41451. const children = [];
  41452. this[$extra] = {
  41453. children,
  41454. width: 0,
  41455. height: 0,
  41456. availableSpace
  41457. };
  41458. const result = this[$childrenToHTML]({
  41459. filter: new Set(["area", "draw", "field", "exclGroup", "subform", "subformSet"]),
  41460. include: true
  41461. });
  41462. if (!result.success) {
  41463. if (result.isBreak()) {
  41464. return result;
  41465. }
  41466. delete this[$extra];
  41467. return HTMLResult.FAILURE;
  41468. }
  41469. style.width = measureToString(this[$extra].width);
  41470. style.height = measureToString(this[$extra].height);
  41471. const html = {
  41472. name: "div",
  41473. attributes,
  41474. children
  41475. };
  41476. const bbox = [this.x, this.y, this[$extra].width, this[$extra].height];
  41477. delete this[$extra];
  41478. return HTMLResult.success(html, bbox);
  41479. }
  41480. }
  41481. class Assist extends XFAObject {
  41482. constructor(attributes) {
  41483. super(TEMPLATE_NS_ID, "assist", true);
  41484. this.id = attributes.id || "";
  41485. this.role = attributes.role || "";
  41486. this.use = attributes.use || "";
  41487. this.usehref = attributes.usehref || "";
  41488. this.speak = null;
  41489. this.toolTip = null;
  41490. }
  41491. [$toHTML]() {
  41492. return this.toolTip?.[$content] || null;
  41493. }
  41494. }
  41495. class Barcode extends XFAObject {
  41496. constructor(attributes) {
  41497. super(TEMPLATE_NS_ID, "barcode", true);
  41498. this.charEncoding = getKeyword({
  41499. data: attributes.charEncoding ? attributes.charEncoding.toLowerCase() : "",
  41500. defaultValue: "",
  41501. 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}/)
  41502. });
  41503. this.checksum = getStringOption(attributes.checksum, ["none", "1mod10", "1mod10_1mod11", "2mod10", "auto"]);
  41504. this.dataColumnCount = getInteger({
  41505. data: attributes.dataColumnCount,
  41506. defaultValue: -1,
  41507. validate: x => x >= 0
  41508. });
  41509. this.dataLength = getInteger({
  41510. data: attributes.dataLength,
  41511. defaultValue: -1,
  41512. validate: x => x >= 0
  41513. });
  41514. this.dataPrep = getStringOption(attributes.dataPrep, ["none", "flateCompress"]);
  41515. this.dataRowCount = getInteger({
  41516. data: attributes.dataRowCount,
  41517. defaultValue: -1,
  41518. validate: x => x >= 0
  41519. });
  41520. this.endChar = attributes.endChar || "";
  41521. this.errorCorrectionLevel = getInteger({
  41522. data: attributes.errorCorrectionLevel,
  41523. defaultValue: -1,
  41524. validate: x => x >= 0 && x <= 8
  41525. });
  41526. this.id = attributes.id || "";
  41527. this.moduleHeight = getMeasurement(attributes.moduleHeight, "5mm");
  41528. this.moduleWidth = getMeasurement(attributes.moduleWidth, "0.25mm");
  41529. this.printCheckDigit = getInteger({
  41530. data: attributes.printCheckDigit,
  41531. defaultValue: 0,
  41532. validate: x => x === 1
  41533. });
  41534. this.rowColumnRatio = getRatio(attributes.rowColumnRatio);
  41535. this.startChar = attributes.startChar || "";
  41536. this.textLocation = getStringOption(attributes.textLocation, ["below", "above", "aboveEmbedded", "belowEmbedded", "none"]);
  41537. this.truncate = getInteger({
  41538. data: attributes.truncate,
  41539. defaultValue: 0,
  41540. validate: x => x === 1
  41541. });
  41542. 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"]);
  41543. this.upsMode = getStringOption(attributes.upsMode, ["usCarrier", "internationalCarrier", "secureSymbol", "standardSymbol"]);
  41544. this.use = attributes.use || "";
  41545. this.usehref = attributes.usehref || "";
  41546. this.wideNarrowRatio = getRatio(attributes.wideNarrowRatio);
  41547. this.encrypt = null;
  41548. this.extras = null;
  41549. }
  41550. }
  41551. class Bind extends XFAObject {
  41552. constructor(attributes) {
  41553. super(TEMPLATE_NS_ID, "bind", true);
  41554. this.match = getStringOption(attributes.match, ["once", "dataRef", "global", "none"]);
  41555. this.ref = attributes.ref || "";
  41556. this.picture = null;
  41557. }
  41558. }
  41559. class BindItems extends XFAObject {
  41560. constructor(attributes) {
  41561. super(TEMPLATE_NS_ID, "bindItems");
  41562. this.connection = attributes.connection || "";
  41563. this.labelRef = attributes.labelRef || "";
  41564. this.ref = attributes.ref || "";
  41565. this.valueRef = attributes.valueRef || "";
  41566. }
  41567. }
  41568. class Bookend extends XFAObject {
  41569. constructor(attributes) {
  41570. super(TEMPLATE_NS_ID, "bookend");
  41571. this.id = attributes.id || "";
  41572. this.leader = attributes.leader || "";
  41573. this.trailer = attributes.trailer || "";
  41574. this.use = attributes.use || "";
  41575. this.usehref = attributes.usehref || "";
  41576. }
  41577. }
  41578. class BooleanElement extends Option01 {
  41579. constructor(attributes) {
  41580. super(TEMPLATE_NS_ID, "boolean");
  41581. this.id = attributes.id || "";
  41582. this.name = attributes.name || "";
  41583. this.use = attributes.use || "";
  41584. this.usehref = attributes.usehref || "";
  41585. }
  41586. [$toHTML](availableSpace) {
  41587. return valueToHtml(this[$content] === 1 ? "1" : "0");
  41588. }
  41589. }
  41590. class Border extends XFAObject {
  41591. constructor(attributes) {
  41592. super(TEMPLATE_NS_ID, "border", true);
  41593. this.break = getStringOption(attributes.break, ["close", "open"]);
  41594. this.hand = getStringOption(attributes.hand, ["even", "left", "right"]);
  41595. this.id = attributes.id || "";
  41596. this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]);
  41597. this.relevant = getRelevant(attributes.relevant);
  41598. this.use = attributes.use || "";
  41599. this.usehref = attributes.usehref || "";
  41600. this.corner = new XFAObjectArray(4);
  41601. this.edge = new XFAObjectArray(4);
  41602. this.extras = null;
  41603. this.fill = null;
  41604. this.margin = null;
  41605. }
  41606. [$getExtra]() {
  41607. if (!this[$extra]) {
  41608. const edges = this.edge.children.slice();
  41609. if (edges.length < 4) {
  41610. const defaultEdge = edges.at(-1) || new Edge({});
  41611. for (let i = edges.length; i < 4; i++) {
  41612. edges.push(defaultEdge);
  41613. }
  41614. }
  41615. const widths = edges.map(edge => edge.thickness);
  41616. const insets = [0, 0, 0, 0];
  41617. if (this.margin) {
  41618. insets[0] = this.margin.topInset;
  41619. insets[1] = this.margin.rightInset;
  41620. insets[2] = this.margin.bottomInset;
  41621. insets[3] = this.margin.leftInset;
  41622. }
  41623. this[$extra] = {
  41624. widths,
  41625. insets,
  41626. edges
  41627. };
  41628. }
  41629. return this[$extra];
  41630. }
  41631. [$toStyle]() {
  41632. const {
  41633. edges
  41634. } = this[$getExtra]();
  41635. const edgeStyles = edges.map(node => {
  41636. const style = node[$toStyle]();
  41637. style.color ||= "#000000";
  41638. return style;
  41639. });
  41640. const style = Object.create(null);
  41641. if (this.margin) {
  41642. Object.assign(style, this.margin[$toStyle]());
  41643. }
  41644. if (this.fill?.presence === "visible") {
  41645. Object.assign(style, this.fill[$toStyle]());
  41646. }
  41647. if (this.corner.children.some(node => node.radius !== 0)) {
  41648. const cornerStyles = this.corner.children.map(node => node[$toStyle]());
  41649. if (cornerStyles.length === 2 || cornerStyles.length === 3) {
  41650. const last = cornerStyles.at(-1);
  41651. for (let i = cornerStyles.length; i < 4; i++) {
  41652. cornerStyles.push(last);
  41653. }
  41654. }
  41655. style.borderRadius = cornerStyles.map(s => s.radius).join(" ");
  41656. }
  41657. switch (this.presence) {
  41658. case "invisible":
  41659. case "hidden":
  41660. style.borderStyle = "";
  41661. break;
  41662. case "inactive":
  41663. style.borderStyle = "none";
  41664. break;
  41665. default:
  41666. style.borderStyle = edgeStyles.map(s => s.style).join(" ");
  41667. break;
  41668. }
  41669. style.borderWidth = edgeStyles.map(s => s.width).join(" ");
  41670. style.borderColor = edgeStyles.map(s => s.color).join(" ");
  41671. return style;
  41672. }
  41673. }
  41674. class Break extends XFAObject {
  41675. constructor(attributes) {
  41676. super(TEMPLATE_NS_ID, "break", true);
  41677. this.after = getStringOption(attributes.after, ["auto", "contentArea", "pageArea", "pageEven", "pageOdd"]);
  41678. this.afterTarget = attributes.afterTarget || "";
  41679. this.before = getStringOption(attributes.before, ["auto", "contentArea", "pageArea", "pageEven", "pageOdd"]);
  41680. this.beforeTarget = attributes.beforeTarget || "";
  41681. this.bookendLeader = attributes.bookendLeader || "";
  41682. this.bookendTrailer = attributes.bookendTrailer || "";
  41683. this.id = attributes.id || "";
  41684. this.overflowLeader = attributes.overflowLeader || "";
  41685. this.overflowTarget = attributes.overflowTarget || "";
  41686. this.overflowTrailer = attributes.overflowTrailer || "";
  41687. this.startNew = getInteger({
  41688. data: attributes.startNew,
  41689. defaultValue: 0,
  41690. validate: x => x === 1
  41691. });
  41692. this.use = attributes.use || "";
  41693. this.usehref = attributes.usehref || "";
  41694. this.extras = null;
  41695. }
  41696. }
  41697. class BreakAfter extends XFAObject {
  41698. constructor(attributes) {
  41699. super(TEMPLATE_NS_ID, "breakAfter", true);
  41700. this.id = attributes.id || "";
  41701. this.leader = attributes.leader || "";
  41702. this.startNew = getInteger({
  41703. data: attributes.startNew,
  41704. defaultValue: 0,
  41705. validate: x => x === 1
  41706. });
  41707. this.target = attributes.target || "";
  41708. this.targetType = getStringOption(attributes.targetType, ["auto", "contentArea", "pageArea"]);
  41709. this.trailer = attributes.trailer || "";
  41710. this.use = attributes.use || "";
  41711. this.usehref = attributes.usehref || "";
  41712. this.script = null;
  41713. }
  41714. }
  41715. class BreakBefore extends XFAObject {
  41716. constructor(attributes) {
  41717. super(TEMPLATE_NS_ID, "breakBefore", true);
  41718. this.id = attributes.id || "";
  41719. this.leader = attributes.leader || "";
  41720. this.startNew = getInteger({
  41721. data: attributes.startNew,
  41722. defaultValue: 0,
  41723. validate: x => x === 1
  41724. });
  41725. this.target = attributes.target || "";
  41726. this.targetType = getStringOption(attributes.targetType, ["auto", "contentArea", "pageArea"]);
  41727. this.trailer = attributes.trailer || "";
  41728. this.use = attributes.use || "";
  41729. this.usehref = attributes.usehref || "";
  41730. this.script = null;
  41731. }
  41732. [$toHTML](availableSpace) {
  41733. this[$extra] = {};
  41734. return HTMLResult.FAILURE;
  41735. }
  41736. }
  41737. class Button extends XFAObject {
  41738. constructor(attributes) {
  41739. super(TEMPLATE_NS_ID, "button", true);
  41740. this.highlight = getStringOption(attributes.highlight, ["inverted", "none", "outline", "push"]);
  41741. this.id = attributes.id || "";
  41742. this.use = attributes.use || "";
  41743. this.usehref = attributes.usehref || "";
  41744. this.extras = null;
  41745. }
  41746. [$toHTML](availableSpace) {
  41747. const parent = this[$getParent]();
  41748. const grandpa = parent[$getParent]();
  41749. const htmlButton = {
  41750. name: "button",
  41751. attributes: {
  41752. id: this[$uid],
  41753. class: ["xfaButton"],
  41754. style: {}
  41755. },
  41756. children: []
  41757. };
  41758. for (const event of grandpa.event.children) {
  41759. if (event.activity !== "click" || !event.script) {
  41760. continue;
  41761. }
  41762. const jsURL = recoverJsURL(event.script[$content]);
  41763. if (!jsURL) {
  41764. continue;
  41765. }
  41766. const href = fixURL(jsURL.url);
  41767. if (!href) {
  41768. continue;
  41769. }
  41770. htmlButton.children.push({
  41771. name: "a",
  41772. attributes: {
  41773. id: "link" + this[$uid],
  41774. href,
  41775. newWindow: jsURL.newWindow,
  41776. class: ["xfaLink"],
  41777. style: {}
  41778. },
  41779. children: []
  41780. });
  41781. }
  41782. return HTMLResult.success(htmlButton);
  41783. }
  41784. }
  41785. class Calculate extends XFAObject {
  41786. constructor(attributes) {
  41787. super(TEMPLATE_NS_ID, "calculate", true);
  41788. this.id = attributes.id || "";
  41789. this.override = getStringOption(attributes.override, ["disabled", "error", "ignore", "warning"]);
  41790. this.use = attributes.use || "";
  41791. this.usehref = attributes.usehref || "";
  41792. this.extras = null;
  41793. this.message = null;
  41794. this.script = null;
  41795. }
  41796. }
  41797. class Caption extends XFAObject {
  41798. constructor(attributes) {
  41799. super(TEMPLATE_NS_ID, "caption", true);
  41800. this.id = attributes.id || "";
  41801. this.placement = getStringOption(attributes.placement, ["left", "bottom", "inline", "right", "top"]);
  41802. this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]);
  41803. this.reserve = Math.ceil(getMeasurement(attributes.reserve));
  41804. this.use = attributes.use || "";
  41805. this.usehref = attributes.usehref || "";
  41806. this.extras = null;
  41807. this.font = null;
  41808. this.margin = null;
  41809. this.para = null;
  41810. this.value = null;
  41811. }
  41812. [$setValue](value) {
  41813. _setValue(this, value);
  41814. }
  41815. [$getExtra](availableSpace) {
  41816. if (!this[$extra]) {
  41817. let {
  41818. width,
  41819. height
  41820. } = availableSpace;
  41821. switch (this.placement) {
  41822. case "left":
  41823. case "right":
  41824. case "inline":
  41825. width = this.reserve <= 0 ? width : this.reserve;
  41826. break;
  41827. case "top":
  41828. case "bottom":
  41829. height = this.reserve <= 0 ? height : this.reserve;
  41830. break;
  41831. }
  41832. this[$extra] = layoutNode(this, {
  41833. width,
  41834. height
  41835. });
  41836. }
  41837. return this[$extra];
  41838. }
  41839. [$toHTML](availableSpace) {
  41840. if (!this.value) {
  41841. return HTMLResult.EMPTY;
  41842. }
  41843. this[$pushPara]();
  41844. const value = this.value[$toHTML](availableSpace).html;
  41845. if (!value) {
  41846. this[$popPara]();
  41847. return HTMLResult.EMPTY;
  41848. }
  41849. const savedReserve = this.reserve;
  41850. if (this.reserve <= 0) {
  41851. const {
  41852. w,
  41853. h
  41854. } = this[$getExtra](availableSpace);
  41855. switch (this.placement) {
  41856. case "left":
  41857. case "right":
  41858. case "inline":
  41859. this.reserve = w;
  41860. break;
  41861. case "top":
  41862. case "bottom":
  41863. this.reserve = h;
  41864. break;
  41865. }
  41866. }
  41867. const children = [];
  41868. if (typeof value === "string") {
  41869. children.push({
  41870. name: "#text",
  41871. value
  41872. });
  41873. } else {
  41874. children.push(value);
  41875. }
  41876. const style = toStyle(this, "font", "margin", "visibility");
  41877. switch (this.placement) {
  41878. case "left":
  41879. case "right":
  41880. if (this.reserve > 0) {
  41881. style.width = measureToString(this.reserve);
  41882. }
  41883. break;
  41884. case "top":
  41885. case "bottom":
  41886. if (this.reserve > 0) {
  41887. style.height = measureToString(this.reserve);
  41888. }
  41889. break;
  41890. }
  41891. setPara(this, null, value);
  41892. this[$popPara]();
  41893. this.reserve = savedReserve;
  41894. return HTMLResult.success({
  41895. name: "div",
  41896. attributes: {
  41897. style,
  41898. class: ["xfaCaption"]
  41899. },
  41900. children
  41901. });
  41902. }
  41903. }
  41904. class Certificate extends StringObject {
  41905. constructor(attributes) {
  41906. super(TEMPLATE_NS_ID, "certificate");
  41907. this.id = attributes.id || "";
  41908. this.name = attributes.name || "";
  41909. this.use = attributes.use || "";
  41910. this.usehref = attributes.usehref || "";
  41911. }
  41912. }
  41913. class Certificates extends XFAObject {
  41914. constructor(attributes) {
  41915. super(TEMPLATE_NS_ID, "certificates", true);
  41916. this.credentialServerPolicy = getStringOption(attributes.credentialServerPolicy, ["optional", "required"]);
  41917. this.id = attributes.id || "";
  41918. this.url = attributes.url || "";
  41919. this.urlPolicy = attributes.urlPolicy || "";
  41920. this.use = attributes.use || "";
  41921. this.usehref = attributes.usehref || "";
  41922. this.encryption = null;
  41923. this.issuers = null;
  41924. this.keyUsage = null;
  41925. this.oids = null;
  41926. this.signing = null;
  41927. this.subjectDNs = null;
  41928. }
  41929. }
  41930. class CheckButton extends XFAObject {
  41931. constructor(attributes) {
  41932. super(TEMPLATE_NS_ID, "checkButton", true);
  41933. this.id = attributes.id || "";
  41934. this.mark = getStringOption(attributes.mark, ["default", "check", "circle", "cross", "diamond", "square", "star"]);
  41935. this.shape = getStringOption(attributes.shape, ["square", "round"]);
  41936. this.size = getMeasurement(attributes.size, "10pt");
  41937. this.use = attributes.use || "";
  41938. this.usehref = attributes.usehref || "";
  41939. this.border = null;
  41940. this.extras = null;
  41941. this.margin = null;
  41942. }
  41943. [$toHTML](availableSpace) {
  41944. const style = toStyle("margin");
  41945. const size = measureToString(this.size);
  41946. style.width = style.height = size;
  41947. let type;
  41948. let className;
  41949. let groupId;
  41950. const field = this[$getParent]()[$getParent]();
  41951. const items = field.items.children.length && field.items.children[0][$toHTML]().html || [];
  41952. const exportedValue = {
  41953. on: (items[0] !== undefined ? items[0] : "on").toString(),
  41954. off: (items[1] !== undefined ? items[1] : "off").toString()
  41955. };
  41956. const value = field.value?.[$text]() || "off";
  41957. const checked = value === exportedValue.on || undefined;
  41958. const container = field[$getSubformParent]();
  41959. const fieldId = field[$uid];
  41960. let dataId;
  41961. if (container instanceof ExclGroup) {
  41962. groupId = container[$uid];
  41963. type = "radio";
  41964. className = "xfaRadio";
  41965. dataId = container[$data]?.[$uid] || container[$uid];
  41966. } else {
  41967. type = "checkbox";
  41968. className = "xfaCheckbox";
  41969. dataId = field[$data]?.[$uid] || field[$uid];
  41970. }
  41971. const input = {
  41972. name: "input",
  41973. attributes: {
  41974. class: [className],
  41975. style,
  41976. fieldId,
  41977. dataId,
  41978. type,
  41979. checked,
  41980. xfaOn: exportedValue.on,
  41981. xfaOff: exportedValue.off,
  41982. "aria-label": ariaLabel(field),
  41983. "aria-required": false
  41984. }
  41985. };
  41986. if (groupId) {
  41987. input.attributes.name = groupId;
  41988. }
  41989. if (isRequired(field)) {
  41990. input.attributes["aria-required"] = true;
  41991. input.attributes.required = true;
  41992. }
  41993. return HTMLResult.success({
  41994. name: "label",
  41995. attributes: {
  41996. class: ["xfaLabel"]
  41997. },
  41998. children: [input]
  41999. });
  42000. }
  42001. }
  42002. class ChoiceList extends XFAObject {
  42003. constructor(attributes) {
  42004. super(TEMPLATE_NS_ID, "choiceList", true);
  42005. this.commitOn = getStringOption(attributes.commitOn, ["select", "exit"]);
  42006. this.id = attributes.id || "";
  42007. this.open = getStringOption(attributes.open, ["userControl", "always", "multiSelect", "onEntry"]);
  42008. this.textEntry = getInteger({
  42009. data: attributes.textEntry,
  42010. defaultValue: 0,
  42011. validate: x => x === 1
  42012. });
  42013. this.use = attributes.use || "";
  42014. this.usehref = attributes.usehref || "";
  42015. this.border = null;
  42016. this.extras = null;
  42017. this.margin = null;
  42018. }
  42019. [$toHTML](availableSpace) {
  42020. const style = toStyle(this, "border", "margin");
  42021. const ui = this[$getParent]();
  42022. const field = ui[$getParent]();
  42023. const fontSize = field.font?.size || 10;
  42024. const optionStyle = {
  42025. fontSize: `calc(${fontSize}px * var(--scale-factor))`
  42026. };
  42027. const children = [];
  42028. if (field.items.children.length > 0) {
  42029. const items = field.items;
  42030. let displayedIndex = 0;
  42031. let saveIndex = 0;
  42032. if (items.children.length === 2) {
  42033. displayedIndex = items.children[0].save;
  42034. saveIndex = 1 - displayedIndex;
  42035. }
  42036. const displayed = items.children[displayedIndex][$toHTML]().html;
  42037. const values = items.children[saveIndex][$toHTML]().html;
  42038. let selected = false;
  42039. const value = field.value?.[$text]() || "";
  42040. for (let i = 0, ii = displayed.length; i < ii; i++) {
  42041. const option = {
  42042. name: "option",
  42043. attributes: {
  42044. value: values[i] || displayed[i],
  42045. style: optionStyle
  42046. },
  42047. value: displayed[i]
  42048. };
  42049. if (values[i] === value) {
  42050. option.attributes.selected = selected = true;
  42051. }
  42052. children.push(option);
  42053. }
  42054. if (!selected) {
  42055. children.splice(0, 0, {
  42056. name: "option",
  42057. attributes: {
  42058. hidden: true,
  42059. selected: true
  42060. },
  42061. value: " "
  42062. });
  42063. }
  42064. }
  42065. const selectAttributes = {
  42066. class: ["xfaSelect"],
  42067. fieldId: field[$uid],
  42068. dataId: field[$data]?.[$uid] || field[$uid],
  42069. style,
  42070. "aria-label": ariaLabel(field),
  42071. "aria-required": false
  42072. };
  42073. if (isRequired(field)) {
  42074. selectAttributes["aria-required"] = true;
  42075. selectAttributes.required = true;
  42076. }
  42077. if (this.open === "multiSelect") {
  42078. selectAttributes.multiple = true;
  42079. }
  42080. return HTMLResult.success({
  42081. name: "label",
  42082. attributes: {
  42083. class: ["xfaLabel"]
  42084. },
  42085. children: [{
  42086. name: "select",
  42087. children,
  42088. attributes: selectAttributes
  42089. }]
  42090. });
  42091. }
  42092. }
  42093. class Color extends XFAObject {
  42094. constructor(attributes) {
  42095. super(TEMPLATE_NS_ID, "color", true);
  42096. this.cSpace = getStringOption(attributes.cSpace, ["SRGB"]);
  42097. this.id = attributes.id || "";
  42098. this.use = attributes.use || "";
  42099. this.usehref = attributes.usehref || "";
  42100. this.value = attributes.value ? getColor(attributes.value) : "";
  42101. this.extras = null;
  42102. }
  42103. [$hasSettableValue]() {
  42104. return false;
  42105. }
  42106. [$toStyle]() {
  42107. return this.value ? Util.makeHexColor(this.value.r, this.value.g, this.value.b) : null;
  42108. }
  42109. }
  42110. class Comb extends XFAObject {
  42111. constructor(attributes) {
  42112. super(TEMPLATE_NS_ID, "comb");
  42113. this.id = attributes.id || "";
  42114. this.numberOfCells = getInteger({
  42115. data: attributes.numberOfCells,
  42116. defaultValue: 0,
  42117. validate: x => x >= 0
  42118. });
  42119. this.use = attributes.use || "";
  42120. this.usehref = attributes.usehref || "";
  42121. }
  42122. }
  42123. class Connect extends XFAObject {
  42124. constructor(attributes) {
  42125. super(TEMPLATE_NS_ID, "connect", true);
  42126. this.connection = attributes.connection || "";
  42127. this.id = attributes.id || "";
  42128. this.ref = attributes.ref || "";
  42129. this.usage = getStringOption(attributes.usage, ["exportAndImport", "exportOnly", "importOnly"]);
  42130. this.use = attributes.use || "";
  42131. this.usehref = attributes.usehref || "";
  42132. this.picture = null;
  42133. }
  42134. }
  42135. class ContentArea extends XFAObject {
  42136. constructor(attributes) {
  42137. super(TEMPLATE_NS_ID, "contentArea", true);
  42138. this.h = getMeasurement(attributes.h);
  42139. this.id = attributes.id || "";
  42140. this.name = attributes.name || "";
  42141. this.relevant = getRelevant(attributes.relevant);
  42142. this.use = attributes.use || "";
  42143. this.usehref = attributes.usehref || "";
  42144. this.w = getMeasurement(attributes.w);
  42145. this.x = getMeasurement(attributes.x, "0pt");
  42146. this.y = getMeasurement(attributes.y, "0pt");
  42147. this.desc = null;
  42148. this.extras = null;
  42149. }
  42150. [$toHTML](availableSpace) {
  42151. const left = measureToString(this.x);
  42152. const top = measureToString(this.y);
  42153. const style = {
  42154. left,
  42155. top,
  42156. width: measureToString(this.w),
  42157. height: measureToString(this.h)
  42158. };
  42159. const classNames = ["xfaContentarea"];
  42160. if (isPrintOnly(this)) {
  42161. classNames.push("xfaPrintOnly");
  42162. }
  42163. return HTMLResult.success({
  42164. name: "div",
  42165. children: [],
  42166. attributes: {
  42167. style,
  42168. class: classNames,
  42169. id: this[$uid]
  42170. }
  42171. });
  42172. }
  42173. }
  42174. class Corner extends XFAObject {
  42175. constructor(attributes) {
  42176. super(TEMPLATE_NS_ID, "corner", true);
  42177. this.id = attributes.id || "";
  42178. this.inverted = getInteger({
  42179. data: attributes.inverted,
  42180. defaultValue: 0,
  42181. validate: x => x === 1
  42182. });
  42183. this.join = getStringOption(attributes.join, ["square", "round"]);
  42184. this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]);
  42185. this.radius = getMeasurement(attributes.radius);
  42186. this.stroke = getStringOption(attributes.stroke, ["solid", "dashDot", "dashDotDot", "dashed", "dotted", "embossed", "etched", "lowered", "raised"]);
  42187. this.thickness = getMeasurement(attributes.thickness, "0.5pt");
  42188. this.use = attributes.use || "";
  42189. this.usehref = attributes.usehref || "";
  42190. this.color = null;
  42191. this.extras = null;
  42192. }
  42193. [$toStyle]() {
  42194. const style = toStyle(this, "visibility");
  42195. style.radius = measureToString(this.join === "square" ? 0 : this.radius);
  42196. return style;
  42197. }
  42198. }
  42199. class DateElement extends ContentObject {
  42200. constructor(attributes) {
  42201. super(TEMPLATE_NS_ID, "date");
  42202. this.id = attributes.id || "";
  42203. this.name = attributes.name || "";
  42204. this.use = attributes.use || "";
  42205. this.usehref = attributes.usehref || "";
  42206. }
  42207. [$finalize]() {
  42208. const date = this[$content].trim();
  42209. this[$content] = date ? new Date(date) : null;
  42210. }
  42211. [$toHTML](availableSpace) {
  42212. return valueToHtml(this[$content] ? this[$content].toString() : "");
  42213. }
  42214. }
  42215. class DateTime extends ContentObject {
  42216. constructor(attributes) {
  42217. super(TEMPLATE_NS_ID, "dateTime");
  42218. this.id = attributes.id || "";
  42219. this.name = attributes.name || "";
  42220. this.use = attributes.use || "";
  42221. this.usehref = attributes.usehref || "";
  42222. }
  42223. [$finalize]() {
  42224. const date = this[$content].trim();
  42225. this[$content] = date ? new Date(date) : null;
  42226. }
  42227. [$toHTML](availableSpace) {
  42228. return valueToHtml(this[$content] ? this[$content].toString() : "");
  42229. }
  42230. }
  42231. class DateTimeEdit extends XFAObject {
  42232. constructor(attributes) {
  42233. super(TEMPLATE_NS_ID, "dateTimeEdit", true);
  42234. this.hScrollPolicy = getStringOption(attributes.hScrollPolicy, ["auto", "off", "on"]);
  42235. this.id = attributes.id || "";
  42236. this.picker = getStringOption(attributes.picker, ["host", "none"]);
  42237. this.use = attributes.use || "";
  42238. this.usehref = attributes.usehref || "";
  42239. this.border = null;
  42240. this.comb = null;
  42241. this.extras = null;
  42242. this.margin = null;
  42243. }
  42244. [$toHTML](availableSpace) {
  42245. const style = toStyle(this, "border", "font", "margin");
  42246. const field = this[$getParent]()[$getParent]();
  42247. const html = {
  42248. name: "input",
  42249. attributes: {
  42250. type: "text",
  42251. fieldId: field[$uid],
  42252. dataId: field[$data]?.[$uid] || field[$uid],
  42253. class: ["xfaTextfield"],
  42254. style,
  42255. "aria-label": ariaLabel(field),
  42256. "aria-required": false
  42257. }
  42258. };
  42259. if (isRequired(field)) {
  42260. html.attributes["aria-required"] = true;
  42261. html.attributes.required = true;
  42262. }
  42263. return HTMLResult.success({
  42264. name: "label",
  42265. attributes: {
  42266. class: ["xfaLabel"]
  42267. },
  42268. children: [html]
  42269. });
  42270. }
  42271. }
  42272. class Decimal extends ContentObject {
  42273. constructor(attributes) {
  42274. super(TEMPLATE_NS_ID, "decimal");
  42275. this.fracDigits = getInteger({
  42276. data: attributes.fracDigits,
  42277. defaultValue: 2,
  42278. validate: x => true
  42279. });
  42280. this.id = attributes.id || "";
  42281. this.leadDigits = getInteger({
  42282. data: attributes.leadDigits,
  42283. defaultValue: -1,
  42284. validate: x => true
  42285. });
  42286. this.name = attributes.name || "";
  42287. this.use = attributes.use || "";
  42288. this.usehref = attributes.usehref || "";
  42289. }
  42290. [$finalize]() {
  42291. const number = parseFloat(this[$content].trim());
  42292. this[$content] = isNaN(number) ? null : number;
  42293. }
  42294. [$toHTML](availableSpace) {
  42295. return valueToHtml(this[$content] !== null ? this[$content].toString() : "");
  42296. }
  42297. }
  42298. class DefaultUi extends XFAObject {
  42299. constructor(attributes) {
  42300. super(TEMPLATE_NS_ID, "defaultUi", true);
  42301. this.id = attributes.id || "";
  42302. this.use = attributes.use || "";
  42303. this.usehref = attributes.usehref || "";
  42304. this.extras = null;
  42305. }
  42306. }
  42307. class Desc extends XFAObject {
  42308. constructor(attributes) {
  42309. super(TEMPLATE_NS_ID, "desc", true);
  42310. this.id = attributes.id || "";
  42311. this.use = attributes.use || "";
  42312. this.usehref = attributes.usehref || "";
  42313. this.boolean = new XFAObjectArray();
  42314. this.date = new XFAObjectArray();
  42315. this.dateTime = new XFAObjectArray();
  42316. this.decimal = new XFAObjectArray();
  42317. this.exData = new XFAObjectArray();
  42318. this.float = new XFAObjectArray();
  42319. this.image = new XFAObjectArray();
  42320. this.integer = new XFAObjectArray();
  42321. this.text = new XFAObjectArray();
  42322. this.time = new XFAObjectArray();
  42323. }
  42324. }
  42325. class DigestMethod extends OptionObject {
  42326. constructor(attributes) {
  42327. super(TEMPLATE_NS_ID, "digestMethod", ["", "SHA1", "SHA256", "SHA512", "RIPEMD160"]);
  42328. this.id = attributes.id || "";
  42329. this.use = attributes.use || "";
  42330. this.usehref = attributes.usehref || "";
  42331. }
  42332. }
  42333. class DigestMethods extends XFAObject {
  42334. constructor(attributes) {
  42335. super(TEMPLATE_NS_ID, "digestMethods", true);
  42336. this.id = attributes.id || "";
  42337. this.type = getStringOption(attributes.type, ["optional", "required"]);
  42338. this.use = attributes.use || "";
  42339. this.usehref = attributes.usehref || "";
  42340. this.digestMethod = new XFAObjectArray();
  42341. }
  42342. }
  42343. class Draw extends XFAObject {
  42344. constructor(attributes) {
  42345. super(TEMPLATE_NS_ID, "draw", true);
  42346. this.anchorType = getStringOption(attributes.anchorType, ["topLeft", "bottomCenter", "bottomLeft", "bottomRight", "middleCenter", "middleLeft", "middleRight", "topCenter", "topRight"]);
  42347. this.colSpan = getInteger({
  42348. data: attributes.colSpan,
  42349. defaultValue: 1,
  42350. validate: n => n >= 1 || n === -1
  42351. });
  42352. this.h = attributes.h ? getMeasurement(attributes.h) : "";
  42353. this.hAlign = getStringOption(attributes.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]);
  42354. this.id = attributes.id || "";
  42355. this.locale = attributes.locale || "";
  42356. this.maxH = getMeasurement(attributes.maxH, "0pt");
  42357. this.maxW = getMeasurement(attributes.maxW, "0pt");
  42358. this.minH = getMeasurement(attributes.minH, "0pt");
  42359. this.minW = getMeasurement(attributes.minW, "0pt");
  42360. this.name = attributes.name || "";
  42361. this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]);
  42362. this.relevant = getRelevant(attributes.relevant);
  42363. this.rotate = getInteger({
  42364. data: attributes.rotate,
  42365. defaultValue: 0,
  42366. validate: x => x % 90 === 0
  42367. });
  42368. this.use = attributes.use || "";
  42369. this.usehref = attributes.usehref || "";
  42370. this.w = attributes.w ? getMeasurement(attributes.w) : "";
  42371. this.x = getMeasurement(attributes.x, "0pt");
  42372. this.y = getMeasurement(attributes.y, "0pt");
  42373. this.assist = null;
  42374. this.border = null;
  42375. this.caption = null;
  42376. this.desc = null;
  42377. this.extras = null;
  42378. this.font = null;
  42379. this.keep = null;
  42380. this.margin = null;
  42381. this.para = null;
  42382. this.traversal = null;
  42383. this.ui = null;
  42384. this.value = null;
  42385. this.setProperty = new XFAObjectArray();
  42386. }
  42387. [$setValue](value) {
  42388. _setValue(this, value);
  42389. }
  42390. [$toHTML](availableSpace) {
  42391. setTabIndex(this);
  42392. if (this.presence === "hidden" || this.presence === "inactive") {
  42393. return HTMLResult.EMPTY;
  42394. }
  42395. fixDimensions(this);
  42396. this[$pushPara]();
  42397. const savedW = this.w;
  42398. const savedH = this.h;
  42399. const {
  42400. w,
  42401. h,
  42402. isBroken
  42403. } = layoutNode(this, availableSpace);
  42404. if (w && this.w === "") {
  42405. if (isBroken && this[$getSubformParent]()[$isThereMoreWidth]()) {
  42406. this[$popPara]();
  42407. return HTMLResult.FAILURE;
  42408. }
  42409. this.w = w;
  42410. }
  42411. if (h && this.h === "") {
  42412. this.h = h;
  42413. }
  42414. setFirstUnsplittable(this);
  42415. if (!checkDimensions(this, availableSpace)) {
  42416. this.w = savedW;
  42417. this.h = savedH;
  42418. this[$popPara]();
  42419. return HTMLResult.FAILURE;
  42420. }
  42421. unsetFirstUnsplittable(this);
  42422. const style = toStyle(this, "font", "hAlign", "dimensions", "position", "presence", "rotate", "anchorType", "border", "margin");
  42423. setMinMaxDimensions(this, style);
  42424. if (style.margin) {
  42425. style.padding = style.margin;
  42426. delete style.margin;
  42427. }
  42428. const classNames = ["xfaDraw"];
  42429. if (this.font) {
  42430. classNames.push("xfaFont");
  42431. }
  42432. if (isPrintOnly(this)) {
  42433. classNames.push("xfaPrintOnly");
  42434. }
  42435. const attributes = {
  42436. style,
  42437. id: this[$uid],
  42438. class: classNames
  42439. };
  42440. if (this.name) {
  42441. attributes.xfaName = this.name;
  42442. }
  42443. const html = {
  42444. name: "div",
  42445. attributes,
  42446. children: []
  42447. };
  42448. applyAssist(this, attributes);
  42449. const bbox = computeBbox(this, html, availableSpace);
  42450. const value = this.value ? this.value[$toHTML](availableSpace).html : null;
  42451. if (value === null) {
  42452. this.w = savedW;
  42453. this.h = savedH;
  42454. this[$popPara]();
  42455. return HTMLResult.success(createWrapper(this, html), bbox);
  42456. }
  42457. html.children.push(value);
  42458. setPara(this, style, value);
  42459. this.w = savedW;
  42460. this.h = savedH;
  42461. this[$popPara]();
  42462. return HTMLResult.success(createWrapper(this, html), bbox);
  42463. }
  42464. }
  42465. class Edge extends XFAObject {
  42466. constructor(attributes) {
  42467. super(TEMPLATE_NS_ID, "edge", true);
  42468. this.cap = getStringOption(attributes.cap, ["square", "butt", "round"]);
  42469. this.id = attributes.id || "";
  42470. this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]);
  42471. this.stroke = getStringOption(attributes.stroke, ["solid", "dashDot", "dashDotDot", "dashed", "dotted", "embossed", "etched", "lowered", "raised"]);
  42472. this.thickness = getMeasurement(attributes.thickness, "0.5pt");
  42473. this.use = attributes.use || "";
  42474. this.usehref = attributes.usehref || "";
  42475. this.color = null;
  42476. this.extras = null;
  42477. }
  42478. [$toStyle]() {
  42479. const style = toStyle(this, "visibility");
  42480. Object.assign(style, {
  42481. linecap: this.cap,
  42482. width: measureToString(this.thickness),
  42483. color: this.color ? this.color[$toStyle]() : "#000000",
  42484. style: ""
  42485. });
  42486. if (this.presence !== "visible") {
  42487. style.style = "none";
  42488. } else {
  42489. switch (this.stroke) {
  42490. case "solid":
  42491. style.style = "solid";
  42492. break;
  42493. case "dashDot":
  42494. style.style = "dashed";
  42495. break;
  42496. case "dashDotDot":
  42497. style.style = "dashed";
  42498. break;
  42499. case "dashed":
  42500. style.style = "dashed";
  42501. break;
  42502. case "dotted":
  42503. style.style = "dotted";
  42504. break;
  42505. case "embossed":
  42506. style.style = "ridge";
  42507. break;
  42508. case "etched":
  42509. style.style = "groove";
  42510. break;
  42511. case "lowered":
  42512. style.style = "inset";
  42513. break;
  42514. case "raised":
  42515. style.style = "outset";
  42516. break;
  42517. }
  42518. }
  42519. return style;
  42520. }
  42521. }
  42522. class Encoding extends OptionObject {
  42523. constructor(attributes) {
  42524. super(TEMPLATE_NS_ID, "encoding", ["adbe.x509.rsa_sha1", "adbe.pkcs7.detached", "adbe.pkcs7.sha1"]);
  42525. this.id = attributes.id || "";
  42526. this.use = attributes.use || "";
  42527. this.usehref = attributes.usehref || "";
  42528. }
  42529. }
  42530. class Encodings extends XFAObject {
  42531. constructor(attributes) {
  42532. super(TEMPLATE_NS_ID, "encodings", true);
  42533. this.id = attributes.id || "";
  42534. this.type = getStringOption(attributes.type, ["optional", "required"]);
  42535. this.use = attributes.use || "";
  42536. this.usehref = attributes.usehref || "";
  42537. this.encoding = new XFAObjectArray();
  42538. }
  42539. }
  42540. class Encrypt extends XFAObject {
  42541. constructor(attributes) {
  42542. super(TEMPLATE_NS_ID, "encrypt", true);
  42543. this.id = attributes.id || "";
  42544. this.use = attributes.use || "";
  42545. this.usehref = attributes.usehref || "";
  42546. this.certificate = null;
  42547. }
  42548. }
  42549. class EncryptData extends XFAObject {
  42550. constructor(attributes) {
  42551. super(TEMPLATE_NS_ID, "encryptData", true);
  42552. this.id = attributes.id || "";
  42553. this.operation = getStringOption(attributes.operation, ["encrypt", "decrypt"]);
  42554. this.target = attributes.target || "";
  42555. this.use = attributes.use || "";
  42556. this.usehref = attributes.usehref || "";
  42557. this.filter = null;
  42558. this.manifest = null;
  42559. }
  42560. }
  42561. class Encryption extends XFAObject {
  42562. constructor(attributes) {
  42563. super(TEMPLATE_NS_ID, "encryption", true);
  42564. this.id = attributes.id || "";
  42565. this.type = getStringOption(attributes.type, ["optional", "required"]);
  42566. this.use = attributes.use || "";
  42567. this.usehref = attributes.usehref || "";
  42568. this.certificate = new XFAObjectArray();
  42569. }
  42570. }
  42571. class EncryptionMethod extends OptionObject {
  42572. constructor(attributes) {
  42573. super(TEMPLATE_NS_ID, "encryptionMethod", ["", "AES256-CBC", "TRIPLEDES-CBC", "AES128-CBC", "AES192-CBC"]);
  42574. this.id = attributes.id || "";
  42575. this.use = attributes.use || "";
  42576. this.usehref = attributes.usehref || "";
  42577. }
  42578. }
  42579. class EncryptionMethods extends XFAObject {
  42580. constructor(attributes) {
  42581. super(TEMPLATE_NS_ID, "encryptionMethods", true);
  42582. this.id = attributes.id || "";
  42583. this.type = getStringOption(attributes.type, ["optional", "required"]);
  42584. this.use = attributes.use || "";
  42585. this.usehref = attributes.usehref || "";
  42586. this.encryptionMethod = new XFAObjectArray();
  42587. }
  42588. }
  42589. class Event extends XFAObject {
  42590. constructor(attributes) {
  42591. super(TEMPLATE_NS_ID, "event", true);
  42592. 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"]);
  42593. this.id = attributes.id || "";
  42594. this.listen = getStringOption(attributes.listen, ["refOnly", "refAndDescendents"]);
  42595. this.name = attributes.name || "";
  42596. this.ref = attributes.ref || "";
  42597. this.use = attributes.use || "";
  42598. this.usehref = attributes.usehref || "";
  42599. this.extras = null;
  42600. this.encryptData = null;
  42601. this.execute = null;
  42602. this.script = null;
  42603. this.signData = null;
  42604. this.submit = null;
  42605. }
  42606. }
  42607. class ExData extends ContentObject {
  42608. constructor(attributes) {
  42609. super(TEMPLATE_NS_ID, "exData");
  42610. this.contentType = attributes.contentType || "";
  42611. this.href = attributes.href || "";
  42612. this.id = attributes.id || "";
  42613. this.maxLength = getInteger({
  42614. data: attributes.maxLength,
  42615. defaultValue: -1,
  42616. validate: x => x >= -1
  42617. });
  42618. this.name = attributes.name || "";
  42619. this.rid = attributes.rid || "";
  42620. this.transferEncoding = getStringOption(attributes.transferEncoding, ["none", "base64", "package"]);
  42621. this.use = attributes.use || "";
  42622. this.usehref = attributes.usehref || "";
  42623. }
  42624. [$isCDATAXml]() {
  42625. return this.contentType === "text/html";
  42626. }
  42627. [$onChild](child) {
  42628. if (this.contentType === "text/html" && child[$namespaceId] === NamespaceIds.xhtml.id) {
  42629. this[$content] = child;
  42630. return true;
  42631. }
  42632. if (this.contentType === "text/xml") {
  42633. this[$content] = child;
  42634. return true;
  42635. }
  42636. return false;
  42637. }
  42638. [$toHTML](availableSpace) {
  42639. if (this.contentType !== "text/html" || !this[$content]) {
  42640. return HTMLResult.EMPTY;
  42641. }
  42642. return this[$content][$toHTML](availableSpace);
  42643. }
  42644. }
  42645. class ExObject extends XFAObject {
  42646. constructor(attributes) {
  42647. super(TEMPLATE_NS_ID, "exObject", true);
  42648. this.archive = attributes.archive || "";
  42649. this.classId = attributes.classId || "";
  42650. this.codeBase = attributes.codeBase || "";
  42651. this.codeType = attributes.codeType || "";
  42652. this.id = attributes.id || "";
  42653. this.name = attributes.name || "";
  42654. this.use = attributes.use || "";
  42655. this.usehref = attributes.usehref || "";
  42656. this.extras = null;
  42657. this.boolean = new XFAObjectArray();
  42658. this.date = new XFAObjectArray();
  42659. this.dateTime = new XFAObjectArray();
  42660. this.decimal = new XFAObjectArray();
  42661. this.exData = new XFAObjectArray();
  42662. this.exObject = new XFAObjectArray();
  42663. this.float = new XFAObjectArray();
  42664. this.image = new XFAObjectArray();
  42665. this.integer = new XFAObjectArray();
  42666. this.text = new XFAObjectArray();
  42667. this.time = new XFAObjectArray();
  42668. }
  42669. }
  42670. class ExclGroup extends XFAObject {
  42671. constructor(attributes) {
  42672. super(TEMPLATE_NS_ID, "exclGroup", true);
  42673. this.access = getStringOption(attributes.access, ["open", "nonInteractive", "protected", "readOnly"]);
  42674. this.accessKey = attributes.accessKey || "";
  42675. this.anchorType = getStringOption(attributes.anchorType, ["topLeft", "bottomCenter", "bottomLeft", "bottomRight", "middleCenter", "middleLeft", "middleRight", "topCenter", "topRight"]);
  42676. this.colSpan = getInteger({
  42677. data: attributes.colSpan,
  42678. defaultValue: 1,
  42679. validate: n => n >= 1 || n === -1
  42680. });
  42681. this.h = attributes.h ? getMeasurement(attributes.h) : "";
  42682. this.hAlign = getStringOption(attributes.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]);
  42683. this.id = attributes.id || "";
  42684. this.layout = getStringOption(attributes.layout, ["position", "lr-tb", "rl-row", "rl-tb", "row", "table", "tb"]);
  42685. this.maxH = getMeasurement(attributes.maxH, "0pt");
  42686. this.maxW = getMeasurement(attributes.maxW, "0pt");
  42687. this.minH = getMeasurement(attributes.minH, "0pt");
  42688. this.minW = getMeasurement(attributes.minW, "0pt");
  42689. this.name = attributes.name || "";
  42690. this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]);
  42691. this.relevant = getRelevant(attributes.relevant);
  42692. this.use = attributes.use || "";
  42693. this.usehref = attributes.usehref || "";
  42694. this.w = attributes.w ? getMeasurement(attributes.w) : "";
  42695. this.x = getMeasurement(attributes.x, "0pt");
  42696. this.y = getMeasurement(attributes.y, "0pt");
  42697. this.assist = null;
  42698. this.bind = null;
  42699. this.border = null;
  42700. this.calculate = null;
  42701. this.caption = null;
  42702. this.desc = null;
  42703. this.extras = null;
  42704. this.margin = null;
  42705. this.para = null;
  42706. this.traversal = null;
  42707. this.validate = null;
  42708. this.connect = new XFAObjectArray();
  42709. this.event = new XFAObjectArray();
  42710. this.field = new XFAObjectArray();
  42711. this.setProperty = new XFAObjectArray();
  42712. }
  42713. [$isBindable]() {
  42714. return true;
  42715. }
  42716. [$hasSettableValue]() {
  42717. return true;
  42718. }
  42719. [$setValue](value) {
  42720. for (const field of this.field.children) {
  42721. if (!field.value) {
  42722. const nodeValue = new Value({});
  42723. field[$appendChild](nodeValue);
  42724. field.value = nodeValue;
  42725. }
  42726. field.value[$setValue](value);
  42727. }
  42728. }
  42729. [$isThereMoreWidth]() {
  42730. return this.layout.endsWith("-tb") && this[$extra].attempt === 0 && this[$extra].numberInLine > 0 || this[$getParent]()[$isThereMoreWidth]();
  42731. }
  42732. [$isSplittable]() {
  42733. const parent = this[$getSubformParent]();
  42734. if (!parent[$isSplittable]()) {
  42735. return false;
  42736. }
  42737. if (this[$extra]._isSplittable !== undefined) {
  42738. return this[$extra]._isSplittable;
  42739. }
  42740. if (this.layout === "position" || this.layout.includes("row")) {
  42741. this[$extra]._isSplittable = false;
  42742. return false;
  42743. }
  42744. if (parent.layout?.endsWith("-tb") && parent[$extra].numberInLine !== 0) {
  42745. return false;
  42746. }
  42747. this[$extra]._isSplittable = true;
  42748. return true;
  42749. }
  42750. [$flushHTML]() {
  42751. return flushHTML(this);
  42752. }
  42753. [$addHTML](html, bbox) {
  42754. addHTML(this, html, bbox);
  42755. }
  42756. [$getAvailableSpace]() {
  42757. return getAvailableSpace(this);
  42758. }
  42759. [$toHTML](availableSpace) {
  42760. setTabIndex(this);
  42761. if (this.presence === "hidden" || this.presence === "inactive" || this.h === 0 || this.w === 0) {
  42762. return HTMLResult.EMPTY;
  42763. }
  42764. fixDimensions(this);
  42765. const children = [];
  42766. const attributes = {
  42767. id: this[$uid],
  42768. class: []
  42769. };
  42770. setAccess(this, attributes.class);
  42771. if (!this[$extra]) {
  42772. this[$extra] = Object.create(null);
  42773. }
  42774. Object.assign(this[$extra], {
  42775. children,
  42776. attributes,
  42777. attempt: 0,
  42778. line: null,
  42779. numberInLine: 0,
  42780. availableSpace: {
  42781. width: Math.min(this.w || Infinity, availableSpace.width),
  42782. height: Math.min(this.h || Infinity, availableSpace.height)
  42783. },
  42784. width: 0,
  42785. height: 0,
  42786. prevHeight: 0,
  42787. currentWidth: 0
  42788. });
  42789. const isSplittable = this[$isSplittable]();
  42790. if (!isSplittable) {
  42791. setFirstUnsplittable(this);
  42792. }
  42793. if (!checkDimensions(this, availableSpace)) {
  42794. return HTMLResult.FAILURE;
  42795. }
  42796. const filter = new Set(["field"]);
  42797. if (this.layout.includes("row")) {
  42798. const columnWidths = this[$getSubformParent]().columnWidths;
  42799. if (Array.isArray(columnWidths) && columnWidths.length > 0) {
  42800. this[$extra].columnWidths = columnWidths;
  42801. this[$extra].currentColumn = 0;
  42802. }
  42803. }
  42804. const style = toStyle(this, "anchorType", "dimensions", "position", "presence", "border", "margin", "hAlign");
  42805. const classNames = ["xfaExclgroup"];
  42806. const cl = layoutClass(this);
  42807. if (cl) {
  42808. classNames.push(cl);
  42809. }
  42810. if (isPrintOnly(this)) {
  42811. classNames.push("xfaPrintOnly");
  42812. }
  42813. attributes.style = style;
  42814. attributes.class = classNames;
  42815. if (this.name) {
  42816. attributes.xfaName = this.name;
  42817. }
  42818. this[$pushPara]();
  42819. const isLrTb = this.layout === "lr-tb" || this.layout === "rl-tb";
  42820. const maxRun = isLrTb ? MAX_ATTEMPTS_FOR_LRTB_LAYOUT : 1;
  42821. for (; this[$extra].attempt < maxRun; this[$extra].attempt++) {
  42822. if (isLrTb && this[$extra].attempt === MAX_ATTEMPTS_FOR_LRTB_LAYOUT - 1) {
  42823. this[$extra].numberInLine = 0;
  42824. }
  42825. const result = this[$childrenToHTML]({
  42826. filter,
  42827. include: true
  42828. });
  42829. if (result.success) {
  42830. break;
  42831. }
  42832. if (result.isBreak()) {
  42833. this[$popPara]();
  42834. return result;
  42835. }
  42836. if (isLrTb && this[$extra].attempt === 0 && this[$extra].numberInLine === 0 && !this[$getTemplateRoot]()[$extra].noLayoutFailure) {
  42837. this[$extra].attempt = maxRun;
  42838. break;
  42839. }
  42840. }
  42841. this[$popPara]();
  42842. if (!isSplittable) {
  42843. unsetFirstUnsplittable(this);
  42844. }
  42845. if (this[$extra].attempt === maxRun) {
  42846. if (!isSplittable) {
  42847. delete this[$extra];
  42848. }
  42849. return HTMLResult.FAILURE;
  42850. }
  42851. let marginH = 0;
  42852. let marginV = 0;
  42853. if (this.margin) {
  42854. marginH = this.margin.leftInset + this.margin.rightInset;
  42855. marginV = this.margin.topInset + this.margin.bottomInset;
  42856. }
  42857. const width = Math.max(this[$extra].width + marginH, this.w || 0);
  42858. const height = Math.max(this[$extra].height + marginV, this.h || 0);
  42859. const bbox = [this.x, this.y, width, height];
  42860. if (this.w === "") {
  42861. style.width = measureToString(width);
  42862. }
  42863. if (this.h === "") {
  42864. style.height = measureToString(height);
  42865. }
  42866. const html = {
  42867. name: "div",
  42868. attributes,
  42869. children
  42870. };
  42871. applyAssist(this, attributes);
  42872. delete this[$extra];
  42873. return HTMLResult.success(createWrapper(this, html), bbox);
  42874. }
  42875. }
  42876. class Execute extends XFAObject {
  42877. constructor(attributes) {
  42878. super(TEMPLATE_NS_ID, "execute");
  42879. this.connection = attributes.connection || "";
  42880. this.executeType = getStringOption(attributes.executeType, ["import", "remerge"]);
  42881. this.id = attributes.id || "";
  42882. this.runAt = getStringOption(attributes.runAt, ["client", "both", "server"]);
  42883. this.use = attributes.use || "";
  42884. this.usehref = attributes.usehref || "";
  42885. }
  42886. }
  42887. class Extras extends XFAObject {
  42888. constructor(attributes) {
  42889. super(TEMPLATE_NS_ID, "extras", true);
  42890. this.id = attributes.id || "";
  42891. this.name = attributes.name || "";
  42892. this.use = attributes.use || "";
  42893. this.usehref = attributes.usehref || "";
  42894. this.boolean = new XFAObjectArray();
  42895. this.date = new XFAObjectArray();
  42896. this.dateTime = new XFAObjectArray();
  42897. this.decimal = new XFAObjectArray();
  42898. this.exData = new XFAObjectArray();
  42899. this.extras = new XFAObjectArray();
  42900. this.float = new XFAObjectArray();
  42901. this.image = new XFAObjectArray();
  42902. this.integer = new XFAObjectArray();
  42903. this.text = new XFAObjectArray();
  42904. this.time = new XFAObjectArray();
  42905. }
  42906. }
  42907. class Field extends XFAObject {
  42908. constructor(attributes) {
  42909. super(TEMPLATE_NS_ID, "field", true);
  42910. this.access = getStringOption(attributes.access, ["open", "nonInteractive", "protected", "readOnly"]);
  42911. this.accessKey = attributes.accessKey || "";
  42912. this.anchorType = getStringOption(attributes.anchorType, ["topLeft", "bottomCenter", "bottomLeft", "bottomRight", "middleCenter", "middleLeft", "middleRight", "topCenter", "topRight"]);
  42913. this.colSpan = getInteger({
  42914. data: attributes.colSpan,
  42915. defaultValue: 1,
  42916. validate: n => n >= 1 || n === -1
  42917. });
  42918. this.h = attributes.h ? getMeasurement(attributes.h) : "";
  42919. this.hAlign = getStringOption(attributes.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]);
  42920. this.id = attributes.id || "";
  42921. this.locale = attributes.locale || "";
  42922. this.maxH = getMeasurement(attributes.maxH, "0pt");
  42923. this.maxW = getMeasurement(attributes.maxW, "0pt");
  42924. this.minH = getMeasurement(attributes.minH, "0pt");
  42925. this.minW = getMeasurement(attributes.minW, "0pt");
  42926. this.name = attributes.name || "";
  42927. this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]);
  42928. this.relevant = getRelevant(attributes.relevant);
  42929. this.rotate = getInteger({
  42930. data: attributes.rotate,
  42931. defaultValue: 0,
  42932. validate: x => x % 90 === 0
  42933. });
  42934. this.use = attributes.use || "";
  42935. this.usehref = attributes.usehref || "";
  42936. this.w = attributes.w ? getMeasurement(attributes.w) : "";
  42937. this.x = getMeasurement(attributes.x, "0pt");
  42938. this.y = getMeasurement(attributes.y, "0pt");
  42939. this.assist = null;
  42940. this.bind = null;
  42941. this.border = null;
  42942. this.calculate = null;
  42943. this.caption = null;
  42944. this.desc = null;
  42945. this.extras = null;
  42946. this.font = null;
  42947. this.format = null;
  42948. this.items = new XFAObjectArray(2);
  42949. this.keep = null;
  42950. this.margin = null;
  42951. this.para = null;
  42952. this.traversal = null;
  42953. this.ui = null;
  42954. this.validate = null;
  42955. this.value = null;
  42956. this.bindItems = new XFAObjectArray();
  42957. this.connect = new XFAObjectArray();
  42958. this.event = new XFAObjectArray();
  42959. this.setProperty = new XFAObjectArray();
  42960. }
  42961. [$isBindable]() {
  42962. return true;
  42963. }
  42964. [$setValue](value) {
  42965. _setValue(this, value);
  42966. }
  42967. [$toHTML](availableSpace) {
  42968. setTabIndex(this);
  42969. if (!this.ui) {
  42970. this.ui = new Ui({});
  42971. this.ui[$globalData] = this[$globalData];
  42972. this[$appendChild](this.ui);
  42973. let node;
  42974. switch (this.items.children.length) {
  42975. case 0:
  42976. node = new TextEdit({});
  42977. this.ui.textEdit = node;
  42978. break;
  42979. case 1:
  42980. node = new CheckButton({});
  42981. this.ui.checkButton = node;
  42982. break;
  42983. case 2:
  42984. node = new ChoiceList({});
  42985. this.ui.choiceList = node;
  42986. break;
  42987. }
  42988. this.ui[$appendChild](node);
  42989. }
  42990. if (!this.ui || this.presence === "hidden" || this.presence === "inactive" || this.h === 0 || this.w === 0) {
  42991. return HTMLResult.EMPTY;
  42992. }
  42993. if (this.caption) {
  42994. delete this.caption[$extra];
  42995. }
  42996. this[$pushPara]();
  42997. const caption = this.caption ? this.caption[$toHTML](availableSpace).html : null;
  42998. const savedW = this.w;
  42999. const savedH = this.h;
  43000. let marginH = 0;
  43001. let marginV = 0;
  43002. if (this.margin) {
  43003. marginH = this.margin.leftInset + this.margin.rightInset;
  43004. marginV = this.margin.topInset + this.margin.bottomInset;
  43005. }
  43006. let borderDims = null;
  43007. if (this.w === "" || this.h === "") {
  43008. let width = null;
  43009. let height = null;
  43010. let uiW = 0;
  43011. let uiH = 0;
  43012. if (this.ui.checkButton) {
  43013. uiW = uiH = this.ui.checkButton.size;
  43014. } else {
  43015. const {
  43016. w,
  43017. h
  43018. } = layoutNode(this, availableSpace);
  43019. if (w !== null) {
  43020. uiW = w;
  43021. uiH = h;
  43022. } else {
  43023. uiH = fonts_getMetrics(this.font, true).lineNoGap;
  43024. }
  43025. }
  43026. borderDims = getBorderDims(this.ui[$getExtra]());
  43027. uiW += borderDims.w;
  43028. uiH += borderDims.h;
  43029. if (this.caption) {
  43030. const {
  43031. w,
  43032. h,
  43033. isBroken
  43034. } = this.caption[$getExtra](availableSpace);
  43035. if (isBroken && this[$getSubformParent]()[$isThereMoreWidth]()) {
  43036. this[$popPara]();
  43037. return HTMLResult.FAILURE;
  43038. }
  43039. width = w;
  43040. height = h;
  43041. switch (this.caption.placement) {
  43042. case "left":
  43043. case "right":
  43044. case "inline":
  43045. width += uiW;
  43046. break;
  43047. case "top":
  43048. case "bottom":
  43049. height += uiH;
  43050. break;
  43051. }
  43052. } else {
  43053. width = uiW;
  43054. height = uiH;
  43055. }
  43056. if (width && this.w === "") {
  43057. width += marginH;
  43058. this.w = Math.min(this.maxW <= 0 ? Infinity : this.maxW, this.minW + 1 < width ? width : this.minW);
  43059. }
  43060. if (height && this.h === "") {
  43061. height += marginV;
  43062. this.h = Math.min(this.maxH <= 0 ? Infinity : this.maxH, this.minH + 1 < height ? height : this.minH);
  43063. }
  43064. }
  43065. this[$popPara]();
  43066. fixDimensions(this);
  43067. setFirstUnsplittable(this);
  43068. if (!checkDimensions(this, availableSpace)) {
  43069. this.w = savedW;
  43070. this.h = savedH;
  43071. this[$popPara]();
  43072. return HTMLResult.FAILURE;
  43073. }
  43074. unsetFirstUnsplittable(this);
  43075. const style = toStyle(this, "font", "dimensions", "position", "rotate", "anchorType", "presence", "margin", "hAlign");
  43076. setMinMaxDimensions(this, style);
  43077. const classNames = ["xfaField"];
  43078. if (this.font) {
  43079. classNames.push("xfaFont");
  43080. }
  43081. if (isPrintOnly(this)) {
  43082. classNames.push("xfaPrintOnly");
  43083. }
  43084. const attributes = {
  43085. style,
  43086. id: this[$uid],
  43087. class: classNames
  43088. };
  43089. if (style.margin) {
  43090. style.padding = style.margin;
  43091. delete style.margin;
  43092. }
  43093. setAccess(this, classNames);
  43094. if (this.name) {
  43095. attributes.xfaName = this.name;
  43096. }
  43097. const children = [];
  43098. const html = {
  43099. name: "div",
  43100. attributes,
  43101. children
  43102. };
  43103. applyAssist(this, attributes);
  43104. const borderStyle = this.border ? this.border[$toStyle]() : null;
  43105. const bbox = computeBbox(this, html, availableSpace);
  43106. const ui = this.ui[$toHTML]().html;
  43107. if (!ui) {
  43108. Object.assign(style, borderStyle);
  43109. return HTMLResult.success(createWrapper(this, html), bbox);
  43110. }
  43111. if (this[$tabIndex]) {
  43112. if (ui.children?.[0]) {
  43113. ui.children[0].attributes.tabindex = this[$tabIndex];
  43114. } else {
  43115. ui.attributes.tabindex = this[$tabIndex];
  43116. }
  43117. }
  43118. if (!ui.attributes.style) {
  43119. ui.attributes.style = Object.create(null);
  43120. }
  43121. let aElement = null;
  43122. if (this.ui.button) {
  43123. if (ui.children.length === 1) {
  43124. [aElement] = ui.children.splice(0, 1);
  43125. }
  43126. Object.assign(ui.attributes.style, borderStyle);
  43127. } else {
  43128. Object.assign(style, borderStyle);
  43129. }
  43130. children.push(ui);
  43131. if (this.value) {
  43132. if (this.ui.imageEdit) {
  43133. ui.children.push(this.value[$toHTML]().html);
  43134. } else if (!this.ui.button) {
  43135. let value = "";
  43136. if (this.value.exData) {
  43137. value = this.value.exData[$text]();
  43138. } else if (this.value.text) {
  43139. value = this.value.text[$getExtra]();
  43140. } else {
  43141. const htmlValue = this.value[$toHTML]().html;
  43142. if (htmlValue !== null) {
  43143. value = htmlValue.children[0].value;
  43144. }
  43145. }
  43146. if (this.ui.textEdit && this.value.text?.maxChars) {
  43147. ui.children[0].attributes.maxLength = this.value.text.maxChars;
  43148. }
  43149. if (value) {
  43150. if (this.ui.numericEdit) {
  43151. value = parseFloat(value);
  43152. value = isNaN(value) ? "" : value.toString();
  43153. }
  43154. if (ui.children[0].name === "textarea") {
  43155. ui.children[0].attributes.textContent = value;
  43156. } else {
  43157. ui.children[0].attributes.value = value;
  43158. }
  43159. }
  43160. }
  43161. }
  43162. if (!this.ui.imageEdit && ui.children?.[0] && this.h) {
  43163. borderDims = borderDims || getBorderDims(this.ui[$getExtra]());
  43164. let captionHeight = 0;
  43165. if (this.caption && ["top", "bottom"].includes(this.caption.placement)) {
  43166. captionHeight = this.caption.reserve;
  43167. if (captionHeight <= 0) {
  43168. captionHeight = this.caption[$getExtra](availableSpace).h;
  43169. }
  43170. const inputHeight = this.h - captionHeight - marginV - borderDims.h;
  43171. ui.children[0].attributes.style.height = measureToString(inputHeight);
  43172. } else {
  43173. ui.children[0].attributes.style.height = "100%";
  43174. }
  43175. }
  43176. if (aElement) {
  43177. ui.children.push(aElement);
  43178. }
  43179. if (!caption) {
  43180. if (ui.attributes.class) {
  43181. ui.attributes.class.push("xfaLeft");
  43182. }
  43183. this.w = savedW;
  43184. this.h = savedH;
  43185. return HTMLResult.success(createWrapper(this, html), bbox);
  43186. }
  43187. if (this.ui.button) {
  43188. if (style.padding) {
  43189. delete style.padding;
  43190. }
  43191. if (caption.name === "div") {
  43192. caption.name = "span";
  43193. }
  43194. ui.children.push(caption);
  43195. return HTMLResult.success(html, bbox);
  43196. } else if (this.ui.checkButton) {
  43197. caption.attributes.class[0] = "xfaCaptionForCheckButton";
  43198. }
  43199. if (!ui.attributes.class) {
  43200. ui.attributes.class = [];
  43201. }
  43202. ui.children.splice(0, 0, caption);
  43203. switch (this.caption.placement) {
  43204. case "left":
  43205. ui.attributes.class.push("xfaLeft");
  43206. break;
  43207. case "right":
  43208. ui.attributes.class.push("xfaRight");
  43209. break;
  43210. case "top":
  43211. ui.attributes.class.push("xfaTop");
  43212. break;
  43213. case "bottom":
  43214. ui.attributes.class.push("xfaBottom");
  43215. break;
  43216. case "inline":
  43217. ui.attributes.class.push("xfaLeft");
  43218. break;
  43219. }
  43220. this.w = savedW;
  43221. this.h = savedH;
  43222. return HTMLResult.success(createWrapper(this, html), bbox);
  43223. }
  43224. }
  43225. class Fill extends XFAObject {
  43226. constructor(attributes) {
  43227. super(TEMPLATE_NS_ID, "fill", true);
  43228. this.id = attributes.id || "";
  43229. this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]);
  43230. this.use = attributes.use || "";
  43231. this.usehref = attributes.usehref || "";
  43232. this.color = null;
  43233. this.extras = null;
  43234. this.linear = null;
  43235. this.pattern = null;
  43236. this.radial = null;
  43237. this.solid = null;
  43238. this.stipple = null;
  43239. }
  43240. [$toStyle]() {
  43241. const parent = this[$getParent]();
  43242. const grandpa = parent[$getParent]();
  43243. const ggrandpa = grandpa[$getParent]();
  43244. const style = Object.create(null);
  43245. let propName = "color";
  43246. let altPropName = propName;
  43247. if (parent instanceof Border) {
  43248. propName = "background-color";
  43249. altPropName = "background";
  43250. if (ggrandpa instanceof Ui) {
  43251. style.backgroundColor = "white";
  43252. }
  43253. }
  43254. if (parent instanceof Rectangle || parent instanceof Arc) {
  43255. propName = altPropName = "fill";
  43256. style.fill = "white";
  43257. }
  43258. for (const name of Object.getOwnPropertyNames(this)) {
  43259. if (name === "extras" || name === "color") {
  43260. continue;
  43261. }
  43262. const obj = this[name];
  43263. if (!(obj instanceof XFAObject)) {
  43264. continue;
  43265. }
  43266. const color = obj[$toStyle](this.color);
  43267. if (color) {
  43268. style[color.startsWith("#") ? propName : altPropName] = color;
  43269. }
  43270. return style;
  43271. }
  43272. if (this.color?.value) {
  43273. const color = this.color[$toStyle]();
  43274. style[color.startsWith("#") ? propName : altPropName] = color;
  43275. }
  43276. return style;
  43277. }
  43278. }
  43279. class Filter extends XFAObject {
  43280. constructor(attributes) {
  43281. super(TEMPLATE_NS_ID, "filter", true);
  43282. this.addRevocationInfo = getStringOption(attributes.addRevocationInfo, ["", "required", "optional", "none"]);
  43283. this.id = attributes.id || "";
  43284. this.name = attributes.name || "";
  43285. this.use = attributes.use || "";
  43286. this.usehref = attributes.usehref || "";
  43287. this.version = getInteger({
  43288. data: this.version,
  43289. defaultValue: 5,
  43290. validate: x => x >= 1 && x <= 5
  43291. });
  43292. this.appearanceFilter = null;
  43293. this.certificates = null;
  43294. this.digestMethods = null;
  43295. this.encodings = null;
  43296. this.encryptionMethods = null;
  43297. this.handler = null;
  43298. this.lockDocument = null;
  43299. this.mdp = null;
  43300. this.reasons = null;
  43301. this.timeStamp = null;
  43302. }
  43303. }
  43304. class Float extends ContentObject {
  43305. constructor(attributes) {
  43306. super(TEMPLATE_NS_ID, "float");
  43307. this.id = attributes.id || "";
  43308. this.name = attributes.name || "";
  43309. this.use = attributes.use || "";
  43310. this.usehref = attributes.usehref || "";
  43311. }
  43312. [$finalize]() {
  43313. const number = parseFloat(this[$content].trim());
  43314. this[$content] = isNaN(number) ? null : number;
  43315. }
  43316. [$toHTML](availableSpace) {
  43317. return valueToHtml(this[$content] !== null ? this[$content].toString() : "");
  43318. }
  43319. }
  43320. class template_Font extends XFAObject {
  43321. constructor(attributes) {
  43322. super(TEMPLATE_NS_ID, "font", true);
  43323. this.baselineShift = getMeasurement(attributes.baselineShift);
  43324. this.fontHorizontalScale = getFloat({
  43325. data: attributes.fontHorizontalScale,
  43326. defaultValue: 100,
  43327. validate: x => x >= 0
  43328. });
  43329. this.fontVerticalScale = getFloat({
  43330. data: attributes.fontVerticalScale,
  43331. defaultValue: 100,
  43332. validate: x => x >= 0
  43333. });
  43334. this.id = attributes.id || "";
  43335. this.kerningMode = getStringOption(attributes.kerningMode, ["none", "pair"]);
  43336. this.letterSpacing = getMeasurement(attributes.letterSpacing, "0");
  43337. this.lineThrough = getInteger({
  43338. data: attributes.lineThrough,
  43339. defaultValue: 0,
  43340. validate: x => x === 1 || x === 2
  43341. });
  43342. this.lineThroughPeriod = getStringOption(attributes.lineThroughPeriod, ["all", "word"]);
  43343. this.overline = getInteger({
  43344. data: attributes.overline,
  43345. defaultValue: 0,
  43346. validate: x => x === 1 || x === 2
  43347. });
  43348. this.overlinePeriod = getStringOption(attributes.overlinePeriod, ["all", "word"]);
  43349. this.posture = getStringOption(attributes.posture, ["normal", "italic"]);
  43350. this.size = getMeasurement(attributes.size, "10pt");
  43351. this.typeface = attributes.typeface || "Courier";
  43352. this.underline = getInteger({
  43353. data: attributes.underline,
  43354. defaultValue: 0,
  43355. validate: x => x === 1 || x === 2
  43356. });
  43357. this.underlinePeriod = getStringOption(attributes.underlinePeriod, ["all", "word"]);
  43358. this.use = attributes.use || "";
  43359. this.usehref = attributes.usehref || "";
  43360. this.weight = getStringOption(attributes.weight, ["normal", "bold"]);
  43361. this.extras = null;
  43362. this.fill = null;
  43363. }
  43364. [$clean](builder) {
  43365. super[$clean](builder);
  43366. this[$globalData].usedTypefaces.add(this.typeface);
  43367. }
  43368. [$toStyle]() {
  43369. const style = toStyle(this, "fill");
  43370. const color = style.color;
  43371. if (color) {
  43372. if (color === "#000000") {
  43373. delete style.color;
  43374. } else if (!color.startsWith("#")) {
  43375. style.background = color;
  43376. style.backgroundClip = "text";
  43377. style.color = "transparent";
  43378. }
  43379. }
  43380. if (this.baselineShift) {
  43381. style.verticalAlign = measureToString(this.baselineShift);
  43382. }
  43383. style.fontKerning = this.kerningMode === "none" ? "none" : "normal";
  43384. style.letterSpacing = measureToString(this.letterSpacing);
  43385. if (this.lineThrough !== 0) {
  43386. style.textDecoration = "line-through";
  43387. if (this.lineThrough === 2) {
  43388. style.textDecorationStyle = "double";
  43389. }
  43390. }
  43391. if (this.overline !== 0) {
  43392. style.textDecoration = "overline";
  43393. if (this.overline === 2) {
  43394. style.textDecorationStyle = "double";
  43395. }
  43396. }
  43397. style.fontStyle = this.posture;
  43398. style.fontSize = measureToString(0.99 * this.size);
  43399. setFontFamily(this, this, this[$globalData].fontFinder, style);
  43400. if (this.underline !== 0) {
  43401. style.textDecoration = "underline";
  43402. if (this.underline === 2) {
  43403. style.textDecorationStyle = "double";
  43404. }
  43405. }
  43406. style.fontWeight = this.weight;
  43407. return style;
  43408. }
  43409. }
  43410. class Format extends XFAObject {
  43411. constructor(attributes) {
  43412. super(TEMPLATE_NS_ID, "format", true);
  43413. this.id = attributes.id || "";
  43414. this.use = attributes.use || "";
  43415. this.usehref = attributes.usehref || "";
  43416. this.extras = null;
  43417. this.picture = null;
  43418. }
  43419. }
  43420. class Handler extends StringObject {
  43421. constructor(attributes) {
  43422. super(TEMPLATE_NS_ID, "handler");
  43423. this.id = attributes.id || "";
  43424. this.type = getStringOption(attributes.type, ["optional", "required"]);
  43425. this.use = attributes.use || "";
  43426. this.usehref = attributes.usehref || "";
  43427. }
  43428. }
  43429. class Hyphenation extends XFAObject {
  43430. constructor(attributes) {
  43431. super(TEMPLATE_NS_ID, "hyphenation");
  43432. this.excludeAllCaps = getInteger({
  43433. data: attributes.excludeAllCaps,
  43434. defaultValue: 0,
  43435. validate: x => x === 1
  43436. });
  43437. this.excludeInitialCap = getInteger({
  43438. data: attributes.excludeInitialCap,
  43439. defaultValue: 0,
  43440. validate: x => x === 1
  43441. });
  43442. this.hyphenate = getInteger({
  43443. data: attributes.hyphenate,
  43444. defaultValue: 0,
  43445. validate: x => x === 1
  43446. });
  43447. this.id = attributes.id || "";
  43448. this.pushCharacterCount = getInteger({
  43449. data: attributes.pushCharacterCount,
  43450. defaultValue: 3,
  43451. validate: x => x >= 0
  43452. });
  43453. this.remainCharacterCount = getInteger({
  43454. data: attributes.remainCharacterCount,
  43455. defaultValue: 3,
  43456. validate: x => x >= 0
  43457. });
  43458. this.use = attributes.use || "";
  43459. this.usehref = attributes.usehref || "";
  43460. this.wordCharacterCount = getInteger({
  43461. data: attributes.wordCharacterCount,
  43462. defaultValue: 7,
  43463. validate: x => x >= 0
  43464. });
  43465. }
  43466. }
  43467. class Image extends StringObject {
  43468. constructor(attributes) {
  43469. super(TEMPLATE_NS_ID, "image");
  43470. this.aspect = getStringOption(attributes.aspect, ["fit", "actual", "height", "none", "width"]);
  43471. this.contentType = attributes.contentType || "";
  43472. this.href = attributes.href || "";
  43473. this.id = attributes.id || "";
  43474. this.name = attributes.name || "";
  43475. this.transferEncoding = getStringOption(attributes.transferEncoding, ["base64", "none", "package"]);
  43476. this.use = attributes.use || "";
  43477. this.usehref = attributes.usehref || "";
  43478. }
  43479. [$toHTML]() {
  43480. if (this.contentType && !MIMES.has(this.contentType.toLowerCase())) {
  43481. return HTMLResult.EMPTY;
  43482. }
  43483. let buffer = this[$globalData].images && this[$globalData].images.get(this.href);
  43484. if (!buffer && (this.href || !this[$content])) {
  43485. return HTMLResult.EMPTY;
  43486. }
  43487. if (!buffer && this.transferEncoding === "base64") {
  43488. buffer = stringToBytes(atob(this[$content]));
  43489. }
  43490. if (!buffer) {
  43491. return HTMLResult.EMPTY;
  43492. }
  43493. if (!this.contentType) {
  43494. for (const [header, type] of IMAGES_HEADERS) {
  43495. if (buffer.length > header.length && header.every((x, i) => x === buffer[i])) {
  43496. this.contentType = type;
  43497. break;
  43498. }
  43499. }
  43500. if (!this.contentType) {
  43501. return HTMLResult.EMPTY;
  43502. }
  43503. }
  43504. const blob = new Blob([buffer], {
  43505. type: this.contentType
  43506. });
  43507. let style;
  43508. switch (this.aspect) {
  43509. case "fit":
  43510. case "actual":
  43511. break;
  43512. case "height":
  43513. style = {
  43514. height: "100%",
  43515. objectFit: "fill"
  43516. };
  43517. break;
  43518. case "none":
  43519. style = {
  43520. width: "100%",
  43521. height: "100%",
  43522. objectFit: "fill"
  43523. };
  43524. break;
  43525. case "width":
  43526. style = {
  43527. width: "100%",
  43528. objectFit: "fill"
  43529. };
  43530. break;
  43531. }
  43532. const parent = this[$getParent]();
  43533. return HTMLResult.success({
  43534. name: "img",
  43535. attributes: {
  43536. class: ["xfaImage"],
  43537. style,
  43538. src: URL.createObjectURL(blob),
  43539. alt: parent ? ariaLabel(parent[$getParent]()) : null
  43540. }
  43541. });
  43542. }
  43543. }
  43544. class ImageEdit extends XFAObject {
  43545. constructor(attributes) {
  43546. super(TEMPLATE_NS_ID, "imageEdit", true);
  43547. this.data = getStringOption(attributes.data, ["link", "embed"]);
  43548. this.id = attributes.id || "";
  43549. this.use = attributes.use || "";
  43550. this.usehref = attributes.usehref || "";
  43551. this.border = null;
  43552. this.extras = null;
  43553. this.margin = null;
  43554. }
  43555. [$toHTML](availableSpace) {
  43556. if (this.data === "embed") {
  43557. return HTMLResult.success({
  43558. name: "div",
  43559. children: [],
  43560. attributes: {}
  43561. });
  43562. }
  43563. return HTMLResult.EMPTY;
  43564. }
  43565. }
  43566. class Integer extends ContentObject {
  43567. constructor(attributes) {
  43568. super(TEMPLATE_NS_ID, "integer");
  43569. this.id = attributes.id || "";
  43570. this.name = attributes.name || "";
  43571. this.use = attributes.use || "";
  43572. this.usehref = attributes.usehref || "";
  43573. }
  43574. [$finalize]() {
  43575. const number = parseInt(this[$content].trim(), 10);
  43576. this[$content] = isNaN(number) ? null : number;
  43577. }
  43578. [$toHTML](availableSpace) {
  43579. return valueToHtml(this[$content] !== null ? this[$content].toString() : "");
  43580. }
  43581. }
  43582. class Issuers extends XFAObject {
  43583. constructor(attributes) {
  43584. super(TEMPLATE_NS_ID, "issuers", true);
  43585. this.id = attributes.id || "";
  43586. this.type = getStringOption(attributes.type, ["optional", "required"]);
  43587. this.use = attributes.use || "";
  43588. this.usehref = attributes.usehref || "";
  43589. this.certificate = new XFAObjectArray();
  43590. }
  43591. }
  43592. class Items extends XFAObject {
  43593. constructor(attributes) {
  43594. super(TEMPLATE_NS_ID, "items", true);
  43595. this.id = attributes.id || "";
  43596. this.name = attributes.name || "";
  43597. this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]);
  43598. this.ref = attributes.ref || "";
  43599. this.save = getInteger({
  43600. data: attributes.save,
  43601. defaultValue: 0,
  43602. validate: x => x === 1
  43603. });
  43604. this.use = attributes.use || "";
  43605. this.usehref = attributes.usehref || "";
  43606. this.boolean = new XFAObjectArray();
  43607. this.date = new XFAObjectArray();
  43608. this.dateTime = new XFAObjectArray();
  43609. this.decimal = new XFAObjectArray();
  43610. this.exData = new XFAObjectArray();
  43611. this.float = new XFAObjectArray();
  43612. this.image = new XFAObjectArray();
  43613. this.integer = new XFAObjectArray();
  43614. this.text = new XFAObjectArray();
  43615. this.time = new XFAObjectArray();
  43616. }
  43617. [$toHTML]() {
  43618. const output = [];
  43619. for (const child of this[$getChildren]()) {
  43620. output.push(child[$text]());
  43621. }
  43622. return HTMLResult.success(output);
  43623. }
  43624. }
  43625. class Keep extends XFAObject {
  43626. constructor(attributes) {
  43627. super(TEMPLATE_NS_ID, "keep", true);
  43628. this.id = attributes.id || "";
  43629. const options = ["none", "contentArea", "pageArea"];
  43630. this.intact = getStringOption(attributes.intact, options);
  43631. this.next = getStringOption(attributes.next, options);
  43632. this.previous = getStringOption(attributes.previous, options);
  43633. this.use = attributes.use || "";
  43634. this.usehref = attributes.usehref || "";
  43635. this.extras = null;
  43636. }
  43637. }
  43638. class KeyUsage extends XFAObject {
  43639. constructor(attributes) {
  43640. super(TEMPLATE_NS_ID, "keyUsage");
  43641. const options = ["", "yes", "no"];
  43642. this.crlSign = getStringOption(attributes.crlSign, options);
  43643. this.dataEncipherment = getStringOption(attributes.dataEncipherment, options);
  43644. this.decipherOnly = getStringOption(attributes.decipherOnly, options);
  43645. this.digitalSignature = getStringOption(attributes.digitalSignature, options);
  43646. this.encipherOnly = getStringOption(attributes.encipherOnly, options);
  43647. this.id = attributes.id || "";
  43648. this.keyAgreement = getStringOption(attributes.keyAgreement, options);
  43649. this.keyCertSign = getStringOption(attributes.keyCertSign, options);
  43650. this.keyEncipherment = getStringOption(attributes.keyEncipherment, options);
  43651. this.nonRepudiation = getStringOption(attributes.nonRepudiation, options);
  43652. this.type = getStringOption(attributes.type, ["optional", "required"]);
  43653. this.use = attributes.use || "";
  43654. this.usehref = attributes.usehref || "";
  43655. }
  43656. }
  43657. class Line extends XFAObject {
  43658. constructor(attributes) {
  43659. super(TEMPLATE_NS_ID, "line", true);
  43660. this.hand = getStringOption(attributes.hand, ["even", "left", "right"]);
  43661. this.id = attributes.id || "";
  43662. this.slope = getStringOption(attributes.slope, ["\\", "/"]);
  43663. this.use = attributes.use || "";
  43664. this.usehref = attributes.usehref || "";
  43665. this.edge = null;
  43666. }
  43667. [$toHTML]() {
  43668. const parent = this[$getParent]()[$getParent]();
  43669. const edge = this.edge || new Edge({});
  43670. const edgeStyle = edge[$toStyle]();
  43671. const style = Object.create(null);
  43672. const thickness = edge.presence === "visible" ? edge.thickness : 0;
  43673. style.strokeWidth = measureToString(thickness);
  43674. style.stroke = edgeStyle.color;
  43675. let x1, y1, x2, y2;
  43676. let width = "100%";
  43677. let height = "100%";
  43678. if (parent.w <= thickness) {
  43679. [x1, y1, x2, y2] = ["50%", 0, "50%", "100%"];
  43680. width = style.strokeWidth;
  43681. } else if (parent.h <= thickness) {
  43682. [x1, y1, x2, y2] = [0, "50%", "100%", "50%"];
  43683. height = style.strokeWidth;
  43684. } else if (this.slope === "\\") {
  43685. [x1, y1, x2, y2] = [0, 0, "100%", "100%"];
  43686. } else {
  43687. [x1, y1, x2, y2] = [0, "100%", "100%", 0];
  43688. }
  43689. const line = {
  43690. name: "line",
  43691. attributes: {
  43692. xmlns: SVG_NS,
  43693. x1,
  43694. y1,
  43695. x2,
  43696. y2,
  43697. style
  43698. }
  43699. };
  43700. const svg = {
  43701. name: "svg",
  43702. children: [line],
  43703. attributes: {
  43704. xmlns: SVG_NS,
  43705. width,
  43706. height,
  43707. style: {
  43708. overflow: "visible"
  43709. }
  43710. }
  43711. };
  43712. if (hasMargin(parent)) {
  43713. return HTMLResult.success({
  43714. name: "div",
  43715. attributes: {
  43716. style: {
  43717. display: "inline",
  43718. width: "100%",
  43719. height: "100%"
  43720. }
  43721. },
  43722. children: [svg]
  43723. });
  43724. }
  43725. svg.attributes.style.position = "absolute";
  43726. return HTMLResult.success(svg);
  43727. }
  43728. }
  43729. class Linear extends XFAObject {
  43730. constructor(attributes) {
  43731. super(TEMPLATE_NS_ID, "linear", true);
  43732. this.id = attributes.id || "";
  43733. this.type = getStringOption(attributes.type, ["toRight", "toBottom", "toLeft", "toTop"]);
  43734. this.use = attributes.use || "";
  43735. this.usehref = attributes.usehref || "";
  43736. this.color = null;
  43737. this.extras = null;
  43738. }
  43739. [$toStyle](startColor) {
  43740. startColor = startColor ? startColor[$toStyle]() : "#FFFFFF";
  43741. const transf = this.type.replace(/([RBLT])/, " $1").toLowerCase();
  43742. const endColor = this.color ? this.color[$toStyle]() : "#000000";
  43743. return `linear-gradient(${transf}, ${startColor}, ${endColor})`;
  43744. }
  43745. }
  43746. class LockDocument extends ContentObject {
  43747. constructor(attributes) {
  43748. super(TEMPLATE_NS_ID, "lockDocument");
  43749. this.id = attributes.id || "";
  43750. this.type = getStringOption(attributes.type, ["optional", "required"]);
  43751. this.use = attributes.use || "";
  43752. this.usehref = attributes.usehref || "";
  43753. }
  43754. [$finalize]() {
  43755. this[$content] = getStringOption(this[$content], ["auto", "0", "1"]);
  43756. }
  43757. }
  43758. class Manifest extends XFAObject {
  43759. constructor(attributes) {
  43760. super(TEMPLATE_NS_ID, "manifest", true);
  43761. this.action = getStringOption(attributes.action, ["include", "all", "exclude"]);
  43762. this.id = attributes.id || "";
  43763. this.name = attributes.name || "";
  43764. this.use = attributes.use || "";
  43765. this.usehref = attributes.usehref || "";
  43766. this.extras = null;
  43767. this.ref = new XFAObjectArray();
  43768. }
  43769. }
  43770. class Margin extends XFAObject {
  43771. constructor(attributes) {
  43772. super(TEMPLATE_NS_ID, "margin", true);
  43773. this.bottomInset = getMeasurement(attributes.bottomInset, "0");
  43774. this.id = attributes.id || "";
  43775. this.leftInset = getMeasurement(attributes.leftInset, "0");
  43776. this.rightInset = getMeasurement(attributes.rightInset, "0");
  43777. this.topInset = getMeasurement(attributes.topInset, "0");
  43778. this.use = attributes.use || "";
  43779. this.usehref = attributes.usehref || "";
  43780. this.extras = null;
  43781. }
  43782. [$toStyle]() {
  43783. return {
  43784. margin: measureToString(this.topInset) + " " + measureToString(this.rightInset) + " " + measureToString(this.bottomInset) + " " + measureToString(this.leftInset)
  43785. };
  43786. }
  43787. }
  43788. class Mdp extends XFAObject {
  43789. constructor(attributes) {
  43790. super(TEMPLATE_NS_ID, "mdp");
  43791. this.id = attributes.id || "";
  43792. this.permissions = getInteger({
  43793. data: attributes.permissions,
  43794. defaultValue: 2,
  43795. validate: x => x === 1 || x === 3
  43796. });
  43797. this.signatureType = getStringOption(attributes.signatureType, ["filler", "author"]);
  43798. this.use = attributes.use || "";
  43799. this.usehref = attributes.usehref || "";
  43800. }
  43801. }
  43802. class Medium extends XFAObject {
  43803. constructor(attributes) {
  43804. super(TEMPLATE_NS_ID, "medium");
  43805. this.id = attributes.id || "";
  43806. this.imagingBBox = getBBox(attributes.imagingBBox);
  43807. this.long = getMeasurement(attributes.long);
  43808. this.orientation = getStringOption(attributes.orientation, ["portrait", "landscape"]);
  43809. this.short = getMeasurement(attributes.short);
  43810. this.stock = attributes.stock || "";
  43811. this.trayIn = getStringOption(attributes.trayIn, ["auto", "delegate", "pageFront"]);
  43812. this.trayOut = getStringOption(attributes.trayOut, ["auto", "delegate"]);
  43813. this.use = attributes.use || "";
  43814. this.usehref = attributes.usehref || "";
  43815. }
  43816. }
  43817. class Message extends XFAObject {
  43818. constructor(attributes) {
  43819. super(TEMPLATE_NS_ID, "message", true);
  43820. this.id = attributes.id || "";
  43821. this.use = attributes.use || "";
  43822. this.usehref = attributes.usehref || "";
  43823. this.text = new XFAObjectArray();
  43824. }
  43825. }
  43826. class NumericEdit extends XFAObject {
  43827. constructor(attributes) {
  43828. super(TEMPLATE_NS_ID, "numericEdit", true);
  43829. this.hScrollPolicy = getStringOption(attributes.hScrollPolicy, ["auto", "off", "on"]);
  43830. this.id = attributes.id || "";
  43831. this.use = attributes.use || "";
  43832. this.usehref = attributes.usehref || "";
  43833. this.border = null;
  43834. this.comb = null;
  43835. this.extras = null;
  43836. this.margin = null;
  43837. }
  43838. [$toHTML](availableSpace) {
  43839. const style = toStyle(this, "border", "font", "margin");
  43840. const field = this[$getParent]()[$getParent]();
  43841. const html = {
  43842. name: "input",
  43843. attributes: {
  43844. type: "text",
  43845. fieldId: field[$uid],
  43846. dataId: field[$data]?.[$uid] || field[$uid],
  43847. class: ["xfaTextfield"],
  43848. style,
  43849. "aria-label": ariaLabel(field),
  43850. "aria-required": false
  43851. }
  43852. };
  43853. if (isRequired(field)) {
  43854. html.attributes["aria-required"] = true;
  43855. html.attributes.required = true;
  43856. }
  43857. return HTMLResult.success({
  43858. name: "label",
  43859. attributes: {
  43860. class: ["xfaLabel"]
  43861. },
  43862. children: [html]
  43863. });
  43864. }
  43865. }
  43866. class Occur extends XFAObject {
  43867. constructor(attributes) {
  43868. super(TEMPLATE_NS_ID, "occur", true);
  43869. this.id = attributes.id || "";
  43870. this.initial = attributes.initial !== "" ? getInteger({
  43871. data: attributes.initial,
  43872. defaultValue: "",
  43873. validate: x => true
  43874. }) : "";
  43875. this.max = attributes.max !== "" ? getInteger({
  43876. data: attributes.max,
  43877. defaultValue: 1,
  43878. validate: x => true
  43879. }) : "";
  43880. this.min = attributes.min !== "" ? getInteger({
  43881. data: attributes.min,
  43882. defaultValue: 1,
  43883. validate: x => true
  43884. }) : "";
  43885. this.use = attributes.use || "";
  43886. this.usehref = attributes.usehref || "";
  43887. this.extras = null;
  43888. }
  43889. [$clean]() {
  43890. const parent = this[$getParent]();
  43891. const originalMin = this.min;
  43892. if (this.min === "") {
  43893. this.min = parent instanceof PageArea || parent instanceof PageSet ? 0 : 1;
  43894. }
  43895. if (this.max === "") {
  43896. if (originalMin === "") {
  43897. this.max = parent instanceof PageArea || parent instanceof PageSet ? -1 : 1;
  43898. } else {
  43899. this.max = this.min;
  43900. }
  43901. }
  43902. if (this.max !== -1 && this.max < this.min) {
  43903. this.max = this.min;
  43904. }
  43905. if (this.initial === "") {
  43906. this.initial = parent instanceof Template ? 1 : this.min;
  43907. }
  43908. }
  43909. }
  43910. class Oid extends StringObject {
  43911. constructor(attributes) {
  43912. super(TEMPLATE_NS_ID, "oid");
  43913. this.id = attributes.id || "";
  43914. this.name = attributes.name || "";
  43915. this.use = attributes.use || "";
  43916. this.usehref = attributes.usehref || "";
  43917. }
  43918. }
  43919. class Oids extends XFAObject {
  43920. constructor(attributes) {
  43921. super(TEMPLATE_NS_ID, "oids", true);
  43922. this.id = attributes.id || "";
  43923. this.type = getStringOption(attributes.type, ["optional", "required"]);
  43924. this.use = attributes.use || "";
  43925. this.usehref = attributes.usehref || "";
  43926. this.oid = new XFAObjectArray();
  43927. }
  43928. }
  43929. class Overflow extends XFAObject {
  43930. constructor(attributes) {
  43931. super(TEMPLATE_NS_ID, "overflow");
  43932. this.id = attributes.id || "";
  43933. this.leader = attributes.leader || "";
  43934. this.target = attributes.target || "";
  43935. this.trailer = attributes.trailer || "";
  43936. this.use = attributes.use || "";
  43937. this.usehref = attributes.usehref || "";
  43938. }
  43939. [$getExtra]() {
  43940. if (!this[$extra]) {
  43941. const parent = this[$getParent]();
  43942. const root = this[$getTemplateRoot]();
  43943. const target = root[$searchNode](this.target, parent);
  43944. const leader = root[$searchNode](this.leader, parent);
  43945. const trailer = root[$searchNode](this.trailer, parent);
  43946. this[$extra] = {
  43947. target: target?.[0] || null,
  43948. leader: leader?.[0] || null,
  43949. trailer: trailer?.[0] || null,
  43950. addLeader: false,
  43951. addTrailer: false
  43952. };
  43953. }
  43954. return this[$extra];
  43955. }
  43956. }
  43957. class PageArea extends XFAObject {
  43958. constructor(attributes) {
  43959. super(TEMPLATE_NS_ID, "pageArea", true);
  43960. this.blankOrNotBlank = getStringOption(attributes.blankOrNotBlank, ["any", "blank", "notBlank"]);
  43961. this.id = attributes.id || "";
  43962. this.initialNumber = getInteger({
  43963. data: attributes.initialNumber,
  43964. defaultValue: 1,
  43965. validate: x => true
  43966. });
  43967. this.name = attributes.name || "";
  43968. this.numbered = getInteger({
  43969. data: attributes.numbered,
  43970. defaultValue: 1,
  43971. validate: x => true
  43972. });
  43973. this.oddOrEven = getStringOption(attributes.oddOrEven, ["any", "even", "odd"]);
  43974. this.pagePosition = getStringOption(attributes.pagePosition, ["any", "first", "last", "only", "rest"]);
  43975. this.relevant = getRelevant(attributes.relevant);
  43976. this.use = attributes.use || "";
  43977. this.usehref = attributes.usehref || "";
  43978. this.desc = null;
  43979. this.extras = null;
  43980. this.medium = null;
  43981. this.occur = null;
  43982. this.area = new XFAObjectArray();
  43983. this.contentArea = new XFAObjectArray();
  43984. this.draw = new XFAObjectArray();
  43985. this.exclGroup = new XFAObjectArray();
  43986. this.field = new XFAObjectArray();
  43987. this.subform = new XFAObjectArray();
  43988. }
  43989. [$isUsable]() {
  43990. if (!this[$extra]) {
  43991. this[$extra] = {
  43992. numberOfUse: 0
  43993. };
  43994. return true;
  43995. }
  43996. return !this.occur || this.occur.max === -1 || this[$extra].numberOfUse < this.occur.max;
  43997. }
  43998. [$cleanPage]() {
  43999. delete this[$extra];
  44000. }
  44001. [$getNextPage]() {
  44002. if (!this[$extra]) {
  44003. this[$extra] = {
  44004. numberOfUse: 0
  44005. };
  44006. }
  44007. const parent = this[$getParent]();
  44008. if (parent.relation === "orderedOccurrence") {
  44009. if (this[$isUsable]()) {
  44010. this[$extra].numberOfUse += 1;
  44011. return this;
  44012. }
  44013. }
  44014. return parent[$getNextPage]();
  44015. }
  44016. [$getAvailableSpace]() {
  44017. return this[$extra].space || {
  44018. width: 0,
  44019. height: 0
  44020. };
  44021. }
  44022. [$toHTML]() {
  44023. if (!this[$extra]) {
  44024. this[$extra] = {
  44025. numberOfUse: 1
  44026. };
  44027. }
  44028. const children = [];
  44029. this[$extra].children = children;
  44030. const style = Object.create(null);
  44031. if (this.medium && this.medium.short && this.medium.long) {
  44032. style.width = measureToString(this.medium.short);
  44033. style.height = measureToString(this.medium.long);
  44034. this[$extra].space = {
  44035. width: this.medium.short,
  44036. height: this.medium.long
  44037. };
  44038. if (this.medium.orientation === "landscape") {
  44039. const x = style.width;
  44040. style.width = style.height;
  44041. style.height = x;
  44042. this[$extra].space = {
  44043. width: this.medium.long,
  44044. height: this.medium.short
  44045. };
  44046. }
  44047. } else {
  44048. warn("XFA - No medium specified in pageArea: please file a bug.");
  44049. }
  44050. this[$childrenToHTML]({
  44051. filter: new Set(["area", "draw", "field", "subform"]),
  44052. include: true
  44053. });
  44054. this[$childrenToHTML]({
  44055. filter: new Set(["contentArea"]),
  44056. include: true
  44057. });
  44058. return HTMLResult.success({
  44059. name: "div",
  44060. children,
  44061. attributes: {
  44062. class: ["xfaPage"],
  44063. id: this[$uid],
  44064. style,
  44065. xfaName: this.name
  44066. }
  44067. });
  44068. }
  44069. }
  44070. class PageSet extends XFAObject {
  44071. constructor(attributes) {
  44072. super(TEMPLATE_NS_ID, "pageSet", true);
  44073. this.duplexImposition = getStringOption(attributes.duplexImposition, ["longEdge", "shortEdge"]);
  44074. this.id = attributes.id || "";
  44075. this.name = attributes.name || "";
  44076. this.relation = getStringOption(attributes.relation, ["orderedOccurrence", "duplexPaginated", "simplexPaginated"]);
  44077. this.relevant = getRelevant(attributes.relevant);
  44078. this.use = attributes.use || "";
  44079. this.usehref = attributes.usehref || "";
  44080. this.extras = null;
  44081. this.occur = null;
  44082. this.pageArea = new XFAObjectArray();
  44083. this.pageSet = new XFAObjectArray();
  44084. }
  44085. [$cleanPage]() {
  44086. for (const page of this.pageArea.children) {
  44087. page[$cleanPage]();
  44088. }
  44089. for (const page of this.pageSet.children) {
  44090. page[$cleanPage]();
  44091. }
  44092. }
  44093. [$isUsable]() {
  44094. return !this.occur || this.occur.max === -1 || this[$extra].numberOfUse < this.occur.max;
  44095. }
  44096. [$getNextPage]() {
  44097. if (!this[$extra]) {
  44098. this[$extra] = {
  44099. numberOfUse: 1,
  44100. pageIndex: -1,
  44101. pageSetIndex: -1
  44102. };
  44103. }
  44104. if (this.relation === "orderedOccurrence") {
  44105. if (this[$extra].pageIndex + 1 < this.pageArea.children.length) {
  44106. this[$extra].pageIndex += 1;
  44107. const pageArea = this.pageArea.children[this[$extra].pageIndex];
  44108. return pageArea[$getNextPage]();
  44109. }
  44110. if (this[$extra].pageSetIndex + 1 < this.pageSet.children.length) {
  44111. this[$extra].pageSetIndex += 1;
  44112. return this.pageSet.children[this[$extra].pageSetIndex][$getNextPage]();
  44113. }
  44114. if (this[$isUsable]()) {
  44115. this[$extra].numberOfUse += 1;
  44116. this[$extra].pageIndex = -1;
  44117. this[$extra].pageSetIndex = -1;
  44118. return this[$getNextPage]();
  44119. }
  44120. const parent = this[$getParent]();
  44121. if (parent instanceof PageSet) {
  44122. return parent[$getNextPage]();
  44123. }
  44124. this[$cleanPage]();
  44125. return this[$getNextPage]();
  44126. }
  44127. const pageNumber = this[$getTemplateRoot]()[$extra].pageNumber;
  44128. const parity = pageNumber % 2 === 0 ? "even" : "odd";
  44129. const position = pageNumber === 0 ? "first" : "rest";
  44130. let page = this.pageArea.children.find(p => p.oddOrEven === parity && p.pagePosition === position);
  44131. if (page) {
  44132. return page;
  44133. }
  44134. page = this.pageArea.children.find(p => p.oddOrEven === "any" && p.pagePosition === position);
  44135. if (page) {
  44136. return page;
  44137. }
  44138. page = this.pageArea.children.find(p => p.oddOrEven === "any" && p.pagePosition === "any");
  44139. if (page) {
  44140. return page;
  44141. }
  44142. return this.pageArea.children[0];
  44143. }
  44144. }
  44145. class Para extends XFAObject {
  44146. constructor(attributes) {
  44147. super(TEMPLATE_NS_ID, "para", true);
  44148. this.hAlign = getStringOption(attributes.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]);
  44149. this.id = attributes.id || "";
  44150. this.lineHeight = attributes.lineHeight ? getMeasurement(attributes.lineHeight, "0pt") : "";
  44151. this.marginLeft = attributes.marginLeft ? getMeasurement(attributes.marginLeft, "0pt") : "";
  44152. this.marginRight = attributes.marginRight ? getMeasurement(attributes.marginRight, "0pt") : "";
  44153. this.orphans = getInteger({
  44154. data: attributes.orphans,
  44155. defaultValue: 0,
  44156. validate: x => x >= 0
  44157. });
  44158. this.preserve = attributes.preserve || "";
  44159. this.radixOffset = attributes.radixOffset ? getMeasurement(attributes.radixOffset, "0pt") : "";
  44160. this.spaceAbove = attributes.spaceAbove ? getMeasurement(attributes.spaceAbove, "0pt") : "";
  44161. this.spaceBelow = attributes.spaceBelow ? getMeasurement(attributes.spaceBelow, "0pt") : "";
  44162. this.tabDefault = attributes.tabDefault ? getMeasurement(this.tabDefault) : "";
  44163. this.tabStops = (attributes.tabStops || "").trim().split(/\s+/).map((x, i) => i % 2 === 1 ? getMeasurement(x) : x);
  44164. this.textIndent = attributes.textIndent ? getMeasurement(attributes.textIndent, "0pt") : "";
  44165. this.use = attributes.use || "";
  44166. this.usehref = attributes.usehref || "";
  44167. this.vAlign = getStringOption(attributes.vAlign, ["top", "bottom", "middle"]);
  44168. this.widows = getInteger({
  44169. data: attributes.widows,
  44170. defaultValue: 0,
  44171. validate: x => x >= 0
  44172. });
  44173. this.hyphenation = null;
  44174. }
  44175. [$toStyle]() {
  44176. const style = toStyle(this, "hAlign");
  44177. if (this.marginLeft !== "") {
  44178. style.paddingLeft = measureToString(this.marginLeft);
  44179. }
  44180. if (this.marginRight !== "") {
  44181. style.paddingight = measureToString(this.marginRight);
  44182. }
  44183. if (this.spaceAbove !== "") {
  44184. style.paddingTop = measureToString(this.spaceAbove);
  44185. }
  44186. if (this.spaceBelow !== "") {
  44187. style.paddingBottom = measureToString(this.spaceBelow);
  44188. }
  44189. if (this.textIndent !== "") {
  44190. style.textIndent = measureToString(this.textIndent);
  44191. fixTextIndent(style);
  44192. }
  44193. if (this.lineHeight > 0) {
  44194. style.lineHeight = measureToString(this.lineHeight);
  44195. }
  44196. if (this.tabDefault !== "") {
  44197. style.tabSize = measureToString(this.tabDefault);
  44198. }
  44199. if (this.tabStops.length > 0) {}
  44200. if (this.hyphenatation) {
  44201. Object.assign(style, this.hyphenatation[$toStyle]());
  44202. }
  44203. return style;
  44204. }
  44205. }
  44206. class PasswordEdit extends XFAObject {
  44207. constructor(attributes) {
  44208. super(TEMPLATE_NS_ID, "passwordEdit", true);
  44209. this.hScrollPolicy = getStringOption(attributes.hScrollPolicy, ["auto", "off", "on"]);
  44210. this.id = attributes.id || "";
  44211. this.passwordChar = attributes.passwordChar || "*";
  44212. this.use = attributes.use || "";
  44213. this.usehref = attributes.usehref || "";
  44214. this.border = null;
  44215. this.extras = null;
  44216. this.margin = null;
  44217. }
  44218. }
  44219. class template_Pattern extends XFAObject {
  44220. constructor(attributes) {
  44221. super(TEMPLATE_NS_ID, "pattern", true);
  44222. this.id = attributes.id || "";
  44223. this.type = getStringOption(attributes.type, ["crossHatch", "crossDiagonal", "diagonalLeft", "diagonalRight", "horizontal", "vertical"]);
  44224. this.use = attributes.use || "";
  44225. this.usehref = attributes.usehref || "";
  44226. this.color = null;
  44227. this.extras = null;
  44228. }
  44229. [$toStyle](startColor) {
  44230. startColor = startColor ? startColor[$toStyle]() : "#FFFFFF";
  44231. const endColor = this.color ? this.color[$toStyle]() : "#000000";
  44232. const width = 5;
  44233. const cmd = "repeating-linear-gradient";
  44234. const colors = `${startColor},${startColor} ${width}px,${endColor} ${width}px,${endColor} ${2 * width}px`;
  44235. switch (this.type) {
  44236. case "crossHatch":
  44237. return `${cmd}(to top,${colors}) ${cmd}(to right,${colors})`;
  44238. case "crossDiagonal":
  44239. return `${cmd}(45deg,${colors}) ${cmd}(-45deg,${colors})`;
  44240. case "diagonalLeft":
  44241. return `${cmd}(45deg,${colors})`;
  44242. case "diagonalRight":
  44243. return `${cmd}(-45deg,${colors})`;
  44244. case "horizontal":
  44245. return `${cmd}(to top,${colors})`;
  44246. case "vertical":
  44247. return `${cmd}(to right,${colors})`;
  44248. }
  44249. return "";
  44250. }
  44251. }
  44252. class Picture extends StringObject {
  44253. constructor(attributes) {
  44254. super(TEMPLATE_NS_ID, "picture");
  44255. this.id = attributes.id || "";
  44256. this.use = attributes.use || "";
  44257. this.usehref = attributes.usehref || "";
  44258. }
  44259. }
  44260. class Proto extends XFAObject {
  44261. constructor(attributes) {
  44262. super(TEMPLATE_NS_ID, "proto", true);
  44263. this.appearanceFilter = new XFAObjectArray();
  44264. this.arc = new XFAObjectArray();
  44265. this.area = new XFAObjectArray();
  44266. this.assist = new XFAObjectArray();
  44267. this.barcode = new XFAObjectArray();
  44268. this.bindItems = new XFAObjectArray();
  44269. this.bookend = new XFAObjectArray();
  44270. this.boolean = new XFAObjectArray();
  44271. this.border = new XFAObjectArray();
  44272. this.break = new XFAObjectArray();
  44273. this.breakAfter = new XFAObjectArray();
  44274. this.breakBefore = new XFAObjectArray();
  44275. this.button = new XFAObjectArray();
  44276. this.calculate = new XFAObjectArray();
  44277. this.caption = new XFAObjectArray();
  44278. this.certificate = new XFAObjectArray();
  44279. this.certificates = new XFAObjectArray();
  44280. this.checkButton = new XFAObjectArray();
  44281. this.choiceList = new XFAObjectArray();
  44282. this.color = new XFAObjectArray();
  44283. this.comb = new XFAObjectArray();
  44284. this.connect = new XFAObjectArray();
  44285. this.contentArea = new XFAObjectArray();
  44286. this.corner = new XFAObjectArray();
  44287. this.date = new XFAObjectArray();
  44288. this.dateTime = new XFAObjectArray();
  44289. this.dateTimeEdit = new XFAObjectArray();
  44290. this.decimal = new XFAObjectArray();
  44291. this.defaultUi = new XFAObjectArray();
  44292. this.desc = new XFAObjectArray();
  44293. this.digestMethod = new XFAObjectArray();
  44294. this.digestMethods = new XFAObjectArray();
  44295. this.draw = new XFAObjectArray();
  44296. this.edge = new XFAObjectArray();
  44297. this.encoding = new XFAObjectArray();
  44298. this.encodings = new XFAObjectArray();
  44299. this.encrypt = new XFAObjectArray();
  44300. this.encryptData = new XFAObjectArray();
  44301. this.encryption = new XFAObjectArray();
  44302. this.encryptionMethod = new XFAObjectArray();
  44303. this.encryptionMethods = new XFAObjectArray();
  44304. this.event = new XFAObjectArray();
  44305. this.exData = new XFAObjectArray();
  44306. this.exObject = new XFAObjectArray();
  44307. this.exclGroup = new XFAObjectArray();
  44308. this.execute = new XFAObjectArray();
  44309. this.extras = new XFAObjectArray();
  44310. this.field = new XFAObjectArray();
  44311. this.fill = new XFAObjectArray();
  44312. this.filter = new XFAObjectArray();
  44313. this.float = new XFAObjectArray();
  44314. this.font = new XFAObjectArray();
  44315. this.format = new XFAObjectArray();
  44316. this.handler = new XFAObjectArray();
  44317. this.hyphenation = new XFAObjectArray();
  44318. this.image = new XFAObjectArray();
  44319. this.imageEdit = new XFAObjectArray();
  44320. this.integer = new XFAObjectArray();
  44321. this.issuers = new XFAObjectArray();
  44322. this.items = new XFAObjectArray();
  44323. this.keep = new XFAObjectArray();
  44324. this.keyUsage = new XFAObjectArray();
  44325. this.line = new XFAObjectArray();
  44326. this.linear = new XFAObjectArray();
  44327. this.lockDocument = new XFAObjectArray();
  44328. this.manifest = new XFAObjectArray();
  44329. this.margin = new XFAObjectArray();
  44330. this.mdp = new XFAObjectArray();
  44331. this.medium = new XFAObjectArray();
  44332. this.message = new XFAObjectArray();
  44333. this.numericEdit = new XFAObjectArray();
  44334. this.occur = new XFAObjectArray();
  44335. this.oid = new XFAObjectArray();
  44336. this.oids = new XFAObjectArray();
  44337. this.overflow = new XFAObjectArray();
  44338. this.pageArea = new XFAObjectArray();
  44339. this.pageSet = new XFAObjectArray();
  44340. this.para = new XFAObjectArray();
  44341. this.passwordEdit = new XFAObjectArray();
  44342. this.pattern = new XFAObjectArray();
  44343. this.picture = new XFAObjectArray();
  44344. this.radial = new XFAObjectArray();
  44345. this.reason = new XFAObjectArray();
  44346. this.reasons = new XFAObjectArray();
  44347. this.rectangle = new XFAObjectArray();
  44348. this.ref = new XFAObjectArray();
  44349. this.script = new XFAObjectArray();
  44350. this.setProperty = new XFAObjectArray();
  44351. this.signData = new XFAObjectArray();
  44352. this.signature = new XFAObjectArray();
  44353. this.signing = new XFAObjectArray();
  44354. this.solid = new XFAObjectArray();
  44355. this.speak = new XFAObjectArray();
  44356. this.stipple = new XFAObjectArray();
  44357. this.subform = new XFAObjectArray();
  44358. this.subformSet = new XFAObjectArray();
  44359. this.subjectDN = new XFAObjectArray();
  44360. this.subjectDNs = new XFAObjectArray();
  44361. this.submit = new XFAObjectArray();
  44362. this.text = new XFAObjectArray();
  44363. this.textEdit = new XFAObjectArray();
  44364. this.time = new XFAObjectArray();
  44365. this.timeStamp = new XFAObjectArray();
  44366. this.toolTip = new XFAObjectArray();
  44367. this.traversal = new XFAObjectArray();
  44368. this.traverse = new XFAObjectArray();
  44369. this.ui = new XFAObjectArray();
  44370. this.validate = new XFAObjectArray();
  44371. this.value = new XFAObjectArray();
  44372. this.variables = new XFAObjectArray();
  44373. }
  44374. }
  44375. class Radial extends XFAObject {
  44376. constructor(attributes) {
  44377. super(TEMPLATE_NS_ID, "radial", true);
  44378. this.id = attributes.id || "";
  44379. this.type = getStringOption(attributes.type, ["toEdge", "toCenter"]);
  44380. this.use = attributes.use || "";
  44381. this.usehref = attributes.usehref || "";
  44382. this.color = null;
  44383. this.extras = null;
  44384. }
  44385. [$toStyle](startColor) {
  44386. startColor = startColor ? startColor[$toStyle]() : "#FFFFFF";
  44387. const endColor = this.color ? this.color[$toStyle]() : "#000000";
  44388. const colors = this.type === "toEdge" ? `${startColor},${endColor}` : `${endColor},${startColor}`;
  44389. return `radial-gradient(circle at center, ${colors})`;
  44390. }
  44391. }
  44392. class Reason extends StringObject {
  44393. constructor(attributes) {
  44394. super(TEMPLATE_NS_ID, "reason");
  44395. this.id = attributes.id || "";
  44396. this.name = attributes.name || "";
  44397. this.use = attributes.use || "";
  44398. this.usehref = attributes.usehref || "";
  44399. }
  44400. }
  44401. class Reasons extends XFAObject {
  44402. constructor(attributes) {
  44403. super(TEMPLATE_NS_ID, "reasons", true);
  44404. this.id = attributes.id || "";
  44405. this.type = getStringOption(attributes.type, ["optional", "required"]);
  44406. this.use = attributes.use || "";
  44407. this.usehref = attributes.usehref || "";
  44408. this.reason = new XFAObjectArray();
  44409. }
  44410. }
  44411. class Rectangle extends XFAObject {
  44412. constructor(attributes) {
  44413. super(TEMPLATE_NS_ID, "rectangle", true);
  44414. this.hand = getStringOption(attributes.hand, ["even", "left", "right"]);
  44415. this.id = attributes.id || "";
  44416. this.use = attributes.use || "";
  44417. this.usehref = attributes.usehref || "";
  44418. this.corner = new XFAObjectArray(4);
  44419. this.edge = new XFAObjectArray(4);
  44420. this.fill = null;
  44421. }
  44422. [$toHTML]() {
  44423. const edge = this.edge.children.length ? this.edge.children[0] : new Edge({});
  44424. const edgeStyle = edge[$toStyle]();
  44425. const style = Object.create(null);
  44426. if (this.fill?.presence === "visible") {
  44427. Object.assign(style, this.fill[$toStyle]());
  44428. } else {
  44429. style.fill = "transparent";
  44430. }
  44431. style.strokeWidth = measureToString(edge.presence === "visible" ? edge.thickness : 0);
  44432. style.stroke = edgeStyle.color;
  44433. const corner = this.corner.children.length ? this.corner.children[0] : new Corner({});
  44434. const cornerStyle = corner[$toStyle]();
  44435. const rect = {
  44436. name: "rect",
  44437. attributes: {
  44438. xmlns: SVG_NS,
  44439. width: "100%",
  44440. height: "100%",
  44441. x: 0,
  44442. y: 0,
  44443. rx: cornerStyle.radius,
  44444. ry: cornerStyle.radius,
  44445. style
  44446. }
  44447. };
  44448. const svg = {
  44449. name: "svg",
  44450. children: [rect],
  44451. attributes: {
  44452. xmlns: SVG_NS,
  44453. style: {
  44454. overflow: "visible"
  44455. },
  44456. width: "100%",
  44457. height: "100%"
  44458. }
  44459. };
  44460. const parent = this[$getParent]()[$getParent]();
  44461. if (hasMargin(parent)) {
  44462. return HTMLResult.success({
  44463. name: "div",
  44464. attributes: {
  44465. style: {
  44466. display: "inline",
  44467. width: "100%",
  44468. height: "100%"
  44469. }
  44470. },
  44471. children: [svg]
  44472. });
  44473. }
  44474. svg.attributes.style.position = "absolute";
  44475. return HTMLResult.success(svg);
  44476. }
  44477. }
  44478. class RefElement extends StringObject {
  44479. constructor(attributes) {
  44480. super(TEMPLATE_NS_ID, "ref");
  44481. this.id = attributes.id || "";
  44482. this.use = attributes.use || "";
  44483. this.usehref = attributes.usehref || "";
  44484. }
  44485. }
  44486. class Script extends StringObject {
  44487. constructor(attributes) {
  44488. super(TEMPLATE_NS_ID, "script");
  44489. this.binding = attributes.binding || "";
  44490. this.contentType = attributes.contentType || "";
  44491. this.id = attributes.id || "";
  44492. this.name = attributes.name || "";
  44493. this.runAt = getStringOption(attributes.runAt, ["client", "both", "server"]);
  44494. this.use = attributes.use || "";
  44495. this.usehref = attributes.usehref || "";
  44496. }
  44497. }
  44498. class SetProperty extends XFAObject {
  44499. constructor(attributes) {
  44500. super(TEMPLATE_NS_ID, "setProperty");
  44501. this.connection = attributes.connection || "";
  44502. this.ref = attributes.ref || "";
  44503. this.target = attributes.target || "";
  44504. }
  44505. }
  44506. class SignData extends XFAObject {
  44507. constructor(attributes) {
  44508. super(TEMPLATE_NS_ID, "signData", true);
  44509. this.id = attributes.id || "";
  44510. this.operation = getStringOption(attributes.operation, ["sign", "clear", "verify"]);
  44511. this.ref = attributes.ref || "";
  44512. this.target = attributes.target || "";
  44513. this.use = attributes.use || "";
  44514. this.usehref = attributes.usehref || "";
  44515. this.filter = null;
  44516. this.manifest = null;
  44517. }
  44518. }
  44519. class Signature extends XFAObject {
  44520. constructor(attributes) {
  44521. super(TEMPLATE_NS_ID, "signature", true);
  44522. this.id = attributes.id || "";
  44523. this.type = getStringOption(attributes.type, ["PDF1.3", "PDF1.6"]);
  44524. this.use = attributes.use || "";
  44525. this.usehref = attributes.usehref || "";
  44526. this.border = null;
  44527. this.extras = null;
  44528. this.filter = null;
  44529. this.manifest = null;
  44530. this.margin = null;
  44531. }
  44532. }
  44533. class Signing extends XFAObject {
  44534. constructor(attributes) {
  44535. super(TEMPLATE_NS_ID, "signing", true);
  44536. this.id = attributes.id || "";
  44537. this.type = getStringOption(attributes.type, ["optional", "required"]);
  44538. this.use = attributes.use || "";
  44539. this.usehref = attributes.usehref || "";
  44540. this.certificate = new XFAObjectArray();
  44541. }
  44542. }
  44543. class Solid extends XFAObject {
  44544. constructor(attributes) {
  44545. super(TEMPLATE_NS_ID, "solid", true);
  44546. this.id = attributes.id || "";
  44547. this.use = attributes.use || "";
  44548. this.usehref = attributes.usehref || "";
  44549. this.extras = null;
  44550. }
  44551. [$toStyle](startColor) {
  44552. return startColor ? startColor[$toStyle]() : "#FFFFFF";
  44553. }
  44554. }
  44555. class Speak extends StringObject {
  44556. constructor(attributes) {
  44557. super(TEMPLATE_NS_ID, "speak");
  44558. this.disable = getInteger({
  44559. data: attributes.disable,
  44560. defaultValue: 0,
  44561. validate: x => x === 1
  44562. });
  44563. this.id = attributes.id || "";
  44564. this.priority = getStringOption(attributes.priority, ["custom", "caption", "name", "toolTip"]);
  44565. this.rid = attributes.rid || "";
  44566. this.use = attributes.use || "";
  44567. this.usehref = attributes.usehref || "";
  44568. }
  44569. }
  44570. class Stipple extends XFAObject {
  44571. constructor(attributes) {
  44572. super(TEMPLATE_NS_ID, "stipple", true);
  44573. this.id = attributes.id || "";
  44574. this.rate = getInteger({
  44575. data: attributes.rate,
  44576. defaultValue: 50,
  44577. validate: x => x >= 0 && x <= 100
  44578. });
  44579. this.use = attributes.use || "";
  44580. this.usehref = attributes.usehref || "";
  44581. this.color = null;
  44582. this.extras = null;
  44583. }
  44584. [$toStyle](bgColor) {
  44585. const alpha = this.rate / 100;
  44586. 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));
  44587. }
  44588. }
  44589. class Subform extends XFAObject {
  44590. constructor(attributes) {
  44591. super(TEMPLATE_NS_ID, "subform", true);
  44592. this.access = getStringOption(attributes.access, ["open", "nonInteractive", "protected", "readOnly"]);
  44593. this.allowMacro = getInteger({
  44594. data: attributes.allowMacro,
  44595. defaultValue: 0,
  44596. validate: x => x === 1
  44597. });
  44598. this.anchorType = getStringOption(attributes.anchorType, ["topLeft", "bottomCenter", "bottomLeft", "bottomRight", "middleCenter", "middleLeft", "middleRight", "topCenter", "topRight"]);
  44599. this.colSpan = getInteger({
  44600. data: attributes.colSpan,
  44601. defaultValue: 1,
  44602. validate: n => n >= 1 || n === -1
  44603. });
  44604. this.columnWidths = (attributes.columnWidths || "").trim().split(/\s+/).map(x => x === "-1" ? -1 : getMeasurement(x));
  44605. this.h = attributes.h ? getMeasurement(attributes.h) : "";
  44606. this.hAlign = getStringOption(attributes.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]);
  44607. this.id = attributes.id || "";
  44608. this.layout = getStringOption(attributes.layout, ["position", "lr-tb", "rl-row", "rl-tb", "row", "table", "tb"]);
  44609. this.locale = attributes.locale || "";
  44610. this.maxH = getMeasurement(attributes.maxH, "0pt");
  44611. this.maxW = getMeasurement(attributes.maxW, "0pt");
  44612. this.mergeMode = getStringOption(attributes.mergeMode, ["consumeData", "matchTemplate"]);
  44613. this.minH = getMeasurement(attributes.minH, "0pt");
  44614. this.minW = getMeasurement(attributes.minW, "0pt");
  44615. this.name = attributes.name || "";
  44616. this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]);
  44617. this.relevant = getRelevant(attributes.relevant);
  44618. this.restoreState = getStringOption(attributes.restoreState, ["manual", "auto"]);
  44619. this.scope = getStringOption(attributes.scope, ["name", "none"]);
  44620. this.use = attributes.use || "";
  44621. this.usehref = attributes.usehref || "";
  44622. this.w = attributes.w ? getMeasurement(attributes.w) : "";
  44623. this.x = getMeasurement(attributes.x, "0pt");
  44624. this.y = getMeasurement(attributes.y, "0pt");
  44625. this.assist = null;
  44626. this.bind = null;
  44627. this.bookend = null;
  44628. this.border = null;
  44629. this.break = null;
  44630. this.calculate = null;
  44631. this.desc = null;
  44632. this.extras = null;
  44633. this.keep = null;
  44634. this.margin = null;
  44635. this.occur = null;
  44636. this.overflow = null;
  44637. this.pageSet = null;
  44638. this.para = null;
  44639. this.traversal = null;
  44640. this.validate = null;
  44641. this.variables = null;
  44642. this.area = new XFAObjectArray();
  44643. this.breakAfter = new XFAObjectArray();
  44644. this.breakBefore = new XFAObjectArray();
  44645. this.connect = new XFAObjectArray();
  44646. this.draw = new XFAObjectArray();
  44647. this.event = new XFAObjectArray();
  44648. this.exObject = new XFAObjectArray();
  44649. this.exclGroup = new XFAObjectArray();
  44650. this.field = new XFAObjectArray();
  44651. this.proto = new XFAObjectArray();
  44652. this.setProperty = new XFAObjectArray();
  44653. this.subform = new XFAObjectArray();
  44654. this.subformSet = new XFAObjectArray();
  44655. }
  44656. [$getSubformParent]() {
  44657. const parent = this[$getParent]();
  44658. if (parent instanceof SubformSet) {
  44659. return parent[$getSubformParent]();
  44660. }
  44661. return parent;
  44662. }
  44663. [$isBindable]() {
  44664. return true;
  44665. }
  44666. [$isThereMoreWidth]() {
  44667. return this.layout.endsWith("-tb") && this[$extra].attempt === 0 && this[$extra].numberInLine > 0 || this[$getParent]()[$isThereMoreWidth]();
  44668. }
  44669. *[$getContainedChildren]() {
  44670. yield* getContainedChildren(this);
  44671. }
  44672. [$flushHTML]() {
  44673. return flushHTML(this);
  44674. }
  44675. [$addHTML](html, bbox) {
  44676. addHTML(this, html, bbox);
  44677. }
  44678. [$getAvailableSpace]() {
  44679. return getAvailableSpace(this);
  44680. }
  44681. [$isSplittable]() {
  44682. const parent = this[$getSubformParent]();
  44683. if (!parent[$isSplittable]()) {
  44684. return false;
  44685. }
  44686. if (this[$extra]._isSplittable !== undefined) {
  44687. return this[$extra]._isSplittable;
  44688. }
  44689. if (this.layout === "position" || this.layout.includes("row")) {
  44690. this[$extra]._isSplittable = false;
  44691. return false;
  44692. }
  44693. if (this.keep && this.keep.intact !== "none") {
  44694. this[$extra]._isSplittable = false;
  44695. return false;
  44696. }
  44697. if (parent.layout?.endsWith("-tb") && parent[$extra].numberInLine !== 0) {
  44698. return false;
  44699. }
  44700. this[$extra]._isSplittable = true;
  44701. return true;
  44702. }
  44703. [$toHTML](availableSpace) {
  44704. setTabIndex(this);
  44705. if (this.break) {
  44706. if (this.break.after !== "auto" || this.break.afterTarget !== "") {
  44707. const node = new BreakAfter({
  44708. targetType: this.break.after,
  44709. target: this.break.afterTarget,
  44710. startNew: this.break.startNew.toString()
  44711. });
  44712. node[$globalData] = this[$globalData];
  44713. this[$appendChild](node);
  44714. this.breakAfter.push(node);
  44715. }
  44716. if (this.break.before !== "auto" || this.break.beforeTarget !== "") {
  44717. const node = new BreakBefore({
  44718. targetType: this.break.before,
  44719. target: this.break.beforeTarget,
  44720. startNew: this.break.startNew.toString()
  44721. });
  44722. node[$globalData] = this[$globalData];
  44723. this[$appendChild](node);
  44724. this.breakBefore.push(node);
  44725. }
  44726. if (this.break.overflowTarget !== "") {
  44727. const node = new Overflow({
  44728. target: this.break.overflowTarget,
  44729. leader: this.break.overflowLeader,
  44730. trailer: this.break.overflowTrailer
  44731. });
  44732. node[$globalData] = this[$globalData];
  44733. this[$appendChild](node);
  44734. this.overflow.push(node);
  44735. }
  44736. this[$removeChild](this.break);
  44737. this.break = null;
  44738. }
  44739. if (this.presence === "hidden" || this.presence === "inactive") {
  44740. return HTMLResult.EMPTY;
  44741. }
  44742. if (this.breakBefore.children.length > 1 || this.breakAfter.children.length > 1) {
  44743. warn("XFA - Several breakBefore or breakAfter in subforms: please file a bug.");
  44744. }
  44745. if (this.breakBefore.children.length >= 1) {
  44746. const breakBefore = this.breakBefore.children[0];
  44747. if (handleBreak(breakBefore)) {
  44748. return HTMLResult.breakNode(breakBefore);
  44749. }
  44750. }
  44751. if (this[$extra]?.afterBreakAfter) {
  44752. return HTMLResult.EMPTY;
  44753. }
  44754. fixDimensions(this);
  44755. const children = [];
  44756. const attributes = {
  44757. id: this[$uid],
  44758. class: []
  44759. };
  44760. setAccess(this, attributes.class);
  44761. if (!this[$extra]) {
  44762. this[$extra] = Object.create(null);
  44763. }
  44764. Object.assign(this[$extra], {
  44765. children,
  44766. line: null,
  44767. attributes,
  44768. attempt: 0,
  44769. numberInLine: 0,
  44770. availableSpace: {
  44771. width: Math.min(this.w || Infinity, availableSpace.width),
  44772. height: Math.min(this.h || Infinity, availableSpace.height)
  44773. },
  44774. width: 0,
  44775. height: 0,
  44776. prevHeight: 0,
  44777. currentWidth: 0
  44778. });
  44779. const root = this[$getTemplateRoot]();
  44780. const savedNoLayoutFailure = root[$extra].noLayoutFailure;
  44781. const isSplittable = this[$isSplittable]();
  44782. if (!isSplittable) {
  44783. setFirstUnsplittable(this);
  44784. }
  44785. if (!checkDimensions(this, availableSpace)) {
  44786. return HTMLResult.FAILURE;
  44787. }
  44788. const filter = new Set(["area", "draw", "exclGroup", "field", "subform", "subformSet"]);
  44789. if (this.layout.includes("row")) {
  44790. const columnWidths = this[$getSubformParent]().columnWidths;
  44791. if (Array.isArray(columnWidths) && columnWidths.length > 0) {
  44792. this[$extra].columnWidths = columnWidths;
  44793. this[$extra].currentColumn = 0;
  44794. }
  44795. }
  44796. const style = toStyle(this, "anchorType", "dimensions", "position", "presence", "border", "margin", "hAlign");
  44797. const classNames = ["xfaSubform"];
  44798. const cl = layoutClass(this);
  44799. if (cl) {
  44800. classNames.push(cl);
  44801. }
  44802. attributes.style = style;
  44803. attributes.class = classNames;
  44804. if (this.name) {
  44805. attributes.xfaName = this.name;
  44806. }
  44807. if (this.overflow) {
  44808. const overflowExtra = this.overflow[$getExtra]();
  44809. if (overflowExtra.addLeader) {
  44810. overflowExtra.addLeader = false;
  44811. handleOverflow(this, overflowExtra.leader, availableSpace);
  44812. }
  44813. }
  44814. this[$pushPara]();
  44815. const isLrTb = this.layout === "lr-tb" || this.layout === "rl-tb";
  44816. const maxRun = isLrTb ? MAX_ATTEMPTS_FOR_LRTB_LAYOUT : 1;
  44817. for (; this[$extra].attempt < maxRun; this[$extra].attempt++) {
  44818. if (isLrTb && this[$extra].attempt === MAX_ATTEMPTS_FOR_LRTB_LAYOUT - 1) {
  44819. this[$extra].numberInLine = 0;
  44820. }
  44821. const result = this[$childrenToHTML]({
  44822. filter,
  44823. include: true
  44824. });
  44825. if (result.success) {
  44826. break;
  44827. }
  44828. if (result.isBreak()) {
  44829. this[$popPara]();
  44830. return result;
  44831. }
  44832. if (isLrTb && this[$extra].attempt === 0 && this[$extra].numberInLine === 0 && !root[$extra].noLayoutFailure) {
  44833. this[$extra].attempt = maxRun;
  44834. break;
  44835. }
  44836. }
  44837. this[$popPara]();
  44838. if (!isSplittable) {
  44839. unsetFirstUnsplittable(this);
  44840. }
  44841. root[$extra].noLayoutFailure = savedNoLayoutFailure;
  44842. if (this[$extra].attempt === maxRun) {
  44843. if (this.overflow) {
  44844. this[$getTemplateRoot]()[$extra].overflowNode = this.overflow;
  44845. }
  44846. if (!isSplittable) {
  44847. delete this[$extra];
  44848. }
  44849. return HTMLResult.FAILURE;
  44850. }
  44851. if (this.overflow) {
  44852. const overflowExtra = this.overflow[$getExtra]();
  44853. if (overflowExtra.addTrailer) {
  44854. overflowExtra.addTrailer = false;
  44855. handleOverflow(this, overflowExtra.trailer, availableSpace);
  44856. }
  44857. }
  44858. let marginH = 0;
  44859. let marginV = 0;
  44860. if (this.margin) {
  44861. marginH = this.margin.leftInset + this.margin.rightInset;
  44862. marginV = this.margin.topInset + this.margin.bottomInset;
  44863. }
  44864. const width = Math.max(this[$extra].width + marginH, this.w || 0);
  44865. const height = Math.max(this[$extra].height + marginV, this.h || 0);
  44866. const bbox = [this.x, this.y, width, height];
  44867. if (this.w === "") {
  44868. style.width = measureToString(width);
  44869. }
  44870. if (this.h === "") {
  44871. style.height = measureToString(height);
  44872. }
  44873. if ((style.width === "0px" || style.height === "0px") && children.length === 0) {
  44874. return HTMLResult.EMPTY;
  44875. }
  44876. const html = {
  44877. name: "div",
  44878. attributes,
  44879. children
  44880. };
  44881. applyAssist(this, attributes);
  44882. const result = HTMLResult.success(createWrapper(this, html), bbox);
  44883. if (this.breakAfter.children.length >= 1) {
  44884. const breakAfter = this.breakAfter.children[0];
  44885. if (handleBreak(breakAfter)) {
  44886. this[$extra].afterBreakAfter = result;
  44887. return HTMLResult.breakNode(breakAfter);
  44888. }
  44889. }
  44890. delete this[$extra];
  44891. return result;
  44892. }
  44893. }
  44894. class SubformSet extends XFAObject {
  44895. constructor(attributes) {
  44896. super(TEMPLATE_NS_ID, "subformSet", true);
  44897. this.id = attributes.id || "";
  44898. this.name = attributes.name || "";
  44899. this.relation = getStringOption(attributes.relation, ["ordered", "choice", "unordered"]);
  44900. this.relevant = getRelevant(attributes.relevant);
  44901. this.use = attributes.use || "";
  44902. this.usehref = attributes.usehref || "";
  44903. this.bookend = null;
  44904. this.break = null;
  44905. this.desc = null;
  44906. this.extras = null;
  44907. this.occur = null;
  44908. this.overflow = null;
  44909. this.breakAfter = new XFAObjectArray();
  44910. this.breakBefore = new XFAObjectArray();
  44911. this.subform = new XFAObjectArray();
  44912. this.subformSet = new XFAObjectArray();
  44913. }
  44914. *[$getContainedChildren]() {
  44915. yield* getContainedChildren(this);
  44916. }
  44917. [$getSubformParent]() {
  44918. let parent = this[$getParent]();
  44919. while (!(parent instanceof Subform)) {
  44920. parent = parent[$getParent]();
  44921. }
  44922. return parent;
  44923. }
  44924. [$isBindable]() {
  44925. return true;
  44926. }
  44927. }
  44928. class SubjectDN extends ContentObject {
  44929. constructor(attributes) {
  44930. super(TEMPLATE_NS_ID, "subjectDN");
  44931. this.delimiter = attributes.delimiter || ",";
  44932. this.id = attributes.id || "";
  44933. this.name = attributes.name || "";
  44934. this.use = attributes.use || "";
  44935. this.usehref = attributes.usehref || "";
  44936. }
  44937. [$finalize]() {
  44938. this[$content] = new Map(this[$content].split(this.delimiter).map(kv => {
  44939. kv = kv.split("=", 2);
  44940. kv[0] = kv[0].trim();
  44941. return kv;
  44942. }));
  44943. }
  44944. }
  44945. class SubjectDNs extends XFAObject {
  44946. constructor(attributes) {
  44947. super(TEMPLATE_NS_ID, "subjectDNs", true);
  44948. this.id = attributes.id || "";
  44949. this.type = getStringOption(attributes.type, ["optional", "required"]);
  44950. this.use = attributes.use || "";
  44951. this.usehref = attributes.usehref || "";
  44952. this.subjectDN = new XFAObjectArray();
  44953. }
  44954. }
  44955. class Submit extends XFAObject {
  44956. constructor(attributes) {
  44957. super(TEMPLATE_NS_ID, "submit", true);
  44958. this.embedPDF = getInteger({
  44959. data: attributes.embedPDF,
  44960. defaultValue: 0,
  44961. validate: x => x === 1
  44962. });
  44963. this.format = getStringOption(attributes.format, ["xdp", "formdata", "pdf", "urlencoded", "xfd", "xml"]);
  44964. this.id = attributes.id || "";
  44965. this.target = attributes.target || "";
  44966. this.textEncoding = getKeyword({
  44967. data: attributes.textEncoding ? attributes.textEncoding.toLowerCase() : "",
  44968. defaultValue: "",
  44969. 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}/)
  44970. });
  44971. this.use = attributes.use || "";
  44972. this.usehref = attributes.usehref || "";
  44973. this.xdpContent = attributes.xdpContent || "";
  44974. this.encrypt = null;
  44975. this.encryptData = new XFAObjectArray();
  44976. this.signData = new XFAObjectArray();
  44977. }
  44978. }
  44979. class Template extends XFAObject {
  44980. constructor(attributes) {
  44981. super(TEMPLATE_NS_ID, "template", true);
  44982. this.baseProfile = getStringOption(attributes.baseProfile, ["full", "interactiveForms"]);
  44983. this.extras = null;
  44984. this.subform = new XFAObjectArray();
  44985. }
  44986. [$finalize]() {
  44987. if (this.subform.children.length === 0) {
  44988. warn("XFA - No subforms in template node.");
  44989. }
  44990. if (this.subform.children.length >= 2) {
  44991. warn("XFA - Several subforms in template node: please file a bug.");
  44992. }
  44993. this[$tabIndex] = DEFAULT_TAB_INDEX;
  44994. }
  44995. [$isSplittable]() {
  44996. return true;
  44997. }
  44998. [$searchNode](expr, container) {
  44999. if (expr.startsWith("#")) {
  45000. return [this[$ids].get(expr.slice(1))];
  45001. }
  45002. return searchNode(this, container, expr, true, true);
  45003. }
  45004. *[$toPages]() {
  45005. if (!this.subform.children.length) {
  45006. return HTMLResult.success({
  45007. name: "div",
  45008. children: []
  45009. });
  45010. }
  45011. this[$extra] = {
  45012. overflowNode: null,
  45013. firstUnsplittable: null,
  45014. currentContentArea: null,
  45015. currentPageArea: null,
  45016. noLayoutFailure: false,
  45017. pageNumber: 1,
  45018. pagePosition: "first",
  45019. oddOrEven: "odd",
  45020. blankOrNotBlank: "nonBlank",
  45021. paraStack: []
  45022. };
  45023. const root = this.subform.children[0];
  45024. root.pageSet[$cleanPage]();
  45025. const pageAreas = root.pageSet.pageArea.children;
  45026. const mainHtml = {
  45027. name: "div",
  45028. children: []
  45029. };
  45030. let pageArea = null;
  45031. let breakBefore = null;
  45032. let breakBeforeTarget = null;
  45033. if (root.breakBefore.children.length >= 1) {
  45034. breakBefore = root.breakBefore.children[0];
  45035. breakBeforeTarget = breakBefore.target;
  45036. } else if (root.subform.children.length >= 1 && root.subform.children[0].breakBefore.children.length >= 1) {
  45037. breakBefore = root.subform.children[0].breakBefore.children[0];
  45038. breakBeforeTarget = breakBefore.target;
  45039. } else if (root.break?.beforeTarget) {
  45040. breakBefore = root.break;
  45041. breakBeforeTarget = breakBefore.beforeTarget;
  45042. } else if (root.subform.children.length >= 1 && root.subform.children[0].break?.beforeTarget) {
  45043. breakBefore = root.subform.children[0].break;
  45044. breakBeforeTarget = breakBefore.beforeTarget;
  45045. }
  45046. if (breakBefore) {
  45047. const target = this[$searchNode](breakBeforeTarget, breakBefore[$getParent]());
  45048. if (target instanceof PageArea) {
  45049. pageArea = target;
  45050. breakBefore[$extra] = {};
  45051. }
  45052. }
  45053. if (!pageArea) {
  45054. pageArea = pageAreas[0];
  45055. }
  45056. pageArea[$extra] = {
  45057. numberOfUse: 1
  45058. };
  45059. const pageAreaParent = pageArea[$getParent]();
  45060. pageAreaParent[$extra] = {
  45061. numberOfUse: 1,
  45062. pageIndex: pageAreaParent.pageArea.children.indexOf(pageArea),
  45063. pageSetIndex: 0
  45064. };
  45065. let targetPageArea;
  45066. let leader = null;
  45067. let trailer = null;
  45068. let hasSomething = true;
  45069. let hasSomethingCounter = 0;
  45070. let startIndex = 0;
  45071. while (true) {
  45072. if (!hasSomething) {
  45073. mainHtml.children.pop();
  45074. if (++hasSomethingCounter === MAX_EMPTY_PAGES) {
  45075. warn("XFA - Something goes wrong: please file a bug.");
  45076. return mainHtml;
  45077. }
  45078. } else {
  45079. hasSomethingCounter = 0;
  45080. }
  45081. targetPageArea = null;
  45082. this[$extra].currentPageArea = pageArea;
  45083. const page = pageArea[$toHTML]().html;
  45084. mainHtml.children.push(page);
  45085. if (leader) {
  45086. this[$extra].noLayoutFailure = true;
  45087. page.children.push(leader[$toHTML](pageArea[$extra].space).html);
  45088. leader = null;
  45089. }
  45090. if (trailer) {
  45091. this[$extra].noLayoutFailure = true;
  45092. page.children.push(trailer[$toHTML](pageArea[$extra].space).html);
  45093. trailer = null;
  45094. }
  45095. const contentAreas = pageArea.contentArea.children;
  45096. const htmlContentAreas = page.children.filter(node => node.attributes.class.includes("xfaContentarea"));
  45097. hasSomething = false;
  45098. this[$extra].firstUnsplittable = null;
  45099. this[$extra].noLayoutFailure = false;
  45100. const flush = index => {
  45101. const html = root[$flushHTML]();
  45102. if (html) {
  45103. hasSomething ||= html.children?.length > 0;
  45104. htmlContentAreas[index].children.push(html);
  45105. }
  45106. };
  45107. for (let i = startIndex, ii = contentAreas.length; i < ii; i++) {
  45108. const contentArea = this[$extra].currentContentArea = contentAreas[i];
  45109. const space = {
  45110. width: contentArea.w,
  45111. height: contentArea.h
  45112. };
  45113. startIndex = 0;
  45114. if (leader) {
  45115. htmlContentAreas[i].children.push(leader[$toHTML](space).html);
  45116. leader = null;
  45117. }
  45118. if (trailer) {
  45119. htmlContentAreas[i].children.push(trailer[$toHTML](space).html);
  45120. trailer = null;
  45121. }
  45122. const html = root[$toHTML](space);
  45123. if (html.success) {
  45124. if (html.html) {
  45125. hasSomething ||= html.html.children?.length > 0;
  45126. htmlContentAreas[i].children.push(html.html);
  45127. } else if (!hasSomething && mainHtml.children.length > 1) {
  45128. mainHtml.children.pop();
  45129. }
  45130. return mainHtml;
  45131. }
  45132. if (html.isBreak()) {
  45133. const node = html.breakNode;
  45134. flush(i);
  45135. if (node.targetType === "auto") {
  45136. continue;
  45137. }
  45138. if (node.leader) {
  45139. leader = this[$searchNode](node.leader, node[$getParent]());
  45140. leader = leader ? leader[0] : null;
  45141. }
  45142. if (node.trailer) {
  45143. trailer = this[$searchNode](node.trailer, node[$getParent]());
  45144. trailer = trailer ? trailer[0] : null;
  45145. }
  45146. if (node.targetType === "pageArea") {
  45147. targetPageArea = node[$extra].target;
  45148. i = Infinity;
  45149. } else if (!node[$extra].target) {
  45150. i = node[$extra].index;
  45151. } else {
  45152. targetPageArea = node[$extra].target;
  45153. startIndex = node[$extra].index + 1;
  45154. i = Infinity;
  45155. }
  45156. continue;
  45157. }
  45158. if (this[$extra].overflowNode) {
  45159. const node = this[$extra].overflowNode;
  45160. this[$extra].overflowNode = null;
  45161. const overflowExtra = node[$getExtra]();
  45162. const target = overflowExtra.target;
  45163. overflowExtra.addLeader = overflowExtra.leader !== null;
  45164. overflowExtra.addTrailer = overflowExtra.trailer !== null;
  45165. flush(i);
  45166. const currentIndex = i;
  45167. i = Infinity;
  45168. if (target instanceof PageArea) {
  45169. targetPageArea = target;
  45170. } else if (target instanceof ContentArea) {
  45171. const index = contentAreas.indexOf(target);
  45172. if (index !== -1) {
  45173. if (index > currentIndex) {
  45174. i = index - 1;
  45175. } else {
  45176. startIndex = index;
  45177. }
  45178. } else {
  45179. targetPageArea = target[$getParent]();
  45180. startIndex = targetPageArea.contentArea.children.indexOf(target);
  45181. }
  45182. }
  45183. continue;
  45184. }
  45185. flush(i);
  45186. }
  45187. this[$extra].pageNumber += 1;
  45188. if (targetPageArea) {
  45189. if (targetPageArea[$isUsable]()) {
  45190. targetPageArea[$extra].numberOfUse += 1;
  45191. } else {
  45192. targetPageArea = null;
  45193. }
  45194. }
  45195. pageArea = targetPageArea || pageArea[$getNextPage]();
  45196. yield null;
  45197. }
  45198. }
  45199. }
  45200. class Text extends ContentObject {
  45201. constructor(attributes) {
  45202. super(TEMPLATE_NS_ID, "text");
  45203. this.id = attributes.id || "";
  45204. this.maxChars = getInteger({
  45205. data: attributes.maxChars,
  45206. defaultValue: 0,
  45207. validate: x => x >= 0
  45208. });
  45209. this.name = attributes.name || "";
  45210. this.rid = attributes.rid || "";
  45211. this.use = attributes.use || "";
  45212. this.usehref = attributes.usehref || "";
  45213. }
  45214. [$acceptWhitespace]() {
  45215. return true;
  45216. }
  45217. [$onChild](child) {
  45218. if (child[$namespaceId] === NamespaceIds.xhtml.id) {
  45219. this[$content] = child;
  45220. return true;
  45221. }
  45222. warn(`XFA - Invalid content in Text: ${child[$nodeName]}.`);
  45223. return false;
  45224. }
  45225. [$onText](str) {
  45226. if (this[$content] instanceof XFAObject) {
  45227. return;
  45228. }
  45229. super[$onText](str);
  45230. }
  45231. [$finalize]() {
  45232. if (typeof this[$content] === "string") {
  45233. this[$content] = this[$content].replaceAll("\r\n", "\n");
  45234. }
  45235. }
  45236. [$getExtra]() {
  45237. if (typeof this[$content] === "string") {
  45238. return this[$content].split(/[\u2029\u2028\n]/).reduce((acc, line) => {
  45239. if (line) {
  45240. acc.push(line);
  45241. }
  45242. return acc;
  45243. }, []).join("\n");
  45244. }
  45245. return this[$content][$text]();
  45246. }
  45247. [$toHTML](availableSpace) {
  45248. if (typeof this[$content] === "string") {
  45249. const html = valueToHtml(this[$content]).html;
  45250. if (this[$content].includes("\u2029")) {
  45251. html.name = "div";
  45252. html.children = [];
  45253. this[$content].split("\u2029").map(para => para.split(/[\u2028\n]/).reduce((acc, line) => {
  45254. acc.push({
  45255. name: "span",
  45256. value: line
  45257. }, {
  45258. name: "br"
  45259. });
  45260. return acc;
  45261. }, [])).forEach(lines => {
  45262. html.children.push({
  45263. name: "p",
  45264. children: lines
  45265. });
  45266. });
  45267. } else if (/[\u2028\n]/.test(this[$content])) {
  45268. html.name = "div";
  45269. html.children = [];
  45270. this[$content].split(/[\u2028\n]/).forEach(line => {
  45271. html.children.push({
  45272. name: "span",
  45273. value: line
  45274. }, {
  45275. name: "br"
  45276. });
  45277. });
  45278. }
  45279. return HTMLResult.success(html);
  45280. }
  45281. return this[$content][$toHTML](availableSpace);
  45282. }
  45283. }
  45284. class TextEdit extends XFAObject {
  45285. constructor(attributes) {
  45286. super(TEMPLATE_NS_ID, "textEdit", true);
  45287. this.allowRichText = getInteger({
  45288. data: attributes.allowRichText,
  45289. defaultValue: 0,
  45290. validate: x => x === 1
  45291. });
  45292. this.hScrollPolicy = getStringOption(attributes.hScrollPolicy, ["auto", "off", "on"]);
  45293. this.id = attributes.id || "";
  45294. this.multiLine = getInteger({
  45295. data: attributes.multiLine,
  45296. defaultValue: "",
  45297. validate: x => x === 0 || x === 1
  45298. });
  45299. this.use = attributes.use || "";
  45300. this.usehref = attributes.usehref || "";
  45301. this.vScrollPolicy = getStringOption(attributes.vScrollPolicy, ["auto", "off", "on"]);
  45302. this.border = null;
  45303. this.comb = null;
  45304. this.extras = null;
  45305. this.margin = null;
  45306. }
  45307. [$toHTML](availableSpace) {
  45308. const style = toStyle(this, "border", "font", "margin");
  45309. let html;
  45310. const field = this[$getParent]()[$getParent]();
  45311. if (this.multiLine === "") {
  45312. this.multiLine = field instanceof Draw ? 1 : 0;
  45313. }
  45314. if (this.multiLine === 1) {
  45315. html = {
  45316. name: "textarea",
  45317. attributes: {
  45318. dataId: field[$data]?.[$uid] || field[$uid],
  45319. fieldId: field[$uid],
  45320. class: ["xfaTextfield"],
  45321. style,
  45322. "aria-label": ariaLabel(field),
  45323. "aria-required": false
  45324. }
  45325. };
  45326. } else {
  45327. html = {
  45328. name: "input",
  45329. attributes: {
  45330. type: "text",
  45331. dataId: field[$data]?.[$uid] || field[$uid],
  45332. fieldId: field[$uid],
  45333. class: ["xfaTextfield"],
  45334. style,
  45335. "aria-label": ariaLabel(field),
  45336. "aria-required": false
  45337. }
  45338. };
  45339. }
  45340. if (isRequired(field)) {
  45341. html.attributes["aria-required"] = true;
  45342. html.attributes.required = true;
  45343. }
  45344. return HTMLResult.success({
  45345. name: "label",
  45346. attributes: {
  45347. class: ["xfaLabel"]
  45348. },
  45349. children: [html]
  45350. });
  45351. }
  45352. }
  45353. class Time extends StringObject {
  45354. constructor(attributes) {
  45355. super(TEMPLATE_NS_ID, "time");
  45356. this.id = attributes.id || "";
  45357. this.name = attributes.name || "";
  45358. this.use = attributes.use || "";
  45359. this.usehref = attributes.usehref || "";
  45360. }
  45361. [$finalize]() {
  45362. const date = this[$content].trim();
  45363. this[$content] = date ? new Date(date) : null;
  45364. }
  45365. [$toHTML](availableSpace) {
  45366. return valueToHtml(this[$content] ? this[$content].toString() : "");
  45367. }
  45368. }
  45369. class TimeStamp extends XFAObject {
  45370. constructor(attributes) {
  45371. super(TEMPLATE_NS_ID, "timeStamp");
  45372. this.id = attributes.id || "";
  45373. this.server = attributes.server || "";
  45374. this.type = getStringOption(attributes.type, ["optional", "required"]);
  45375. this.use = attributes.use || "";
  45376. this.usehref = attributes.usehref || "";
  45377. }
  45378. }
  45379. class ToolTip extends StringObject {
  45380. constructor(attributes) {
  45381. super(TEMPLATE_NS_ID, "toolTip");
  45382. this.id = attributes.id || "";
  45383. this.rid = attributes.rid || "";
  45384. this.use = attributes.use || "";
  45385. this.usehref = attributes.usehref || "";
  45386. }
  45387. }
  45388. class Traversal extends XFAObject {
  45389. constructor(attributes) {
  45390. super(TEMPLATE_NS_ID, "traversal", true);
  45391. this.id = attributes.id || "";
  45392. this.use = attributes.use || "";
  45393. this.usehref = attributes.usehref || "";
  45394. this.extras = null;
  45395. this.traverse = new XFAObjectArray();
  45396. }
  45397. }
  45398. class Traverse extends XFAObject {
  45399. constructor(attributes) {
  45400. super(TEMPLATE_NS_ID, "traverse", true);
  45401. this.id = attributes.id || "";
  45402. this.operation = getStringOption(attributes.operation, ["next", "back", "down", "first", "left", "right", "up"]);
  45403. this.ref = attributes.ref || "";
  45404. this.use = attributes.use || "";
  45405. this.usehref = attributes.usehref || "";
  45406. this.extras = null;
  45407. this.script = null;
  45408. }
  45409. get name() {
  45410. return this.operation;
  45411. }
  45412. [$isTransparent]() {
  45413. return false;
  45414. }
  45415. }
  45416. class Ui extends XFAObject {
  45417. constructor(attributes) {
  45418. super(TEMPLATE_NS_ID, "ui", true);
  45419. this.id = attributes.id || "";
  45420. this.use = attributes.use || "";
  45421. this.usehref = attributes.usehref || "";
  45422. this.extras = null;
  45423. this.picture = null;
  45424. this.barcode = null;
  45425. this.button = null;
  45426. this.checkButton = null;
  45427. this.choiceList = null;
  45428. this.dateTimeEdit = null;
  45429. this.defaultUi = null;
  45430. this.imageEdit = null;
  45431. this.numericEdit = null;
  45432. this.passwordEdit = null;
  45433. this.signature = null;
  45434. this.textEdit = null;
  45435. }
  45436. [$getExtra]() {
  45437. if (this[$extra] === undefined) {
  45438. for (const name of Object.getOwnPropertyNames(this)) {
  45439. if (name === "extras" || name === "picture") {
  45440. continue;
  45441. }
  45442. const obj = this[name];
  45443. if (!(obj instanceof XFAObject)) {
  45444. continue;
  45445. }
  45446. this[$extra] = obj;
  45447. return obj;
  45448. }
  45449. this[$extra] = null;
  45450. }
  45451. return this[$extra];
  45452. }
  45453. [$toHTML](availableSpace) {
  45454. const obj = this[$getExtra]();
  45455. if (obj) {
  45456. return obj[$toHTML](availableSpace);
  45457. }
  45458. return HTMLResult.EMPTY;
  45459. }
  45460. }
  45461. class Validate extends XFAObject {
  45462. constructor(attributes) {
  45463. super(TEMPLATE_NS_ID, "validate", true);
  45464. this.formatTest = getStringOption(attributes.formatTest, ["warning", "disabled", "error"]);
  45465. this.id = attributes.id || "";
  45466. this.nullTest = getStringOption(attributes.nullTest, ["disabled", "error", "warning"]);
  45467. this.scriptTest = getStringOption(attributes.scriptTest, ["error", "disabled", "warning"]);
  45468. this.use = attributes.use || "";
  45469. this.usehref = attributes.usehref || "";
  45470. this.extras = null;
  45471. this.message = null;
  45472. this.picture = null;
  45473. this.script = null;
  45474. }
  45475. }
  45476. class Value extends XFAObject {
  45477. constructor(attributes) {
  45478. super(TEMPLATE_NS_ID, "value", true);
  45479. this.id = attributes.id || "";
  45480. this.override = getInteger({
  45481. data: attributes.override,
  45482. defaultValue: 0,
  45483. validate: x => x === 1
  45484. });
  45485. this.relevant = getRelevant(attributes.relevant);
  45486. this.use = attributes.use || "";
  45487. this.usehref = attributes.usehref || "";
  45488. this.arc = null;
  45489. this.boolean = null;
  45490. this.date = null;
  45491. this.dateTime = null;
  45492. this.decimal = null;
  45493. this.exData = null;
  45494. this.float = null;
  45495. this.image = null;
  45496. this.integer = null;
  45497. this.line = null;
  45498. this.rectangle = null;
  45499. this.text = null;
  45500. this.time = null;
  45501. }
  45502. [$setValue](value) {
  45503. const parent = this[$getParent]();
  45504. if (parent instanceof Field) {
  45505. if (parent.ui?.imageEdit) {
  45506. if (!this.image) {
  45507. this.image = new Image({});
  45508. this[$appendChild](this.image);
  45509. }
  45510. this.image[$content] = value[$content];
  45511. return;
  45512. }
  45513. }
  45514. const valueName = value[$nodeName];
  45515. if (this[valueName] !== null) {
  45516. this[valueName][$content] = value[$content];
  45517. return;
  45518. }
  45519. for (const name of Object.getOwnPropertyNames(this)) {
  45520. const obj = this[name];
  45521. if (obj instanceof XFAObject) {
  45522. this[name] = null;
  45523. this[$removeChild](obj);
  45524. }
  45525. }
  45526. this[value[$nodeName]] = value;
  45527. this[$appendChild](value);
  45528. }
  45529. [$text]() {
  45530. if (this.exData) {
  45531. if (typeof this.exData[$content] === "string") {
  45532. return this.exData[$content].trim();
  45533. }
  45534. return this.exData[$content][$text]().trim();
  45535. }
  45536. for (const name of Object.getOwnPropertyNames(this)) {
  45537. if (name === "image") {
  45538. continue;
  45539. }
  45540. const obj = this[name];
  45541. if (obj instanceof XFAObject) {
  45542. return (obj[$content] || "").toString().trim();
  45543. }
  45544. }
  45545. return null;
  45546. }
  45547. [$toHTML](availableSpace) {
  45548. for (const name of Object.getOwnPropertyNames(this)) {
  45549. const obj = this[name];
  45550. if (!(obj instanceof XFAObject)) {
  45551. continue;
  45552. }
  45553. return obj[$toHTML](availableSpace);
  45554. }
  45555. return HTMLResult.EMPTY;
  45556. }
  45557. }
  45558. class Variables extends XFAObject {
  45559. constructor(attributes) {
  45560. super(TEMPLATE_NS_ID, "variables", true);
  45561. this.id = attributes.id || "";
  45562. this.use = attributes.use || "";
  45563. this.usehref = attributes.usehref || "";
  45564. this.boolean = new XFAObjectArray();
  45565. this.date = new XFAObjectArray();
  45566. this.dateTime = new XFAObjectArray();
  45567. this.decimal = new XFAObjectArray();
  45568. this.exData = new XFAObjectArray();
  45569. this.float = new XFAObjectArray();
  45570. this.image = new XFAObjectArray();
  45571. this.integer = new XFAObjectArray();
  45572. this.manifest = new XFAObjectArray();
  45573. this.script = new XFAObjectArray();
  45574. this.text = new XFAObjectArray();
  45575. this.time = new XFAObjectArray();
  45576. }
  45577. [$isTransparent]() {
  45578. return true;
  45579. }
  45580. }
  45581. class TemplateNamespace {
  45582. static [$buildXFAObject](name, attributes) {
  45583. if (TemplateNamespace.hasOwnProperty(name)) {
  45584. const node = TemplateNamespace[name](attributes);
  45585. node[$setSetAttributes](attributes);
  45586. return node;
  45587. }
  45588. return undefined;
  45589. }
  45590. static appearanceFilter(attrs) {
  45591. return new AppearanceFilter(attrs);
  45592. }
  45593. static arc(attrs) {
  45594. return new Arc(attrs);
  45595. }
  45596. static area(attrs) {
  45597. return new Area(attrs);
  45598. }
  45599. static assist(attrs) {
  45600. return new Assist(attrs);
  45601. }
  45602. static barcode(attrs) {
  45603. return new Barcode(attrs);
  45604. }
  45605. static bind(attrs) {
  45606. return new Bind(attrs);
  45607. }
  45608. static bindItems(attrs) {
  45609. return new BindItems(attrs);
  45610. }
  45611. static bookend(attrs) {
  45612. return new Bookend(attrs);
  45613. }
  45614. static boolean(attrs) {
  45615. return new BooleanElement(attrs);
  45616. }
  45617. static border(attrs) {
  45618. return new Border(attrs);
  45619. }
  45620. static break(attrs) {
  45621. return new Break(attrs);
  45622. }
  45623. static breakAfter(attrs) {
  45624. return new BreakAfter(attrs);
  45625. }
  45626. static breakBefore(attrs) {
  45627. return new BreakBefore(attrs);
  45628. }
  45629. static button(attrs) {
  45630. return new Button(attrs);
  45631. }
  45632. static calculate(attrs) {
  45633. return new Calculate(attrs);
  45634. }
  45635. static caption(attrs) {
  45636. return new Caption(attrs);
  45637. }
  45638. static certificate(attrs) {
  45639. return new Certificate(attrs);
  45640. }
  45641. static certificates(attrs) {
  45642. return new Certificates(attrs);
  45643. }
  45644. static checkButton(attrs) {
  45645. return new CheckButton(attrs);
  45646. }
  45647. static choiceList(attrs) {
  45648. return new ChoiceList(attrs);
  45649. }
  45650. static color(attrs) {
  45651. return new Color(attrs);
  45652. }
  45653. static comb(attrs) {
  45654. return new Comb(attrs);
  45655. }
  45656. static connect(attrs) {
  45657. return new Connect(attrs);
  45658. }
  45659. static contentArea(attrs) {
  45660. return new ContentArea(attrs);
  45661. }
  45662. static corner(attrs) {
  45663. return new Corner(attrs);
  45664. }
  45665. static date(attrs) {
  45666. return new DateElement(attrs);
  45667. }
  45668. static dateTime(attrs) {
  45669. return new DateTime(attrs);
  45670. }
  45671. static dateTimeEdit(attrs) {
  45672. return new DateTimeEdit(attrs);
  45673. }
  45674. static decimal(attrs) {
  45675. return new Decimal(attrs);
  45676. }
  45677. static defaultUi(attrs) {
  45678. return new DefaultUi(attrs);
  45679. }
  45680. static desc(attrs) {
  45681. return new Desc(attrs);
  45682. }
  45683. static digestMethod(attrs) {
  45684. return new DigestMethod(attrs);
  45685. }
  45686. static digestMethods(attrs) {
  45687. return new DigestMethods(attrs);
  45688. }
  45689. static draw(attrs) {
  45690. return new Draw(attrs);
  45691. }
  45692. static edge(attrs) {
  45693. return new Edge(attrs);
  45694. }
  45695. static encoding(attrs) {
  45696. return new Encoding(attrs);
  45697. }
  45698. static encodings(attrs) {
  45699. return new Encodings(attrs);
  45700. }
  45701. static encrypt(attrs) {
  45702. return new Encrypt(attrs);
  45703. }
  45704. static encryptData(attrs) {
  45705. return new EncryptData(attrs);
  45706. }
  45707. static encryption(attrs) {
  45708. return new Encryption(attrs);
  45709. }
  45710. static encryptionMethod(attrs) {
  45711. return new EncryptionMethod(attrs);
  45712. }
  45713. static encryptionMethods(attrs) {
  45714. return new EncryptionMethods(attrs);
  45715. }
  45716. static event(attrs) {
  45717. return new Event(attrs);
  45718. }
  45719. static exData(attrs) {
  45720. return new ExData(attrs);
  45721. }
  45722. static exObject(attrs) {
  45723. return new ExObject(attrs);
  45724. }
  45725. static exclGroup(attrs) {
  45726. return new ExclGroup(attrs);
  45727. }
  45728. static execute(attrs) {
  45729. return new Execute(attrs);
  45730. }
  45731. static extras(attrs) {
  45732. return new Extras(attrs);
  45733. }
  45734. static field(attrs) {
  45735. return new Field(attrs);
  45736. }
  45737. static fill(attrs) {
  45738. return new Fill(attrs);
  45739. }
  45740. static filter(attrs) {
  45741. return new Filter(attrs);
  45742. }
  45743. static float(attrs) {
  45744. return new Float(attrs);
  45745. }
  45746. static font(attrs) {
  45747. return new template_Font(attrs);
  45748. }
  45749. static format(attrs) {
  45750. return new Format(attrs);
  45751. }
  45752. static handler(attrs) {
  45753. return new Handler(attrs);
  45754. }
  45755. static hyphenation(attrs) {
  45756. return new Hyphenation(attrs);
  45757. }
  45758. static image(attrs) {
  45759. return new Image(attrs);
  45760. }
  45761. static imageEdit(attrs) {
  45762. return new ImageEdit(attrs);
  45763. }
  45764. static integer(attrs) {
  45765. return new Integer(attrs);
  45766. }
  45767. static issuers(attrs) {
  45768. return new Issuers(attrs);
  45769. }
  45770. static items(attrs) {
  45771. return new Items(attrs);
  45772. }
  45773. static keep(attrs) {
  45774. return new Keep(attrs);
  45775. }
  45776. static keyUsage(attrs) {
  45777. return new KeyUsage(attrs);
  45778. }
  45779. static line(attrs) {
  45780. return new Line(attrs);
  45781. }
  45782. static linear(attrs) {
  45783. return new Linear(attrs);
  45784. }
  45785. static lockDocument(attrs) {
  45786. return new LockDocument(attrs);
  45787. }
  45788. static manifest(attrs) {
  45789. return new Manifest(attrs);
  45790. }
  45791. static margin(attrs) {
  45792. return new Margin(attrs);
  45793. }
  45794. static mdp(attrs) {
  45795. return new Mdp(attrs);
  45796. }
  45797. static medium(attrs) {
  45798. return new Medium(attrs);
  45799. }
  45800. static message(attrs) {
  45801. return new Message(attrs);
  45802. }
  45803. static numericEdit(attrs) {
  45804. return new NumericEdit(attrs);
  45805. }
  45806. static occur(attrs) {
  45807. return new Occur(attrs);
  45808. }
  45809. static oid(attrs) {
  45810. return new Oid(attrs);
  45811. }
  45812. static oids(attrs) {
  45813. return new Oids(attrs);
  45814. }
  45815. static overflow(attrs) {
  45816. return new Overflow(attrs);
  45817. }
  45818. static pageArea(attrs) {
  45819. return new PageArea(attrs);
  45820. }
  45821. static pageSet(attrs) {
  45822. return new PageSet(attrs);
  45823. }
  45824. static para(attrs) {
  45825. return new Para(attrs);
  45826. }
  45827. static passwordEdit(attrs) {
  45828. return new PasswordEdit(attrs);
  45829. }
  45830. static pattern(attrs) {
  45831. return new template_Pattern(attrs);
  45832. }
  45833. static picture(attrs) {
  45834. return new Picture(attrs);
  45835. }
  45836. static proto(attrs) {
  45837. return new Proto(attrs);
  45838. }
  45839. static radial(attrs) {
  45840. return new Radial(attrs);
  45841. }
  45842. static reason(attrs) {
  45843. return new Reason(attrs);
  45844. }
  45845. static reasons(attrs) {
  45846. return new Reasons(attrs);
  45847. }
  45848. static rectangle(attrs) {
  45849. return new Rectangle(attrs);
  45850. }
  45851. static ref(attrs) {
  45852. return new RefElement(attrs);
  45853. }
  45854. static script(attrs) {
  45855. return new Script(attrs);
  45856. }
  45857. static setProperty(attrs) {
  45858. return new SetProperty(attrs);
  45859. }
  45860. static signData(attrs) {
  45861. return new SignData(attrs);
  45862. }
  45863. static signature(attrs) {
  45864. return new Signature(attrs);
  45865. }
  45866. static signing(attrs) {
  45867. return new Signing(attrs);
  45868. }
  45869. static solid(attrs) {
  45870. return new Solid(attrs);
  45871. }
  45872. static speak(attrs) {
  45873. return new Speak(attrs);
  45874. }
  45875. static stipple(attrs) {
  45876. return new Stipple(attrs);
  45877. }
  45878. static subform(attrs) {
  45879. return new Subform(attrs);
  45880. }
  45881. static subformSet(attrs) {
  45882. return new SubformSet(attrs);
  45883. }
  45884. static subjectDN(attrs) {
  45885. return new SubjectDN(attrs);
  45886. }
  45887. static subjectDNs(attrs) {
  45888. return new SubjectDNs(attrs);
  45889. }
  45890. static submit(attrs) {
  45891. return new Submit(attrs);
  45892. }
  45893. static template(attrs) {
  45894. return new Template(attrs);
  45895. }
  45896. static text(attrs) {
  45897. return new Text(attrs);
  45898. }
  45899. static textEdit(attrs) {
  45900. return new TextEdit(attrs);
  45901. }
  45902. static time(attrs) {
  45903. return new Time(attrs);
  45904. }
  45905. static timeStamp(attrs) {
  45906. return new TimeStamp(attrs);
  45907. }
  45908. static toolTip(attrs) {
  45909. return new ToolTip(attrs);
  45910. }
  45911. static traversal(attrs) {
  45912. return new Traversal(attrs);
  45913. }
  45914. static traverse(attrs) {
  45915. return new Traverse(attrs);
  45916. }
  45917. static ui(attrs) {
  45918. return new Ui(attrs);
  45919. }
  45920. static validate(attrs) {
  45921. return new Validate(attrs);
  45922. }
  45923. static value(attrs) {
  45924. return new Value(attrs);
  45925. }
  45926. static variables(attrs) {
  45927. return new Variables(attrs);
  45928. }
  45929. }
  45930. ;// CONCATENATED MODULE: ./src/core/xfa/bind.js
  45931. const bind_NS_DATASETS = NamespaceIds.datasets.id;
  45932. function createText(content) {
  45933. const node = new Text({});
  45934. node[$content] = content;
  45935. return node;
  45936. }
  45937. class Binder {
  45938. constructor(root) {
  45939. this.root = root;
  45940. this.datasets = root.datasets;
  45941. this.data = root.datasets?.data || new XmlObject(NamespaceIds.datasets.id, "data");
  45942. this.emptyMerge = this.data[$getChildren]().length === 0;
  45943. this.root.form = this.form = root.template[$clone]();
  45944. }
  45945. _isConsumeData() {
  45946. return !this.emptyMerge && this._mergeMode;
  45947. }
  45948. _isMatchTemplate() {
  45949. return !this._isConsumeData();
  45950. }
  45951. bind() {
  45952. this._bindElement(this.form, this.data);
  45953. return this.form;
  45954. }
  45955. getData() {
  45956. return this.data;
  45957. }
  45958. _bindValue(formNode, data, picture) {
  45959. formNode[$data] = data;
  45960. if (formNode[$hasSettableValue]()) {
  45961. if (data[$isDataValue]()) {
  45962. const value = data[$getDataValue]();
  45963. formNode[$setValue](createText(value));
  45964. } else if (formNode instanceof Field && formNode.ui?.choiceList?.open === "multiSelect") {
  45965. const value = data[$getChildren]().map(child => child[$content].trim()).join("\n");
  45966. formNode[$setValue](createText(value));
  45967. } else if (this._isConsumeData()) {
  45968. warn(`XFA - Nodes haven't the same type.`);
  45969. }
  45970. } else if (!data[$isDataValue]() || this._isMatchTemplate()) {
  45971. this._bindElement(formNode, data);
  45972. } else {
  45973. warn(`XFA - Nodes haven't the same type.`);
  45974. }
  45975. }
  45976. _findDataByNameToConsume(name, isValue, dataNode, global) {
  45977. if (!name) {
  45978. return null;
  45979. }
  45980. let generator, match;
  45981. for (let i = 0; i < 3; i++) {
  45982. generator = dataNode[$getRealChildrenByNameIt](name, false, true);
  45983. while (true) {
  45984. match = generator.next().value;
  45985. if (!match) {
  45986. break;
  45987. }
  45988. if (isValue === match[$isDataValue]()) {
  45989. return match;
  45990. }
  45991. }
  45992. if (dataNode[$namespaceId] === NamespaceIds.datasets.id && dataNode[$nodeName] === "data") {
  45993. break;
  45994. }
  45995. dataNode = dataNode[$getParent]();
  45996. }
  45997. if (!global) {
  45998. return null;
  45999. }
  46000. generator = this.data[$getRealChildrenByNameIt](name, true, false);
  46001. match = generator.next().value;
  46002. if (match) {
  46003. return match;
  46004. }
  46005. generator = this.data[$getAttributeIt](name, true);
  46006. match = generator.next().value;
  46007. if (match?.[$isDataValue]()) {
  46008. return match;
  46009. }
  46010. return null;
  46011. }
  46012. _setProperties(formNode, dataNode) {
  46013. if (!formNode.hasOwnProperty("setProperty")) {
  46014. return;
  46015. }
  46016. for (const {
  46017. ref,
  46018. target,
  46019. connection
  46020. } of formNode.setProperty.children) {
  46021. if (connection) {
  46022. continue;
  46023. }
  46024. if (!ref) {
  46025. continue;
  46026. }
  46027. const nodes = searchNode(this.root, dataNode, ref, false, false);
  46028. if (!nodes) {
  46029. warn(`XFA - Invalid reference: ${ref}.`);
  46030. continue;
  46031. }
  46032. const [node] = nodes;
  46033. if (!node[$isDescendent](this.data)) {
  46034. warn(`XFA - Invalid node: must be a data node.`);
  46035. continue;
  46036. }
  46037. const targetNodes = searchNode(this.root, formNode, target, false, false);
  46038. if (!targetNodes) {
  46039. warn(`XFA - Invalid target: ${target}.`);
  46040. continue;
  46041. }
  46042. const [targetNode] = targetNodes;
  46043. if (!targetNode[$isDescendent](formNode)) {
  46044. warn(`XFA - Invalid target: must be a property or subproperty.`);
  46045. continue;
  46046. }
  46047. const targetParent = targetNode[$getParent]();
  46048. if (targetNode instanceof SetProperty || targetParent instanceof SetProperty) {
  46049. warn(`XFA - Invalid target: cannot be a setProperty or one of its properties.`);
  46050. continue;
  46051. }
  46052. if (targetNode instanceof BindItems || targetParent instanceof BindItems) {
  46053. warn(`XFA - Invalid target: cannot be a bindItems or one of its properties.`);
  46054. continue;
  46055. }
  46056. const content = node[$text]();
  46057. const name = targetNode[$nodeName];
  46058. if (targetNode instanceof XFAAttribute) {
  46059. const attrs = Object.create(null);
  46060. attrs[name] = content;
  46061. const obj = Reflect.construct(Object.getPrototypeOf(targetParent).constructor, [attrs]);
  46062. targetParent[name] = obj[name];
  46063. continue;
  46064. }
  46065. if (!targetNode.hasOwnProperty($content)) {
  46066. warn(`XFA - Invalid node to use in setProperty`);
  46067. continue;
  46068. }
  46069. targetNode[$data] = node;
  46070. targetNode[$content] = content;
  46071. targetNode[$finalize]();
  46072. }
  46073. }
  46074. _bindItems(formNode, dataNode) {
  46075. if (!formNode.hasOwnProperty("items") || !formNode.hasOwnProperty("bindItems") || formNode.bindItems.isEmpty()) {
  46076. return;
  46077. }
  46078. for (const item of formNode.items.children) {
  46079. formNode[$removeChild](item);
  46080. }
  46081. formNode.items.clear();
  46082. const labels = new Items({});
  46083. const values = new Items({});
  46084. formNode[$appendChild](labels);
  46085. formNode.items.push(labels);
  46086. formNode[$appendChild](values);
  46087. formNode.items.push(values);
  46088. for (const {
  46089. ref,
  46090. labelRef,
  46091. valueRef,
  46092. connection
  46093. } of formNode.bindItems.children) {
  46094. if (connection) {
  46095. continue;
  46096. }
  46097. if (!ref) {
  46098. continue;
  46099. }
  46100. const nodes = searchNode(this.root, dataNode, ref, false, false);
  46101. if (!nodes) {
  46102. warn(`XFA - Invalid reference: ${ref}.`);
  46103. continue;
  46104. }
  46105. for (const node of nodes) {
  46106. if (!node[$isDescendent](this.datasets)) {
  46107. warn(`XFA - Invalid ref (${ref}): must be a datasets child.`);
  46108. continue;
  46109. }
  46110. const labelNodes = searchNode(this.root, node, labelRef, true, false);
  46111. if (!labelNodes) {
  46112. warn(`XFA - Invalid label: ${labelRef}.`);
  46113. continue;
  46114. }
  46115. const [labelNode] = labelNodes;
  46116. if (!labelNode[$isDescendent](this.datasets)) {
  46117. warn(`XFA - Invalid label: must be a datasets child.`);
  46118. continue;
  46119. }
  46120. const valueNodes = searchNode(this.root, node, valueRef, true, false);
  46121. if (!valueNodes) {
  46122. warn(`XFA - Invalid value: ${valueRef}.`);
  46123. continue;
  46124. }
  46125. const [valueNode] = valueNodes;
  46126. if (!valueNode[$isDescendent](this.datasets)) {
  46127. warn(`XFA - Invalid value: must be a datasets child.`);
  46128. continue;
  46129. }
  46130. const label = createText(labelNode[$text]());
  46131. const value = createText(valueNode[$text]());
  46132. labels[$appendChild](label);
  46133. labels.text.push(label);
  46134. values[$appendChild](value);
  46135. values.text.push(value);
  46136. }
  46137. }
  46138. }
  46139. _bindOccurrences(formNode, matches, picture) {
  46140. let baseClone;
  46141. if (matches.length > 1) {
  46142. baseClone = formNode[$clone]();
  46143. baseClone[$removeChild](baseClone.occur);
  46144. baseClone.occur = null;
  46145. }
  46146. this._bindValue(formNode, matches[0], picture);
  46147. this._setProperties(formNode, matches[0]);
  46148. this._bindItems(formNode, matches[0]);
  46149. if (matches.length === 1) {
  46150. return;
  46151. }
  46152. const parent = formNode[$getParent]();
  46153. const name = formNode[$nodeName];
  46154. const pos = parent[$indexOf](formNode);
  46155. for (let i = 1, ii = matches.length; i < ii; i++) {
  46156. const match = matches[i];
  46157. const clone = baseClone[$clone]();
  46158. parent[name].push(clone);
  46159. parent[$insertAt](pos + i, clone);
  46160. this._bindValue(clone, match, picture);
  46161. this._setProperties(clone, match);
  46162. this._bindItems(clone, match);
  46163. }
  46164. }
  46165. _createOccurrences(formNode) {
  46166. if (!this.emptyMerge) {
  46167. return;
  46168. }
  46169. const {
  46170. occur
  46171. } = formNode;
  46172. if (!occur || occur.initial <= 1) {
  46173. return;
  46174. }
  46175. const parent = formNode[$getParent]();
  46176. const name = formNode[$nodeName];
  46177. if (!(parent[name] instanceof XFAObjectArray)) {
  46178. return;
  46179. }
  46180. let currentNumber;
  46181. if (formNode.name) {
  46182. currentNumber = parent[name].children.filter(e => e.name === formNode.name).length;
  46183. } else {
  46184. currentNumber = parent[name].children.length;
  46185. }
  46186. const pos = parent[$indexOf](formNode) + 1;
  46187. const ii = occur.initial - currentNumber;
  46188. if (ii) {
  46189. const nodeClone = formNode[$clone]();
  46190. nodeClone[$removeChild](nodeClone.occur);
  46191. nodeClone.occur = null;
  46192. parent[name].push(nodeClone);
  46193. parent[$insertAt](pos, nodeClone);
  46194. for (let i = 1; i < ii; i++) {
  46195. const clone = nodeClone[$clone]();
  46196. parent[name].push(clone);
  46197. parent[$insertAt](pos + i, clone);
  46198. }
  46199. }
  46200. }
  46201. _getOccurInfo(formNode) {
  46202. const {
  46203. name,
  46204. occur
  46205. } = formNode;
  46206. if (!occur || !name) {
  46207. return [1, 1];
  46208. }
  46209. const max = occur.max === -1 ? Infinity : occur.max;
  46210. return [occur.min, max];
  46211. }
  46212. _setAndBind(formNode, dataNode) {
  46213. this._setProperties(formNode, dataNode);
  46214. this._bindItems(formNode, dataNode);
  46215. this._bindElement(formNode, dataNode);
  46216. }
  46217. _bindElement(formNode, dataNode) {
  46218. const uselessNodes = [];
  46219. this._createOccurrences(formNode);
  46220. for (const child of formNode[$getChildren]()) {
  46221. if (child[$data]) {
  46222. continue;
  46223. }
  46224. if (this._mergeMode === undefined && child[$nodeName] === "subform") {
  46225. this._mergeMode = child.mergeMode === "consumeData";
  46226. const dataChildren = dataNode[$getChildren]();
  46227. if (dataChildren.length > 0) {
  46228. this._bindOccurrences(child, [dataChildren[0]], null);
  46229. } else if (this.emptyMerge) {
  46230. const nsId = dataNode[$namespaceId] === bind_NS_DATASETS ? -1 : dataNode[$namespaceId];
  46231. const dataChild = child[$data] = new XmlObject(nsId, child.name || "root");
  46232. dataNode[$appendChild](dataChild);
  46233. this._bindElement(child, dataChild);
  46234. }
  46235. continue;
  46236. }
  46237. if (!child[$isBindable]()) {
  46238. continue;
  46239. }
  46240. let global = false;
  46241. let picture = null;
  46242. let ref = null;
  46243. let match = null;
  46244. if (child.bind) {
  46245. switch (child.bind.match) {
  46246. case "none":
  46247. this._setAndBind(child, dataNode);
  46248. continue;
  46249. case "global":
  46250. global = true;
  46251. break;
  46252. case "dataRef":
  46253. if (!child.bind.ref) {
  46254. warn(`XFA - ref is empty in node ${child[$nodeName]}.`);
  46255. this._setAndBind(child, dataNode);
  46256. continue;
  46257. }
  46258. ref = child.bind.ref;
  46259. break;
  46260. default:
  46261. break;
  46262. }
  46263. if (child.bind.picture) {
  46264. picture = child.bind.picture[$content];
  46265. }
  46266. }
  46267. const [min, max] = this._getOccurInfo(child);
  46268. if (ref) {
  46269. match = searchNode(this.root, dataNode, ref, true, false);
  46270. if (match === null) {
  46271. match = createDataNode(this.data, dataNode, ref);
  46272. if (!match) {
  46273. continue;
  46274. }
  46275. if (this._isConsumeData()) {
  46276. match[$consumed] = true;
  46277. }
  46278. this._setAndBind(child, match);
  46279. continue;
  46280. } else {
  46281. if (this._isConsumeData()) {
  46282. match = match.filter(node => !node[$consumed]);
  46283. }
  46284. if (match.length > max) {
  46285. match = match.slice(0, max);
  46286. } else if (match.length === 0) {
  46287. match = null;
  46288. }
  46289. if (match && this._isConsumeData()) {
  46290. match.forEach(node => {
  46291. node[$consumed] = true;
  46292. });
  46293. }
  46294. }
  46295. } else {
  46296. if (!child.name) {
  46297. this._setAndBind(child, dataNode);
  46298. continue;
  46299. }
  46300. if (this._isConsumeData()) {
  46301. const matches = [];
  46302. while (matches.length < max) {
  46303. const found = this._findDataByNameToConsume(child.name, child[$hasSettableValue](), dataNode, global);
  46304. if (!found) {
  46305. break;
  46306. }
  46307. found[$consumed] = true;
  46308. matches.push(found);
  46309. }
  46310. match = matches.length > 0 ? matches : null;
  46311. } else {
  46312. match = dataNode[$getRealChildrenByNameIt](child.name, false, this.emptyMerge).next().value;
  46313. if (!match) {
  46314. if (min === 0) {
  46315. uselessNodes.push(child);
  46316. continue;
  46317. }
  46318. const nsId = dataNode[$namespaceId] === bind_NS_DATASETS ? -1 : dataNode[$namespaceId];
  46319. match = child[$data] = new XmlObject(nsId, child.name);
  46320. if (this.emptyMerge) {
  46321. match[$consumed] = true;
  46322. }
  46323. dataNode[$appendChild](match);
  46324. this._setAndBind(child, match);
  46325. continue;
  46326. }
  46327. if (this.emptyMerge) {
  46328. match[$consumed] = true;
  46329. }
  46330. match = [match];
  46331. }
  46332. }
  46333. if (match) {
  46334. this._bindOccurrences(child, match, picture);
  46335. } else if (min > 0) {
  46336. this._setAndBind(child, dataNode);
  46337. } else {
  46338. uselessNodes.push(child);
  46339. }
  46340. }
  46341. uselessNodes.forEach(node => node[$getParent]()[$removeChild](node));
  46342. }
  46343. }
  46344. ;// CONCATENATED MODULE: ./src/core/xfa/data.js
  46345. class DataHandler {
  46346. constructor(root, data) {
  46347. this.data = data;
  46348. this.dataset = root.datasets || null;
  46349. }
  46350. serialize(storage) {
  46351. const stack = [[-1, this.data[$getChildren]()]];
  46352. while (stack.length > 0) {
  46353. const last = stack.at(-1);
  46354. const [i, children] = last;
  46355. if (i + 1 === children.length) {
  46356. stack.pop();
  46357. continue;
  46358. }
  46359. const child = children[++last[0]];
  46360. const storageEntry = storage.get(child[$uid]);
  46361. if (storageEntry) {
  46362. child[$setValue](storageEntry);
  46363. } else {
  46364. const attributes = child[$getAttributes]();
  46365. for (const value of attributes.values()) {
  46366. const entry = storage.get(value[$uid]);
  46367. if (entry) {
  46368. value[$setValue](entry);
  46369. break;
  46370. }
  46371. }
  46372. }
  46373. const nodes = child[$getChildren]();
  46374. if (nodes.length > 0) {
  46375. stack.push([-1, nodes]);
  46376. }
  46377. }
  46378. const buf = [`<xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">`];
  46379. if (this.dataset) {
  46380. for (const child of this.dataset[$getChildren]()) {
  46381. if (child[$nodeName] !== "data") {
  46382. child[$toString](buf);
  46383. }
  46384. }
  46385. }
  46386. this.data[$toString](buf);
  46387. buf.push("</xfa:datasets>");
  46388. return buf.join("");
  46389. }
  46390. }
  46391. ;// CONCATENATED MODULE: ./src/core/xfa/config.js
  46392. const CONFIG_NS_ID = NamespaceIds.config.id;
  46393. class Acrobat extends XFAObject {
  46394. constructor(attributes) {
  46395. super(CONFIG_NS_ID, "acrobat", true);
  46396. this.acrobat7 = null;
  46397. this.autoSave = null;
  46398. this.common = null;
  46399. this.validate = null;
  46400. this.validateApprovalSignatures = null;
  46401. this.submitUrl = new XFAObjectArray();
  46402. }
  46403. }
  46404. class Acrobat7 extends XFAObject {
  46405. constructor(attributes) {
  46406. super(CONFIG_NS_ID, "acrobat7", true);
  46407. this.dynamicRender = null;
  46408. }
  46409. }
  46410. class ADBE_JSConsole extends OptionObject {
  46411. constructor(attributes) {
  46412. super(CONFIG_NS_ID, "ADBE_JSConsole", ["delegate", "Enable", "Disable"]);
  46413. }
  46414. }
  46415. class ADBE_JSDebugger extends OptionObject {
  46416. constructor(attributes) {
  46417. super(CONFIG_NS_ID, "ADBE_JSDebugger", ["delegate", "Enable", "Disable"]);
  46418. }
  46419. }
  46420. class AddSilentPrint extends Option01 {
  46421. constructor(attributes) {
  46422. super(CONFIG_NS_ID, "addSilentPrint");
  46423. }
  46424. }
  46425. class AddViewerPreferences extends Option01 {
  46426. constructor(attributes) {
  46427. super(CONFIG_NS_ID, "addViewerPreferences");
  46428. }
  46429. }
  46430. class AdjustData extends Option10 {
  46431. constructor(attributes) {
  46432. super(CONFIG_NS_ID, "adjustData");
  46433. }
  46434. }
  46435. class AdobeExtensionLevel extends IntegerObject {
  46436. constructor(attributes) {
  46437. super(CONFIG_NS_ID, "adobeExtensionLevel", 0, n => n >= 1 && n <= 8);
  46438. }
  46439. }
  46440. class Agent extends XFAObject {
  46441. constructor(attributes) {
  46442. super(CONFIG_NS_ID, "agent", true);
  46443. this.name = attributes.name ? attributes.name.trim() : "";
  46444. this.common = new XFAObjectArray();
  46445. }
  46446. }
  46447. class AlwaysEmbed extends ContentObject {
  46448. constructor(attributes) {
  46449. super(CONFIG_NS_ID, "alwaysEmbed");
  46450. }
  46451. }
  46452. class Amd extends StringObject {
  46453. constructor(attributes) {
  46454. super(CONFIG_NS_ID, "amd");
  46455. }
  46456. }
  46457. class config_Area extends XFAObject {
  46458. constructor(attributes) {
  46459. super(CONFIG_NS_ID, "area");
  46460. this.level = getInteger({
  46461. data: attributes.level,
  46462. defaultValue: 0,
  46463. validate: n => n >= 1 && n <= 3
  46464. });
  46465. this.name = getStringOption(attributes.name, ["", "barcode", "coreinit", "deviceDriver", "font", "general", "layout", "merge", "script", "signature", "sourceSet", "templateCache"]);
  46466. }
  46467. }
  46468. class Attributes extends OptionObject {
  46469. constructor(attributes) {
  46470. super(CONFIG_NS_ID, "attributes", ["preserve", "delegate", "ignore"]);
  46471. }
  46472. }
  46473. class AutoSave extends OptionObject {
  46474. constructor(attributes) {
  46475. super(CONFIG_NS_ID, "autoSave", ["disabled", "enabled"]);
  46476. }
  46477. }
  46478. class Base extends StringObject {
  46479. constructor(attributes) {
  46480. super(CONFIG_NS_ID, "base");
  46481. }
  46482. }
  46483. class BatchOutput extends XFAObject {
  46484. constructor(attributes) {
  46485. super(CONFIG_NS_ID, "batchOutput");
  46486. this.format = getStringOption(attributes.format, ["none", "concat", "zip", "zipCompress"]);
  46487. }
  46488. }
  46489. class BehaviorOverride extends ContentObject {
  46490. constructor(attributes) {
  46491. super(CONFIG_NS_ID, "behaviorOverride");
  46492. }
  46493. [$finalize]() {
  46494. this[$content] = new Map(this[$content].trim().split(/\s+/).filter(x => x.includes(":")).map(x => x.split(":", 2)));
  46495. }
  46496. }
  46497. class Cache extends XFAObject {
  46498. constructor(attributes) {
  46499. super(CONFIG_NS_ID, "cache", true);
  46500. this.templateCache = null;
  46501. }
  46502. }
  46503. class Change extends Option01 {
  46504. constructor(attributes) {
  46505. super(CONFIG_NS_ID, "change");
  46506. }
  46507. }
  46508. class Common extends XFAObject {
  46509. constructor(attributes) {
  46510. super(CONFIG_NS_ID, "common", true);
  46511. this.data = null;
  46512. this.locale = null;
  46513. this.localeSet = null;
  46514. this.messaging = null;
  46515. this.suppressBanner = null;
  46516. this.template = null;
  46517. this.validationMessaging = null;
  46518. this.versionControl = null;
  46519. this.log = new XFAObjectArray();
  46520. }
  46521. }
  46522. class Compress extends XFAObject {
  46523. constructor(attributes) {
  46524. super(CONFIG_NS_ID, "compress");
  46525. this.scope = getStringOption(attributes.scope, ["imageOnly", "document"]);
  46526. }
  46527. }
  46528. class CompressLogicalStructure extends Option01 {
  46529. constructor(attributes) {
  46530. super(CONFIG_NS_ID, "compressLogicalStructure");
  46531. }
  46532. }
  46533. class CompressObjectStream extends Option10 {
  46534. constructor(attributes) {
  46535. super(CONFIG_NS_ID, "compressObjectStream");
  46536. }
  46537. }
  46538. class Compression extends XFAObject {
  46539. constructor(attributes) {
  46540. super(CONFIG_NS_ID, "compression", true);
  46541. this.compressLogicalStructure = null;
  46542. this.compressObjectStream = null;
  46543. this.level = null;
  46544. this.type = null;
  46545. }
  46546. }
  46547. class Config extends XFAObject {
  46548. constructor(attributes) {
  46549. super(CONFIG_NS_ID, "config", true);
  46550. this.acrobat = null;
  46551. this.present = null;
  46552. this.trace = null;
  46553. this.agent = new XFAObjectArray();
  46554. }
  46555. }
  46556. class Conformance extends OptionObject {
  46557. constructor(attributes) {
  46558. super(CONFIG_NS_ID, "conformance", ["A", "B"]);
  46559. }
  46560. }
  46561. class ContentCopy extends Option01 {
  46562. constructor(attributes) {
  46563. super(CONFIG_NS_ID, "contentCopy");
  46564. }
  46565. }
  46566. class Copies extends IntegerObject {
  46567. constructor(attributes) {
  46568. super(CONFIG_NS_ID, "copies", 1, n => n >= 1);
  46569. }
  46570. }
  46571. class Creator extends StringObject {
  46572. constructor(attributes) {
  46573. super(CONFIG_NS_ID, "creator");
  46574. }
  46575. }
  46576. class CurrentPage extends IntegerObject {
  46577. constructor(attributes) {
  46578. super(CONFIG_NS_ID, "currentPage", 0, n => n >= 0);
  46579. }
  46580. }
  46581. class Data extends XFAObject {
  46582. constructor(attributes) {
  46583. super(CONFIG_NS_ID, "data", true);
  46584. this.adjustData = null;
  46585. this.attributes = null;
  46586. this.incrementalLoad = null;
  46587. this.outputXSL = null;
  46588. this.range = null;
  46589. this.record = null;
  46590. this.startNode = null;
  46591. this.uri = null;
  46592. this.window = null;
  46593. this.xsl = null;
  46594. this.excludeNS = new XFAObjectArray();
  46595. this.transform = new XFAObjectArray();
  46596. }
  46597. }
  46598. class Debug extends XFAObject {
  46599. constructor(attributes) {
  46600. super(CONFIG_NS_ID, "debug", true);
  46601. this.uri = null;
  46602. }
  46603. }
  46604. class DefaultTypeface extends ContentObject {
  46605. constructor(attributes) {
  46606. super(CONFIG_NS_ID, "defaultTypeface");
  46607. this.writingScript = getStringOption(attributes.writingScript, ["*", "Arabic", "Cyrillic", "EastEuropeanRoman", "Greek", "Hebrew", "Japanese", "Korean", "Roman", "SimplifiedChinese", "Thai", "TraditionalChinese", "Vietnamese"]);
  46608. }
  46609. }
  46610. class Destination extends OptionObject {
  46611. constructor(attributes) {
  46612. super(CONFIG_NS_ID, "destination", ["pdf", "pcl", "ps", "webClient", "zpl"]);
  46613. }
  46614. }
  46615. class DocumentAssembly extends Option01 {
  46616. constructor(attributes) {
  46617. super(CONFIG_NS_ID, "documentAssembly");
  46618. }
  46619. }
  46620. class Driver extends XFAObject {
  46621. constructor(attributes) {
  46622. super(CONFIG_NS_ID, "driver", true);
  46623. this.name = attributes.name ? attributes.name.trim() : "";
  46624. this.fontInfo = null;
  46625. this.xdc = null;
  46626. }
  46627. }
  46628. class DuplexOption extends OptionObject {
  46629. constructor(attributes) {
  46630. super(CONFIG_NS_ID, "duplexOption", ["simplex", "duplexFlipLongEdge", "duplexFlipShortEdge"]);
  46631. }
  46632. }
  46633. class DynamicRender extends OptionObject {
  46634. constructor(attributes) {
  46635. super(CONFIG_NS_ID, "dynamicRender", ["forbidden", "required"]);
  46636. }
  46637. }
  46638. class Embed extends Option01 {
  46639. constructor(attributes) {
  46640. super(CONFIG_NS_ID, "embed");
  46641. }
  46642. }
  46643. class config_Encrypt extends Option01 {
  46644. constructor(attributes) {
  46645. super(CONFIG_NS_ID, "encrypt");
  46646. }
  46647. }
  46648. class config_Encryption extends XFAObject {
  46649. constructor(attributes) {
  46650. super(CONFIG_NS_ID, "encryption", true);
  46651. this.encrypt = null;
  46652. this.encryptionLevel = null;
  46653. this.permissions = null;
  46654. }
  46655. }
  46656. class EncryptionLevel extends OptionObject {
  46657. constructor(attributes) {
  46658. super(CONFIG_NS_ID, "encryptionLevel", ["40bit", "128bit"]);
  46659. }
  46660. }
  46661. class Enforce extends StringObject {
  46662. constructor(attributes) {
  46663. super(CONFIG_NS_ID, "enforce");
  46664. }
  46665. }
  46666. class Equate extends XFAObject {
  46667. constructor(attributes) {
  46668. super(CONFIG_NS_ID, "equate");
  46669. this.force = getInteger({
  46670. data: attributes.force,
  46671. defaultValue: 1,
  46672. validate: n => n === 0
  46673. });
  46674. this.from = attributes.from || "";
  46675. this.to = attributes.to || "";
  46676. }
  46677. }
  46678. class EquateRange extends XFAObject {
  46679. constructor(attributes) {
  46680. super(CONFIG_NS_ID, "equateRange");
  46681. this.from = attributes.from || "";
  46682. this.to = attributes.to || "";
  46683. this._unicodeRange = attributes.unicodeRange || "";
  46684. }
  46685. get unicodeRange() {
  46686. const ranges = [];
  46687. const unicodeRegex = /U\+([0-9a-fA-F]+)/;
  46688. const unicodeRange = this._unicodeRange;
  46689. for (let range of unicodeRange.split(",").map(x => x.trim()).filter(x => !!x)) {
  46690. range = range.split("-", 2).map(x => {
  46691. const found = x.match(unicodeRegex);
  46692. if (!found) {
  46693. return 0;
  46694. }
  46695. return parseInt(found[1], 16);
  46696. });
  46697. if (range.length === 1) {
  46698. range.push(range[0]);
  46699. }
  46700. ranges.push(range);
  46701. }
  46702. return shadow(this, "unicodeRange", ranges);
  46703. }
  46704. }
  46705. class Exclude extends ContentObject {
  46706. constructor(attributes) {
  46707. super(CONFIG_NS_ID, "exclude");
  46708. }
  46709. [$finalize]() {
  46710. this[$content] = this[$content].trim().split(/\s+/).filter(x => x && ["calculate", "close", "enter", "exit", "initialize", "ready", "validate"].includes(x));
  46711. }
  46712. }
  46713. class ExcludeNS extends StringObject {
  46714. constructor(attributes) {
  46715. super(CONFIG_NS_ID, "excludeNS");
  46716. }
  46717. }
  46718. class FlipLabel extends OptionObject {
  46719. constructor(attributes) {
  46720. super(CONFIG_NS_ID, "flipLabel", ["usePrinterSetting", "on", "off"]);
  46721. }
  46722. }
  46723. class config_FontInfo extends XFAObject {
  46724. constructor(attributes) {
  46725. super(CONFIG_NS_ID, "fontInfo", true);
  46726. this.embed = null;
  46727. this.map = null;
  46728. this.subsetBelow = null;
  46729. this.alwaysEmbed = new XFAObjectArray();
  46730. this.defaultTypeface = new XFAObjectArray();
  46731. this.neverEmbed = new XFAObjectArray();
  46732. }
  46733. }
  46734. class FormFieldFilling extends Option01 {
  46735. constructor(attributes) {
  46736. super(CONFIG_NS_ID, "formFieldFilling");
  46737. }
  46738. }
  46739. class GroupParent extends StringObject {
  46740. constructor(attributes) {
  46741. super(CONFIG_NS_ID, "groupParent");
  46742. }
  46743. }
  46744. class IfEmpty extends OptionObject {
  46745. constructor(attributes) {
  46746. super(CONFIG_NS_ID, "ifEmpty", ["dataValue", "dataGroup", "ignore", "remove"]);
  46747. }
  46748. }
  46749. class IncludeXDPContent extends StringObject {
  46750. constructor(attributes) {
  46751. super(CONFIG_NS_ID, "includeXDPContent");
  46752. }
  46753. }
  46754. class IncrementalLoad extends OptionObject {
  46755. constructor(attributes) {
  46756. super(CONFIG_NS_ID, "incrementalLoad", ["none", "forwardOnly"]);
  46757. }
  46758. }
  46759. class IncrementalMerge extends Option01 {
  46760. constructor(attributes) {
  46761. super(CONFIG_NS_ID, "incrementalMerge");
  46762. }
  46763. }
  46764. class Interactive extends Option01 {
  46765. constructor(attributes) {
  46766. super(CONFIG_NS_ID, "interactive");
  46767. }
  46768. }
  46769. class Jog extends OptionObject {
  46770. constructor(attributes) {
  46771. super(CONFIG_NS_ID, "jog", ["usePrinterSetting", "none", "pageSet"]);
  46772. }
  46773. }
  46774. class LabelPrinter extends XFAObject {
  46775. constructor(attributes) {
  46776. super(CONFIG_NS_ID, "labelPrinter", true);
  46777. this.name = getStringOption(attributes.name, ["zpl", "dpl", "ipl", "tcpl"]);
  46778. this.batchOutput = null;
  46779. this.flipLabel = null;
  46780. this.fontInfo = null;
  46781. this.xdc = null;
  46782. }
  46783. }
  46784. class Layout extends OptionObject {
  46785. constructor(attributes) {
  46786. super(CONFIG_NS_ID, "layout", ["paginate", "panel"]);
  46787. }
  46788. }
  46789. class Level extends IntegerObject {
  46790. constructor(attributes) {
  46791. super(CONFIG_NS_ID, "level", 0, n => n > 0);
  46792. }
  46793. }
  46794. class Linearized extends Option01 {
  46795. constructor(attributes) {
  46796. super(CONFIG_NS_ID, "linearized");
  46797. }
  46798. }
  46799. class Locale extends StringObject {
  46800. constructor(attributes) {
  46801. super(CONFIG_NS_ID, "locale");
  46802. }
  46803. }
  46804. class LocaleSet extends StringObject {
  46805. constructor(attributes) {
  46806. super(CONFIG_NS_ID, "localeSet");
  46807. }
  46808. }
  46809. class Log extends XFAObject {
  46810. constructor(attributes) {
  46811. super(CONFIG_NS_ID, "log", true);
  46812. this.mode = null;
  46813. this.threshold = null;
  46814. this.to = null;
  46815. this.uri = null;
  46816. }
  46817. }
  46818. class MapElement extends XFAObject {
  46819. constructor(attributes) {
  46820. super(CONFIG_NS_ID, "map", true);
  46821. this.equate = new XFAObjectArray();
  46822. this.equateRange = new XFAObjectArray();
  46823. }
  46824. }
  46825. class MediumInfo extends XFAObject {
  46826. constructor(attributes) {
  46827. super(CONFIG_NS_ID, "mediumInfo", true);
  46828. this.map = null;
  46829. }
  46830. }
  46831. class config_Message extends XFAObject {
  46832. constructor(attributes) {
  46833. super(CONFIG_NS_ID, "message", true);
  46834. this.msgId = null;
  46835. this.severity = null;
  46836. }
  46837. }
  46838. class Messaging extends XFAObject {
  46839. constructor(attributes) {
  46840. super(CONFIG_NS_ID, "messaging", true);
  46841. this.message = new XFAObjectArray();
  46842. }
  46843. }
  46844. class Mode extends OptionObject {
  46845. constructor(attributes) {
  46846. super(CONFIG_NS_ID, "mode", ["append", "overwrite"]);
  46847. }
  46848. }
  46849. class ModifyAnnots extends Option01 {
  46850. constructor(attributes) {
  46851. super(CONFIG_NS_ID, "modifyAnnots");
  46852. }
  46853. }
  46854. class MsgId extends IntegerObject {
  46855. constructor(attributes) {
  46856. super(CONFIG_NS_ID, "msgId", 1, n => n >= 1);
  46857. }
  46858. }
  46859. class NameAttr extends StringObject {
  46860. constructor(attributes) {
  46861. super(CONFIG_NS_ID, "nameAttr");
  46862. }
  46863. }
  46864. class NeverEmbed extends ContentObject {
  46865. constructor(attributes) {
  46866. super(CONFIG_NS_ID, "neverEmbed");
  46867. }
  46868. }
  46869. class NumberOfCopies extends IntegerObject {
  46870. constructor(attributes) {
  46871. super(CONFIG_NS_ID, "numberOfCopies", null, n => n >= 2 && n <= 5);
  46872. }
  46873. }
  46874. class OpenAction extends XFAObject {
  46875. constructor(attributes) {
  46876. super(CONFIG_NS_ID, "openAction", true);
  46877. this.destination = null;
  46878. }
  46879. }
  46880. class Output extends XFAObject {
  46881. constructor(attributes) {
  46882. super(CONFIG_NS_ID, "output", true);
  46883. this.to = null;
  46884. this.type = null;
  46885. this.uri = null;
  46886. }
  46887. }
  46888. class OutputBin extends StringObject {
  46889. constructor(attributes) {
  46890. super(CONFIG_NS_ID, "outputBin");
  46891. }
  46892. }
  46893. class OutputXSL extends XFAObject {
  46894. constructor(attributes) {
  46895. super(CONFIG_NS_ID, "outputXSL", true);
  46896. this.uri = null;
  46897. }
  46898. }
  46899. class Overprint extends OptionObject {
  46900. constructor(attributes) {
  46901. super(CONFIG_NS_ID, "overprint", ["none", "both", "draw", "field"]);
  46902. }
  46903. }
  46904. class Packets extends StringObject {
  46905. constructor(attributes) {
  46906. super(CONFIG_NS_ID, "packets");
  46907. }
  46908. [$finalize]() {
  46909. if (this[$content] === "*") {
  46910. return;
  46911. }
  46912. this[$content] = this[$content].trim().split(/\s+/).filter(x => ["config", "datasets", "template", "xfdf", "xslt"].includes(x));
  46913. }
  46914. }
  46915. class PageOffset extends XFAObject {
  46916. constructor(attributes) {
  46917. super(CONFIG_NS_ID, "pageOffset");
  46918. this.x = getInteger({
  46919. data: attributes.x,
  46920. defaultValue: "useXDCSetting",
  46921. validate: n => true
  46922. });
  46923. this.y = getInteger({
  46924. data: attributes.y,
  46925. defaultValue: "useXDCSetting",
  46926. validate: n => true
  46927. });
  46928. }
  46929. }
  46930. class PageRange extends StringObject {
  46931. constructor(attributes) {
  46932. super(CONFIG_NS_ID, "pageRange");
  46933. }
  46934. [$finalize]() {
  46935. const numbers = this[$content].trim().split(/\s+/).map(x => parseInt(x, 10));
  46936. const ranges = [];
  46937. for (let i = 0, ii = numbers.length; i < ii; i += 2) {
  46938. ranges.push(numbers.slice(i, i + 2));
  46939. }
  46940. this[$content] = ranges;
  46941. }
  46942. }
  46943. class Pagination extends OptionObject {
  46944. constructor(attributes) {
  46945. super(CONFIG_NS_ID, "pagination", ["simplex", "duplexShortEdge", "duplexLongEdge"]);
  46946. }
  46947. }
  46948. class PaginationOverride extends OptionObject {
  46949. constructor(attributes) {
  46950. super(CONFIG_NS_ID, "paginationOverride", ["none", "forceDuplex", "forceDuplexLongEdge", "forceDuplexShortEdge", "forceSimplex"]);
  46951. }
  46952. }
  46953. class Part extends IntegerObject {
  46954. constructor(attributes) {
  46955. super(CONFIG_NS_ID, "part", 1, n => false);
  46956. }
  46957. }
  46958. class Pcl extends XFAObject {
  46959. constructor(attributes) {
  46960. super(CONFIG_NS_ID, "pcl", true);
  46961. this.name = attributes.name || "";
  46962. this.batchOutput = null;
  46963. this.fontInfo = null;
  46964. this.jog = null;
  46965. this.mediumInfo = null;
  46966. this.outputBin = null;
  46967. this.pageOffset = null;
  46968. this.staple = null;
  46969. this.xdc = null;
  46970. }
  46971. }
  46972. class Pdf extends XFAObject {
  46973. constructor(attributes) {
  46974. super(CONFIG_NS_ID, "pdf", true);
  46975. this.name = attributes.name || "";
  46976. this.adobeExtensionLevel = null;
  46977. this.batchOutput = null;
  46978. this.compression = null;
  46979. this.creator = null;
  46980. this.encryption = null;
  46981. this.fontInfo = null;
  46982. this.interactive = null;
  46983. this.linearized = null;
  46984. this.openAction = null;
  46985. this.pdfa = null;
  46986. this.producer = null;
  46987. this.renderPolicy = null;
  46988. this.scriptModel = null;
  46989. this.silentPrint = null;
  46990. this.submitFormat = null;
  46991. this.tagged = null;
  46992. this.version = null;
  46993. this.viewerPreferences = null;
  46994. this.xdc = null;
  46995. }
  46996. }
  46997. class Pdfa extends XFAObject {
  46998. constructor(attributes) {
  46999. super(CONFIG_NS_ID, "pdfa", true);
  47000. this.amd = null;
  47001. this.conformance = null;
  47002. this.includeXDPContent = null;
  47003. this.part = null;
  47004. }
  47005. }
  47006. class Permissions extends XFAObject {
  47007. constructor(attributes) {
  47008. super(CONFIG_NS_ID, "permissions", true);
  47009. this.accessibleContent = null;
  47010. this.change = null;
  47011. this.contentCopy = null;
  47012. this.documentAssembly = null;
  47013. this.formFieldFilling = null;
  47014. this.modifyAnnots = null;
  47015. this.plaintextMetadata = null;
  47016. this.print = null;
  47017. this.printHighQuality = null;
  47018. }
  47019. }
  47020. class PickTrayByPDFSize extends Option01 {
  47021. constructor(attributes) {
  47022. super(CONFIG_NS_ID, "pickTrayByPDFSize");
  47023. }
  47024. }
  47025. class config_Picture extends StringObject {
  47026. constructor(attributes) {
  47027. super(CONFIG_NS_ID, "picture");
  47028. }
  47029. }
  47030. class PlaintextMetadata extends Option01 {
  47031. constructor(attributes) {
  47032. super(CONFIG_NS_ID, "plaintextMetadata");
  47033. }
  47034. }
  47035. class Presence extends OptionObject {
  47036. constructor(attributes) {
  47037. super(CONFIG_NS_ID, "presence", ["preserve", "dissolve", "dissolveStructure", "ignore", "remove"]);
  47038. }
  47039. }
  47040. class Present extends XFAObject {
  47041. constructor(attributes) {
  47042. super(CONFIG_NS_ID, "present", true);
  47043. this.behaviorOverride = null;
  47044. this.cache = null;
  47045. this.common = null;
  47046. this.copies = null;
  47047. this.destination = null;
  47048. this.incrementalMerge = null;
  47049. this.layout = null;
  47050. this.output = null;
  47051. this.overprint = null;
  47052. this.pagination = null;
  47053. this.paginationOverride = null;
  47054. this.script = null;
  47055. this.validate = null;
  47056. this.xdp = null;
  47057. this.driver = new XFAObjectArray();
  47058. this.labelPrinter = new XFAObjectArray();
  47059. this.pcl = new XFAObjectArray();
  47060. this.pdf = new XFAObjectArray();
  47061. this.ps = new XFAObjectArray();
  47062. this.submitUrl = new XFAObjectArray();
  47063. this.webClient = new XFAObjectArray();
  47064. this.zpl = new XFAObjectArray();
  47065. }
  47066. }
  47067. class Print extends Option01 {
  47068. constructor(attributes) {
  47069. super(CONFIG_NS_ID, "print");
  47070. }
  47071. }
  47072. class PrintHighQuality extends Option01 {
  47073. constructor(attributes) {
  47074. super(CONFIG_NS_ID, "printHighQuality");
  47075. }
  47076. }
  47077. class PrintScaling extends OptionObject {
  47078. constructor(attributes) {
  47079. super(CONFIG_NS_ID, "printScaling", ["appdefault", "noScaling"]);
  47080. }
  47081. }
  47082. class PrinterName extends StringObject {
  47083. constructor(attributes) {
  47084. super(CONFIG_NS_ID, "printerName");
  47085. }
  47086. }
  47087. class Producer extends StringObject {
  47088. constructor(attributes) {
  47089. super(CONFIG_NS_ID, "producer");
  47090. }
  47091. }
  47092. class Ps extends XFAObject {
  47093. constructor(attributes) {
  47094. super(CONFIG_NS_ID, "ps", true);
  47095. this.name = attributes.name || "";
  47096. this.batchOutput = null;
  47097. this.fontInfo = null;
  47098. this.jog = null;
  47099. this.mediumInfo = null;
  47100. this.outputBin = null;
  47101. this.staple = null;
  47102. this.xdc = null;
  47103. }
  47104. }
  47105. class Range extends ContentObject {
  47106. constructor(attributes) {
  47107. super(CONFIG_NS_ID, "range");
  47108. }
  47109. [$finalize]() {
  47110. 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 => {
  47111. if (range.length === 1) {
  47112. range.push(range[0]);
  47113. }
  47114. return range;
  47115. });
  47116. }
  47117. }
  47118. class Record extends ContentObject {
  47119. constructor(attributes) {
  47120. super(CONFIG_NS_ID, "record");
  47121. }
  47122. [$finalize]() {
  47123. this[$content] = this[$content].trim();
  47124. const n = parseInt(this[$content], 10);
  47125. if (!isNaN(n) && n >= 0) {
  47126. this[$content] = n;
  47127. }
  47128. }
  47129. }
  47130. class Relevant extends ContentObject {
  47131. constructor(attributes) {
  47132. super(CONFIG_NS_ID, "relevant");
  47133. }
  47134. [$finalize]() {
  47135. this[$content] = this[$content].trim().split(/\s+/);
  47136. }
  47137. }
  47138. class Rename extends ContentObject {
  47139. constructor(attributes) {
  47140. super(CONFIG_NS_ID, "rename");
  47141. }
  47142. [$finalize]() {
  47143. this[$content] = this[$content].trim();
  47144. if (this[$content].toLowerCase().startsWith("xml") || new RegExp("[\\p{L}_][\\p{L}\\d._\\p{M}-]*", "u").test(this[$content])) {
  47145. warn("XFA - Rename: invalid XFA name");
  47146. }
  47147. }
  47148. }
  47149. class RenderPolicy extends OptionObject {
  47150. constructor(attributes) {
  47151. super(CONFIG_NS_ID, "renderPolicy", ["server", "client"]);
  47152. }
  47153. }
  47154. class RunScripts extends OptionObject {
  47155. constructor(attributes) {
  47156. super(CONFIG_NS_ID, "runScripts", ["both", "client", "none", "server"]);
  47157. }
  47158. }
  47159. class config_Script extends XFAObject {
  47160. constructor(attributes) {
  47161. super(CONFIG_NS_ID, "script", true);
  47162. this.currentPage = null;
  47163. this.exclude = null;
  47164. this.runScripts = null;
  47165. }
  47166. }
  47167. class ScriptModel extends OptionObject {
  47168. constructor(attributes) {
  47169. super(CONFIG_NS_ID, "scriptModel", ["XFA", "none"]);
  47170. }
  47171. }
  47172. class Severity extends OptionObject {
  47173. constructor(attributes) {
  47174. super(CONFIG_NS_ID, "severity", ["ignore", "error", "information", "trace", "warning"]);
  47175. }
  47176. }
  47177. class SilentPrint extends XFAObject {
  47178. constructor(attributes) {
  47179. super(CONFIG_NS_ID, "silentPrint", true);
  47180. this.addSilentPrint = null;
  47181. this.printerName = null;
  47182. }
  47183. }
  47184. class Staple extends XFAObject {
  47185. constructor(attributes) {
  47186. super(CONFIG_NS_ID, "staple");
  47187. this.mode = getStringOption(attributes.mode, ["usePrinterSetting", "on", "off"]);
  47188. }
  47189. }
  47190. class StartNode extends StringObject {
  47191. constructor(attributes) {
  47192. super(CONFIG_NS_ID, "startNode");
  47193. }
  47194. }
  47195. class StartPage extends IntegerObject {
  47196. constructor(attributes) {
  47197. super(CONFIG_NS_ID, "startPage", 0, n => true);
  47198. }
  47199. }
  47200. class SubmitFormat extends OptionObject {
  47201. constructor(attributes) {
  47202. super(CONFIG_NS_ID, "submitFormat", ["html", "delegate", "fdf", "xml", "pdf"]);
  47203. }
  47204. }
  47205. class SubmitUrl extends StringObject {
  47206. constructor(attributes) {
  47207. super(CONFIG_NS_ID, "submitUrl");
  47208. }
  47209. }
  47210. class SubsetBelow extends IntegerObject {
  47211. constructor(attributes) {
  47212. super(CONFIG_NS_ID, "subsetBelow", 100, n => n >= 0 && n <= 100);
  47213. }
  47214. }
  47215. class SuppressBanner extends Option01 {
  47216. constructor(attributes) {
  47217. super(CONFIG_NS_ID, "suppressBanner");
  47218. }
  47219. }
  47220. class Tagged extends Option01 {
  47221. constructor(attributes) {
  47222. super(CONFIG_NS_ID, "tagged");
  47223. }
  47224. }
  47225. class config_Template extends XFAObject {
  47226. constructor(attributes) {
  47227. super(CONFIG_NS_ID, "template", true);
  47228. this.base = null;
  47229. this.relevant = null;
  47230. this.startPage = null;
  47231. this.uri = null;
  47232. this.xsl = null;
  47233. }
  47234. }
  47235. class Threshold extends OptionObject {
  47236. constructor(attributes) {
  47237. super(CONFIG_NS_ID, "threshold", ["trace", "error", "information", "warning"]);
  47238. }
  47239. }
  47240. class To extends OptionObject {
  47241. constructor(attributes) {
  47242. super(CONFIG_NS_ID, "to", ["null", "memory", "stderr", "stdout", "system", "uri"]);
  47243. }
  47244. }
  47245. class TemplateCache extends XFAObject {
  47246. constructor(attributes) {
  47247. super(CONFIG_NS_ID, "templateCache");
  47248. this.maxEntries = getInteger({
  47249. data: attributes.maxEntries,
  47250. defaultValue: 5,
  47251. validate: n => n >= 0
  47252. });
  47253. }
  47254. }
  47255. class Trace extends XFAObject {
  47256. constructor(attributes) {
  47257. super(CONFIG_NS_ID, "trace", true);
  47258. this.area = new XFAObjectArray();
  47259. }
  47260. }
  47261. class Transform extends XFAObject {
  47262. constructor(attributes) {
  47263. super(CONFIG_NS_ID, "transform", true);
  47264. this.groupParent = null;
  47265. this.ifEmpty = null;
  47266. this.nameAttr = null;
  47267. this.picture = null;
  47268. this.presence = null;
  47269. this.rename = null;
  47270. this.whitespace = null;
  47271. }
  47272. }
  47273. class Type extends OptionObject {
  47274. constructor(attributes) {
  47275. super(CONFIG_NS_ID, "type", ["none", "ascii85", "asciiHex", "ccittfax", "flate", "lzw", "runLength", "native", "xdp", "mergedXDP"]);
  47276. }
  47277. }
  47278. class Uri extends StringObject {
  47279. constructor(attributes) {
  47280. super(CONFIG_NS_ID, "uri");
  47281. }
  47282. }
  47283. class config_Validate extends OptionObject {
  47284. constructor(attributes) {
  47285. super(CONFIG_NS_ID, "validate", ["preSubmit", "prePrint", "preExecute", "preSave"]);
  47286. }
  47287. }
  47288. class ValidateApprovalSignatures extends ContentObject {
  47289. constructor(attributes) {
  47290. super(CONFIG_NS_ID, "validateApprovalSignatures");
  47291. }
  47292. [$finalize]() {
  47293. this[$content] = this[$content].trim().split(/\s+/).filter(x => ["docReady", "postSign"].includes(x));
  47294. }
  47295. }
  47296. class ValidationMessaging extends OptionObject {
  47297. constructor(attributes) {
  47298. super(CONFIG_NS_ID, "validationMessaging", ["allMessagesIndividually", "allMessagesTogether", "firstMessageOnly", "noMessages"]);
  47299. }
  47300. }
  47301. class Version extends OptionObject {
  47302. constructor(attributes) {
  47303. super(CONFIG_NS_ID, "version", ["1.7", "1.6", "1.5", "1.4", "1.3", "1.2"]);
  47304. }
  47305. }
  47306. class VersionControl extends XFAObject {
  47307. constructor(attributes) {
  47308. super(CONFIG_NS_ID, "VersionControl");
  47309. this.outputBelow = getStringOption(attributes.outputBelow, ["warn", "error", "update"]);
  47310. this.sourceAbove = getStringOption(attributes.sourceAbove, ["warn", "error"]);
  47311. this.sourceBelow = getStringOption(attributes.sourceBelow, ["update", "maintain"]);
  47312. }
  47313. }
  47314. class ViewerPreferences extends XFAObject {
  47315. constructor(attributes) {
  47316. super(CONFIG_NS_ID, "viewerPreferences", true);
  47317. this.ADBE_JSConsole = null;
  47318. this.ADBE_JSDebugger = null;
  47319. this.addViewerPreferences = null;
  47320. this.duplexOption = null;
  47321. this.enforce = null;
  47322. this.numberOfCopies = null;
  47323. this.pageRange = null;
  47324. this.pickTrayByPDFSize = null;
  47325. this.printScaling = null;
  47326. }
  47327. }
  47328. class WebClient extends XFAObject {
  47329. constructor(attributes) {
  47330. super(CONFIG_NS_ID, "webClient", true);
  47331. this.name = attributes.name ? attributes.name.trim() : "";
  47332. this.fontInfo = null;
  47333. this.xdc = null;
  47334. }
  47335. }
  47336. class Whitespace extends OptionObject {
  47337. constructor(attributes) {
  47338. super(CONFIG_NS_ID, "whitespace", ["preserve", "ltrim", "normalize", "rtrim", "trim"]);
  47339. }
  47340. }
  47341. class Window extends ContentObject {
  47342. constructor(attributes) {
  47343. super(CONFIG_NS_ID, "window");
  47344. }
  47345. [$finalize]() {
  47346. const pair = this[$content].trim().split(/\s*,\s*/, 2).map(x => parseInt(x, 10));
  47347. if (pair.some(x => isNaN(x))) {
  47348. this[$content] = [0, 0];
  47349. return;
  47350. }
  47351. if (pair.length === 1) {
  47352. pair.push(pair[0]);
  47353. }
  47354. this[$content] = pair;
  47355. }
  47356. }
  47357. class Xdc extends XFAObject {
  47358. constructor(attributes) {
  47359. super(CONFIG_NS_ID, "xdc", true);
  47360. this.uri = new XFAObjectArray();
  47361. this.xsl = new XFAObjectArray();
  47362. }
  47363. }
  47364. class Xdp extends XFAObject {
  47365. constructor(attributes) {
  47366. super(CONFIG_NS_ID, "xdp", true);
  47367. this.packets = null;
  47368. }
  47369. }
  47370. class Xsl extends XFAObject {
  47371. constructor(attributes) {
  47372. super(CONFIG_NS_ID, "xsl", true);
  47373. this.debug = null;
  47374. this.uri = null;
  47375. }
  47376. }
  47377. class Zpl extends XFAObject {
  47378. constructor(attributes) {
  47379. super(CONFIG_NS_ID, "zpl", true);
  47380. this.name = attributes.name ? attributes.name.trim() : "";
  47381. this.batchOutput = null;
  47382. this.flipLabel = null;
  47383. this.fontInfo = null;
  47384. this.xdc = null;
  47385. }
  47386. }
  47387. class ConfigNamespace {
  47388. static [$buildXFAObject](name, attributes) {
  47389. if (ConfigNamespace.hasOwnProperty(name)) {
  47390. return ConfigNamespace[name](attributes);
  47391. }
  47392. return undefined;
  47393. }
  47394. static acrobat(attrs) {
  47395. return new Acrobat(attrs);
  47396. }
  47397. static acrobat7(attrs) {
  47398. return new Acrobat7(attrs);
  47399. }
  47400. static ADBE_JSConsole(attrs) {
  47401. return new ADBE_JSConsole(attrs);
  47402. }
  47403. static ADBE_JSDebugger(attrs) {
  47404. return new ADBE_JSDebugger(attrs);
  47405. }
  47406. static addSilentPrint(attrs) {
  47407. return new AddSilentPrint(attrs);
  47408. }
  47409. static addViewerPreferences(attrs) {
  47410. return new AddViewerPreferences(attrs);
  47411. }
  47412. static adjustData(attrs) {
  47413. return new AdjustData(attrs);
  47414. }
  47415. static adobeExtensionLevel(attrs) {
  47416. return new AdobeExtensionLevel(attrs);
  47417. }
  47418. static agent(attrs) {
  47419. return new Agent(attrs);
  47420. }
  47421. static alwaysEmbed(attrs) {
  47422. return new AlwaysEmbed(attrs);
  47423. }
  47424. static amd(attrs) {
  47425. return new Amd(attrs);
  47426. }
  47427. static area(attrs) {
  47428. return new config_Area(attrs);
  47429. }
  47430. static attributes(attrs) {
  47431. return new Attributes(attrs);
  47432. }
  47433. static autoSave(attrs) {
  47434. return new AutoSave(attrs);
  47435. }
  47436. static base(attrs) {
  47437. return new Base(attrs);
  47438. }
  47439. static batchOutput(attrs) {
  47440. return new BatchOutput(attrs);
  47441. }
  47442. static behaviorOverride(attrs) {
  47443. return new BehaviorOverride(attrs);
  47444. }
  47445. static cache(attrs) {
  47446. return new Cache(attrs);
  47447. }
  47448. static change(attrs) {
  47449. return new Change(attrs);
  47450. }
  47451. static common(attrs) {
  47452. return new Common(attrs);
  47453. }
  47454. static compress(attrs) {
  47455. return new Compress(attrs);
  47456. }
  47457. static compressLogicalStructure(attrs) {
  47458. return new CompressLogicalStructure(attrs);
  47459. }
  47460. static compressObjectStream(attrs) {
  47461. return new CompressObjectStream(attrs);
  47462. }
  47463. static compression(attrs) {
  47464. return new Compression(attrs);
  47465. }
  47466. static config(attrs) {
  47467. return new Config(attrs);
  47468. }
  47469. static conformance(attrs) {
  47470. return new Conformance(attrs);
  47471. }
  47472. static contentCopy(attrs) {
  47473. return new ContentCopy(attrs);
  47474. }
  47475. static copies(attrs) {
  47476. return new Copies(attrs);
  47477. }
  47478. static creator(attrs) {
  47479. return new Creator(attrs);
  47480. }
  47481. static currentPage(attrs) {
  47482. return new CurrentPage(attrs);
  47483. }
  47484. static data(attrs) {
  47485. return new Data(attrs);
  47486. }
  47487. static debug(attrs) {
  47488. return new Debug(attrs);
  47489. }
  47490. static defaultTypeface(attrs) {
  47491. return new DefaultTypeface(attrs);
  47492. }
  47493. static destination(attrs) {
  47494. return new Destination(attrs);
  47495. }
  47496. static documentAssembly(attrs) {
  47497. return new DocumentAssembly(attrs);
  47498. }
  47499. static driver(attrs) {
  47500. return new Driver(attrs);
  47501. }
  47502. static duplexOption(attrs) {
  47503. return new DuplexOption(attrs);
  47504. }
  47505. static dynamicRender(attrs) {
  47506. return new DynamicRender(attrs);
  47507. }
  47508. static embed(attrs) {
  47509. return new Embed(attrs);
  47510. }
  47511. static encrypt(attrs) {
  47512. return new config_Encrypt(attrs);
  47513. }
  47514. static encryption(attrs) {
  47515. return new config_Encryption(attrs);
  47516. }
  47517. static encryptionLevel(attrs) {
  47518. return new EncryptionLevel(attrs);
  47519. }
  47520. static enforce(attrs) {
  47521. return new Enforce(attrs);
  47522. }
  47523. static equate(attrs) {
  47524. return new Equate(attrs);
  47525. }
  47526. static equateRange(attrs) {
  47527. return new EquateRange(attrs);
  47528. }
  47529. static exclude(attrs) {
  47530. return new Exclude(attrs);
  47531. }
  47532. static excludeNS(attrs) {
  47533. return new ExcludeNS(attrs);
  47534. }
  47535. static flipLabel(attrs) {
  47536. return new FlipLabel(attrs);
  47537. }
  47538. static fontInfo(attrs) {
  47539. return new config_FontInfo(attrs);
  47540. }
  47541. static formFieldFilling(attrs) {
  47542. return new FormFieldFilling(attrs);
  47543. }
  47544. static groupParent(attrs) {
  47545. return new GroupParent(attrs);
  47546. }
  47547. static ifEmpty(attrs) {
  47548. return new IfEmpty(attrs);
  47549. }
  47550. static includeXDPContent(attrs) {
  47551. return new IncludeXDPContent(attrs);
  47552. }
  47553. static incrementalLoad(attrs) {
  47554. return new IncrementalLoad(attrs);
  47555. }
  47556. static incrementalMerge(attrs) {
  47557. return new IncrementalMerge(attrs);
  47558. }
  47559. static interactive(attrs) {
  47560. return new Interactive(attrs);
  47561. }
  47562. static jog(attrs) {
  47563. return new Jog(attrs);
  47564. }
  47565. static labelPrinter(attrs) {
  47566. return new LabelPrinter(attrs);
  47567. }
  47568. static layout(attrs) {
  47569. return new Layout(attrs);
  47570. }
  47571. static level(attrs) {
  47572. return new Level(attrs);
  47573. }
  47574. static linearized(attrs) {
  47575. return new Linearized(attrs);
  47576. }
  47577. static locale(attrs) {
  47578. return new Locale(attrs);
  47579. }
  47580. static localeSet(attrs) {
  47581. return new LocaleSet(attrs);
  47582. }
  47583. static log(attrs) {
  47584. return new Log(attrs);
  47585. }
  47586. static map(attrs) {
  47587. return new MapElement(attrs);
  47588. }
  47589. static mediumInfo(attrs) {
  47590. return new MediumInfo(attrs);
  47591. }
  47592. static message(attrs) {
  47593. return new config_Message(attrs);
  47594. }
  47595. static messaging(attrs) {
  47596. return new Messaging(attrs);
  47597. }
  47598. static mode(attrs) {
  47599. return new Mode(attrs);
  47600. }
  47601. static modifyAnnots(attrs) {
  47602. return new ModifyAnnots(attrs);
  47603. }
  47604. static msgId(attrs) {
  47605. return new MsgId(attrs);
  47606. }
  47607. static nameAttr(attrs) {
  47608. return new NameAttr(attrs);
  47609. }
  47610. static neverEmbed(attrs) {
  47611. return new NeverEmbed(attrs);
  47612. }
  47613. static numberOfCopies(attrs) {
  47614. return new NumberOfCopies(attrs);
  47615. }
  47616. static openAction(attrs) {
  47617. return new OpenAction(attrs);
  47618. }
  47619. static output(attrs) {
  47620. return new Output(attrs);
  47621. }
  47622. static outputBin(attrs) {
  47623. return new OutputBin(attrs);
  47624. }
  47625. static outputXSL(attrs) {
  47626. return new OutputXSL(attrs);
  47627. }
  47628. static overprint(attrs) {
  47629. return new Overprint(attrs);
  47630. }
  47631. static packets(attrs) {
  47632. return new Packets(attrs);
  47633. }
  47634. static pageOffset(attrs) {
  47635. return new PageOffset(attrs);
  47636. }
  47637. static pageRange(attrs) {
  47638. return new PageRange(attrs);
  47639. }
  47640. static pagination(attrs) {
  47641. return new Pagination(attrs);
  47642. }
  47643. static paginationOverride(attrs) {
  47644. return new PaginationOverride(attrs);
  47645. }
  47646. static part(attrs) {
  47647. return new Part(attrs);
  47648. }
  47649. static pcl(attrs) {
  47650. return new Pcl(attrs);
  47651. }
  47652. static pdf(attrs) {
  47653. return new Pdf(attrs);
  47654. }
  47655. static pdfa(attrs) {
  47656. return new Pdfa(attrs);
  47657. }
  47658. static permissions(attrs) {
  47659. return new Permissions(attrs);
  47660. }
  47661. static pickTrayByPDFSize(attrs) {
  47662. return new PickTrayByPDFSize(attrs);
  47663. }
  47664. static picture(attrs) {
  47665. return new config_Picture(attrs);
  47666. }
  47667. static plaintextMetadata(attrs) {
  47668. return new PlaintextMetadata(attrs);
  47669. }
  47670. static presence(attrs) {
  47671. return new Presence(attrs);
  47672. }
  47673. static present(attrs) {
  47674. return new Present(attrs);
  47675. }
  47676. static print(attrs) {
  47677. return new Print(attrs);
  47678. }
  47679. static printHighQuality(attrs) {
  47680. return new PrintHighQuality(attrs);
  47681. }
  47682. static printScaling(attrs) {
  47683. return new PrintScaling(attrs);
  47684. }
  47685. static printerName(attrs) {
  47686. return new PrinterName(attrs);
  47687. }
  47688. static producer(attrs) {
  47689. return new Producer(attrs);
  47690. }
  47691. static ps(attrs) {
  47692. return new Ps(attrs);
  47693. }
  47694. static range(attrs) {
  47695. return new Range(attrs);
  47696. }
  47697. static record(attrs) {
  47698. return new Record(attrs);
  47699. }
  47700. static relevant(attrs) {
  47701. return new Relevant(attrs);
  47702. }
  47703. static rename(attrs) {
  47704. return new Rename(attrs);
  47705. }
  47706. static renderPolicy(attrs) {
  47707. return new RenderPolicy(attrs);
  47708. }
  47709. static runScripts(attrs) {
  47710. return new RunScripts(attrs);
  47711. }
  47712. static script(attrs) {
  47713. return new config_Script(attrs);
  47714. }
  47715. static scriptModel(attrs) {
  47716. return new ScriptModel(attrs);
  47717. }
  47718. static severity(attrs) {
  47719. return new Severity(attrs);
  47720. }
  47721. static silentPrint(attrs) {
  47722. return new SilentPrint(attrs);
  47723. }
  47724. static staple(attrs) {
  47725. return new Staple(attrs);
  47726. }
  47727. static startNode(attrs) {
  47728. return new StartNode(attrs);
  47729. }
  47730. static startPage(attrs) {
  47731. return new StartPage(attrs);
  47732. }
  47733. static submitFormat(attrs) {
  47734. return new SubmitFormat(attrs);
  47735. }
  47736. static submitUrl(attrs) {
  47737. return new SubmitUrl(attrs);
  47738. }
  47739. static subsetBelow(attrs) {
  47740. return new SubsetBelow(attrs);
  47741. }
  47742. static suppressBanner(attrs) {
  47743. return new SuppressBanner(attrs);
  47744. }
  47745. static tagged(attrs) {
  47746. return new Tagged(attrs);
  47747. }
  47748. static template(attrs) {
  47749. return new config_Template(attrs);
  47750. }
  47751. static templateCache(attrs) {
  47752. return new TemplateCache(attrs);
  47753. }
  47754. static threshold(attrs) {
  47755. return new Threshold(attrs);
  47756. }
  47757. static to(attrs) {
  47758. return new To(attrs);
  47759. }
  47760. static trace(attrs) {
  47761. return new Trace(attrs);
  47762. }
  47763. static transform(attrs) {
  47764. return new Transform(attrs);
  47765. }
  47766. static type(attrs) {
  47767. return new Type(attrs);
  47768. }
  47769. static uri(attrs) {
  47770. return new Uri(attrs);
  47771. }
  47772. static validate(attrs) {
  47773. return new config_Validate(attrs);
  47774. }
  47775. static validateApprovalSignatures(attrs) {
  47776. return new ValidateApprovalSignatures(attrs);
  47777. }
  47778. static validationMessaging(attrs) {
  47779. return new ValidationMessaging(attrs);
  47780. }
  47781. static version(attrs) {
  47782. return new Version(attrs);
  47783. }
  47784. static versionControl(attrs) {
  47785. return new VersionControl(attrs);
  47786. }
  47787. static viewerPreferences(attrs) {
  47788. return new ViewerPreferences(attrs);
  47789. }
  47790. static webClient(attrs) {
  47791. return new WebClient(attrs);
  47792. }
  47793. static whitespace(attrs) {
  47794. return new Whitespace(attrs);
  47795. }
  47796. static window(attrs) {
  47797. return new Window(attrs);
  47798. }
  47799. static xdc(attrs) {
  47800. return new Xdc(attrs);
  47801. }
  47802. static xdp(attrs) {
  47803. return new Xdp(attrs);
  47804. }
  47805. static xsl(attrs) {
  47806. return new Xsl(attrs);
  47807. }
  47808. static zpl(attrs) {
  47809. return new Zpl(attrs);
  47810. }
  47811. }
  47812. ;// CONCATENATED MODULE: ./src/core/xfa/connection_set.js
  47813. const CONNECTION_SET_NS_ID = NamespaceIds.connectionSet.id;
  47814. class ConnectionSet extends XFAObject {
  47815. constructor(attributes) {
  47816. super(CONNECTION_SET_NS_ID, "connectionSet", true);
  47817. this.wsdlConnection = new XFAObjectArray();
  47818. this.xmlConnection = new XFAObjectArray();
  47819. this.xsdConnection = new XFAObjectArray();
  47820. }
  47821. }
  47822. class EffectiveInputPolicy extends XFAObject {
  47823. constructor(attributes) {
  47824. super(CONNECTION_SET_NS_ID, "effectiveInputPolicy");
  47825. this.id = attributes.id || "";
  47826. this.name = attributes.name || "";
  47827. this.use = attributes.use || "";
  47828. this.usehref = attributes.usehref || "";
  47829. }
  47830. }
  47831. class EffectiveOutputPolicy extends XFAObject {
  47832. constructor(attributes) {
  47833. super(CONNECTION_SET_NS_ID, "effectiveOutputPolicy");
  47834. this.id = attributes.id || "";
  47835. this.name = attributes.name || "";
  47836. this.use = attributes.use || "";
  47837. this.usehref = attributes.usehref || "";
  47838. }
  47839. }
  47840. class Operation extends StringObject {
  47841. constructor(attributes) {
  47842. super(CONNECTION_SET_NS_ID, "operation");
  47843. this.id = attributes.id || "";
  47844. this.input = attributes.input || "";
  47845. this.name = attributes.name || "";
  47846. this.output = attributes.output || "";
  47847. this.use = attributes.use || "";
  47848. this.usehref = attributes.usehref || "";
  47849. }
  47850. }
  47851. class RootElement extends StringObject {
  47852. constructor(attributes) {
  47853. super(CONNECTION_SET_NS_ID, "rootElement");
  47854. this.id = attributes.id || "";
  47855. this.name = attributes.name || "";
  47856. this.use = attributes.use || "";
  47857. this.usehref = attributes.usehref || "";
  47858. }
  47859. }
  47860. class SoapAction extends StringObject {
  47861. constructor(attributes) {
  47862. super(CONNECTION_SET_NS_ID, "soapAction");
  47863. this.id = attributes.id || "";
  47864. this.name = attributes.name || "";
  47865. this.use = attributes.use || "";
  47866. this.usehref = attributes.usehref || "";
  47867. }
  47868. }
  47869. class SoapAddress extends StringObject {
  47870. constructor(attributes) {
  47871. super(CONNECTION_SET_NS_ID, "soapAddress");
  47872. this.id = attributes.id || "";
  47873. this.name = attributes.name || "";
  47874. this.use = attributes.use || "";
  47875. this.usehref = attributes.usehref || "";
  47876. }
  47877. }
  47878. class connection_set_Uri extends StringObject {
  47879. constructor(attributes) {
  47880. super(CONNECTION_SET_NS_ID, "uri");
  47881. this.id = attributes.id || "";
  47882. this.name = attributes.name || "";
  47883. this.use = attributes.use || "";
  47884. this.usehref = attributes.usehref || "";
  47885. }
  47886. }
  47887. class WsdlAddress extends StringObject {
  47888. constructor(attributes) {
  47889. super(CONNECTION_SET_NS_ID, "wsdlAddress");
  47890. this.id = attributes.id || "";
  47891. this.name = attributes.name || "";
  47892. this.use = attributes.use || "";
  47893. this.usehref = attributes.usehref || "";
  47894. }
  47895. }
  47896. class WsdlConnection extends XFAObject {
  47897. constructor(attributes) {
  47898. super(CONNECTION_SET_NS_ID, "wsdlConnection", true);
  47899. this.dataDescription = attributes.dataDescription || "";
  47900. this.name = attributes.name || "";
  47901. this.effectiveInputPolicy = null;
  47902. this.effectiveOutputPolicy = null;
  47903. this.operation = null;
  47904. this.soapAction = null;
  47905. this.soapAddress = null;
  47906. this.wsdlAddress = null;
  47907. }
  47908. }
  47909. class XmlConnection extends XFAObject {
  47910. constructor(attributes) {
  47911. super(CONNECTION_SET_NS_ID, "xmlConnection", true);
  47912. this.dataDescription = attributes.dataDescription || "";
  47913. this.name = attributes.name || "";
  47914. this.uri = null;
  47915. }
  47916. }
  47917. class XsdConnection extends XFAObject {
  47918. constructor(attributes) {
  47919. super(CONNECTION_SET_NS_ID, "xsdConnection", true);
  47920. this.dataDescription = attributes.dataDescription || "";
  47921. this.name = attributes.name || "";
  47922. this.rootElement = null;
  47923. this.uri = null;
  47924. }
  47925. }
  47926. class ConnectionSetNamespace {
  47927. static [$buildXFAObject](name, attributes) {
  47928. if (ConnectionSetNamespace.hasOwnProperty(name)) {
  47929. return ConnectionSetNamespace[name](attributes);
  47930. }
  47931. return undefined;
  47932. }
  47933. static connectionSet(attrs) {
  47934. return new ConnectionSet(attrs);
  47935. }
  47936. static effectiveInputPolicy(attrs) {
  47937. return new EffectiveInputPolicy(attrs);
  47938. }
  47939. static effectiveOutputPolicy(attrs) {
  47940. return new EffectiveOutputPolicy(attrs);
  47941. }
  47942. static operation(attrs) {
  47943. return new Operation(attrs);
  47944. }
  47945. static rootElement(attrs) {
  47946. return new RootElement(attrs);
  47947. }
  47948. static soapAction(attrs) {
  47949. return new SoapAction(attrs);
  47950. }
  47951. static soapAddress(attrs) {
  47952. return new SoapAddress(attrs);
  47953. }
  47954. static uri(attrs) {
  47955. return new connection_set_Uri(attrs);
  47956. }
  47957. static wsdlAddress(attrs) {
  47958. return new WsdlAddress(attrs);
  47959. }
  47960. static wsdlConnection(attrs) {
  47961. return new WsdlConnection(attrs);
  47962. }
  47963. static xmlConnection(attrs) {
  47964. return new XmlConnection(attrs);
  47965. }
  47966. static xsdConnection(attrs) {
  47967. return new XsdConnection(attrs);
  47968. }
  47969. }
  47970. ;// CONCATENATED MODULE: ./src/core/xfa/datasets.js
  47971. const DATASETS_NS_ID = NamespaceIds.datasets.id;
  47972. class datasets_Data extends XmlObject {
  47973. constructor(attributes) {
  47974. super(DATASETS_NS_ID, "data", attributes);
  47975. }
  47976. [$isNsAgnostic]() {
  47977. return true;
  47978. }
  47979. }
  47980. class Datasets extends XFAObject {
  47981. constructor(attributes) {
  47982. super(DATASETS_NS_ID, "datasets", true);
  47983. this.data = null;
  47984. this.Signature = null;
  47985. }
  47986. [$onChild](child) {
  47987. const name = child[$nodeName];
  47988. if (name === "data" && child[$namespaceId] === DATASETS_NS_ID || name === "Signature" && child[$namespaceId] === NamespaceIds.signature.id) {
  47989. this[name] = child;
  47990. }
  47991. this[$appendChild](child);
  47992. }
  47993. }
  47994. class DatasetsNamespace {
  47995. static [$buildXFAObject](name, attributes) {
  47996. if (DatasetsNamespace.hasOwnProperty(name)) {
  47997. return DatasetsNamespace[name](attributes);
  47998. }
  47999. return undefined;
  48000. }
  48001. static datasets(attributes) {
  48002. return new Datasets(attributes);
  48003. }
  48004. static data(attributes) {
  48005. return new datasets_Data(attributes);
  48006. }
  48007. }
  48008. ;// CONCATENATED MODULE: ./src/core/xfa/locale_set.js
  48009. const LOCALE_SET_NS_ID = NamespaceIds.localeSet.id;
  48010. class CalendarSymbols extends XFAObject {
  48011. constructor(attributes) {
  48012. super(LOCALE_SET_NS_ID, "calendarSymbols", true);
  48013. this.name = "gregorian";
  48014. this.dayNames = new XFAObjectArray(2);
  48015. this.eraNames = null;
  48016. this.meridiemNames = null;
  48017. this.monthNames = new XFAObjectArray(2);
  48018. }
  48019. }
  48020. class CurrencySymbol extends StringObject {
  48021. constructor(attributes) {
  48022. super(LOCALE_SET_NS_ID, "currencySymbol");
  48023. this.name = getStringOption(attributes.name, ["symbol", "isoname", "decimal"]);
  48024. }
  48025. }
  48026. class CurrencySymbols extends XFAObject {
  48027. constructor(attributes) {
  48028. super(LOCALE_SET_NS_ID, "currencySymbols", true);
  48029. this.currencySymbol = new XFAObjectArray(3);
  48030. }
  48031. }
  48032. class DatePattern extends StringObject {
  48033. constructor(attributes) {
  48034. super(LOCALE_SET_NS_ID, "datePattern");
  48035. this.name = getStringOption(attributes.name, ["full", "long", "med", "short"]);
  48036. }
  48037. }
  48038. class DatePatterns extends XFAObject {
  48039. constructor(attributes) {
  48040. super(LOCALE_SET_NS_ID, "datePatterns", true);
  48041. this.datePattern = new XFAObjectArray(4);
  48042. }
  48043. }
  48044. class DateTimeSymbols extends ContentObject {
  48045. constructor(attributes) {
  48046. super(LOCALE_SET_NS_ID, "dateTimeSymbols");
  48047. }
  48048. }
  48049. class Day extends StringObject {
  48050. constructor(attributes) {
  48051. super(LOCALE_SET_NS_ID, "day");
  48052. }
  48053. }
  48054. class DayNames extends XFAObject {
  48055. constructor(attributes) {
  48056. super(LOCALE_SET_NS_ID, "dayNames", true);
  48057. this.abbr = getInteger({
  48058. data: attributes.abbr,
  48059. defaultValue: 0,
  48060. validate: x => x === 1
  48061. });
  48062. this.day = new XFAObjectArray(7);
  48063. }
  48064. }
  48065. class Era extends StringObject {
  48066. constructor(attributes) {
  48067. super(LOCALE_SET_NS_ID, "era");
  48068. }
  48069. }
  48070. class EraNames extends XFAObject {
  48071. constructor(attributes) {
  48072. super(LOCALE_SET_NS_ID, "eraNames", true);
  48073. this.era = new XFAObjectArray(2);
  48074. }
  48075. }
  48076. class locale_set_Locale extends XFAObject {
  48077. constructor(attributes) {
  48078. super(LOCALE_SET_NS_ID, "locale", true);
  48079. this.desc = attributes.desc || "";
  48080. this.name = "isoname";
  48081. this.calendarSymbols = null;
  48082. this.currencySymbols = null;
  48083. this.datePatterns = null;
  48084. this.dateTimeSymbols = null;
  48085. this.numberPatterns = null;
  48086. this.numberSymbols = null;
  48087. this.timePatterns = null;
  48088. this.typeFaces = null;
  48089. }
  48090. }
  48091. class locale_set_LocaleSet extends XFAObject {
  48092. constructor(attributes) {
  48093. super(LOCALE_SET_NS_ID, "localeSet", true);
  48094. this.locale = new XFAObjectArray();
  48095. }
  48096. }
  48097. class Meridiem extends StringObject {
  48098. constructor(attributes) {
  48099. super(LOCALE_SET_NS_ID, "meridiem");
  48100. }
  48101. }
  48102. class MeridiemNames extends XFAObject {
  48103. constructor(attributes) {
  48104. super(LOCALE_SET_NS_ID, "meridiemNames", true);
  48105. this.meridiem = new XFAObjectArray(2);
  48106. }
  48107. }
  48108. class Month extends StringObject {
  48109. constructor(attributes) {
  48110. super(LOCALE_SET_NS_ID, "month");
  48111. }
  48112. }
  48113. class MonthNames extends XFAObject {
  48114. constructor(attributes) {
  48115. super(LOCALE_SET_NS_ID, "monthNames", true);
  48116. this.abbr = getInteger({
  48117. data: attributes.abbr,
  48118. defaultValue: 0,
  48119. validate: x => x === 1
  48120. });
  48121. this.month = new XFAObjectArray(12);
  48122. }
  48123. }
  48124. class NumberPattern extends StringObject {
  48125. constructor(attributes) {
  48126. super(LOCALE_SET_NS_ID, "numberPattern");
  48127. this.name = getStringOption(attributes.name, ["full", "long", "med", "short"]);
  48128. }
  48129. }
  48130. class NumberPatterns extends XFAObject {
  48131. constructor(attributes) {
  48132. super(LOCALE_SET_NS_ID, "numberPatterns", true);
  48133. this.numberPattern = new XFAObjectArray(4);
  48134. }
  48135. }
  48136. class NumberSymbol extends StringObject {
  48137. constructor(attributes) {
  48138. super(LOCALE_SET_NS_ID, "numberSymbol");
  48139. this.name = getStringOption(attributes.name, ["decimal", "grouping", "percent", "minus", "zero"]);
  48140. }
  48141. }
  48142. class NumberSymbols extends XFAObject {
  48143. constructor(attributes) {
  48144. super(LOCALE_SET_NS_ID, "numberSymbols", true);
  48145. this.numberSymbol = new XFAObjectArray(5);
  48146. }
  48147. }
  48148. class TimePattern extends StringObject {
  48149. constructor(attributes) {
  48150. super(LOCALE_SET_NS_ID, "timePattern");
  48151. this.name = getStringOption(attributes.name, ["full", "long", "med", "short"]);
  48152. }
  48153. }
  48154. class TimePatterns extends XFAObject {
  48155. constructor(attributes) {
  48156. super(LOCALE_SET_NS_ID, "timePatterns", true);
  48157. this.timePattern = new XFAObjectArray(4);
  48158. }
  48159. }
  48160. class TypeFace extends XFAObject {
  48161. constructor(attributes) {
  48162. super(LOCALE_SET_NS_ID, "typeFace", true);
  48163. this.name = attributes.name | "";
  48164. }
  48165. }
  48166. class TypeFaces extends XFAObject {
  48167. constructor(attributes) {
  48168. super(LOCALE_SET_NS_ID, "typeFaces", true);
  48169. this.typeFace = new XFAObjectArray();
  48170. }
  48171. }
  48172. class LocaleSetNamespace {
  48173. static [$buildXFAObject](name, attributes) {
  48174. if (LocaleSetNamespace.hasOwnProperty(name)) {
  48175. return LocaleSetNamespace[name](attributes);
  48176. }
  48177. return undefined;
  48178. }
  48179. static calendarSymbols(attrs) {
  48180. return new CalendarSymbols(attrs);
  48181. }
  48182. static currencySymbol(attrs) {
  48183. return new CurrencySymbol(attrs);
  48184. }
  48185. static currencySymbols(attrs) {
  48186. return new CurrencySymbols(attrs);
  48187. }
  48188. static datePattern(attrs) {
  48189. return new DatePattern(attrs);
  48190. }
  48191. static datePatterns(attrs) {
  48192. return new DatePatterns(attrs);
  48193. }
  48194. static dateTimeSymbols(attrs) {
  48195. return new DateTimeSymbols(attrs);
  48196. }
  48197. static day(attrs) {
  48198. return new Day(attrs);
  48199. }
  48200. static dayNames(attrs) {
  48201. return new DayNames(attrs);
  48202. }
  48203. static era(attrs) {
  48204. return new Era(attrs);
  48205. }
  48206. static eraNames(attrs) {
  48207. return new EraNames(attrs);
  48208. }
  48209. static locale(attrs) {
  48210. return new locale_set_Locale(attrs);
  48211. }
  48212. static localeSet(attrs) {
  48213. return new locale_set_LocaleSet(attrs);
  48214. }
  48215. static meridiem(attrs) {
  48216. return new Meridiem(attrs);
  48217. }
  48218. static meridiemNames(attrs) {
  48219. return new MeridiemNames(attrs);
  48220. }
  48221. static month(attrs) {
  48222. return new Month(attrs);
  48223. }
  48224. static monthNames(attrs) {
  48225. return new MonthNames(attrs);
  48226. }
  48227. static numberPattern(attrs) {
  48228. return new NumberPattern(attrs);
  48229. }
  48230. static numberPatterns(attrs) {
  48231. return new NumberPatterns(attrs);
  48232. }
  48233. static numberSymbol(attrs) {
  48234. return new NumberSymbol(attrs);
  48235. }
  48236. static numberSymbols(attrs) {
  48237. return new NumberSymbols(attrs);
  48238. }
  48239. static timePattern(attrs) {
  48240. return new TimePattern(attrs);
  48241. }
  48242. static timePatterns(attrs) {
  48243. return new TimePatterns(attrs);
  48244. }
  48245. static typeFace(attrs) {
  48246. return new TypeFace(attrs);
  48247. }
  48248. static typeFaces(attrs) {
  48249. return new TypeFaces(attrs);
  48250. }
  48251. }
  48252. ;// CONCATENATED MODULE: ./src/core/xfa/signature.js
  48253. const SIGNATURE_NS_ID = NamespaceIds.signature.id;
  48254. class signature_Signature extends XFAObject {
  48255. constructor(attributes) {
  48256. super(SIGNATURE_NS_ID, "signature", true);
  48257. }
  48258. }
  48259. class SignatureNamespace {
  48260. static [$buildXFAObject](name, attributes) {
  48261. if (SignatureNamespace.hasOwnProperty(name)) {
  48262. return SignatureNamespace[name](attributes);
  48263. }
  48264. return undefined;
  48265. }
  48266. static signature(attributes) {
  48267. return new signature_Signature(attributes);
  48268. }
  48269. }
  48270. ;// CONCATENATED MODULE: ./src/core/xfa/stylesheet.js
  48271. const STYLESHEET_NS_ID = NamespaceIds.stylesheet.id;
  48272. class Stylesheet extends XFAObject {
  48273. constructor(attributes) {
  48274. super(STYLESHEET_NS_ID, "stylesheet", true);
  48275. }
  48276. }
  48277. class StylesheetNamespace {
  48278. static [$buildXFAObject](name, attributes) {
  48279. if (StylesheetNamespace.hasOwnProperty(name)) {
  48280. return StylesheetNamespace[name](attributes);
  48281. }
  48282. return undefined;
  48283. }
  48284. static stylesheet(attributes) {
  48285. return new Stylesheet(attributes);
  48286. }
  48287. }
  48288. ;// CONCATENATED MODULE: ./src/core/xfa/xdp.js
  48289. const XDP_NS_ID = NamespaceIds.xdp.id;
  48290. class xdp_Xdp extends XFAObject {
  48291. constructor(attributes) {
  48292. super(XDP_NS_ID, "xdp", true);
  48293. this.uuid = attributes.uuid || "";
  48294. this.timeStamp = attributes.timeStamp || "";
  48295. this.config = null;
  48296. this.connectionSet = null;
  48297. this.datasets = null;
  48298. this.localeSet = null;
  48299. this.stylesheet = new XFAObjectArray();
  48300. this.template = null;
  48301. }
  48302. [$onChildCheck](child) {
  48303. const ns = NamespaceIds[child[$nodeName]];
  48304. return ns && child[$namespaceId] === ns.id;
  48305. }
  48306. }
  48307. class XdpNamespace {
  48308. static [$buildXFAObject](name, attributes) {
  48309. if (XdpNamespace.hasOwnProperty(name)) {
  48310. return XdpNamespace[name](attributes);
  48311. }
  48312. return undefined;
  48313. }
  48314. static xdp(attributes) {
  48315. return new xdp_Xdp(attributes);
  48316. }
  48317. }
  48318. ;// CONCATENATED MODULE: ./src/core/xfa/xhtml.js
  48319. const XHTML_NS_ID = NamespaceIds.xhtml.id;
  48320. const $richText = Symbol();
  48321. 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"]);
  48322. 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) => {
  48323. value = original.fontSize = getMeasurement(value);
  48324. return measureToString(0.99 * value);
  48325. }], ["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))]]);
  48326. const spacesRegExp = /\s+/g;
  48327. const crlfRegExp = /[\r\n]+/g;
  48328. const crlfForRichTextRegExp = /\r\n?/g;
  48329. function mapStyle(styleStr, node, richText) {
  48330. const style = Object.create(null);
  48331. if (!styleStr) {
  48332. return style;
  48333. }
  48334. const original = Object.create(null);
  48335. for (const [key, value] of styleStr.split(";").map(s => s.split(":", 2))) {
  48336. const mapping = StyleMapping.get(key);
  48337. if (mapping === "") {
  48338. continue;
  48339. }
  48340. let newValue = value;
  48341. if (mapping) {
  48342. newValue = typeof mapping === "string" ? mapping : mapping(value, original);
  48343. }
  48344. if (key.endsWith("scale")) {
  48345. style.transform = style.transform ? `${style[key]} ${newValue}` : newValue;
  48346. } else {
  48347. style[key.replaceAll(/-([a-zA-Z])/g, (_, x) => x.toUpperCase())] = newValue;
  48348. }
  48349. }
  48350. if (style.fontFamily) {
  48351. setFontFamily({
  48352. typeface: style.fontFamily,
  48353. weight: style.fontWeight || "normal",
  48354. posture: style.fontStyle || "normal",
  48355. size: original.fontSize || 0
  48356. }, node, node[$globalData].fontFinder, style);
  48357. }
  48358. if (richText && style.verticalAlign && style.verticalAlign !== "0px" && style.fontSize) {
  48359. const SUB_SUPER_SCRIPT_FACTOR = 0.583;
  48360. const VERTICAL_FACTOR = 0.333;
  48361. const fontSize = getMeasurement(style.fontSize);
  48362. style.fontSize = measureToString(fontSize * SUB_SUPER_SCRIPT_FACTOR);
  48363. style.verticalAlign = measureToString(Math.sign(getMeasurement(style.verticalAlign)) * fontSize * VERTICAL_FACTOR);
  48364. }
  48365. if (richText && style.fontSize) {
  48366. style.fontSize = `calc(${style.fontSize} * var(--scale-factor))`;
  48367. }
  48368. fixTextIndent(style);
  48369. return style;
  48370. }
  48371. function checkStyle(node) {
  48372. if (!node.style) {
  48373. return "";
  48374. }
  48375. return node.style.trim().split(/\s*;\s*/).filter(s => !!s).map(s => s.split(/\s*:\s*/, 2)).filter(([key, value]) => {
  48376. if (key === "font-family") {
  48377. node[$globalData].usedTypefaces.add(value);
  48378. }
  48379. return VALID_STYLES.has(key);
  48380. }).map(kv => kv.join(":")).join(";");
  48381. }
  48382. const NoWhites = new Set(["body", "html"]);
  48383. class XhtmlObject extends XmlObject {
  48384. constructor(attributes, name) {
  48385. super(XHTML_NS_ID, name);
  48386. this[$richText] = false;
  48387. this.style = attributes.style || "";
  48388. }
  48389. [$clean](builder) {
  48390. super[$clean](builder);
  48391. this.style = checkStyle(this);
  48392. }
  48393. [$acceptWhitespace]() {
  48394. return !NoWhites.has(this[$nodeName]);
  48395. }
  48396. [$onText](str, richText = false) {
  48397. if (!richText) {
  48398. str = str.replaceAll(crlfRegExp, "");
  48399. if (!this.style.includes("xfa-spacerun:yes")) {
  48400. str = str.replaceAll(spacesRegExp, " ");
  48401. }
  48402. } else {
  48403. this[$richText] = true;
  48404. }
  48405. if (str) {
  48406. this[$content] += str;
  48407. }
  48408. }
  48409. [$pushGlyphs](measure, mustPop = true) {
  48410. const xfaFont = Object.create(null);
  48411. const margin = {
  48412. top: NaN,
  48413. bottom: NaN,
  48414. left: NaN,
  48415. right: NaN
  48416. };
  48417. let lineHeight = null;
  48418. for (const [key, value] of this.style.split(";").map(s => s.split(":", 2))) {
  48419. switch (key) {
  48420. case "font-family":
  48421. xfaFont.typeface = stripQuotes(value);
  48422. break;
  48423. case "font-size":
  48424. xfaFont.size = getMeasurement(value);
  48425. break;
  48426. case "font-weight":
  48427. xfaFont.weight = value;
  48428. break;
  48429. case "font-style":
  48430. xfaFont.posture = value;
  48431. break;
  48432. case "letter-spacing":
  48433. xfaFont.letterSpacing = getMeasurement(value);
  48434. break;
  48435. case "margin":
  48436. const values = value.split(/ \t/).map(x => getMeasurement(x));
  48437. switch (values.length) {
  48438. case 1:
  48439. margin.top = margin.bottom = margin.left = margin.right = values[0];
  48440. break;
  48441. case 2:
  48442. margin.top = margin.bottom = values[0];
  48443. margin.left = margin.right = values[1];
  48444. break;
  48445. case 3:
  48446. margin.top = values[0];
  48447. margin.bottom = values[2];
  48448. margin.left = margin.right = values[1];
  48449. break;
  48450. case 4:
  48451. margin.top = values[0];
  48452. margin.left = values[1];
  48453. margin.bottom = values[2];
  48454. margin.right = values[3];
  48455. break;
  48456. }
  48457. break;
  48458. case "margin-top":
  48459. margin.top = getMeasurement(value);
  48460. break;
  48461. case "margin-bottom":
  48462. margin.bottom = getMeasurement(value);
  48463. break;
  48464. case "margin-left":
  48465. margin.left = getMeasurement(value);
  48466. break;
  48467. case "margin-right":
  48468. margin.right = getMeasurement(value);
  48469. break;
  48470. case "line-height":
  48471. lineHeight = getMeasurement(value);
  48472. break;
  48473. }
  48474. }
  48475. measure.pushData(xfaFont, margin, lineHeight);
  48476. if (this[$content]) {
  48477. measure.addString(this[$content]);
  48478. } else {
  48479. for (const child of this[$getChildren]()) {
  48480. if (child[$nodeName] === "#text") {
  48481. measure.addString(child[$content]);
  48482. continue;
  48483. }
  48484. child[$pushGlyphs](measure);
  48485. }
  48486. }
  48487. if (mustPop) {
  48488. measure.popFont();
  48489. }
  48490. }
  48491. [$toHTML](availableSpace) {
  48492. const children = [];
  48493. this[$extra] = {
  48494. children
  48495. };
  48496. this[$childrenToHTML]({});
  48497. if (children.length === 0 && !this[$content]) {
  48498. return HTMLResult.EMPTY;
  48499. }
  48500. let value;
  48501. if (this[$richText]) {
  48502. value = this[$content] ? this[$content].replaceAll(crlfForRichTextRegExp, "\n") : undefined;
  48503. } else {
  48504. value = this[$content] || undefined;
  48505. }
  48506. return HTMLResult.success({
  48507. name: this[$nodeName],
  48508. attributes: {
  48509. href: this.href,
  48510. style: mapStyle(this.style, this, this[$richText])
  48511. },
  48512. children,
  48513. value
  48514. });
  48515. }
  48516. }
  48517. class A extends XhtmlObject {
  48518. constructor(attributes) {
  48519. super(attributes, "a");
  48520. this.href = fixURL(attributes.href) || "";
  48521. }
  48522. }
  48523. class B extends XhtmlObject {
  48524. constructor(attributes) {
  48525. super(attributes, "b");
  48526. }
  48527. [$pushGlyphs](measure) {
  48528. measure.pushFont({
  48529. weight: "bold"
  48530. });
  48531. super[$pushGlyphs](measure);
  48532. measure.popFont();
  48533. }
  48534. }
  48535. class Body extends XhtmlObject {
  48536. constructor(attributes) {
  48537. super(attributes, "body");
  48538. }
  48539. [$toHTML](availableSpace) {
  48540. const res = super[$toHTML](availableSpace);
  48541. const {
  48542. html
  48543. } = res;
  48544. if (!html) {
  48545. return HTMLResult.EMPTY;
  48546. }
  48547. html.name = "div";
  48548. html.attributes.class = ["xfaRich"];
  48549. return res;
  48550. }
  48551. }
  48552. class Br extends XhtmlObject {
  48553. constructor(attributes) {
  48554. super(attributes, "br");
  48555. }
  48556. [$text]() {
  48557. return "\n";
  48558. }
  48559. [$pushGlyphs](measure) {
  48560. measure.addString("\n");
  48561. }
  48562. [$toHTML](availableSpace) {
  48563. return HTMLResult.success({
  48564. name: "br"
  48565. });
  48566. }
  48567. }
  48568. class Html extends XhtmlObject {
  48569. constructor(attributes) {
  48570. super(attributes, "html");
  48571. }
  48572. [$toHTML](availableSpace) {
  48573. const children = [];
  48574. this[$extra] = {
  48575. children
  48576. };
  48577. this[$childrenToHTML]({});
  48578. if (children.length === 0) {
  48579. return HTMLResult.success({
  48580. name: "div",
  48581. attributes: {
  48582. class: ["xfaRich"],
  48583. style: {}
  48584. },
  48585. value: this[$content] || ""
  48586. });
  48587. }
  48588. if (children.length === 1) {
  48589. const child = children[0];
  48590. if (child.attributes?.class.includes("xfaRich")) {
  48591. return HTMLResult.success(child);
  48592. }
  48593. }
  48594. return HTMLResult.success({
  48595. name: "div",
  48596. attributes: {
  48597. class: ["xfaRich"],
  48598. style: {}
  48599. },
  48600. children
  48601. });
  48602. }
  48603. }
  48604. class I extends XhtmlObject {
  48605. constructor(attributes) {
  48606. super(attributes, "i");
  48607. }
  48608. [$pushGlyphs](measure) {
  48609. measure.pushFont({
  48610. posture: "italic"
  48611. });
  48612. super[$pushGlyphs](measure);
  48613. measure.popFont();
  48614. }
  48615. }
  48616. class Li extends XhtmlObject {
  48617. constructor(attributes) {
  48618. super(attributes, "li");
  48619. }
  48620. }
  48621. class Ol extends XhtmlObject {
  48622. constructor(attributes) {
  48623. super(attributes, "ol");
  48624. }
  48625. }
  48626. class P extends XhtmlObject {
  48627. constructor(attributes) {
  48628. super(attributes, "p");
  48629. }
  48630. [$pushGlyphs](measure) {
  48631. super[$pushGlyphs](measure, false);
  48632. measure.addString("\n");
  48633. measure.addPara();
  48634. measure.popFont();
  48635. }
  48636. [$text]() {
  48637. const siblings = this[$getParent]()[$getChildren]();
  48638. if (siblings.at(-1) === this) {
  48639. return super[$text]();
  48640. }
  48641. return super[$text]() + "\n";
  48642. }
  48643. }
  48644. class Span extends XhtmlObject {
  48645. constructor(attributes) {
  48646. super(attributes, "span");
  48647. }
  48648. }
  48649. class Sub extends XhtmlObject {
  48650. constructor(attributes) {
  48651. super(attributes, "sub");
  48652. }
  48653. }
  48654. class Sup extends XhtmlObject {
  48655. constructor(attributes) {
  48656. super(attributes, "sup");
  48657. }
  48658. }
  48659. class Ul extends XhtmlObject {
  48660. constructor(attributes) {
  48661. super(attributes, "ul");
  48662. }
  48663. }
  48664. class XhtmlNamespace {
  48665. static [$buildXFAObject](name, attributes) {
  48666. if (XhtmlNamespace.hasOwnProperty(name)) {
  48667. return XhtmlNamespace[name](attributes);
  48668. }
  48669. return undefined;
  48670. }
  48671. static a(attributes) {
  48672. return new A(attributes);
  48673. }
  48674. static b(attributes) {
  48675. return new B(attributes);
  48676. }
  48677. static body(attributes) {
  48678. return new Body(attributes);
  48679. }
  48680. static br(attributes) {
  48681. return new Br(attributes);
  48682. }
  48683. static html(attributes) {
  48684. return new Html(attributes);
  48685. }
  48686. static i(attributes) {
  48687. return new I(attributes);
  48688. }
  48689. static li(attributes) {
  48690. return new Li(attributes);
  48691. }
  48692. static ol(attributes) {
  48693. return new Ol(attributes);
  48694. }
  48695. static p(attributes) {
  48696. return new P(attributes);
  48697. }
  48698. static span(attributes) {
  48699. return new Span(attributes);
  48700. }
  48701. static sub(attributes) {
  48702. return new Sub(attributes);
  48703. }
  48704. static sup(attributes) {
  48705. return new Sup(attributes);
  48706. }
  48707. static ul(attributes) {
  48708. return new Ul(attributes);
  48709. }
  48710. }
  48711. ;// CONCATENATED MODULE: ./src/core/xfa/setup.js
  48712. const NamespaceSetUp = {
  48713. config: ConfigNamespace,
  48714. connection: ConnectionSetNamespace,
  48715. datasets: DatasetsNamespace,
  48716. localeSet: LocaleSetNamespace,
  48717. signature: SignatureNamespace,
  48718. stylesheet: StylesheetNamespace,
  48719. template: TemplateNamespace,
  48720. xdp: XdpNamespace,
  48721. xhtml: XhtmlNamespace
  48722. };
  48723. ;// CONCATENATED MODULE: ./src/core/xfa/unknown.js
  48724. class UnknownNamespace {
  48725. constructor(nsId) {
  48726. this.namespaceId = nsId;
  48727. }
  48728. [$buildXFAObject](name, attributes) {
  48729. return new XmlObject(this.namespaceId, name, attributes);
  48730. }
  48731. }
  48732. ;// CONCATENATED MODULE: ./src/core/xfa/builder.js
  48733. class Root extends XFAObject {
  48734. constructor(ids) {
  48735. super(-1, "root", Object.create(null));
  48736. this.element = null;
  48737. this[$ids] = ids;
  48738. }
  48739. [$onChild](child) {
  48740. this.element = child;
  48741. return true;
  48742. }
  48743. [$finalize]() {
  48744. super[$finalize]();
  48745. if (this.element.template instanceof Template) {
  48746. this[$ids].set($root, this.element);
  48747. this.element.template[$resolvePrototypes](this[$ids]);
  48748. this.element.template[$ids] = this[$ids];
  48749. }
  48750. }
  48751. }
  48752. class Empty extends XFAObject {
  48753. constructor() {
  48754. super(-1, "", Object.create(null));
  48755. }
  48756. [$onChild](_) {
  48757. return false;
  48758. }
  48759. }
  48760. class Builder {
  48761. constructor(rootNameSpace = null) {
  48762. this._namespaceStack = [];
  48763. this._nsAgnosticLevel = 0;
  48764. this._namespacePrefixes = new Map();
  48765. this._namespaces = new Map();
  48766. this._nextNsId = Math.max(...Object.values(NamespaceIds).map(({
  48767. id
  48768. }) => id));
  48769. this._currentNamespace = rootNameSpace || new UnknownNamespace(++this._nextNsId);
  48770. }
  48771. buildRoot(ids) {
  48772. return new Root(ids);
  48773. }
  48774. build({
  48775. nsPrefix,
  48776. name,
  48777. attributes,
  48778. namespace,
  48779. prefixes
  48780. }) {
  48781. const hasNamespaceDef = namespace !== null;
  48782. if (hasNamespaceDef) {
  48783. this._namespaceStack.push(this._currentNamespace);
  48784. this._currentNamespace = this._searchNamespace(namespace);
  48785. }
  48786. if (prefixes) {
  48787. this._addNamespacePrefix(prefixes);
  48788. }
  48789. if (attributes.hasOwnProperty($nsAttributes)) {
  48790. const dataTemplate = NamespaceSetUp.datasets;
  48791. const nsAttrs = attributes[$nsAttributes];
  48792. let xfaAttrs = null;
  48793. for (const [ns, attrs] of Object.entries(nsAttrs)) {
  48794. const nsToUse = this._getNamespaceToUse(ns);
  48795. if (nsToUse === dataTemplate) {
  48796. xfaAttrs = {
  48797. xfa: attrs
  48798. };
  48799. break;
  48800. }
  48801. }
  48802. if (xfaAttrs) {
  48803. attributes[$nsAttributes] = xfaAttrs;
  48804. } else {
  48805. delete attributes[$nsAttributes];
  48806. }
  48807. }
  48808. const namespaceToUse = this._getNamespaceToUse(nsPrefix);
  48809. const node = namespaceToUse?.[$buildXFAObject](name, attributes) || new Empty();
  48810. if (node[$isNsAgnostic]()) {
  48811. this._nsAgnosticLevel++;
  48812. }
  48813. if (hasNamespaceDef || prefixes || node[$isNsAgnostic]()) {
  48814. node[$cleanup] = {
  48815. hasNamespace: hasNamespaceDef,
  48816. prefixes,
  48817. nsAgnostic: node[$isNsAgnostic]()
  48818. };
  48819. }
  48820. return node;
  48821. }
  48822. isNsAgnostic() {
  48823. return this._nsAgnosticLevel > 0;
  48824. }
  48825. _searchNamespace(nsName) {
  48826. let ns = this._namespaces.get(nsName);
  48827. if (ns) {
  48828. return ns;
  48829. }
  48830. for (const [name, {
  48831. check
  48832. }] of Object.entries(NamespaceIds)) {
  48833. if (check(nsName)) {
  48834. ns = NamespaceSetUp[name];
  48835. if (ns) {
  48836. this._namespaces.set(nsName, ns);
  48837. return ns;
  48838. }
  48839. break;
  48840. }
  48841. }
  48842. ns = new UnknownNamespace(++this._nextNsId);
  48843. this._namespaces.set(nsName, ns);
  48844. return ns;
  48845. }
  48846. _addNamespacePrefix(prefixes) {
  48847. for (const {
  48848. prefix,
  48849. value
  48850. } of prefixes) {
  48851. const namespace = this._searchNamespace(value);
  48852. let prefixStack = this._namespacePrefixes.get(prefix);
  48853. if (!prefixStack) {
  48854. prefixStack = [];
  48855. this._namespacePrefixes.set(prefix, prefixStack);
  48856. }
  48857. prefixStack.push(namespace);
  48858. }
  48859. }
  48860. _getNamespaceToUse(prefix) {
  48861. if (!prefix) {
  48862. return this._currentNamespace;
  48863. }
  48864. const prefixStack = this._namespacePrefixes.get(prefix);
  48865. if (prefixStack?.length > 0) {
  48866. return prefixStack.at(-1);
  48867. }
  48868. warn(`Unknown namespace prefix: ${prefix}.`);
  48869. return null;
  48870. }
  48871. clean(data) {
  48872. const {
  48873. hasNamespace,
  48874. prefixes,
  48875. nsAgnostic
  48876. } = data;
  48877. if (hasNamespace) {
  48878. this._currentNamespace = this._namespaceStack.pop();
  48879. }
  48880. if (prefixes) {
  48881. prefixes.forEach(({
  48882. prefix
  48883. }) => {
  48884. this._namespacePrefixes.get(prefix).pop();
  48885. });
  48886. }
  48887. if (nsAgnostic) {
  48888. this._nsAgnosticLevel--;
  48889. }
  48890. }
  48891. }
  48892. ;// CONCATENATED MODULE: ./src/core/xfa/parser.js
  48893. class XFAParser extends XMLParserBase {
  48894. constructor(rootNameSpace = null, richText = false) {
  48895. super();
  48896. this._builder = new Builder(rootNameSpace);
  48897. this._stack = [];
  48898. this._globalData = {
  48899. usedTypefaces: new Set()
  48900. };
  48901. this._ids = new Map();
  48902. this._current = this._builder.buildRoot(this._ids);
  48903. this._errorCode = XMLParserErrorCode.NoError;
  48904. this._whiteRegex = /^\s+$/;
  48905. this._nbsps = /\xa0+/g;
  48906. this._richText = richText;
  48907. }
  48908. parse(data) {
  48909. this.parseXml(data);
  48910. if (this._errorCode !== XMLParserErrorCode.NoError) {
  48911. return undefined;
  48912. }
  48913. this._current[$finalize]();
  48914. return this._current.element;
  48915. }
  48916. onText(text) {
  48917. text = text.replace(this._nbsps, match => match.slice(1) + " ");
  48918. if (this._richText || this._current[$acceptWhitespace]()) {
  48919. this._current[$onText](text, this._richText);
  48920. return;
  48921. }
  48922. if (this._whiteRegex.test(text)) {
  48923. return;
  48924. }
  48925. this._current[$onText](text.trim());
  48926. }
  48927. onCdata(text) {
  48928. this._current[$onText](text);
  48929. }
  48930. _mkAttributes(attributes, tagName) {
  48931. let namespace = null;
  48932. let prefixes = null;
  48933. const attributeObj = Object.create({});
  48934. for (const {
  48935. name,
  48936. value
  48937. } of attributes) {
  48938. if (name === "xmlns") {
  48939. if (!namespace) {
  48940. namespace = value;
  48941. } else {
  48942. warn(`XFA - multiple namespace definition in <${tagName}>`);
  48943. }
  48944. } else if (name.startsWith("xmlns:")) {
  48945. const prefix = name.substring("xmlns:".length);
  48946. if (!prefixes) {
  48947. prefixes = [];
  48948. }
  48949. prefixes.push({
  48950. prefix,
  48951. value
  48952. });
  48953. } else {
  48954. const i = name.indexOf(":");
  48955. if (i === -1) {
  48956. attributeObj[name] = value;
  48957. } else {
  48958. let nsAttrs = attributeObj[$nsAttributes];
  48959. if (!nsAttrs) {
  48960. nsAttrs = attributeObj[$nsAttributes] = Object.create(null);
  48961. }
  48962. const [ns, attrName] = [name.slice(0, i), name.slice(i + 1)];
  48963. const attrs = nsAttrs[ns] ||= Object.create(null);
  48964. attrs[attrName] = value;
  48965. }
  48966. }
  48967. }
  48968. return [namespace, prefixes, attributeObj];
  48969. }
  48970. _getNameAndPrefix(name, nsAgnostic) {
  48971. const i = name.indexOf(":");
  48972. if (i === -1) {
  48973. return [name, null];
  48974. }
  48975. return [name.substring(i + 1), nsAgnostic ? "" : name.substring(0, i)];
  48976. }
  48977. onBeginElement(tagName, attributes, isEmpty) {
  48978. const [namespace, prefixes, attributesObj] = this._mkAttributes(attributes, tagName);
  48979. const [name, nsPrefix] = this._getNameAndPrefix(tagName, this._builder.isNsAgnostic());
  48980. const node = this._builder.build({
  48981. nsPrefix,
  48982. name,
  48983. attributes: attributesObj,
  48984. namespace,
  48985. prefixes
  48986. });
  48987. node[$globalData] = this._globalData;
  48988. if (isEmpty) {
  48989. node[$finalize]();
  48990. if (this._current[$onChild](node)) {
  48991. node[$setId](this._ids);
  48992. }
  48993. node[$clean](this._builder);
  48994. return;
  48995. }
  48996. this._stack.push(this._current);
  48997. this._current = node;
  48998. }
  48999. onEndElement(name) {
  49000. const node = this._current;
  49001. if (node[$isCDATAXml]() && typeof node[$content] === "string") {
  49002. const parser = new XFAParser();
  49003. parser._globalData = this._globalData;
  49004. const root = parser.parse(node[$content]);
  49005. node[$content] = null;
  49006. node[$onChild](root);
  49007. }
  49008. node[$finalize]();
  49009. this._current = this._stack.pop();
  49010. if (this._current[$onChild](node)) {
  49011. node[$setId](this._ids);
  49012. }
  49013. node[$clean](this._builder);
  49014. }
  49015. onError(code) {
  49016. this._errorCode = code;
  49017. }
  49018. }
  49019. ;// CONCATENATED MODULE: ./src/core/xfa/factory.js
  49020. class XFAFactory {
  49021. constructor(data) {
  49022. try {
  49023. this.root = new XFAParser().parse(XFAFactory._createDocument(data));
  49024. const binder = new Binder(this.root);
  49025. this.form = binder.bind();
  49026. this.dataHandler = new DataHandler(this.root, binder.getData());
  49027. this.form[$globalData].template = this.form;
  49028. } catch (e) {
  49029. warn(`XFA - an error occurred during parsing and binding: ${e}`);
  49030. }
  49031. }
  49032. isValid() {
  49033. return this.root && this.form;
  49034. }
  49035. _createPagesHelper() {
  49036. const iterator = this.form[$toPages]();
  49037. return new Promise((resolve, reject) => {
  49038. const nextIteration = () => {
  49039. try {
  49040. const value = iterator.next();
  49041. if (value.done) {
  49042. resolve(value.value);
  49043. } else {
  49044. setTimeout(nextIteration, 0);
  49045. }
  49046. } catch (e) {
  49047. reject(e);
  49048. }
  49049. };
  49050. setTimeout(nextIteration, 0);
  49051. });
  49052. }
  49053. async _createPages() {
  49054. try {
  49055. this.pages = await this._createPagesHelper();
  49056. this.dims = this.pages.children.map(c => {
  49057. const {
  49058. width,
  49059. height
  49060. } = c.attributes.style;
  49061. return [0, 0, parseInt(width), parseInt(height)];
  49062. });
  49063. } catch (e) {
  49064. warn(`XFA - an error occurred during layout: ${e}`);
  49065. }
  49066. }
  49067. getBoundingBox(pageIndex) {
  49068. return this.dims[pageIndex];
  49069. }
  49070. async getNumPages() {
  49071. if (!this.pages) {
  49072. await this._createPages();
  49073. }
  49074. return this.dims.length;
  49075. }
  49076. setImages(images) {
  49077. this.form[$globalData].images = images;
  49078. }
  49079. setFonts(fonts) {
  49080. this.form[$globalData].fontFinder = new FontFinder(fonts);
  49081. const missingFonts = [];
  49082. for (let typeface of this.form[$globalData].usedTypefaces) {
  49083. typeface = stripQuotes(typeface);
  49084. const font = this.form[$globalData].fontFinder.find(typeface);
  49085. if (!font) {
  49086. missingFonts.push(typeface);
  49087. }
  49088. }
  49089. if (missingFonts.length > 0) {
  49090. return missingFonts;
  49091. }
  49092. return null;
  49093. }
  49094. appendFonts(fonts, reallyMissingFonts) {
  49095. this.form[$globalData].fontFinder.add(fonts, reallyMissingFonts);
  49096. }
  49097. async getPages() {
  49098. if (!this.pages) {
  49099. await this._createPages();
  49100. }
  49101. const pages = this.pages;
  49102. this.pages = null;
  49103. return pages;
  49104. }
  49105. serializeData(storage) {
  49106. return this.dataHandler.serialize(storage);
  49107. }
  49108. static _createDocument(data) {
  49109. if (!data["/xdp:xdp"]) {
  49110. return data["xdp:xdp"];
  49111. }
  49112. return Object.values(data).join("");
  49113. }
  49114. static getRichTextAsHtml(rc) {
  49115. if (!rc || typeof rc !== "string") {
  49116. return null;
  49117. }
  49118. try {
  49119. let root = new XFAParser(XhtmlNamespace, true).parse(rc);
  49120. if (!["body", "xhtml"].includes(root[$nodeName])) {
  49121. const newRoot = XhtmlNamespace.body({});
  49122. newRoot[$appendChild](root);
  49123. root = newRoot;
  49124. }
  49125. const result = root[$toHTML]();
  49126. if (!result.success) {
  49127. return null;
  49128. }
  49129. const {
  49130. html
  49131. } = result;
  49132. const {
  49133. attributes
  49134. } = html;
  49135. if (attributes) {
  49136. if (attributes.class) {
  49137. attributes.class = attributes.class.filter(attr => !attr.startsWith("xfa"));
  49138. }
  49139. attributes.dir = "auto";
  49140. }
  49141. return {
  49142. html,
  49143. str: root[$text]()
  49144. };
  49145. } catch (e) {
  49146. warn(`XFA - an error occurred during parsing of rich text: ${e}`);
  49147. }
  49148. return null;
  49149. }
  49150. }
  49151. ;// CONCATENATED MODULE: ./src/core/annotation.js
  49152. class AnnotationFactory {
  49153. static createGlobals(pdfManager) {
  49154. return Promise.all([pdfManager.ensureCatalog("acroForm"), pdfManager.ensureDoc("xfaDatasets"), pdfManager.ensureCatalog("structTreeRoot"), pdfManager.ensureCatalog("baseUrl"), pdfManager.ensureCatalog("attachments")]).then(([acroForm, xfaDatasets, structTreeRoot, baseUrl, attachments]) => {
  49155. return {
  49156. pdfManager,
  49157. acroForm: acroForm instanceof Dict ? acroForm : Dict.empty,
  49158. xfaDatasets,
  49159. structTreeRoot,
  49160. baseUrl,
  49161. attachments
  49162. };
  49163. }, reason => {
  49164. warn(`createGlobals: "${reason}".`);
  49165. return null;
  49166. });
  49167. }
  49168. static async create(xref, ref, annotationGlobals, idFactory, collectFields, pageRef) {
  49169. const pageIndex = collectFields ? await this._getPageIndex(xref, ref, annotationGlobals.pdfManager) : null;
  49170. return annotationGlobals.pdfManager.ensure(this, "_create", [xref, ref, annotationGlobals, idFactory, collectFields, pageIndex, pageRef]);
  49171. }
  49172. static _create(xref, ref, annotationGlobals, idFactory, collectFields = false, pageIndex = null, pageRef = null) {
  49173. const dict = xref.fetchIfRef(ref);
  49174. if (!(dict instanceof Dict)) {
  49175. return undefined;
  49176. }
  49177. const {
  49178. acroForm,
  49179. pdfManager
  49180. } = annotationGlobals;
  49181. const id = ref instanceof Ref ? ref.toString() : `annot_${idFactory.createObjId()}`;
  49182. let subtype = dict.get("Subtype");
  49183. subtype = subtype instanceof Name ? subtype.name : null;
  49184. const parameters = {
  49185. xref,
  49186. ref,
  49187. dict,
  49188. subtype,
  49189. id,
  49190. annotationGlobals,
  49191. collectFields,
  49192. needAppearances: !collectFields && acroForm.get("NeedAppearances") === true,
  49193. pageIndex,
  49194. evaluatorOptions: pdfManager.evaluatorOptions,
  49195. pageRef
  49196. };
  49197. switch (subtype) {
  49198. case "Link":
  49199. return new LinkAnnotation(parameters);
  49200. case "Text":
  49201. return new TextAnnotation(parameters);
  49202. case "Widget":
  49203. let fieldType = getInheritableProperty({
  49204. dict,
  49205. key: "FT"
  49206. });
  49207. fieldType = fieldType instanceof Name ? fieldType.name : null;
  49208. switch (fieldType) {
  49209. case "Tx":
  49210. return new TextWidgetAnnotation(parameters);
  49211. case "Btn":
  49212. return new ButtonWidgetAnnotation(parameters);
  49213. case "Ch":
  49214. return new ChoiceWidgetAnnotation(parameters);
  49215. case "Sig":
  49216. return new SignatureWidgetAnnotation(parameters);
  49217. }
  49218. warn(`Unimplemented widget field type "${fieldType}", ` + "falling back to base field type.");
  49219. return new WidgetAnnotation(parameters);
  49220. case "Popup":
  49221. return new PopupAnnotation(parameters);
  49222. case "FreeText":
  49223. return new FreeTextAnnotation(parameters);
  49224. case "Line":
  49225. return new LineAnnotation(parameters);
  49226. case "Square":
  49227. return new SquareAnnotation(parameters);
  49228. case "Circle":
  49229. return new CircleAnnotation(parameters);
  49230. case "PolyLine":
  49231. return new PolylineAnnotation(parameters);
  49232. case "Polygon":
  49233. return new PolygonAnnotation(parameters);
  49234. case "Caret":
  49235. return new CaretAnnotation(parameters);
  49236. case "Ink":
  49237. return new InkAnnotation(parameters);
  49238. case "Highlight":
  49239. return new HighlightAnnotation(parameters);
  49240. case "Underline":
  49241. return new UnderlineAnnotation(parameters);
  49242. case "Squiggly":
  49243. return new SquigglyAnnotation(parameters);
  49244. case "StrikeOut":
  49245. return new StrikeOutAnnotation(parameters);
  49246. case "Stamp":
  49247. return new StampAnnotation(parameters);
  49248. case "FileAttachment":
  49249. return new FileAttachmentAnnotation(parameters);
  49250. default:
  49251. if (!collectFields) {
  49252. if (!subtype) {
  49253. warn("Annotation is missing the required /Subtype.");
  49254. } else {
  49255. warn(`Unimplemented annotation type "${subtype}", ` + "falling back to base annotation.");
  49256. }
  49257. }
  49258. return new Annotation(parameters);
  49259. }
  49260. }
  49261. static async _getPageIndex(xref, ref, pdfManager) {
  49262. try {
  49263. const annotDict = await xref.fetchIfRefAsync(ref);
  49264. if (!(annotDict instanceof Dict)) {
  49265. return -1;
  49266. }
  49267. const pageRef = annotDict.getRaw("P");
  49268. if (pageRef instanceof Ref) {
  49269. try {
  49270. const pageIndex = await pdfManager.ensureCatalog("getPageIndex", [pageRef]);
  49271. return pageIndex;
  49272. } catch (ex) {
  49273. info(`_getPageIndex -- not a valid page reference: "${ex}".`);
  49274. }
  49275. }
  49276. if (annotDict.has("Kids")) {
  49277. return -1;
  49278. }
  49279. const numPages = await pdfManager.ensureDoc("numPages");
  49280. for (let pageIndex = 0; pageIndex < numPages; pageIndex++) {
  49281. const page = await pdfManager.getPage(pageIndex);
  49282. const annotations = await pdfManager.ensure(page, "annotations");
  49283. for (const annotRef of annotations) {
  49284. if (annotRef instanceof Ref && isRefsEqual(annotRef, ref)) {
  49285. return pageIndex;
  49286. }
  49287. }
  49288. }
  49289. } catch (ex) {
  49290. warn(`_getPageIndex: "${ex}".`);
  49291. }
  49292. return -1;
  49293. }
  49294. static generateImages(annotations, xref, isOffscreenCanvasSupported) {
  49295. if (!isOffscreenCanvasSupported) {
  49296. warn("generateImages: OffscreenCanvas is not supported, cannot save or print some annotations with images.");
  49297. return null;
  49298. }
  49299. let imagePromises;
  49300. for (const {
  49301. bitmapId,
  49302. bitmap
  49303. } of annotations) {
  49304. if (!bitmap) {
  49305. continue;
  49306. }
  49307. imagePromises ||= new Map();
  49308. imagePromises.set(bitmapId, StampAnnotation.createImage(bitmap, xref));
  49309. }
  49310. return imagePromises;
  49311. }
  49312. static async saveNewAnnotations(evaluator, task, annotations, imagePromises) {
  49313. const xref = evaluator.xref;
  49314. let baseFontRef;
  49315. const dependencies = [];
  49316. const promises = [];
  49317. const {
  49318. isOffscreenCanvasSupported
  49319. } = evaluator.options;
  49320. for (const annotation of annotations) {
  49321. if (annotation.deleted) {
  49322. continue;
  49323. }
  49324. switch (annotation.annotationType) {
  49325. case AnnotationEditorType.FREETEXT:
  49326. if (!baseFontRef) {
  49327. const baseFont = new Dict(xref);
  49328. baseFont.set("BaseFont", Name.get("Helvetica"));
  49329. baseFont.set("Type", Name.get("Font"));
  49330. baseFont.set("Subtype", Name.get("Type1"));
  49331. baseFont.set("Encoding", Name.get("WinAnsiEncoding"));
  49332. const buffer = [];
  49333. baseFontRef = xref.getNewTemporaryRef();
  49334. await writeObject(baseFontRef, baseFont, buffer, xref);
  49335. dependencies.push({
  49336. ref: baseFontRef,
  49337. data: buffer.join("")
  49338. });
  49339. }
  49340. promises.push(FreeTextAnnotation.createNewAnnotation(xref, annotation, dependencies, {
  49341. evaluator,
  49342. task,
  49343. baseFontRef
  49344. }));
  49345. break;
  49346. case AnnotationEditorType.HIGHLIGHT:
  49347. if (annotation.quadPoints) {
  49348. promises.push(HighlightAnnotation.createNewAnnotation(xref, annotation, dependencies));
  49349. } else {
  49350. promises.push(InkAnnotation.createNewAnnotation(xref, annotation, dependencies));
  49351. }
  49352. break;
  49353. case AnnotationEditorType.INK:
  49354. promises.push(InkAnnotation.createNewAnnotation(xref, annotation, dependencies));
  49355. break;
  49356. case AnnotationEditorType.STAMP:
  49357. if (!isOffscreenCanvasSupported) {
  49358. break;
  49359. }
  49360. const image = await imagePromises.get(annotation.bitmapId);
  49361. if (image.imageStream) {
  49362. const {
  49363. imageStream,
  49364. smaskStream
  49365. } = image;
  49366. const buffer = [];
  49367. if (smaskStream) {
  49368. const smaskRef = xref.getNewTemporaryRef();
  49369. await writeObject(smaskRef, smaskStream, buffer, xref);
  49370. dependencies.push({
  49371. ref: smaskRef,
  49372. data: buffer.join("")
  49373. });
  49374. imageStream.dict.set("SMask", smaskRef);
  49375. buffer.length = 0;
  49376. }
  49377. const imageRef = image.imageRef = xref.getNewTemporaryRef();
  49378. await writeObject(imageRef, imageStream, buffer, xref);
  49379. dependencies.push({
  49380. ref: imageRef,
  49381. data: buffer.join("")
  49382. });
  49383. image.imageStream = image.smaskStream = null;
  49384. }
  49385. promises.push(StampAnnotation.createNewAnnotation(xref, annotation, dependencies, {
  49386. image
  49387. }));
  49388. break;
  49389. }
  49390. }
  49391. return {
  49392. annotations: await Promise.all(promises),
  49393. dependencies
  49394. };
  49395. }
  49396. static async printNewAnnotations(annotationGlobals, evaluator, task, annotations, imagePromises) {
  49397. if (!annotations) {
  49398. return null;
  49399. }
  49400. const {
  49401. options,
  49402. xref
  49403. } = evaluator;
  49404. const promises = [];
  49405. for (const annotation of annotations) {
  49406. if (annotation.deleted) {
  49407. continue;
  49408. }
  49409. switch (annotation.annotationType) {
  49410. case AnnotationEditorType.FREETEXT:
  49411. promises.push(FreeTextAnnotation.createNewPrintAnnotation(annotationGlobals, xref, annotation, {
  49412. evaluator,
  49413. task,
  49414. evaluatorOptions: options
  49415. }));
  49416. break;
  49417. case AnnotationEditorType.HIGHLIGHT:
  49418. if (annotation.quadPoints) {
  49419. promises.push(HighlightAnnotation.createNewPrintAnnotation(annotationGlobals, xref, annotation, {
  49420. evaluatorOptions: options
  49421. }));
  49422. } else {
  49423. promises.push(InkAnnotation.createNewPrintAnnotation(annotationGlobals, xref, annotation, {
  49424. evaluatorOptions: options
  49425. }));
  49426. }
  49427. break;
  49428. case AnnotationEditorType.INK:
  49429. promises.push(InkAnnotation.createNewPrintAnnotation(annotationGlobals, xref, annotation, {
  49430. evaluatorOptions: options
  49431. }));
  49432. break;
  49433. case AnnotationEditorType.STAMP:
  49434. if (!options.isOffscreenCanvasSupported) {
  49435. break;
  49436. }
  49437. const image = await imagePromises.get(annotation.bitmapId);
  49438. if (image.imageStream) {
  49439. const {
  49440. imageStream,
  49441. smaskStream
  49442. } = image;
  49443. if (smaskStream) {
  49444. imageStream.dict.set("SMask", smaskStream);
  49445. }
  49446. image.imageRef = new JpegStream(imageStream, imageStream.length);
  49447. image.imageStream = image.smaskStream = null;
  49448. }
  49449. promises.push(StampAnnotation.createNewPrintAnnotation(annotationGlobals, xref, annotation, {
  49450. image,
  49451. evaluatorOptions: options
  49452. }));
  49453. break;
  49454. }
  49455. }
  49456. return Promise.all(promises);
  49457. }
  49458. }
  49459. function getRgbColor(color, defaultColor = new Uint8ClampedArray(3)) {
  49460. if (!Array.isArray(color)) {
  49461. return defaultColor;
  49462. }
  49463. const rgbColor = defaultColor || new Uint8ClampedArray(3);
  49464. switch (color.length) {
  49465. case 0:
  49466. return null;
  49467. case 1:
  49468. ColorSpace.singletons.gray.getRgbItem(color, 0, rgbColor, 0);
  49469. return rgbColor;
  49470. case 3:
  49471. ColorSpace.singletons.rgb.getRgbItem(color, 0, rgbColor, 0);
  49472. return rgbColor;
  49473. case 4:
  49474. ColorSpace.singletons.cmyk.getRgbItem(color, 0, rgbColor, 0);
  49475. return rgbColor;
  49476. default:
  49477. return defaultColor;
  49478. }
  49479. }
  49480. function getPdfColorArray(color) {
  49481. return Array.from(color, c => c / 255);
  49482. }
  49483. function getQuadPoints(dict, rect) {
  49484. const quadPoints = dict.getArray("QuadPoints");
  49485. if (!isNumberArray(quadPoints, null) || quadPoints.length === 0 || quadPoints.length % 8 > 0) {
  49486. return null;
  49487. }
  49488. const newQuadPoints = new Float32Array(quadPoints.length);
  49489. for (let i = 0, ii = quadPoints.length; i < ii; i += 8) {
  49490. const [x1, y1, x2, y2, x3, y3, x4, y4] = quadPoints.slice(i, i + 8);
  49491. const minX = Math.min(x1, x2, x3, x4);
  49492. const maxX = Math.max(x1, x2, x3, x4);
  49493. const minY = Math.min(y1, y2, y3, y4);
  49494. const maxY = Math.max(y1, y2, y3, y4);
  49495. if (rect !== null && (minX < rect[0] || maxX > rect[2] || minY < rect[1] || maxY > rect[3])) {
  49496. return null;
  49497. }
  49498. newQuadPoints.set([minX, maxY, maxX, maxY, minX, minY, maxX, minY], i);
  49499. }
  49500. return newQuadPoints;
  49501. }
  49502. function getTransformMatrix(rect, bbox, matrix) {
  49503. const [minX, minY, maxX, maxY] = Util.getAxialAlignedBoundingBox(bbox, matrix);
  49504. if (minX === maxX || minY === maxY) {
  49505. return [1, 0, 0, 1, rect[0], rect[1]];
  49506. }
  49507. const xRatio = (rect[2] - rect[0]) / (maxX - minX);
  49508. const yRatio = (rect[3] - rect[1]) / (maxY - minY);
  49509. return [xRatio, 0, 0, yRatio, rect[0] - minX * xRatio, rect[1] - minY * yRatio];
  49510. }
  49511. class Annotation {
  49512. constructor(params) {
  49513. const {
  49514. dict,
  49515. xref,
  49516. annotationGlobals
  49517. } = params;
  49518. this.setTitle(dict.get("T"));
  49519. this.setContents(dict.get("Contents"));
  49520. this.setModificationDate(dict.get("M"));
  49521. this.setFlags(dict.get("F"));
  49522. this.setRectangle(dict.getArray("Rect"));
  49523. this.setColor(dict.getArray("C"));
  49524. this.setBorderStyle(dict);
  49525. this.setAppearance(dict);
  49526. this.setOptionalContent(dict);
  49527. const MK = dict.get("MK");
  49528. this.setBorderAndBackgroundColors(MK);
  49529. this.setRotation(MK, dict);
  49530. this.ref = params.ref instanceof Ref ? params.ref : null;
  49531. this._streams = [];
  49532. if (this.appearance) {
  49533. this._streams.push(this.appearance);
  49534. }
  49535. const isLocked = !!(this.flags & AnnotationFlag.LOCKED);
  49536. const isContentLocked = !!(this.flags & AnnotationFlag.LOCKEDCONTENTS);
  49537. if (annotationGlobals.structTreeRoot) {
  49538. let structParent = dict.get("StructParent");
  49539. structParent = Number.isInteger(structParent) && structParent >= 0 ? structParent : -1;
  49540. annotationGlobals.structTreeRoot.addAnnotationIdToPage(params.pageRef, structParent);
  49541. }
  49542. this.data = {
  49543. annotationFlags: this.flags,
  49544. borderStyle: this.borderStyle,
  49545. color: this.color,
  49546. backgroundColor: this.backgroundColor,
  49547. borderColor: this.borderColor,
  49548. rotation: this.rotation,
  49549. contentsObj: this._contents,
  49550. hasAppearance: !!this.appearance,
  49551. id: params.id,
  49552. modificationDate: this.modificationDate,
  49553. rect: this.rectangle,
  49554. subtype: params.subtype,
  49555. hasOwnCanvas: false,
  49556. noRotate: !!(this.flags & AnnotationFlag.NOROTATE),
  49557. noHTML: isLocked && isContentLocked,
  49558. isEditable: false
  49559. };
  49560. if (params.collectFields) {
  49561. const kids = dict.get("Kids");
  49562. if (Array.isArray(kids)) {
  49563. const kidIds = [];
  49564. for (const kid of kids) {
  49565. if (kid instanceof Ref) {
  49566. kidIds.push(kid.toString());
  49567. }
  49568. }
  49569. if (kidIds.length !== 0) {
  49570. this.data.kidIds = kidIds;
  49571. }
  49572. }
  49573. this.data.actions = collectActions(xref, dict, AnnotationActionEventType);
  49574. this.data.fieldName = this._constructFieldName(dict);
  49575. this.data.pageIndex = params.pageIndex;
  49576. }
  49577. this._isOffscreenCanvasSupported = params.evaluatorOptions.isOffscreenCanvasSupported;
  49578. this._fallbackFontDict = null;
  49579. this._needAppearances = false;
  49580. }
  49581. _hasFlag(flags, flag) {
  49582. return !!(flags & flag);
  49583. }
  49584. _isViewable(flags) {
  49585. return !this._hasFlag(flags, AnnotationFlag.INVISIBLE) && !this._hasFlag(flags, AnnotationFlag.NOVIEW);
  49586. }
  49587. _isPrintable(flags) {
  49588. return this._hasFlag(flags, AnnotationFlag.PRINT) && !this._hasFlag(flags, AnnotationFlag.HIDDEN) && !this._hasFlag(flags, AnnotationFlag.INVISIBLE);
  49589. }
  49590. mustBeViewed(annotationStorage, _renderForms) {
  49591. const noView = annotationStorage?.get(this.data.id)?.noView;
  49592. if (noView !== undefined) {
  49593. return !noView;
  49594. }
  49595. return this.viewable && !this._hasFlag(this.flags, AnnotationFlag.HIDDEN);
  49596. }
  49597. mustBePrinted(annotationStorage) {
  49598. const noPrint = annotationStorage?.get(this.data.id)?.noPrint;
  49599. if (noPrint !== undefined) {
  49600. return !noPrint;
  49601. }
  49602. return this.printable;
  49603. }
  49604. mustBeViewedWhenEditing(isEditing, modifiedIds = null) {
  49605. return isEditing ? !this.data.isEditable : !modifiedIds?.has(this.data.id);
  49606. }
  49607. get viewable() {
  49608. if (this.data.quadPoints === null) {
  49609. return false;
  49610. }
  49611. if (this.flags === 0) {
  49612. return true;
  49613. }
  49614. return this._isViewable(this.flags);
  49615. }
  49616. get printable() {
  49617. if (this.data.quadPoints === null) {
  49618. return false;
  49619. }
  49620. if (this.flags === 0) {
  49621. return false;
  49622. }
  49623. return this._isPrintable(this.flags);
  49624. }
  49625. _parseStringHelper(data) {
  49626. const str = typeof data === "string" ? stringToPDFString(data) : "";
  49627. const dir = str && bidi(str).dir === "rtl" ? "rtl" : "ltr";
  49628. return {
  49629. str,
  49630. dir
  49631. };
  49632. }
  49633. setDefaultAppearance(params) {
  49634. const {
  49635. dict,
  49636. annotationGlobals
  49637. } = params;
  49638. const defaultAppearance = getInheritableProperty({
  49639. dict,
  49640. key: "DA"
  49641. }) || annotationGlobals.acroForm.get("DA");
  49642. this._defaultAppearance = typeof defaultAppearance === "string" ? defaultAppearance : "";
  49643. this.data.defaultAppearanceData = parseDefaultAppearance(this._defaultAppearance);
  49644. }
  49645. setTitle(title) {
  49646. this._title = this._parseStringHelper(title);
  49647. }
  49648. setContents(contents) {
  49649. this._contents = this._parseStringHelper(contents);
  49650. }
  49651. setModificationDate(modificationDate) {
  49652. this.modificationDate = typeof modificationDate === "string" ? modificationDate : null;
  49653. }
  49654. setFlags(flags) {
  49655. this.flags = Number.isInteger(flags) && flags > 0 ? flags : 0;
  49656. if (this.flags & AnnotationFlag.INVISIBLE && this.constructor.name !== "Annotation") {
  49657. this.flags ^= AnnotationFlag.INVISIBLE;
  49658. }
  49659. }
  49660. hasFlag(flag) {
  49661. return this._hasFlag(this.flags, flag);
  49662. }
  49663. setRectangle(rectangle) {
  49664. this.rectangle = lookupNormalRect(rectangle, [0, 0, 0, 0]);
  49665. }
  49666. setColor(color) {
  49667. this.color = getRgbColor(color);
  49668. }
  49669. setLineEndings(lineEndings) {
  49670. this.lineEndings = ["None", "None"];
  49671. if (Array.isArray(lineEndings) && lineEndings.length === 2) {
  49672. for (let i = 0; i < 2; i++) {
  49673. const obj = lineEndings[i];
  49674. if (obj instanceof Name) {
  49675. switch (obj.name) {
  49676. case "None":
  49677. continue;
  49678. case "Square":
  49679. case "Circle":
  49680. case "Diamond":
  49681. case "OpenArrow":
  49682. case "ClosedArrow":
  49683. case "Butt":
  49684. case "ROpenArrow":
  49685. case "RClosedArrow":
  49686. case "Slash":
  49687. this.lineEndings[i] = obj.name;
  49688. continue;
  49689. }
  49690. }
  49691. warn(`Ignoring invalid lineEnding: ${obj}`);
  49692. }
  49693. }
  49694. }
  49695. setRotation(mk, dict) {
  49696. this.rotation = 0;
  49697. let angle = mk instanceof Dict ? mk.get("R") || 0 : dict.get("Rotate") || 0;
  49698. if (Number.isInteger(angle) && angle !== 0) {
  49699. angle %= 360;
  49700. if (angle < 0) {
  49701. angle += 360;
  49702. }
  49703. if (angle % 90 === 0) {
  49704. this.rotation = angle;
  49705. }
  49706. }
  49707. }
  49708. setBorderAndBackgroundColors(mk) {
  49709. if (mk instanceof Dict) {
  49710. this.borderColor = getRgbColor(mk.getArray("BC"), null);
  49711. this.backgroundColor = getRgbColor(mk.getArray("BG"), null);
  49712. } else {
  49713. this.borderColor = this.backgroundColor = null;
  49714. }
  49715. }
  49716. setBorderStyle(borderStyle) {
  49717. this.borderStyle = new AnnotationBorderStyle();
  49718. if (!(borderStyle instanceof Dict)) {
  49719. return;
  49720. }
  49721. if (borderStyle.has("BS")) {
  49722. const dict = borderStyle.get("BS");
  49723. if (dict instanceof Dict) {
  49724. const dictType = dict.get("Type");
  49725. if (!dictType || isName(dictType, "Border")) {
  49726. this.borderStyle.setWidth(dict.get("W"), this.rectangle);
  49727. this.borderStyle.setStyle(dict.get("S"));
  49728. this.borderStyle.setDashArray(dict.getArray("D"));
  49729. }
  49730. }
  49731. } else if (borderStyle.has("Border")) {
  49732. const array = borderStyle.getArray("Border");
  49733. if (Array.isArray(array) && array.length >= 3) {
  49734. this.borderStyle.setHorizontalCornerRadius(array[0]);
  49735. this.borderStyle.setVerticalCornerRadius(array[1]);
  49736. this.borderStyle.setWidth(array[2], this.rectangle);
  49737. if (array.length === 4) {
  49738. this.borderStyle.setDashArray(array[3], true);
  49739. }
  49740. }
  49741. } else {
  49742. this.borderStyle.setWidth(0);
  49743. }
  49744. }
  49745. setAppearance(dict) {
  49746. this.appearance = null;
  49747. const appearanceStates = dict.get("AP");
  49748. if (!(appearanceStates instanceof Dict)) {
  49749. return;
  49750. }
  49751. const normalAppearanceState = appearanceStates.get("N");
  49752. if (normalAppearanceState instanceof BaseStream) {
  49753. this.appearance = normalAppearanceState;
  49754. return;
  49755. }
  49756. if (!(normalAppearanceState instanceof Dict)) {
  49757. return;
  49758. }
  49759. const as = dict.get("AS");
  49760. if (!(as instanceof Name) || !normalAppearanceState.has(as.name)) {
  49761. return;
  49762. }
  49763. const appearance = normalAppearanceState.get(as.name);
  49764. if (appearance instanceof BaseStream) {
  49765. this.appearance = appearance;
  49766. }
  49767. }
  49768. setOptionalContent(dict) {
  49769. this.oc = null;
  49770. const oc = dict.get("OC");
  49771. if (oc instanceof Name) {
  49772. warn("setOptionalContent: Support for /Name-entry is not implemented.");
  49773. } else if (oc instanceof Dict) {
  49774. this.oc = oc;
  49775. }
  49776. }
  49777. loadResources(keys, appearance) {
  49778. return appearance.dict.getAsync("Resources").then(resources => {
  49779. if (!resources) {
  49780. return undefined;
  49781. }
  49782. const objectLoader = new ObjectLoader(resources, keys, resources.xref);
  49783. return objectLoader.load().then(function () {
  49784. return resources;
  49785. });
  49786. });
  49787. }
  49788. async getOperatorList(evaluator, task, intent, annotationStorage) {
  49789. const {
  49790. hasOwnCanvas,
  49791. id,
  49792. rect
  49793. } = this.data;
  49794. let appearance = this.appearance;
  49795. const isUsingOwnCanvas = !!(hasOwnCanvas && intent & RenderingIntentFlag.DISPLAY);
  49796. if (isUsingOwnCanvas && (rect[0] === rect[2] || rect[1] === rect[3])) {
  49797. this.data.hasOwnCanvas = false;
  49798. return {
  49799. opList: new OperatorList(),
  49800. separateForm: false,
  49801. separateCanvas: false
  49802. };
  49803. }
  49804. if (!appearance) {
  49805. if (!isUsingOwnCanvas) {
  49806. return {
  49807. opList: new OperatorList(),
  49808. separateForm: false,
  49809. separateCanvas: false
  49810. };
  49811. }
  49812. appearance = new StringStream("");
  49813. appearance.dict = new Dict();
  49814. }
  49815. const appearanceDict = appearance.dict;
  49816. const resources = await this.loadResources(["ExtGState", "ColorSpace", "Pattern", "Shading", "XObject", "Font"], appearance);
  49817. const bbox = lookupRect(appearanceDict.getArray("BBox"), [0, 0, 1, 1]);
  49818. const matrix = lookupMatrix(appearanceDict.getArray("Matrix"), IDENTITY_MATRIX);
  49819. const transform = getTransformMatrix(rect, bbox, matrix);
  49820. const opList = new OperatorList();
  49821. let optionalContent;
  49822. if (this.oc) {
  49823. optionalContent = await evaluator.parseMarkedContentProps(this.oc, null);
  49824. }
  49825. if (optionalContent !== undefined) {
  49826. opList.addOp(OPS.beginMarkedContentProps, ["OC", optionalContent]);
  49827. }
  49828. opList.addOp(OPS.beginAnnotation, [id, rect, transform, matrix, isUsingOwnCanvas]);
  49829. await evaluator.getOperatorList({
  49830. stream: appearance,
  49831. task,
  49832. resources,
  49833. operatorList: opList,
  49834. fallbackFontDict: this._fallbackFontDict
  49835. });
  49836. opList.addOp(OPS.endAnnotation, []);
  49837. if (optionalContent !== undefined) {
  49838. opList.addOp(OPS.endMarkedContent, []);
  49839. }
  49840. this.reset();
  49841. return {
  49842. opList,
  49843. separateForm: false,
  49844. separateCanvas: isUsingOwnCanvas
  49845. };
  49846. }
  49847. async save(evaluator, task, annotationStorage) {
  49848. return null;
  49849. }
  49850. get hasTextContent() {
  49851. return false;
  49852. }
  49853. async extractTextContent(evaluator, task, viewBox) {
  49854. if (!this.appearance) {
  49855. return;
  49856. }
  49857. const resources = await this.loadResources(["ExtGState", "Font", "Properties", "XObject"], this.appearance);
  49858. const text = [];
  49859. const buffer = [];
  49860. let firstPosition = null;
  49861. const sink = {
  49862. desiredSize: Math.Infinity,
  49863. ready: true,
  49864. enqueue(chunk, size) {
  49865. for (const item of chunk.items) {
  49866. if (item.str === undefined) {
  49867. continue;
  49868. }
  49869. firstPosition ||= item.transform.slice(-2);
  49870. buffer.push(item.str);
  49871. if (item.hasEOL) {
  49872. text.push(buffer.join("").trimEnd());
  49873. buffer.length = 0;
  49874. }
  49875. }
  49876. }
  49877. };
  49878. await evaluator.getTextContent({
  49879. stream: this.appearance,
  49880. task,
  49881. resources,
  49882. includeMarkedContent: true,
  49883. keepWhiteSpace: true,
  49884. sink,
  49885. viewBox
  49886. });
  49887. this.reset();
  49888. if (buffer.length) {
  49889. text.push(buffer.join("").trimEnd());
  49890. }
  49891. if (text.length > 1 || text[0]) {
  49892. const appearanceDict = this.appearance.dict;
  49893. const bbox = lookupRect(appearanceDict.getArray("BBox"), null);
  49894. const matrix = lookupMatrix(appearanceDict.getArray("Matrix"), null);
  49895. this.data.textPosition = this._transformPoint(firstPosition, bbox, matrix);
  49896. this.data.textContent = text;
  49897. }
  49898. }
  49899. _transformPoint(coords, bbox, matrix) {
  49900. const {
  49901. rect
  49902. } = this.data;
  49903. bbox ||= [0, 0, 1, 1];
  49904. matrix ||= [1, 0, 0, 1, 0, 0];
  49905. const transform = getTransformMatrix(rect, bbox, matrix);
  49906. transform[4] -= rect[0];
  49907. transform[5] -= rect[1];
  49908. coords = Util.applyTransform(coords, transform);
  49909. return Util.applyTransform(coords, matrix);
  49910. }
  49911. getFieldObject() {
  49912. if (this.data.kidIds) {
  49913. return {
  49914. id: this.data.id,
  49915. actions: this.data.actions,
  49916. name: this.data.fieldName,
  49917. strokeColor: this.data.borderColor,
  49918. fillColor: this.data.backgroundColor,
  49919. type: "",
  49920. kidIds: this.data.kidIds,
  49921. page: this.data.pageIndex,
  49922. rotation: this.rotation
  49923. };
  49924. }
  49925. return null;
  49926. }
  49927. reset() {
  49928. for (const stream of this._streams) {
  49929. stream.reset();
  49930. }
  49931. }
  49932. _constructFieldName(dict) {
  49933. if (!dict.has("T") && !dict.has("Parent")) {
  49934. warn("Unknown field name, falling back to empty field name.");
  49935. return "";
  49936. }
  49937. if (!dict.has("Parent")) {
  49938. return stringToPDFString(dict.get("T"));
  49939. }
  49940. const fieldName = [];
  49941. if (dict.has("T")) {
  49942. fieldName.unshift(stringToPDFString(dict.get("T")));
  49943. }
  49944. let loopDict = dict;
  49945. const visited = new RefSet();
  49946. if (dict.objId) {
  49947. visited.put(dict.objId);
  49948. }
  49949. while (loopDict.has("Parent")) {
  49950. loopDict = loopDict.get("Parent");
  49951. if (!(loopDict instanceof Dict) || loopDict.objId && visited.has(loopDict.objId)) {
  49952. break;
  49953. }
  49954. if (loopDict.objId) {
  49955. visited.put(loopDict.objId);
  49956. }
  49957. if (loopDict.has("T")) {
  49958. fieldName.unshift(stringToPDFString(loopDict.get("T")));
  49959. }
  49960. }
  49961. return fieldName.join(".");
  49962. }
  49963. }
  49964. class AnnotationBorderStyle {
  49965. constructor() {
  49966. this.width = 1;
  49967. this.style = AnnotationBorderStyleType.SOLID;
  49968. this.dashArray = [3];
  49969. this.horizontalCornerRadius = 0;
  49970. this.verticalCornerRadius = 0;
  49971. }
  49972. setWidth(width, rect = [0, 0, 0, 0]) {
  49973. if (width instanceof Name) {
  49974. this.width = 0;
  49975. return;
  49976. }
  49977. if (typeof width === "number") {
  49978. if (width > 0) {
  49979. const maxWidth = (rect[2] - rect[0]) / 2;
  49980. const maxHeight = (rect[3] - rect[1]) / 2;
  49981. if (maxWidth > 0 && maxHeight > 0 && (width > maxWidth || width > maxHeight)) {
  49982. warn(`AnnotationBorderStyle.setWidth - ignoring width: ${width}`);
  49983. width = 1;
  49984. }
  49985. }
  49986. this.width = width;
  49987. }
  49988. }
  49989. setStyle(style) {
  49990. if (!(style instanceof Name)) {
  49991. return;
  49992. }
  49993. switch (style.name) {
  49994. case "S":
  49995. this.style = AnnotationBorderStyleType.SOLID;
  49996. break;
  49997. case "D":
  49998. this.style = AnnotationBorderStyleType.DASHED;
  49999. break;
  50000. case "B":
  50001. this.style = AnnotationBorderStyleType.BEVELED;
  50002. break;
  50003. case "I":
  50004. this.style = AnnotationBorderStyleType.INSET;
  50005. break;
  50006. case "U":
  50007. this.style = AnnotationBorderStyleType.UNDERLINE;
  50008. break;
  50009. default:
  50010. break;
  50011. }
  50012. }
  50013. setDashArray(dashArray, forceStyle = false) {
  50014. if (Array.isArray(dashArray)) {
  50015. let isValid = true;
  50016. let allZeros = true;
  50017. for (const element of dashArray) {
  50018. const validNumber = +element >= 0;
  50019. if (!validNumber) {
  50020. isValid = false;
  50021. break;
  50022. } else if (element > 0) {
  50023. allZeros = false;
  50024. }
  50025. }
  50026. if (dashArray.length === 0 || isValid && !allZeros) {
  50027. this.dashArray = dashArray;
  50028. if (forceStyle) {
  50029. this.setStyle(Name.get("D"));
  50030. }
  50031. } else {
  50032. this.width = 0;
  50033. }
  50034. } else if (dashArray) {
  50035. this.width = 0;
  50036. }
  50037. }
  50038. setHorizontalCornerRadius(radius) {
  50039. if (Number.isInteger(radius)) {
  50040. this.horizontalCornerRadius = radius;
  50041. }
  50042. }
  50043. setVerticalCornerRadius(radius) {
  50044. if (Number.isInteger(radius)) {
  50045. this.verticalCornerRadius = radius;
  50046. }
  50047. }
  50048. }
  50049. class MarkupAnnotation extends Annotation {
  50050. constructor(params) {
  50051. super(params);
  50052. const {
  50053. dict
  50054. } = params;
  50055. if (dict.has("IRT")) {
  50056. const rawIRT = dict.getRaw("IRT");
  50057. this.data.inReplyTo = rawIRT instanceof Ref ? rawIRT.toString() : null;
  50058. const rt = dict.get("RT");
  50059. this.data.replyType = rt instanceof Name ? rt.name : AnnotationReplyType.REPLY;
  50060. }
  50061. let popupRef = null;
  50062. if (this.data.replyType === AnnotationReplyType.GROUP) {
  50063. const parent = dict.get("IRT");
  50064. this.setTitle(parent.get("T"));
  50065. this.data.titleObj = this._title;
  50066. this.setContents(parent.get("Contents"));
  50067. this.data.contentsObj = this._contents;
  50068. if (!parent.has("CreationDate")) {
  50069. this.data.creationDate = null;
  50070. } else {
  50071. this.setCreationDate(parent.get("CreationDate"));
  50072. this.data.creationDate = this.creationDate;
  50073. }
  50074. if (!parent.has("M")) {
  50075. this.data.modificationDate = null;
  50076. } else {
  50077. this.setModificationDate(parent.get("M"));
  50078. this.data.modificationDate = this.modificationDate;
  50079. }
  50080. popupRef = parent.getRaw("Popup");
  50081. if (!parent.has("C")) {
  50082. this.data.color = null;
  50083. } else {
  50084. this.setColor(parent.getArray("C"));
  50085. this.data.color = this.color;
  50086. }
  50087. } else {
  50088. this.data.titleObj = this._title;
  50089. this.setCreationDate(dict.get("CreationDate"));
  50090. this.data.creationDate = this.creationDate;
  50091. popupRef = dict.getRaw("Popup");
  50092. if (!dict.has("C")) {
  50093. this.data.color = null;
  50094. }
  50095. }
  50096. this.data.popupRef = popupRef instanceof Ref ? popupRef.toString() : null;
  50097. if (dict.has("RC")) {
  50098. this.data.richText = XFAFactory.getRichTextAsHtml(dict.get("RC"));
  50099. }
  50100. }
  50101. setCreationDate(creationDate) {
  50102. this.creationDate = typeof creationDate === "string" ? creationDate : null;
  50103. }
  50104. _setDefaultAppearance({
  50105. xref,
  50106. extra,
  50107. strokeColor,
  50108. fillColor,
  50109. blendMode,
  50110. strokeAlpha,
  50111. fillAlpha,
  50112. pointsCallback
  50113. }) {
  50114. let minX = Number.MAX_VALUE;
  50115. let minY = Number.MAX_VALUE;
  50116. let maxX = Number.MIN_VALUE;
  50117. let maxY = Number.MIN_VALUE;
  50118. const buffer = ["q"];
  50119. if (extra) {
  50120. buffer.push(extra);
  50121. }
  50122. if (strokeColor) {
  50123. buffer.push(`${strokeColor[0]} ${strokeColor[1]} ${strokeColor[2]} RG`);
  50124. }
  50125. if (fillColor) {
  50126. buffer.push(`${fillColor[0]} ${fillColor[1]} ${fillColor[2]} rg`);
  50127. }
  50128. let pointsArray = this.data.quadPoints;
  50129. if (!pointsArray) {
  50130. 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]]);
  50131. }
  50132. for (let i = 0, ii = pointsArray.length; i < ii; i += 8) {
  50133. const [mX, MX, mY, MY] = pointsCallback(buffer, pointsArray.subarray(i, i + 8));
  50134. minX = Math.min(minX, mX);
  50135. maxX = Math.max(maxX, MX);
  50136. minY = Math.min(minY, mY);
  50137. maxY = Math.max(maxY, MY);
  50138. }
  50139. buffer.push("Q");
  50140. const formDict = new Dict(xref);
  50141. const appearanceStreamDict = new Dict(xref);
  50142. appearanceStreamDict.set("Subtype", Name.get("Form"));
  50143. const appearanceStream = new StringStream(buffer.join(" "));
  50144. appearanceStream.dict = appearanceStreamDict;
  50145. formDict.set("Fm0", appearanceStream);
  50146. const gsDict = new Dict(xref);
  50147. if (blendMode) {
  50148. gsDict.set("BM", Name.get(blendMode));
  50149. }
  50150. if (typeof strokeAlpha === "number") {
  50151. gsDict.set("CA", strokeAlpha);
  50152. }
  50153. if (typeof fillAlpha === "number") {
  50154. gsDict.set("ca", fillAlpha);
  50155. }
  50156. const stateDict = new Dict(xref);
  50157. stateDict.set("GS0", gsDict);
  50158. const resources = new Dict(xref);
  50159. resources.set("ExtGState", stateDict);
  50160. resources.set("XObject", formDict);
  50161. const appearanceDict = new Dict(xref);
  50162. appearanceDict.set("Resources", resources);
  50163. const bbox = this.data.rect = [minX, minY, maxX, maxY];
  50164. appearanceDict.set("BBox", bbox);
  50165. this.appearance = new StringStream("/GS0 gs /Fm0 Do");
  50166. this.appearance.dict = appearanceDict;
  50167. this._streams.push(this.appearance, appearanceStream);
  50168. }
  50169. static async createNewAnnotation(xref, annotation, dependencies, params) {
  50170. let oldAnnotation;
  50171. if (annotation.ref) {
  50172. oldAnnotation = (await xref.fetchIfRefAsync(annotation.ref)).clone();
  50173. } else {
  50174. annotation.ref = xref.getNewTemporaryRef();
  50175. }
  50176. const annotationRef = annotation.ref;
  50177. const ap = await this.createNewAppearanceStream(annotation, xref, params);
  50178. const buffer = [];
  50179. let annotationDict;
  50180. if (ap) {
  50181. const apRef = xref.getNewTemporaryRef();
  50182. annotationDict = this.createNewDict(annotation, xref, {
  50183. apRef,
  50184. oldAnnotation
  50185. });
  50186. await writeObject(apRef, ap, buffer, xref);
  50187. dependencies.push({
  50188. ref: apRef,
  50189. data: buffer.join("")
  50190. });
  50191. } else {
  50192. annotationDict = this.createNewDict(annotation, xref, {
  50193. oldAnnotation
  50194. });
  50195. }
  50196. if (Number.isInteger(annotation.parentTreeId)) {
  50197. annotationDict.set("StructParent", annotation.parentTreeId);
  50198. }
  50199. buffer.length = 0;
  50200. await writeObject(annotationRef, annotationDict, buffer, xref);
  50201. return {
  50202. ref: annotationRef,
  50203. data: buffer.join("")
  50204. };
  50205. }
  50206. static async createNewPrintAnnotation(annotationGlobals, xref, annotation, params) {
  50207. const ap = await this.createNewAppearanceStream(annotation, xref, params);
  50208. const annotationDict = this.createNewDict(annotation, xref, {
  50209. ap
  50210. });
  50211. const newAnnotation = new this.prototype.constructor({
  50212. dict: annotationDict,
  50213. xref,
  50214. annotationGlobals,
  50215. evaluatorOptions: params.evaluatorOptions
  50216. });
  50217. if (annotation.ref) {
  50218. newAnnotation.ref = newAnnotation.refToReplace = annotation.ref;
  50219. }
  50220. return newAnnotation;
  50221. }
  50222. }
  50223. class WidgetAnnotation extends Annotation {
  50224. constructor(params) {
  50225. super(params);
  50226. const {
  50227. dict,
  50228. xref,
  50229. annotationGlobals
  50230. } = params;
  50231. const data = this.data;
  50232. this._needAppearances = params.needAppearances;
  50233. data.annotationType = AnnotationType.WIDGET;
  50234. if (data.fieldName === undefined) {
  50235. data.fieldName = this._constructFieldName(dict);
  50236. }
  50237. if (data.actions === undefined) {
  50238. data.actions = collectActions(xref, dict, AnnotationActionEventType);
  50239. }
  50240. let fieldValue = getInheritableProperty({
  50241. dict,
  50242. key: "V",
  50243. getArray: true
  50244. });
  50245. data.fieldValue = this._decodeFormValue(fieldValue);
  50246. const defaultFieldValue = getInheritableProperty({
  50247. dict,
  50248. key: "DV",
  50249. getArray: true
  50250. });
  50251. data.defaultFieldValue = this._decodeFormValue(defaultFieldValue);
  50252. if (fieldValue === undefined && annotationGlobals.xfaDatasets) {
  50253. const path = this._title.str;
  50254. if (path) {
  50255. this._hasValueFromXFA = true;
  50256. data.fieldValue = fieldValue = annotationGlobals.xfaDatasets.getValue(path);
  50257. }
  50258. }
  50259. if (fieldValue === undefined && data.defaultFieldValue !== null) {
  50260. data.fieldValue = data.defaultFieldValue;
  50261. }
  50262. data.alternativeText = stringToPDFString(dict.get("TU") || "");
  50263. this.setDefaultAppearance(params);
  50264. data.hasAppearance ||= this._needAppearances && data.fieldValue !== undefined && data.fieldValue !== null;
  50265. const fieldType = getInheritableProperty({
  50266. dict,
  50267. key: "FT"
  50268. });
  50269. data.fieldType = fieldType instanceof Name ? fieldType.name : null;
  50270. const localResources = getInheritableProperty({
  50271. dict,
  50272. key: "DR"
  50273. });
  50274. const acroFormResources = annotationGlobals.acroForm.get("DR");
  50275. const appearanceResources = this.appearance?.dict.get("Resources");
  50276. this._fieldResources = {
  50277. localResources,
  50278. acroFormResources,
  50279. appearanceResources,
  50280. mergedResources: Dict.merge({
  50281. xref,
  50282. dictArray: [localResources, appearanceResources, acroFormResources],
  50283. mergeSubDicts: true
  50284. })
  50285. };
  50286. data.fieldFlags = getInheritableProperty({
  50287. dict,
  50288. key: "Ff"
  50289. });
  50290. if (!Number.isInteger(data.fieldFlags) || data.fieldFlags < 0) {
  50291. data.fieldFlags = 0;
  50292. }
  50293. data.readOnly = this.hasFieldFlag(AnnotationFieldFlag.READONLY);
  50294. data.required = this.hasFieldFlag(AnnotationFieldFlag.REQUIRED);
  50295. data.hidden = this._hasFlag(data.annotationFlags, AnnotationFlag.HIDDEN) || this._hasFlag(data.annotationFlags, AnnotationFlag.NOVIEW);
  50296. }
  50297. _decodeFormValue(formValue) {
  50298. if (Array.isArray(formValue)) {
  50299. return formValue.filter(item => typeof item === "string").map(item => stringToPDFString(item));
  50300. } else if (formValue instanceof Name) {
  50301. return stringToPDFString(formValue.name);
  50302. } else if (typeof formValue === "string") {
  50303. return stringToPDFString(formValue);
  50304. }
  50305. return null;
  50306. }
  50307. hasFieldFlag(flag) {
  50308. return !!(this.data.fieldFlags & flag);
  50309. }
  50310. _isViewable(flags) {
  50311. return true;
  50312. }
  50313. mustBeViewed(annotationStorage, renderForms) {
  50314. if (renderForms) {
  50315. return this.viewable;
  50316. }
  50317. return super.mustBeViewed(annotationStorage, renderForms) && !this._hasFlag(this.flags, AnnotationFlag.NOVIEW);
  50318. }
  50319. getRotationMatrix(annotationStorage) {
  50320. let rotation = annotationStorage?.get(this.data.id)?.rotation;
  50321. if (rotation === undefined) {
  50322. rotation = this.rotation;
  50323. }
  50324. if (rotation === 0) {
  50325. return IDENTITY_MATRIX;
  50326. }
  50327. const width = this.data.rect[2] - this.data.rect[0];
  50328. const height = this.data.rect[3] - this.data.rect[1];
  50329. return getRotationMatrix(rotation, width, height);
  50330. }
  50331. getBorderAndBackgroundAppearances(annotationStorage) {
  50332. let rotation = annotationStorage?.get(this.data.id)?.rotation;
  50333. if (rotation === undefined) {
  50334. rotation = this.rotation;
  50335. }
  50336. if (!this.backgroundColor && !this.borderColor) {
  50337. return "";
  50338. }
  50339. const width = this.data.rect[2] - this.data.rect[0];
  50340. const height = this.data.rect[3] - this.data.rect[1];
  50341. const rect = rotation === 0 || rotation === 180 ? `0 0 ${width} ${height} re` : `0 0 ${height} ${width} re`;
  50342. let str = "";
  50343. if (this.backgroundColor) {
  50344. str = `${getPdfColor(this.backgroundColor, true)} ${rect} f `;
  50345. }
  50346. if (this.borderColor) {
  50347. const borderWidth = this.borderStyle.width || 1;
  50348. str += `${borderWidth} w ${getPdfColor(this.borderColor, false)} ${rect} S `;
  50349. }
  50350. return str;
  50351. }
  50352. async getOperatorList(evaluator, task, intent, annotationStorage) {
  50353. if (intent & RenderingIntentFlag.ANNOTATIONS_FORMS && !(this instanceof SignatureWidgetAnnotation) && !this.data.noHTML && !this.data.hasOwnCanvas) {
  50354. return {
  50355. opList: new OperatorList(),
  50356. separateForm: true,
  50357. separateCanvas: false
  50358. };
  50359. }
  50360. if (!this._hasText) {
  50361. return super.getOperatorList(evaluator, task, intent, annotationStorage);
  50362. }
  50363. const content = await this._getAppearance(evaluator, task, intent, annotationStorage);
  50364. if (this.appearance && content === null) {
  50365. return super.getOperatorList(evaluator, task, intent, annotationStorage);
  50366. }
  50367. const opList = new OperatorList();
  50368. if (!this._defaultAppearance || content === null) {
  50369. return {
  50370. opList,
  50371. separateForm: false,
  50372. separateCanvas: false
  50373. };
  50374. }
  50375. const isUsingOwnCanvas = !!(this.data.hasOwnCanvas && intent & RenderingIntentFlag.DISPLAY);
  50376. const matrix = [1, 0, 0, 1, 0, 0];
  50377. const bbox = [0, 0, this.data.rect[2] - this.data.rect[0], this.data.rect[3] - this.data.rect[1]];
  50378. const transform = getTransformMatrix(this.data.rect, bbox, matrix);
  50379. let optionalContent;
  50380. if (this.oc) {
  50381. optionalContent = await evaluator.parseMarkedContentProps(this.oc, null);
  50382. }
  50383. if (optionalContent !== undefined) {
  50384. opList.addOp(OPS.beginMarkedContentProps, ["OC", optionalContent]);
  50385. }
  50386. opList.addOp(OPS.beginAnnotation, [this.data.id, this.data.rect, transform, this.getRotationMatrix(annotationStorage), isUsingOwnCanvas]);
  50387. const stream = new StringStream(content);
  50388. await evaluator.getOperatorList({
  50389. stream,
  50390. task,
  50391. resources: this._fieldResources.mergedResources,
  50392. operatorList: opList
  50393. });
  50394. opList.addOp(OPS.endAnnotation, []);
  50395. if (optionalContent !== undefined) {
  50396. opList.addOp(OPS.endMarkedContent, []);
  50397. }
  50398. return {
  50399. opList,
  50400. separateForm: false,
  50401. separateCanvas: isUsingOwnCanvas
  50402. };
  50403. }
  50404. _getMKDict(rotation) {
  50405. const mk = new Dict(null);
  50406. if (rotation) {
  50407. mk.set("R", rotation);
  50408. }
  50409. if (this.borderColor) {
  50410. mk.set("BC", getPdfColorArray(this.borderColor));
  50411. }
  50412. if (this.backgroundColor) {
  50413. mk.set("BG", getPdfColorArray(this.backgroundColor));
  50414. }
  50415. return mk.size > 0 ? mk : null;
  50416. }
  50417. amendSavedDict(annotationStorage, dict) {}
  50418. async save(evaluator, task, annotationStorage) {
  50419. const storageEntry = annotationStorage?.get(this.data.id);
  50420. let value = storageEntry?.value,
  50421. rotation = storageEntry?.rotation;
  50422. if (value === this.data.fieldValue || value === undefined) {
  50423. if (!this._hasValueFromXFA && rotation === undefined) {
  50424. return null;
  50425. }
  50426. value ||= this.data.fieldValue;
  50427. }
  50428. if (rotation === undefined && !this._hasValueFromXFA && Array.isArray(value) && Array.isArray(this.data.fieldValue) && value.length === this.data.fieldValue.length && value.every((x, i) => x === this.data.fieldValue[i])) {
  50429. return null;
  50430. }
  50431. if (rotation === undefined) {
  50432. rotation = this.rotation;
  50433. }
  50434. let appearance = null;
  50435. if (!this._needAppearances) {
  50436. appearance = await this._getAppearance(evaluator, task, RenderingIntentFlag.SAVE, annotationStorage);
  50437. if (appearance === null) {
  50438. return null;
  50439. }
  50440. } else {}
  50441. let needAppearances = false;
  50442. if (appearance?.needAppearances) {
  50443. needAppearances = true;
  50444. appearance = null;
  50445. }
  50446. const {
  50447. xref
  50448. } = evaluator;
  50449. const originalDict = xref.fetchIfRef(this.ref);
  50450. if (!(originalDict instanceof Dict)) {
  50451. return null;
  50452. }
  50453. const dict = new Dict(xref);
  50454. for (const key of originalDict.getKeys()) {
  50455. if (key !== "AP") {
  50456. dict.set(key, originalDict.getRaw(key));
  50457. }
  50458. }
  50459. const xfa = {
  50460. path: this.data.fieldName,
  50461. value
  50462. };
  50463. dict.set("V", Array.isArray(value) ? value.map(stringToAsciiOrUTF16BE) : stringToAsciiOrUTF16BE(value));
  50464. this.amendSavedDict(annotationStorage, dict);
  50465. const maybeMK = this._getMKDict(rotation);
  50466. if (maybeMK) {
  50467. dict.set("MK", maybeMK);
  50468. }
  50469. const buffer = [];
  50470. const changes = [{
  50471. ref: this.ref,
  50472. data: "",
  50473. xfa,
  50474. needAppearances
  50475. }];
  50476. if (appearance !== null) {
  50477. const newRef = xref.getNewTemporaryRef();
  50478. const AP = new Dict(xref);
  50479. dict.set("AP", AP);
  50480. AP.set("N", newRef);
  50481. const resources = this._getSaveFieldResources(xref);
  50482. const appearanceStream = new StringStream(appearance);
  50483. const appearanceDict = appearanceStream.dict = new Dict(xref);
  50484. appearanceDict.set("Subtype", Name.get("Form"));
  50485. appearanceDict.set("Resources", resources);
  50486. appearanceDict.set("BBox", [0, 0, this.data.rect[2] - this.data.rect[0], this.data.rect[3] - this.data.rect[1]]);
  50487. const rotationMatrix = this.getRotationMatrix(annotationStorage);
  50488. if (rotationMatrix !== IDENTITY_MATRIX) {
  50489. appearanceDict.set("Matrix", rotationMatrix);
  50490. }
  50491. await writeObject(newRef, appearanceStream, buffer, xref);
  50492. changes.push({
  50493. ref: newRef,
  50494. data: buffer.join(""),
  50495. xfa: null,
  50496. needAppearances: false
  50497. });
  50498. buffer.length = 0;
  50499. }
  50500. dict.set("M", `D:${getModificationDate()}`);
  50501. await writeObject(this.ref, dict, buffer, xref);
  50502. changes[0].data = buffer.join("");
  50503. return changes;
  50504. }
  50505. async _getAppearance(evaluator, task, intent, annotationStorage) {
  50506. const isPassword = this.hasFieldFlag(AnnotationFieldFlag.PASSWORD);
  50507. if (isPassword) {
  50508. return null;
  50509. }
  50510. const storageEntry = annotationStorage?.get(this.data.id);
  50511. let value, rotation;
  50512. if (storageEntry) {
  50513. value = storageEntry.formattedValue || storageEntry.value;
  50514. rotation = storageEntry.rotation;
  50515. }
  50516. if (rotation === undefined && value === undefined && !this._needAppearances) {
  50517. if (!this._hasValueFromXFA || this.appearance) {
  50518. return null;
  50519. }
  50520. }
  50521. const colors = this.getBorderAndBackgroundAppearances(annotationStorage);
  50522. if (value === undefined) {
  50523. value = this.data.fieldValue;
  50524. if (!value) {
  50525. return `/Tx BMC q ${colors}Q EMC`;
  50526. }
  50527. }
  50528. if (Array.isArray(value) && value.length === 1) {
  50529. value = value[0];
  50530. }
  50531. assert(typeof value === "string", "Expected `value` to be a string.");
  50532. value = value.trim();
  50533. if (this.data.combo) {
  50534. const option = this.data.options.find(({
  50535. exportValue
  50536. }) => value === exportValue);
  50537. value = option?.displayValue || value;
  50538. }
  50539. if (value === "") {
  50540. return `/Tx BMC q ${colors}Q EMC`;
  50541. }
  50542. if (rotation === undefined) {
  50543. rotation = this.rotation;
  50544. }
  50545. let lineCount = -1;
  50546. let lines;
  50547. if (this.data.multiLine) {
  50548. lines = value.split(/\r\n?|\n/).map(line => line.normalize("NFC"));
  50549. lineCount = lines.length;
  50550. } else {
  50551. lines = [value.replace(/\r\n?|\n/, "").normalize("NFC")];
  50552. }
  50553. const defaultPadding = 1;
  50554. const defaultHPadding = 2;
  50555. let totalHeight = this.data.rect[3] - this.data.rect[1];
  50556. let totalWidth = this.data.rect[2] - this.data.rect[0];
  50557. if (rotation === 90 || rotation === 270) {
  50558. [totalWidth, totalHeight] = [totalHeight, totalWidth];
  50559. }
  50560. if (!this._defaultAppearance) {
  50561. this.data.defaultAppearanceData = parseDefaultAppearance(this._defaultAppearance = "/Helvetica 0 Tf 0 g");
  50562. }
  50563. let font = await WidgetAnnotation._getFontData(evaluator, task, this.data.defaultAppearanceData, this._fieldResources.mergedResources);
  50564. let defaultAppearance, fontSize, lineHeight;
  50565. const encodedLines = [];
  50566. let encodingError = false;
  50567. for (const line of lines) {
  50568. const encodedString = font.encodeString(line);
  50569. if (encodedString.length > 1) {
  50570. encodingError = true;
  50571. }
  50572. encodedLines.push(encodedString.join(""));
  50573. }
  50574. if (encodingError && intent & RenderingIntentFlag.SAVE) {
  50575. return {
  50576. needAppearances: true
  50577. };
  50578. }
  50579. if (encodingError && this._isOffscreenCanvasSupported) {
  50580. const fontFamily = this.data.comb ? "monospace" : "sans-serif";
  50581. const fakeUnicodeFont = new FakeUnicodeFont(evaluator.xref, fontFamily);
  50582. const resources = fakeUnicodeFont.createFontResources(lines.join(""));
  50583. const newFont = resources.getRaw("Font");
  50584. if (this._fieldResources.mergedResources.has("Font")) {
  50585. const oldFont = this._fieldResources.mergedResources.get("Font");
  50586. for (const key of newFont.getKeys()) {
  50587. oldFont.set(key, newFont.getRaw(key));
  50588. }
  50589. } else {
  50590. this._fieldResources.mergedResources.set("Font", newFont);
  50591. }
  50592. const fontName = fakeUnicodeFont.fontName.name;
  50593. font = await WidgetAnnotation._getFontData(evaluator, task, {
  50594. fontName,
  50595. fontSize: 0
  50596. }, resources);
  50597. for (let i = 0, ii = encodedLines.length; i < ii; i++) {
  50598. encodedLines[i] = stringToUTF16String(lines[i]);
  50599. }
  50600. const savedDefaultAppearance = Object.assign(Object.create(null), this.data.defaultAppearanceData);
  50601. this.data.defaultAppearanceData.fontSize = 0;
  50602. this.data.defaultAppearanceData.fontName = fontName;
  50603. [defaultAppearance, fontSize, lineHeight] = this._computeFontSize(totalHeight - 2 * defaultPadding, totalWidth - 2 * defaultHPadding, value, font, lineCount);
  50604. this.data.defaultAppearanceData = savedDefaultAppearance;
  50605. } else {
  50606. if (!this._isOffscreenCanvasSupported) {
  50607. warn("_getAppearance: OffscreenCanvas is not supported, annotation may not render correctly.");
  50608. }
  50609. [defaultAppearance, fontSize, lineHeight] = this._computeFontSize(totalHeight - 2 * defaultPadding, totalWidth - 2 * defaultHPadding, value, font, lineCount);
  50610. }
  50611. let descent = font.descent;
  50612. if (isNaN(descent)) {
  50613. descent = BASELINE_FACTOR * lineHeight;
  50614. } else {
  50615. descent = Math.max(BASELINE_FACTOR * lineHeight, Math.abs(descent) * fontSize);
  50616. }
  50617. const defaultVPadding = Math.min(Math.floor((totalHeight - fontSize) / 2), defaultPadding);
  50618. const alignment = this.data.textAlignment;
  50619. if (this.data.multiLine) {
  50620. return this._getMultilineAppearance(defaultAppearance, encodedLines, font, fontSize, totalWidth, totalHeight, alignment, defaultHPadding, defaultVPadding, descent, lineHeight, annotationStorage);
  50621. }
  50622. if (this.data.comb) {
  50623. return this._getCombAppearance(defaultAppearance, font, encodedLines[0], fontSize, totalWidth, totalHeight, defaultHPadding, defaultVPadding, descent, lineHeight, annotationStorage);
  50624. }
  50625. const bottomPadding = defaultVPadding + descent;
  50626. if (alignment === 0 || alignment > 2) {
  50627. return `/Tx BMC q ${colors}BT ` + defaultAppearance + ` 1 0 0 1 ${numberToString(defaultHPadding)} ${numberToString(bottomPadding)} Tm (${escapeString(encodedLines[0])}) Tj` + " ET Q EMC";
  50628. }
  50629. const prevInfo = {
  50630. shift: 0
  50631. };
  50632. const renderedText = this._renderText(encodedLines[0], font, fontSize, totalWidth, alignment, prevInfo, defaultHPadding, bottomPadding);
  50633. return `/Tx BMC q ${colors}BT ` + defaultAppearance + ` 1 0 0 1 0 0 Tm ${renderedText}` + " ET Q EMC";
  50634. }
  50635. static async _getFontData(evaluator, task, appearanceData, resources) {
  50636. const operatorList = new OperatorList();
  50637. const initialState = {
  50638. font: null,
  50639. clone() {
  50640. return this;
  50641. }
  50642. };
  50643. const {
  50644. fontName,
  50645. fontSize
  50646. } = appearanceData;
  50647. await evaluator.handleSetFont(resources, [fontName && Name.get(fontName), fontSize], null, operatorList, task, initialState, null);
  50648. return initialState.font;
  50649. }
  50650. _getTextWidth(text, font) {
  50651. return font.charsToGlyphs(text).reduce((width, glyph) => width + glyph.width, 0) / 1000;
  50652. }
  50653. _computeFontSize(height, width, text, font, lineCount) {
  50654. let {
  50655. fontSize
  50656. } = this.data.defaultAppearanceData;
  50657. let lineHeight = (fontSize || 12) * LINE_FACTOR,
  50658. numberOfLines = Math.round(height / lineHeight);
  50659. if (!fontSize) {
  50660. const roundWithTwoDigits = x => Math.floor(x * 100) / 100;
  50661. if (lineCount === -1) {
  50662. const textWidth = this._getTextWidth(text, font);
  50663. fontSize = roundWithTwoDigits(Math.min(height / LINE_FACTOR, textWidth > width ? width / textWidth : Infinity));
  50664. numberOfLines = 1;
  50665. } else {
  50666. const lines = text.split(/\r\n?|\n/);
  50667. const cachedLines = [];
  50668. for (const line of lines) {
  50669. const encoded = font.encodeString(line).join("");
  50670. const glyphs = font.charsToGlyphs(encoded);
  50671. const positions = font.getCharPositions(encoded);
  50672. cachedLines.push({
  50673. line: encoded,
  50674. glyphs,
  50675. positions
  50676. });
  50677. }
  50678. const isTooBig = fsize => {
  50679. let totalHeight = 0;
  50680. for (const cache of cachedLines) {
  50681. const chunks = this._splitLine(null, font, fsize, width, cache);
  50682. totalHeight += chunks.length * fsize;
  50683. if (totalHeight > height) {
  50684. return true;
  50685. }
  50686. }
  50687. return false;
  50688. };
  50689. numberOfLines = Math.max(numberOfLines, lineCount);
  50690. while (true) {
  50691. lineHeight = height / numberOfLines;
  50692. fontSize = roundWithTwoDigits(lineHeight / LINE_FACTOR);
  50693. if (isTooBig(fontSize)) {
  50694. numberOfLines++;
  50695. continue;
  50696. }
  50697. break;
  50698. }
  50699. }
  50700. const {
  50701. fontName,
  50702. fontColor
  50703. } = this.data.defaultAppearanceData;
  50704. this._defaultAppearance = createDefaultAppearance({
  50705. fontSize,
  50706. fontName,
  50707. fontColor
  50708. });
  50709. }
  50710. return [this._defaultAppearance, fontSize, height / numberOfLines];
  50711. }
  50712. _renderText(text, font, fontSize, totalWidth, alignment, prevInfo, hPadding, vPadding) {
  50713. let shift;
  50714. if (alignment === 1) {
  50715. const width = this._getTextWidth(text, font) * fontSize;
  50716. shift = (totalWidth - width) / 2;
  50717. } else if (alignment === 2) {
  50718. const width = this._getTextWidth(text, font) * fontSize;
  50719. shift = totalWidth - width - hPadding;
  50720. } else {
  50721. shift = hPadding;
  50722. }
  50723. const shiftStr = numberToString(shift - prevInfo.shift);
  50724. prevInfo.shift = shift;
  50725. vPadding = numberToString(vPadding);
  50726. return `${shiftStr} ${vPadding} Td (${escapeString(text)}) Tj`;
  50727. }
  50728. _getSaveFieldResources(xref) {
  50729. const {
  50730. localResources,
  50731. appearanceResources,
  50732. acroFormResources
  50733. } = this._fieldResources;
  50734. const fontName = this.data.defaultAppearanceData?.fontName;
  50735. if (!fontName) {
  50736. return localResources || Dict.empty;
  50737. }
  50738. for (const resources of [localResources, appearanceResources]) {
  50739. if (resources instanceof Dict) {
  50740. const localFont = resources.get("Font");
  50741. if (localFont instanceof Dict && localFont.has(fontName)) {
  50742. return resources;
  50743. }
  50744. }
  50745. }
  50746. if (acroFormResources instanceof Dict) {
  50747. const acroFormFont = acroFormResources.get("Font");
  50748. if (acroFormFont instanceof Dict && acroFormFont.has(fontName)) {
  50749. const subFontDict = new Dict(xref);
  50750. subFontDict.set(fontName, acroFormFont.getRaw(fontName));
  50751. const subResourcesDict = new Dict(xref);
  50752. subResourcesDict.set("Font", subFontDict);
  50753. return Dict.merge({
  50754. xref,
  50755. dictArray: [subResourcesDict, localResources],
  50756. mergeSubDicts: true
  50757. });
  50758. }
  50759. }
  50760. return localResources || Dict.empty;
  50761. }
  50762. getFieldObject() {
  50763. return null;
  50764. }
  50765. }
  50766. class TextWidgetAnnotation extends WidgetAnnotation {
  50767. constructor(params) {
  50768. super(params);
  50769. const {
  50770. dict
  50771. } = params;
  50772. if (dict.has("PMD")) {
  50773. this.flags |= AnnotationFlag.HIDDEN;
  50774. this.data.hidden = true;
  50775. warn("Barcodes are not supported");
  50776. }
  50777. this.data.hasOwnCanvas = this.data.readOnly && !this.data.noHTML;
  50778. this._hasText = true;
  50779. if (typeof this.data.fieldValue !== "string") {
  50780. this.data.fieldValue = "";
  50781. }
  50782. let alignment = getInheritableProperty({
  50783. dict,
  50784. key: "Q"
  50785. });
  50786. if (!Number.isInteger(alignment) || alignment < 0 || alignment > 2) {
  50787. alignment = null;
  50788. }
  50789. this.data.textAlignment = alignment;
  50790. let maximumLength = getInheritableProperty({
  50791. dict,
  50792. key: "MaxLen"
  50793. });
  50794. if (!Number.isInteger(maximumLength) || maximumLength < 0) {
  50795. maximumLength = 0;
  50796. }
  50797. this.data.maxLen = maximumLength;
  50798. this.data.multiLine = this.hasFieldFlag(AnnotationFieldFlag.MULTILINE);
  50799. this.data.comb = this.hasFieldFlag(AnnotationFieldFlag.COMB) && !this.hasFieldFlag(AnnotationFieldFlag.MULTILINE) && !this.hasFieldFlag(AnnotationFieldFlag.PASSWORD) && !this.hasFieldFlag(AnnotationFieldFlag.FILESELECT) && this.data.maxLen !== 0;
  50800. this.data.doNotScroll = this.hasFieldFlag(AnnotationFieldFlag.DONOTSCROLL);
  50801. }
  50802. get hasTextContent() {
  50803. return !!this.appearance && !this._needAppearances;
  50804. }
  50805. _getCombAppearance(defaultAppearance, font, text, fontSize, width, height, hPadding, vPadding, descent, lineHeight, annotationStorage) {
  50806. const combWidth = width / this.data.maxLen;
  50807. const colors = this.getBorderAndBackgroundAppearances(annotationStorage);
  50808. const buf = [];
  50809. const positions = font.getCharPositions(text);
  50810. for (const [start, end] of positions) {
  50811. buf.push(`(${escapeString(text.substring(start, end))}) Tj`);
  50812. }
  50813. const renderedComb = buf.join(` ${numberToString(combWidth)} 0 Td `);
  50814. return `/Tx BMC q ${colors}BT ` + defaultAppearance + ` 1 0 0 1 ${numberToString(hPadding)} ${numberToString(vPadding + descent)} Tm ${renderedComb}` + " ET Q EMC";
  50815. }
  50816. _getMultilineAppearance(defaultAppearance, lines, font, fontSize, width, height, alignment, hPadding, vPadding, descent, lineHeight, annotationStorage) {
  50817. const buf = [];
  50818. const totalWidth = width - 2 * hPadding;
  50819. const prevInfo = {
  50820. shift: 0
  50821. };
  50822. for (let i = 0, ii = lines.length; i < ii; i++) {
  50823. const line = lines[i];
  50824. const chunks = this._splitLine(line, font, fontSize, totalWidth);
  50825. for (let j = 0, jj = chunks.length; j < jj; j++) {
  50826. const chunk = chunks[j];
  50827. const vShift = i === 0 && j === 0 ? -vPadding - (lineHeight - descent) : -lineHeight;
  50828. buf.push(this._renderText(chunk, font, fontSize, width, alignment, prevInfo, hPadding, vShift));
  50829. }
  50830. }
  50831. const colors = this.getBorderAndBackgroundAppearances(annotationStorage);
  50832. const renderedText = buf.join("\n");
  50833. return `/Tx BMC q ${colors}BT ` + defaultAppearance + ` 1 0 0 1 0 ${numberToString(height)} Tm ${renderedText}` + " ET Q EMC";
  50834. }
  50835. _splitLine(line, font, fontSize, width, cache = {}) {
  50836. line = cache.line || line;
  50837. const glyphs = cache.glyphs || font.charsToGlyphs(line);
  50838. if (glyphs.length <= 1) {
  50839. return [line];
  50840. }
  50841. const positions = cache.positions || font.getCharPositions(line);
  50842. const scale = fontSize / 1000;
  50843. const chunks = [];
  50844. let lastSpacePosInStringStart = -1,
  50845. lastSpacePosInStringEnd = -1,
  50846. lastSpacePos = -1,
  50847. startChunk = 0,
  50848. currentWidth = 0;
  50849. for (let i = 0, ii = glyphs.length; i < ii; i++) {
  50850. const [start, end] = positions[i];
  50851. const glyph = glyphs[i];
  50852. const glyphWidth = glyph.width * scale;
  50853. if (glyph.unicode === " ") {
  50854. if (currentWidth + glyphWidth > width) {
  50855. chunks.push(line.substring(startChunk, start));
  50856. startChunk = start;
  50857. currentWidth = glyphWidth;
  50858. lastSpacePosInStringStart = -1;
  50859. lastSpacePos = -1;
  50860. } else {
  50861. currentWidth += glyphWidth;
  50862. lastSpacePosInStringStart = start;
  50863. lastSpacePosInStringEnd = end;
  50864. lastSpacePos = i;
  50865. }
  50866. } else if (currentWidth + glyphWidth > width) {
  50867. if (lastSpacePosInStringStart !== -1) {
  50868. chunks.push(line.substring(startChunk, lastSpacePosInStringEnd));
  50869. startChunk = lastSpacePosInStringEnd;
  50870. i = lastSpacePos + 1;
  50871. lastSpacePosInStringStart = -1;
  50872. currentWidth = 0;
  50873. } else {
  50874. chunks.push(line.substring(startChunk, start));
  50875. startChunk = start;
  50876. currentWidth = glyphWidth;
  50877. }
  50878. } else {
  50879. currentWidth += glyphWidth;
  50880. }
  50881. }
  50882. if (startChunk < line.length) {
  50883. chunks.push(line.substring(startChunk, line.length));
  50884. }
  50885. return chunks;
  50886. }
  50887. getFieldObject() {
  50888. return {
  50889. id: this.data.id,
  50890. value: this.data.fieldValue,
  50891. defaultValue: this.data.defaultFieldValue || "",
  50892. multiline: this.data.multiLine,
  50893. password: this.hasFieldFlag(AnnotationFieldFlag.PASSWORD),
  50894. charLimit: this.data.maxLen,
  50895. comb: this.data.comb,
  50896. editable: !this.data.readOnly,
  50897. hidden: this.data.hidden,
  50898. name: this.data.fieldName,
  50899. rect: this.data.rect,
  50900. actions: this.data.actions,
  50901. page: this.data.pageIndex,
  50902. strokeColor: this.data.borderColor,
  50903. fillColor: this.data.backgroundColor,
  50904. rotation: this.rotation,
  50905. type: "text"
  50906. };
  50907. }
  50908. }
  50909. class ButtonWidgetAnnotation extends WidgetAnnotation {
  50910. constructor(params) {
  50911. super(params);
  50912. this.checkedAppearance = null;
  50913. this.uncheckedAppearance = null;
  50914. this.data.checkBox = !this.hasFieldFlag(AnnotationFieldFlag.RADIO) && !this.hasFieldFlag(AnnotationFieldFlag.PUSHBUTTON);
  50915. this.data.radioButton = this.hasFieldFlag(AnnotationFieldFlag.RADIO) && !this.hasFieldFlag(AnnotationFieldFlag.PUSHBUTTON);
  50916. this.data.pushButton = this.hasFieldFlag(AnnotationFieldFlag.PUSHBUTTON);
  50917. this.data.isTooltipOnly = false;
  50918. if (this.data.checkBox) {
  50919. this._processCheckBox(params);
  50920. } else if (this.data.radioButton) {
  50921. this._processRadioButton(params);
  50922. } else if (this.data.pushButton) {
  50923. this.data.hasOwnCanvas = true;
  50924. this.data.noHTML = false;
  50925. this._processPushButton(params);
  50926. } else {
  50927. warn("Invalid field flags for button widget annotation");
  50928. }
  50929. }
  50930. async getOperatorList(evaluator, task, intent, annotationStorage) {
  50931. if (this.data.pushButton) {
  50932. return super.getOperatorList(evaluator, task, intent, false, annotationStorage);
  50933. }
  50934. let value = null;
  50935. let rotation = null;
  50936. if (annotationStorage) {
  50937. const storageEntry = annotationStorage.get(this.data.id);
  50938. value = storageEntry ? storageEntry.value : null;
  50939. rotation = storageEntry ? storageEntry.rotation : null;
  50940. }
  50941. if (value === null && this.appearance) {
  50942. return super.getOperatorList(evaluator, task, intent, annotationStorage);
  50943. }
  50944. if (value === null || value === undefined) {
  50945. value = this.data.checkBox ? this.data.fieldValue === this.data.exportValue : this.data.fieldValue === this.data.buttonValue;
  50946. }
  50947. const appearance = value ? this.checkedAppearance : this.uncheckedAppearance;
  50948. if (appearance) {
  50949. const savedAppearance = this.appearance;
  50950. const savedMatrix = lookupMatrix(appearance.dict.getArray("Matrix"), IDENTITY_MATRIX);
  50951. if (rotation) {
  50952. appearance.dict.set("Matrix", this.getRotationMatrix(annotationStorage));
  50953. }
  50954. this.appearance = appearance;
  50955. const operatorList = super.getOperatorList(evaluator, task, intent, annotationStorage);
  50956. this.appearance = savedAppearance;
  50957. appearance.dict.set("Matrix", savedMatrix);
  50958. return operatorList;
  50959. }
  50960. return {
  50961. opList: new OperatorList(),
  50962. separateForm: false,
  50963. separateCanvas: false
  50964. };
  50965. }
  50966. async save(evaluator, task, annotationStorage) {
  50967. if (this.data.checkBox) {
  50968. return this._saveCheckbox(evaluator, task, annotationStorage);
  50969. }
  50970. if (this.data.radioButton) {
  50971. return this._saveRadioButton(evaluator, task, annotationStorage);
  50972. }
  50973. return null;
  50974. }
  50975. async _saveCheckbox(evaluator, task, annotationStorage) {
  50976. if (!annotationStorage) {
  50977. return null;
  50978. }
  50979. const storageEntry = annotationStorage.get(this.data.id);
  50980. let rotation = storageEntry?.rotation,
  50981. value = storageEntry?.value;
  50982. if (rotation === undefined) {
  50983. if (value === undefined) {
  50984. return null;
  50985. }
  50986. const defaultValue = this.data.fieldValue === this.data.exportValue;
  50987. if (defaultValue === value) {
  50988. return null;
  50989. }
  50990. }
  50991. const dict = evaluator.xref.fetchIfRef(this.ref);
  50992. if (!(dict instanceof Dict)) {
  50993. return null;
  50994. }
  50995. if (rotation === undefined) {
  50996. rotation = this.rotation;
  50997. }
  50998. if (value === undefined) {
  50999. value = this.data.fieldValue === this.data.exportValue;
  51000. }
  51001. const xfa = {
  51002. path: this.data.fieldName,
  51003. value: value ? this.data.exportValue : ""
  51004. };
  51005. const name = Name.get(value ? this.data.exportValue : "Off");
  51006. dict.set("V", name);
  51007. dict.set("AS", name);
  51008. dict.set("M", `D:${getModificationDate()}`);
  51009. const maybeMK = this._getMKDict(rotation);
  51010. if (maybeMK) {
  51011. dict.set("MK", maybeMK);
  51012. }
  51013. const buffer = [];
  51014. await writeObject(this.ref, dict, buffer, evaluator.xref);
  51015. return [{
  51016. ref: this.ref,
  51017. data: buffer.join(""),
  51018. xfa
  51019. }];
  51020. }
  51021. async _saveRadioButton(evaluator, task, annotationStorage) {
  51022. if (!annotationStorage) {
  51023. return null;
  51024. }
  51025. const storageEntry = annotationStorage.get(this.data.id);
  51026. let rotation = storageEntry?.rotation,
  51027. value = storageEntry?.value;
  51028. if (rotation === undefined) {
  51029. if (value === undefined) {
  51030. return null;
  51031. }
  51032. const defaultValue = this.data.fieldValue === this.data.buttonValue;
  51033. if (defaultValue === value) {
  51034. return null;
  51035. }
  51036. }
  51037. const dict = evaluator.xref.fetchIfRef(this.ref);
  51038. if (!(dict instanceof Dict)) {
  51039. return null;
  51040. }
  51041. if (value === undefined) {
  51042. value = this.data.fieldValue === this.data.buttonValue;
  51043. }
  51044. if (rotation === undefined) {
  51045. rotation = this.rotation;
  51046. }
  51047. const xfa = {
  51048. path: this.data.fieldName,
  51049. value: value ? this.data.buttonValue : ""
  51050. };
  51051. const name = Name.get(value ? this.data.buttonValue : "Off");
  51052. const buffer = [];
  51053. let parentData = null;
  51054. if (value) {
  51055. if (this.parent instanceof Ref) {
  51056. const parent = evaluator.xref.fetch(this.parent);
  51057. parent.set("V", name);
  51058. await writeObject(this.parent, parent, buffer, evaluator.xref);
  51059. parentData = buffer.join("");
  51060. buffer.length = 0;
  51061. } else if (this.parent instanceof Dict) {
  51062. this.parent.set("V", name);
  51063. }
  51064. }
  51065. dict.set("AS", name);
  51066. dict.set("M", `D:${getModificationDate()}`);
  51067. const maybeMK = this._getMKDict(rotation);
  51068. if (maybeMK) {
  51069. dict.set("MK", maybeMK);
  51070. }
  51071. await writeObject(this.ref, dict, buffer, evaluator.xref);
  51072. const newRefs = [{
  51073. ref: this.ref,
  51074. data: buffer.join(""),
  51075. xfa
  51076. }];
  51077. if (parentData) {
  51078. newRefs.push({
  51079. ref: this.parent,
  51080. data: parentData,
  51081. xfa: null
  51082. });
  51083. }
  51084. return newRefs;
  51085. }
  51086. _getDefaultCheckedAppearance(params, type) {
  51087. const width = this.data.rect[2] - this.data.rect[0];
  51088. const height = this.data.rect[3] - this.data.rect[1];
  51089. const bbox = [0, 0, width, height];
  51090. const FONT_RATIO = 0.8;
  51091. const fontSize = Math.min(width, height) * FONT_RATIO;
  51092. let metrics, char;
  51093. if (type === "check") {
  51094. metrics = {
  51095. width: 0.755 * fontSize,
  51096. height: 0.705 * fontSize
  51097. };
  51098. char = "\x33";
  51099. } else if (type === "disc") {
  51100. metrics = {
  51101. width: 0.791 * fontSize,
  51102. height: 0.705 * fontSize
  51103. };
  51104. char = "\x6C";
  51105. } else {
  51106. unreachable(`_getDefaultCheckedAppearance - unsupported type: ${type}`);
  51107. }
  51108. const xShift = numberToString((width - metrics.width) / 2);
  51109. const yShift = numberToString((height - metrics.height) / 2);
  51110. const appearance = `q BT /PdfJsZaDb ${fontSize} Tf 0 g ${xShift} ${yShift} Td (${char}) Tj ET Q`;
  51111. const appearanceStreamDict = new Dict(params.xref);
  51112. appearanceStreamDict.set("FormType", 1);
  51113. appearanceStreamDict.set("Subtype", Name.get("Form"));
  51114. appearanceStreamDict.set("Type", Name.get("XObject"));
  51115. appearanceStreamDict.set("BBox", bbox);
  51116. appearanceStreamDict.set("Matrix", [1, 0, 0, 1, 0, 0]);
  51117. appearanceStreamDict.set("Length", appearance.length);
  51118. const resources = new Dict(params.xref);
  51119. const font = new Dict(params.xref);
  51120. font.set("PdfJsZaDb", this.fallbackFontDict);
  51121. resources.set("Font", font);
  51122. appearanceStreamDict.set("Resources", resources);
  51123. this.checkedAppearance = new StringStream(appearance);
  51124. this.checkedAppearance.dict = appearanceStreamDict;
  51125. this._streams.push(this.checkedAppearance);
  51126. }
  51127. _processCheckBox(params) {
  51128. const customAppearance = params.dict.get("AP");
  51129. if (!(customAppearance instanceof Dict)) {
  51130. return;
  51131. }
  51132. const normalAppearance = customAppearance.get("N");
  51133. if (!(normalAppearance instanceof Dict)) {
  51134. return;
  51135. }
  51136. const asValue = this._decodeFormValue(params.dict.get("AS"));
  51137. if (typeof asValue === "string") {
  51138. this.data.fieldValue = asValue;
  51139. }
  51140. const yes = this.data.fieldValue !== null && this.data.fieldValue !== "Off" ? this.data.fieldValue : "Yes";
  51141. const exportValues = normalAppearance.getKeys();
  51142. if (exportValues.length === 0) {
  51143. exportValues.push("Off", yes);
  51144. } else if (exportValues.length === 1) {
  51145. if (exportValues[0] === "Off") {
  51146. exportValues.push(yes);
  51147. } else {
  51148. exportValues.unshift("Off");
  51149. }
  51150. } else if (exportValues.includes(yes)) {
  51151. exportValues.length = 0;
  51152. exportValues.push("Off", yes);
  51153. } else {
  51154. const otherYes = exportValues.find(v => v !== "Off");
  51155. exportValues.length = 0;
  51156. exportValues.push("Off", otherYes);
  51157. }
  51158. if (!exportValues.includes(this.data.fieldValue)) {
  51159. this.data.fieldValue = "Off";
  51160. }
  51161. this.data.exportValue = exportValues[1];
  51162. const checkedAppearance = normalAppearance.get(this.data.exportValue);
  51163. this.checkedAppearance = checkedAppearance instanceof BaseStream ? checkedAppearance : null;
  51164. const uncheckedAppearance = normalAppearance.get("Off");
  51165. this.uncheckedAppearance = uncheckedAppearance instanceof BaseStream ? uncheckedAppearance : null;
  51166. if (this.checkedAppearance) {
  51167. this._streams.push(this.checkedAppearance);
  51168. } else {
  51169. this._getDefaultCheckedAppearance(params, "check");
  51170. }
  51171. if (this.uncheckedAppearance) {
  51172. this._streams.push(this.uncheckedAppearance);
  51173. }
  51174. this._fallbackFontDict = this.fallbackFontDict;
  51175. if (this.data.defaultFieldValue === null) {
  51176. this.data.defaultFieldValue = "Off";
  51177. }
  51178. }
  51179. _processRadioButton(params) {
  51180. this.data.buttonValue = null;
  51181. const fieldParent = params.dict.get("Parent");
  51182. if (fieldParent instanceof Dict) {
  51183. this.parent = params.dict.getRaw("Parent");
  51184. const fieldParentValue = fieldParent.get("V");
  51185. if (fieldParentValue instanceof Name) {
  51186. this.data.fieldValue = this._decodeFormValue(fieldParentValue);
  51187. }
  51188. }
  51189. const appearanceStates = params.dict.get("AP");
  51190. if (!(appearanceStates instanceof Dict)) {
  51191. return;
  51192. }
  51193. const normalAppearance = appearanceStates.get("N");
  51194. if (!(normalAppearance instanceof Dict)) {
  51195. return;
  51196. }
  51197. for (const key of normalAppearance.getKeys()) {
  51198. if (key !== "Off") {
  51199. this.data.buttonValue = this._decodeFormValue(key);
  51200. break;
  51201. }
  51202. }
  51203. const checkedAppearance = normalAppearance.get(this.data.buttonValue);
  51204. this.checkedAppearance = checkedAppearance instanceof BaseStream ? checkedAppearance : null;
  51205. const uncheckedAppearance = normalAppearance.get("Off");
  51206. this.uncheckedAppearance = uncheckedAppearance instanceof BaseStream ? uncheckedAppearance : null;
  51207. if (this.checkedAppearance) {
  51208. this._streams.push(this.checkedAppearance);
  51209. } else {
  51210. this._getDefaultCheckedAppearance(params, "disc");
  51211. }
  51212. if (this.uncheckedAppearance) {
  51213. this._streams.push(this.uncheckedAppearance);
  51214. }
  51215. this._fallbackFontDict = this.fallbackFontDict;
  51216. if (this.data.defaultFieldValue === null) {
  51217. this.data.defaultFieldValue = "Off";
  51218. }
  51219. }
  51220. _processPushButton(params) {
  51221. const {
  51222. dict,
  51223. annotationGlobals
  51224. } = params;
  51225. if (!dict.has("A") && !dict.has("AA") && !this.data.alternativeText) {
  51226. warn("Push buttons without action dictionaries are not supported");
  51227. return;
  51228. }
  51229. this.data.isTooltipOnly = !dict.has("A") && !dict.has("AA");
  51230. Catalog.parseDestDictionary({
  51231. destDict: dict,
  51232. resultObj: this.data,
  51233. docBaseUrl: annotationGlobals.baseUrl,
  51234. docAttachments: annotationGlobals.attachments
  51235. });
  51236. }
  51237. getFieldObject() {
  51238. let type = "button";
  51239. let exportValues;
  51240. if (this.data.checkBox) {
  51241. type = "checkbox";
  51242. exportValues = this.data.exportValue;
  51243. } else if (this.data.radioButton) {
  51244. type = "radiobutton";
  51245. exportValues = this.data.buttonValue;
  51246. }
  51247. return {
  51248. id: this.data.id,
  51249. value: this.data.fieldValue || "Off",
  51250. defaultValue: this.data.defaultFieldValue,
  51251. exportValues,
  51252. editable: !this.data.readOnly,
  51253. name: this.data.fieldName,
  51254. rect: this.data.rect,
  51255. hidden: this.data.hidden,
  51256. actions: this.data.actions,
  51257. page: this.data.pageIndex,
  51258. strokeColor: this.data.borderColor,
  51259. fillColor: this.data.backgroundColor,
  51260. rotation: this.rotation,
  51261. type
  51262. };
  51263. }
  51264. get fallbackFontDict() {
  51265. const dict = new Dict();
  51266. dict.set("BaseFont", Name.get("ZapfDingbats"));
  51267. dict.set("Type", Name.get("FallbackType"));
  51268. dict.set("Subtype", Name.get("FallbackType"));
  51269. dict.set("Encoding", Name.get("ZapfDingbatsEncoding"));
  51270. return shadow(this, "fallbackFontDict", dict);
  51271. }
  51272. }
  51273. class ChoiceWidgetAnnotation extends WidgetAnnotation {
  51274. constructor(params) {
  51275. super(params);
  51276. const {
  51277. dict,
  51278. xref
  51279. } = params;
  51280. this.indices = dict.getArray("I");
  51281. this.hasIndices = Array.isArray(this.indices) && this.indices.length > 0;
  51282. this.data.options = [];
  51283. const options = getInheritableProperty({
  51284. dict,
  51285. key: "Opt"
  51286. });
  51287. if (Array.isArray(options)) {
  51288. for (let i = 0, ii = options.length; i < ii; i++) {
  51289. const option = xref.fetchIfRef(options[i]);
  51290. const isOptionArray = Array.isArray(option);
  51291. this.data.options[i] = {
  51292. exportValue: this._decodeFormValue(isOptionArray ? xref.fetchIfRef(option[0]) : option),
  51293. displayValue: this._decodeFormValue(isOptionArray ? xref.fetchIfRef(option[1]) : option)
  51294. };
  51295. }
  51296. }
  51297. if (!this.hasIndices) {
  51298. if (typeof this.data.fieldValue === "string") {
  51299. this.data.fieldValue = [this.data.fieldValue];
  51300. } else if (!this.data.fieldValue) {
  51301. this.data.fieldValue = [];
  51302. }
  51303. } else {
  51304. this.data.fieldValue = [];
  51305. const ii = this.data.options.length;
  51306. for (const i of this.indices) {
  51307. if (Number.isInteger(i) && i >= 0 && i < ii) {
  51308. this.data.fieldValue.push(this.data.options[i].exportValue);
  51309. }
  51310. }
  51311. }
  51312. this.data.combo = this.hasFieldFlag(AnnotationFieldFlag.COMBO);
  51313. this.data.multiSelect = this.hasFieldFlag(AnnotationFieldFlag.MULTISELECT);
  51314. this._hasText = true;
  51315. }
  51316. getFieldObject() {
  51317. const type = this.data.combo ? "combobox" : "listbox";
  51318. const value = this.data.fieldValue.length > 0 ? this.data.fieldValue[0] : null;
  51319. return {
  51320. id: this.data.id,
  51321. value,
  51322. defaultValue: this.data.defaultFieldValue,
  51323. editable: !this.data.readOnly,
  51324. name: this.data.fieldName,
  51325. rect: this.data.rect,
  51326. numItems: this.data.fieldValue.length,
  51327. multipleSelection: this.data.multiSelect,
  51328. hidden: this.data.hidden,
  51329. actions: this.data.actions,
  51330. items: this.data.options,
  51331. page: this.data.pageIndex,
  51332. strokeColor: this.data.borderColor,
  51333. fillColor: this.data.backgroundColor,
  51334. rotation: this.rotation,
  51335. type
  51336. };
  51337. }
  51338. amendSavedDict(annotationStorage, dict) {
  51339. if (!this.hasIndices) {
  51340. return;
  51341. }
  51342. let values = annotationStorage?.get(this.data.id)?.value;
  51343. if (!Array.isArray(values)) {
  51344. values = [values];
  51345. }
  51346. const indices = [];
  51347. const {
  51348. options
  51349. } = this.data;
  51350. for (let i = 0, j = 0, ii = options.length; i < ii; i++) {
  51351. if (options[i].exportValue === values[j]) {
  51352. indices.push(i);
  51353. j += 1;
  51354. }
  51355. }
  51356. dict.set("I", indices);
  51357. }
  51358. async _getAppearance(evaluator, task, intent, annotationStorage) {
  51359. if (this.data.combo) {
  51360. return super._getAppearance(evaluator, task, intent, annotationStorage);
  51361. }
  51362. let exportedValue, rotation;
  51363. const storageEntry = annotationStorage?.get(this.data.id);
  51364. if (storageEntry) {
  51365. rotation = storageEntry.rotation;
  51366. exportedValue = storageEntry.value;
  51367. }
  51368. if (rotation === undefined && exportedValue === undefined && !this._needAppearances) {
  51369. return null;
  51370. }
  51371. if (exportedValue === undefined) {
  51372. exportedValue = this.data.fieldValue;
  51373. } else if (!Array.isArray(exportedValue)) {
  51374. exportedValue = [exportedValue];
  51375. }
  51376. const defaultPadding = 1;
  51377. const defaultHPadding = 2;
  51378. let totalHeight = this.data.rect[3] - this.data.rect[1];
  51379. let totalWidth = this.data.rect[2] - this.data.rect[0];
  51380. if (rotation === 90 || rotation === 270) {
  51381. [totalWidth, totalHeight] = [totalHeight, totalWidth];
  51382. }
  51383. const lineCount = this.data.options.length;
  51384. const valueIndices = [];
  51385. for (let i = 0; i < lineCount; i++) {
  51386. const {
  51387. exportValue
  51388. } = this.data.options[i];
  51389. if (exportedValue.includes(exportValue)) {
  51390. valueIndices.push(i);
  51391. }
  51392. }
  51393. if (!this._defaultAppearance) {
  51394. this.data.defaultAppearanceData = parseDefaultAppearance(this._defaultAppearance = "/Helvetica 0 Tf 0 g");
  51395. }
  51396. const font = await WidgetAnnotation._getFontData(evaluator, task, this.data.defaultAppearanceData, this._fieldResources.mergedResources);
  51397. let defaultAppearance;
  51398. let {
  51399. fontSize
  51400. } = this.data.defaultAppearanceData;
  51401. if (!fontSize) {
  51402. const lineHeight = (totalHeight - defaultPadding) / lineCount;
  51403. let lineWidth = -1;
  51404. let value;
  51405. for (const {
  51406. displayValue
  51407. } of this.data.options) {
  51408. const width = this._getTextWidth(displayValue, font);
  51409. if (width > lineWidth) {
  51410. lineWidth = width;
  51411. value = displayValue;
  51412. }
  51413. }
  51414. [defaultAppearance, fontSize] = this._computeFontSize(lineHeight, totalWidth - 2 * defaultHPadding, value, font, -1);
  51415. } else {
  51416. defaultAppearance = this._defaultAppearance;
  51417. }
  51418. const lineHeight = fontSize * LINE_FACTOR;
  51419. const vPadding = (lineHeight - fontSize) / 2;
  51420. const numberOfVisibleLines = Math.floor(totalHeight / lineHeight);
  51421. let firstIndex = 0;
  51422. if (valueIndices.length > 0) {
  51423. const minIndex = Math.min(...valueIndices);
  51424. const maxIndex = Math.max(...valueIndices);
  51425. firstIndex = Math.max(0, maxIndex - numberOfVisibleLines + 1);
  51426. if (firstIndex > minIndex) {
  51427. firstIndex = minIndex;
  51428. }
  51429. }
  51430. const end = Math.min(firstIndex + numberOfVisibleLines + 1, lineCount);
  51431. const buf = ["/Tx BMC q", `1 1 ${totalWidth} ${totalHeight} re W n`];
  51432. if (valueIndices.length) {
  51433. buf.push("0.600006 0.756866 0.854904 rg");
  51434. for (const index of valueIndices) {
  51435. if (firstIndex <= index && index < end) {
  51436. buf.push(`1 ${totalHeight - (index - firstIndex + 1) * lineHeight} ${totalWidth} ${lineHeight} re f`);
  51437. }
  51438. }
  51439. }
  51440. buf.push("BT", defaultAppearance, `1 0 0 1 0 ${totalHeight} Tm`);
  51441. const prevInfo = {
  51442. shift: 0
  51443. };
  51444. for (let i = firstIndex; i < end; i++) {
  51445. const {
  51446. displayValue
  51447. } = this.data.options[i];
  51448. const vpadding = i === firstIndex ? vPadding : 0;
  51449. buf.push(this._renderText(displayValue, font, fontSize, totalWidth, 0, prevInfo, defaultHPadding, -lineHeight + vpadding));
  51450. }
  51451. buf.push("ET Q EMC");
  51452. return buf.join("\n");
  51453. }
  51454. }
  51455. class SignatureWidgetAnnotation extends WidgetAnnotation {
  51456. constructor(params) {
  51457. super(params);
  51458. this.data.fieldValue = null;
  51459. this.data.hasOwnCanvas = this.data.noRotate;
  51460. this.data.noHTML = !this.data.hasOwnCanvas;
  51461. }
  51462. getFieldObject() {
  51463. return {
  51464. id: this.data.id,
  51465. value: null,
  51466. page: this.data.pageIndex,
  51467. type: "signature"
  51468. };
  51469. }
  51470. }
  51471. class TextAnnotation extends MarkupAnnotation {
  51472. constructor(params) {
  51473. const DEFAULT_ICON_SIZE = 22;
  51474. super(params);
  51475. this.data.noRotate = true;
  51476. this.data.hasOwnCanvas = this.data.noRotate;
  51477. this.data.noHTML = false;
  51478. const {
  51479. dict
  51480. } = params;
  51481. this.data.annotationType = AnnotationType.TEXT;
  51482. if (this.data.hasAppearance) {
  51483. this.data.name = "NoIcon";
  51484. } else {
  51485. this.data.rect[1] = this.data.rect[3] - DEFAULT_ICON_SIZE;
  51486. this.data.rect[2] = this.data.rect[0] + DEFAULT_ICON_SIZE;
  51487. this.data.name = dict.has("Name") ? dict.get("Name").name : "Note";
  51488. }
  51489. if (dict.has("State")) {
  51490. this.data.state = dict.get("State") || null;
  51491. this.data.stateModel = dict.get("StateModel") || null;
  51492. } else {
  51493. this.data.state = null;
  51494. this.data.stateModel = null;
  51495. }
  51496. }
  51497. }
  51498. class LinkAnnotation extends Annotation {
  51499. constructor(params) {
  51500. super(params);
  51501. const {
  51502. dict,
  51503. annotationGlobals
  51504. } = params;
  51505. this.data.annotationType = AnnotationType.LINK;
  51506. this.data.noHTML = false;
  51507. const quadPoints = getQuadPoints(dict, this.rectangle);
  51508. if (quadPoints) {
  51509. this.data.quadPoints = quadPoints;
  51510. }
  51511. this.data.borderColor ||= this.data.color;
  51512. Catalog.parseDestDictionary({
  51513. destDict: dict,
  51514. resultObj: this.data,
  51515. docBaseUrl: annotationGlobals.baseUrl,
  51516. docAttachments: annotationGlobals.attachments
  51517. });
  51518. }
  51519. }
  51520. class PopupAnnotation extends Annotation {
  51521. constructor(params) {
  51522. super(params);
  51523. const {
  51524. dict
  51525. } = params;
  51526. this.data.annotationType = AnnotationType.POPUP;
  51527. this.data.noHTML = false;
  51528. if (this.data.rect[0] === this.data.rect[2] || this.data.rect[1] === this.data.rect[3]) {
  51529. this.data.rect = null;
  51530. }
  51531. let parentItem = dict.get("Parent");
  51532. if (!parentItem) {
  51533. warn("Popup annotation has a missing or invalid parent annotation.");
  51534. return;
  51535. }
  51536. this.data.parentRect = lookupNormalRect(parentItem.getArray("Rect"), null);
  51537. const rt = parentItem.get("RT");
  51538. if (isName(rt, AnnotationReplyType.GROUP)) {
  51539. parentItem = parentItem.get("IRT");
  51540. }
  51541. if (!parentItem.has("M")) {
  51542. this.data.modificationDate = null;
  51543. } else {
  51544. this.setModificationDate(parentItem.get("M"));
  51545. this.data.modificationDate = this.modificationDate;
  51546. }
  51547. if (!parentItem.has("C")) {
  51548. this.data.color = null;
  51549. } else {
  51550. this.setColor(parentItem.getArray("C"));
  51551. this.data.color = this.color;
  51552. }
  51553. if (!this.viewable) {
  51554. const parentFlags = parentItem.get("F");
  51555. if (this._isViewable(parentFlags)) {
  51556. this.setFlags(parentFlags);
  51557. }
  51558. }
  51559. this.setTitle(parentItem.get("T"));
  51560. this.data.titleObj = this._title;
  51561. this.setContents(parentItem.get("Contents"));
  51562. this.data.contentsObj = this._contents;
  51563. if (parentItem.has("RC")) {
  51564. this.data.richText = XFAFactory.getRichTextAsHtml(parentItem.get("RC"));
  51565. }
  51566. this.data.open = !!dict.get("Open");
  51567. }
  51568. }
  51569. class FreeTextAnnotation extends MarkupAnnotation {
  51570. constructor(params) {
  51571. super(params);
  51572. this.data.hasOwnCanvas = this.data.noRotate;
  51573. this.data.isEditable = !this.data.noHTML;
  51574. this.data.noHTML = false;
  51575. const {
  51576. evaluatorOptions,
  51577. xref
  51578. } = params;
  51579. this.data.annotationType = AnnotationType.FREETEXT;
  51580. this.setDefaultAppearance(params);
  51581. this._hasAppearance = !!this.appearance;
  51582. if (this._hasAppearance) {
  51583. const {
  51584. fontColor,
  51585. fontSize
  51586. } = parseAppearanceStream(this.appearance, evaluatorOptions, xref);
  51587. this.data.defaultAppearanceData.fontColor = fontColor;
  51588. this.data.defaultAppearanceData.fontSize = fontSize || 10;
  51589. } else {
  51590. this.data.defaultAppearanceData.fontSize ||= 10;
  51591. const {
  51592. fontColor,
  51593. fontSize
  51594. } = this.data.defaultAppearanceData;
  51595. if (this._contents.str) {
  51596. this.data.textContent = this._contents.str.split(/\r\n?|\n/).map(line => line.trimEnd());
  51597. const {
  51598. coords,
  51599. bbox,
  51600. matrix
  51601. } = FakeUnicodeFont.getFirstPositionInfo(this.rectangle, this.rotation, fontSize);
  51602. this.data.textPosition = this._transformPoint(coords, bbox, matrix);
  51603. }
  51604. if (this._isOffscreenCanvasSupported) {
  51605. const strokeAlpha = params.dict.get("CA");
  51606. const fakeUnicodeFont = new FakeUnicodeFont(xref, "sans-serif");
  51607. this.appearance = fakeUnicodeFont.createAppearance(this._contents.str, this.rectangle, this.rotation, fontSize, fontColor, strokeAlpha);
  51608. this._streams.push(this.appearance);
  51609. } else {
  51610. warn("FreeTextAnnotation: OffscreenCanvas is not supported, annotation may not render correctly.");
  51611. }
  51612. }
  51613. }
  51614. get hasTextContent() {
  51615. return this._hasAppearance;
  51616. }
  51617. static createNewDict(annotation, xref, {
  51618. apRef,
  51619. ap,
  51620. oldAnnotation
  51621. }) {
  51622. const {
  51623. color,
  51624. fontSize,
  51625. rect,
  51626. rotation,
  51627. user,
  51628. value
  51629. } = annotation;
  51630. const freetext = oldAnnotation || new Dict(xref);
  51631. freetext.set("Type", Name.get("Annot"));
  51632. freetext.set("Subtype", Name.get("FreeText"));
  51633. if (oldAnnotation) {
  51634. freetext.set("M", `D:${getModificationDate()}`);
  51635. freetext.delete("RC");
  51636. } else {
  51637. freetext.set("CreationDate", `D:${getModificationDate()}`);
  51638. }
  51639. freetext.set("Rect", rect);
  51640. const da = `/Helv ${fontSize} Tf ${getPdfColor(color, true)}`;
  51641. freetext.set("DA", da);
  51642. freetext.set("Contents", stringToAsciiOrUTF16BE(value));
  51643. freetext.set("F", 4);
  51644. freetext.set("Border", [0, 0, 0]);
  51645. freetext.set("Rotate", rotation);
  51646. if (user) {
  51647. freetext.set("T", stringToAsciiOrUTF16BE(user));
  51648. }
  51649. if (apRef || ap) {
  51650. const n = new Dict(xref);
  51651. freetext.set("AP", n);
  51652. if (apRef) {
  51653. n.set("N", apRef);
  51654. } else {
  51655. n.set("N", ap);
  51656. }
  51657. }
  51658. return freetext;
  51659. }
  51660. static async createNewAppearanceStream(annotation, xref, params) {
  51661. const {
  51662. baseFontRef,
  51663. evaluator,
  51664. task
  51665. } = params;
  51666. const {
  51667. color,
  51668. fontSize,
  51669. rect,
  51670. rotation,
  51671. value
  51672. } = annotation;
  51673. const resources = new Dict(xref);
  51674. const font = new Dict(xref);
  51675. if (baseFontRef) {
  51676. font.set("Helv", baseFontRef);
  51677. } else {
  51678. const baseFont = new Dict(xref);
  51679. baseFont.set("BaseFont", Name.get("Helvetica"));
  51680. baseFont.set("Type", Name.get("Font"));
  51681. baseFont.set("Subtype", Name.get("Type1"));
  51682. baseFont.set("Encoding", Name.get("WinAnsiEncoding"));
  51683. font.set("Helv", baseFont);
  51684. }
  51685. resources.set("Font", font);
  51686. const helv = await WidgetAnnotation._getFontData(evaluator, task, {
  51687. fontName: "Helv",
  51688. fontSize
  51689. }, resources);
  51690. const [x1, y1, x2, y2] = rect;
  51691. let w = x2 - x1;
  51692. let h = y2 - y1;
  51693. if (rotation % 180 !== 0) {
  51694. [w, h] = [h, w];
  51695. }
  51696. const lines = value.split("\n");
  51697. const scale = fontSize / 1000;
  51698. let totalWidth = -Infinity;
  51699. const encodedLines = [];
  51700. for (let line of lines) {
  51701. const encoded = helv.encodeString(line);
  51702. if (encoded.length > 1) {
  51703. return null;
  51704. }
  51705. line = encoded.join("");
  51706. encodedLines.push(line);
  51707. let lineWidth = 0;
  51708. const glyphs = helv.charsToGlyphs(line);
  51709. for (const glyph of glyphs) {
  51710. lineWidth += glyph.width * scale;
  51711. }
  51712. totalWidth = Math.max(totalWidth, lineWidth);
  51713. }
  51714. let hscale = 1;
  51715. if (totalWidth > w) {
  51716. hscale = w / totalWidth;
  51717. }
  51718. let vscale = 1;
  51719. const lineHeight = LINE_FACTOR * fontSize;
  51720. const lineAscent = (LINE_FACTOR - LINE_DESCENT_FACTOR) * fontSize;
  51721. const totalHeight = lineHeight * lines.length;
  51722. if (totalHeight > h) {
  51723. vscale = h / totalHeight;
  51724. }
  51725. const fscale = Math.min(hscale, vscale);
  51726. const newFontSize = fontSize * fscale;
  51727. let firstPoint, clipBox, matrix;
  51728. switch (rotation) {
  51729. case 0:
  51730. matrix = [1, 0, 0, 1];
  51731. clipBox = [rect[0], rect[1], w, h];
  51732. firstPoint = [rect[0], rect[3] - lineAscent];
  51733. break;
  51734. case 90:
  51735. matrix = [0, 1, -1, 0];
  51736. clipBox = [rect[1], -rect[2], w, h];
  51737. firstPoint = [rect[1], -rect[0] - lineAscent];
  51738. break;
  51739. case 180:
  51740. matrix = [-1, 0, 0, -1];
  51741. clipBox = [-rect[2], -rect[3], w, h];
  51742. firstPoint = [-rect[2], -rect[1] - lineAscent];
  51743. break;
  51744. case 270:
  51745. matrix = [0, -1, 1, 0];
  51746. clipBox = [-rect[3], rect[0], w, h];
  51747. firstPoint = [-rect[3], rect[2] - lineAscent];
  51748. break;
  51749. }
  51750. const buffer = ["q", `${matrix.join(" ")} 0 0 cm`, `${clipBox.join(" ")} re W n`, `BT`, `${getPdfColor(color, true)}`, `0 Tc /Helv ${numberToString(newFontSize)} Tf`];
  51751. buffer.push(`${firstPoint.join(" ")} Td (${escapeString(encodedLines[0])}) Tj`);
  51752. const vShift = numberToString(lineHeight);
  51753. for (let i = 1, ii = encodedLines.length; i < ii; i++) {
  51754. const line = encodedLines[i];
  51755. buffer.push(`0 -${vShift} Td (${escapeString(line)}) Tj`);
  51756. }
  51757. buffer.push("ET", "Q");
  51758. const appearance = buffer.join("\n");
  51759. const appearanceStreamDict = new Dict(xref);
  51760. appearanceStreamDict.set("FormType", 1);
  51761. appearanceStreamDict.set("Subtype", Name.get("Form"));
  51762. appearanceStreamDict.set("Type", Name.get("XObject"));
  51763. appearanceStreamDict.set("BBox", rect);
  51764. appearanceStreamDict.set("Resources", resources);
  51765. appearanceStreamDict.set("Matrix", [1, 0, 0, 1, -rect[0], -rect[1]]);
  51766. const ap = new StringStream(appearance);
  51767. ap.dict = appearanceStreamDict;
  51768. return ap;
  51769. }
  51770. }
  51771. class LineAnnotation extends MarkupAnnotation {
  51772. constructor(params) {
  51773. super(params);
  51774. const {
  51775. dict,
  51776. xref
  51777. } = params;
  51778. this.data.annotationType = AnnotationType.LINE;
  51779. this.data.hasOwnCanvas = this.data.noRotate;
  51780. this.data.noHTML = false;
  51781. const lineCoordinates = lookupRect(dict.getArray("L"), [0, 0, 0, 0]);
  51782. this.data.lineCoordinates = Util.normalizeRect(lineCoordinates);
  51783. this.setLineEndings(dict.getArray("LE"));
  51784. this.data.lineEndings = this.lineEndings;
  51785. if (!this.appearance) {
  51786. const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0];
  51787. const strokeAlpha = dict.get("CA");
  51788. const interiorColor = getRgbColor(dict.getArray("IC"), null);
  51789. const fillColor = interiorColor ? getPdfColorArray(interiorColor) : null;
  51790. const fillAlpha = fillColor ? strokeAlpha : null;
  51791. const borderWidth = this.borderStyle.width || 1,
  51792. borderAdjust = 2 * borderWidth;
  51793. const bbox = [this.data.lineCoordinates[0] - borderAdjust, this.data.lineCoordinates[1] - borderAdjust, this.data.lineCoordinates[2] + borderAdjust, this.data.lineCoordinates[3] + borderAdjust];
  51794. if (!Util.intersect(this.rectangle, bbox)) {
  51795. this.rectangle = bbox;
  51796. }
  51797. this._setDefaultAppearance({
  51798. xref,
  51799. extra: `${borderWidth} w`,
  51800. strokeColor,
  51801. fillColor,
  51802. strokeAlpha,
  51803. fillAlpha,
  51804. pointsCallback: (buffer, points) => {
  51805. buffer.push(`${lineCoordinates[0]} ${lineCoordinates[1]} m`, `${lineCoordinates[2]} ${lineCoordinates[3]} l`, "S");
  51806. return [points[0] - borderWidth, points[2] + borderWidth, points[7] - borderWidth, points[3] + borderWidth];
  51807. }
  51808. });
  51809. }
  51810. }
  51811. }
  51812. class SquareAnnotation extends MarkupAnnotation {
  51813. constructor(params) {
  51814. super(params);
  51815. const {
  51816. dict,
  51817. xref
  51818. } = params;
  51819. this.data.annotationType = AnnotationType.SQUARE;
  51820. this.data.hasOwnCanvas = this.data.noRotate;
  51821. this.data.noHTML = false;
  51822. if (!this.appearance) {
  51823. const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0];
  51824. const strokeAlpha = dict.get("CA");
  51825. const interiorColor = getRgbColor(dict.getArray("IC"), null);
  51826. const fillColor = interiorColor ? getPdfColorArray(interiorColor) : null;
  51827. const fillAlpha = fillColor ? strokeAlpha : null;
  51828. if (this.borderStyle.width === 0 && !fillColor) {
  51829. return;
  51830. }
  51831. this._setDefaultAppearance({
  51832. xref,
  51833. extra: `${this.borderStyle.width} w`,
  51834. strokeColor,
  51835. fillColor,
  51836. strokeAlpha,
  51837. fillAlpha,
  51838. pointsCallback: (buffer, points) => {
  51839. const x = points[4] + this.borderStyle.width / 2;
  51840. const y = points[5] + this.borderStyle.width / 2;
  51841. const width = points[6] - points[4] - this.borderStyle.width;
  51842. const height = points[3] - points[7] - this.borderStyle.width;
  51843. buffer.push(`${x} ${y} ${width} ${height} re`);
  51844. if (fillColor) {
  51845. buffer.push("B");
  51846. } else {
  51847. buffer.push("S");
  51848. }
  51849. return [points[0], points[2], points[7], points[3]];
  51850. }
  51851. });
  51852. }
  51853. }
  51854. }
  51855. class CircleAnnotation extends MarkupAnnotation {
  51856. constructor(params) {
  51857. super(params);
  51858. const {
  51859. dict,
  51860. xref
  51861. } = params;
  51862. this.data.annotationType = AnnotationType.CIRCLE;
  51863. if (!this.appearance) {
  51864. const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0];
  51865. const strokeAlpha = dict.get("CA");
  51866. const interiorColor = getRgbColor(dict.getArray("IC"), null);
  51867. const fillColor = interiorColor ? getPdfColorArray(interiorColor) : null;
  51868. const fillAlpha = fillColor ? strokeAlpha : null;
  51869. if (this.borderStyle.width === 0 && !fillColor) {
  51870. return;
  51871. }
  51872. const controlPointsDistance = 4 / 3 * Math.tan(Math.PI / (2 * 4));
  51873. this._setDefaultAppearance({
  51874. xref,
  51875. extra: `${this.borderStyle.width} w`,
  51876. strokeColor,
  51877. fillColor,
  51878. strokeAlpha,
  51879. fillAlpha,
  51880. pointsCallback: (buffer, points) => {
  51881. const x0 = points[0] + this.borderStyle.width / 2;
  51882. const y0 = points[1] - this.borderStyle.width / 2;
  51883. const x1 = points[6] - this.borderStyle.width / 2;
  51884. const y1 = points[7] + this.borderStyle.width / 2;
  51885. const xMid = x0 + (x1 - x0) / 2;
  51886. const yMid = y0 + (y1 - y0) / 2;
  51887. const xOffset = (x1 - x0) / 2 * controlPointsDistance;
  51888. const yOffset = (y1 - y0) / 2 * controlPointsDistance;
  51889. 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");
  51890. if (fillColor) {
  51891. buffer.push("B");
  51892. } else {
  51893. buffer.push("S");
  51894. }
  51895. return [points[0], points[2], points[7], points[3]];
  51896. }
  51897. });
  51898. }
  51899. }
  51900. }
  51901. class PolylineAnnotation extends MarkupAnnotation {
  51902. constructor(params) {
  51903. super(params);
  51904. const {
  51905. dict,
  51906. xref
  51907. } = params;
  51908. this.data.annotationType = AnnotationType.POLYLINE;
  51909. this.data.hasOwnCanvas = this.data.noRotate;
  51910. this.data.noHTML = false;
  51911. this.data.vertices = null;
  51912. if (!(this instanceof PolygonAnnotation)) {
  51913. this.setLineEndings(dict.getArray("LE"));
  51914. this.data.lineEndings = this.lineEndings;
  51915. }
  51916. const rawVertices = dict.getArray("Vertices");
  51917. if (!isNumberArray(rawVertices, null)) {
  51918. return;
  51919. }
  51920. const vertices = this.data.vertices = Float32Array.from(rawVertices);
  51921. if (!this.appearance) {
  51922. const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0];
  51923. const strokeAlpha = dict.get("CA");
  51924. const borderWidth = this.borderStyle.width || 1,
  51925. borderAdjust = 2 * borderWidth;
  51926. const bbox = [Infinity, Infinity, -Infinity, -Infinity];
  51927. for (let i = 0, ii = vertices.length; i < ii; i += 2) {
  51928. bbox[0] = Math.min(bbox[0], vertices[i] - borderAdjust);
  51929. bbox[1] = Math.min(bbox[1], vertices[i + 1] - borderAdjust);
  51930. bbox[2] = Math.max(bbox[2], vertices[i] + borderAdjust);
  51931. bbox[3] = Math.max(bbox[3], vertices[i + 1] + borderAdjust);
  51932. }
  51933. if (!Util.intersect(this.rectangle, bbox)) {
  51934. this.rectangle = bbox;
  51935. }
  51936. this._setDefaultAppearance({
  51937. xref,
  51938. extra: `${borderWidth} w`,
  51939. strokeColor,
  51940. strokeAlpha,
  51941. pointsCallback: (buffer, points) => {
  51942. for (let i = 0, ii = vertices.length; i < ii; i += 2) {
  51943. buffer.push(`${vertices[i]} ${vertices[i + 1]} ${i === 0 ? "m" : "l"}`);
  51944. }
  51945. buffer.push("S");
  51946. return [points[0], points[2], points[7], points[3]];
  51947. }
  51948. });
  51949. }
  51950. }
  51951. }
  51952. class PolygonAnnotation extends PolylineAnnotation {
  51953. constructor(params) {
  51954. super(params);
  51955. this.data.annotationType = AnnotationType.POLYGON;
  51956. }
  51957. }
  51958. class CaretAnnotation extends MarkupAnnotation {
  51959. constructor(params) {
  51960. super(params);
  51961. this.data.annotationType = AnnotationType.CARET;
  51962. }
  51963. }
  51964. class InkAnnotation extends MarkupAnnotation {
  51965. constructor(params) {
  51966. super(params);
  51967. this.data.hasOwnCanvas = this.data.noRotate;
  51968. this.data.noHTML = false;
  51969. const {
  51970. dict,
  51971. xref
  51972. } = params;
  51973. this.data.annotationType = AnnotationType.INK;
  51974. this.data.inkLists = [];
  51975. const rawInkLists = dict.getArray("InkList");
  51976. if (!Array.isArray(rawInkLists)) {
  51977. return;
  51978. }
  51979. for (let i = 0, ii = rawInkLists.length; i < ii; ++i) {
  51980. if (!Array.isArray(rawInkLists[i])) {
  51981. continue;
  51982. }
  51983. const inkList = new Float32Array(rawInkLists[i].length);
  51984. this.data.inkLists.push(inkList);
  51985. for (let j = 0, jj = rawInkLists[i].length; j < jj; j += 2) {
  51986. const x = xref.fetchIfRef(rawInkLists[i][j]),
  51987. y = xref.fetchIfRef(rawInkLists[i][j + 1]);
  51988. if (typeof x === "number" && typeof y === "number") {
  51989. inkList[j] = x;
  51990. inkList[j + 1] = y;
  51991. }
  51992. }
  51993. }
  51994. if (!this.appearance) {
  51995. const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0];
  51996. const strokeAlpha = dict.get("CA");
  51997. const borderWidth = this.borderStyle.width || 1,
  51998. borderAdjust = 2 * borderWidth;
  51999. const bbox = [Infinity, Infinity, -Infinity, -Infinity];
  52000. for (const inkList of this.data.inkLists) {
  52001. for (let i = 0, ii = inkList.length; i < ii; i += 2) {
  52002. bbox[0] = Math.min(bbox[0], inkList[i] - borderAdjust);
  52003. bbox[1] = Math.min(bbox[1], inkList[i + 1] - borderAdjust);
  52004. bbox[2] = Math.max(bbox[2], inkList[i] + borderAdjust);
  52005. bbox[3] = Math.max(bbox[3], inkList[i + 1] + borderAdjust);
  52006. }
  52007. }
  52008. if (!Util.intersect(this.rectangle, bbox)) {
  52009. this.rectangle = bbox;
  52010. }
  52011. this._setDefaultAppearance({
  52012. xref,
  52013. extra: `${borderWidth} w`,
  52014. strokeColor,
  52015. strokeAlpha,
  52016. pointsCallback: (buffer, points) => {
  52017. for (const inkList of this.data.inkLists) {
  52018. for (let i = 0, ii = inkList.length; i < ii; i += 2) {
  52019. buffer.push(`${inkList[i]} ${inkList[i + 1]} ${i === 0 ? "m" : "l"}`);
  52020. }
  52021. buffer.push("S");
  52022. }
  52023. return [points[0], points[2], points[7], points[3]];
  52024. }
  52025. });
  52026. }
  52027. }
  52028. static createNewDict(annotation, xref, {
  52029. apRef,
  52030. ap
  52031. }) {
  52032. const {
  52033. color,
  52034. opacity,
  52035. paths,
  52036. outlines,
  52037. rect,
  52038. rotation,
  52039. thickness
  52040. } = annotation;
  52041. const ink = new Dict(xref);
  52042. ink.set("Type", Name.get("Annot"));
  52043. ink.set("Subtype", Name.get("Ink"));
  52044. ink.set("CreationDate", `D:${getModificationDate()}`);
  52045. ink.set("Rect", rect);
  52046. ink.set("InkList", outlines?.points || paths.map(p => p.points));
  52047. ink.set("F", 4);
  52048. ink.set("Rotate", rotation);
  52049. if (outlines) {
  52050. ink.set("IT", Name.get("InkHighlight"));
  52051. }
  52052. const bs = new Dict(xref);
  52053. ink.set("BS", bs);
  52054. bs.set("W", thickness);
  52055. ink.set("C", Array.from(color, c => c / 255));
  52056. ink.set("CA", opacity);
  52057. const n = new Dict(xref);
  52058. ink.set("AP", n);
  52059. if (apRef) {
  52060. n.set("N", apRef);
  52061. } else {
  52062. n.set("N", ap);
  52063. }
  52064. return ink;
  52065. }
  52066. static async createNewAppearanceStream(annotation, xref, params) {
  52067. if (annotation.outlines) {
  52068. return this.createNewAppearanceStreamForHighlight(annotation, xref, params);
  52069. }
  52070. const {
  52071. color,
  52072. rect,
  52073. paths,
  52074. thickness,
  52075. opacity
  52076. } = annotation;
  52077. const appearanceBuffer = [`${thickness} w 1 J 1 j`, `${getPdfColor(color, false)}`];
  52078. if (opacity !== 1) {
  52079. appearanceBuffer.push("/R0 gs");
  52080. }
  52081. const buffer = [];
  52082. for (const {
  52083. bezier
  52084. } of paths) {
  52085. buffer.length = 0;
  52086. buffer.push(`${numberToString(bezier[0])} ${numberToString(bezier[1])} m`);
  52087. if (bezier.length === 2) {
  52088. buffer.push(`${numberToString(bezier[0])} ${numberToString(bezier[1])} l S`);
  52089. } else {
  52090. for (let i = 2, ii = bezier.length; i < ii; i += 6) {
  52091. const curve = bezier.slice(i, i + 6).map(numberToString).join(" ");
  52092. buffer.push(`${curve} c`);
  52093. }
  52094. buffer.push("S");
  52095. }
  52096. appearanceBuffer.push(buffer.join("\n"));
  52097. }
  52098. const appearance = appearanceBuffer.join("\n");
  52099. const appearanceStreamDict = new Dict(xref);
  52100. appearanceStreamDict.set("FormType", 1);
  52101. appearanceStreamDict.set("Subtype", Name.get("Form"));
  52102. appearanceStreamDict.set("Type", Name.get("XObject"));
  52103. appearanceStreamDict.set("BBox", rect);
  52104. appearanceStreamDict.set("Length", appearance.length);
  52105. if (opacity !== 1) {
  52106. const resources = new Dict(xref);
  52107. const extGState = new Dict(xref);
  52108. const r0 = new Dict(xref);
  52109. r0.set("CA", opacity);
  52110. r0.set("Type", Name.get("ExtGState"));
  52111. extGState.set("R0", r0);
  52112. resources.set("ExtGState", extGState);
  52113. appearanceStreamDict.set("Resources", resources);
  52114. }
  52115. const ap = new StringStream(appearance);
  52116. ap.dict = appearanceStreamDict;
  52117. return ap;
  52118. }
  52119. static async createNewAppearanceStreamForHighlight(annotation, xref, params) {
  52120. const {
  52121. color,
  52122. rect,
  52123. outlines: {
  52124. outline
  52125. },
  52126. opacity
  52127. } = annotation;
  52128. const appearanceBuffer = [`${getPdfColor(color, true)}`, "/R0 gs"];
  52129. appearanceBuffer.push(`${numberToString(outline[4])} ${numberToString(outline[5])} m`);
  52130. for (let i = 6, ii = outline.length; i < ii; i += 6) {
  52131. if (isNaN(outline[i]) || outline[i] === null) {
  52132. appearanceBuffer.push(`${numberToString(outline[i + 4])} ${numberToString(outline[i + 5])} l`);
  52133. } else {
  52134. const curve = outline.slice(i, i + 6).map(numberToString).join(" ");
  52135. appearanceBuffer.push(`${curve} c`);
  52136. }
  52137. }
  52138. appearanceBuffer.push("h f");
  52139. const appearance = appearanceBuffer.join("\n");
  52140. const appearanceStreamDict = new Dict(xref);
  52141. appearanceStreamDict.set("FormType", 1);
  52142. appearanceStreamDict.set("Subtype", Name.get("Form"));
  52143. appearanceStreamDict.set("Type", Name.get("XObject"));
  52144. appearanceStreamDict.set("BBox", rect);
  52145. appearanceStreamDict.set("Length", appearance.length);
  52146. const resources = new Dict(xref);
  52147. const extGState = new Dict(xref);
  52148. resources.set("ExtGState", extGState);
  52149. appearanceStreamDict.set("Resources", resources);
  52150. const r0 = new Dict(xref);
  52151. extGState.set("R0", r0);
  52152. r0.set("BM", Name.get("Multiply"));
  52153. if (opacity !== 1) {
  52154. r0.set("ca", opacity);
  52155. r0.set("Type", Name.get("ExtGState"));
  52156. }
  52157. const ap = new StringStream(appearance);
  52158. ap.dict = appearanceStreamDict;
  52159. return ap;
  52160. }
  52161. }
  52162. class HighlightAnnotation extends MarkupAnnotation {
  52163. constructor(params) {
  52164. super(params);
  52165. const {
  52166. dict,
  52167. xref
  52168. } = params;
  52169. this.data.annotationType = AnnotationType.HIGHLIGHT;
  52170. const quadPoints = this.data.quadPoints = getQuadPoints(dict, null);
  52171. if (quadPoints) {
  52172. const resources = this.appearance?.dict.get("Resources");
  52173. if (!this.appearance || !resources?.has("ExtGState")) {
  52174. if (this.appearance) {
  52175. warn("HighlightAnnotation - ignoring built-in appearance stream.");
  52176. }
  52177. const fillColor = this.color ? getPdfColorArray(this.color) : [1, 1, 0];
  52178. const fillAlpha = dict.get("CA");
  52179. this._setDefaultAppearance({
  52180. xref,
  52181. fillColor,
  52182. blendMode: "Multiply",
  52183. fillAlpha,
  52184. pointsCallback: (buffer, points) => {
  52185. buffer.push(`${points[0]} ${points[1]} m`, `${points[2]} ${points[3]} l`, `${points[6]} ${points[7]} l`, `${points[4]} ${points[5]} l`, "f");
  52186. return [points[0], points[2], points[7], points[3]];
  52187. }
  52188. });
  52189. }
  52190. } else {
  52191. this.data.popupRef = null;
  52192. }
  52193. }
  52194. static createNewDict(annotation, xref, {
  52195. apRef,
  52196. ap
  52197. }) {
  52198. const {
  52199. color,
  52200. opacity,
  52201. rect,
  52202. rotation,
  52203. user,
  52204. quadPoints
  52205. } = annotation;
  52206. const highlight = new Dict(xref);
  52207. highlight.set("Type", Name.get("Annot"));
  52208. highlight.set("Subtype", Name.get("Highlight"));
  52209. highlight.set("CreationDate", `D:${getModificationDate()}`);
  52210. highlight.set("Rect", rect);
  52211. highlight.set("F", 4);
  52212. highlight.set("Border", [0, 0, 0]);
  52213. highlight.set("Rotate", rotation);
  52214. highlight.set("QuadPoints", quadPoints);
  52215. highlight.set("C", Array.from(color, c => c / 255));
  52216. highlight.set("CA", opacity);
  52217. if (user) {
  52218. highlight.set("T", stringToAsciiOrUTF16BE(user));
  52219. }
  52220. if (apRef || ap) {
  52221. const n = new Dict(xref);
  52222. highlight.set("AP", n);
  52223. n.set("N", apRef || ap);
  52224. }
  52225. return highlight;
  52226. }
  52227. static async createNewAppearanceStream(annotation, xref, params) {
  52228. const {
  52229. color,
  52230. rect,
  52231. outlines,
  52232. opacity
  52233. } = annotation;
  52234. const appearanceBuffer = [`${getPdfColor(color, true)}`, "/R0 gs"];
  52235. const buffer = [];
  52236. for (const outline of outlines) {
  52237. buffer.length = 0;
  52238. buffer.push(`${numberToString(outline[0])} ${numberToString(outline[1])} m`);
  52239. for (let i = 2, ii = outline.length; i < ii; i += 2) {
  52240. buffer.push(`${numberToString(outline[i])} ${numberToString(outline[i + 1])} l`);
  52241. }
  52242. buffer.push("h");
  52243. appearanceBuffer.push(buffer.join("\n"));
  52244. }
  52245. appearanceBuffer.push("f*");
  52246. const appearance = appearanceBuffer.join("\n");
  52247. const appearanceStreamDict = new Dict(xref);
  52248. appearanceStreamDict.set("FormType", 1);
  52249. appearanceStreamDict.set("Subtype", Name.get("Form"));
  52250. appearanceStreamDict.set("Type", Name.get("XObject"));
  52251. appearanceStreamDict.set("BBox", rect);
  52252. appearanceStreamDict.set("Length", appearance.length);
  52253. const resources = new Dict(xref);
  52254. const extGState = new Dict(xref);
  52255. resources.set("ExtGState", extGState);
  52256. appearanceStreamDict.set("Resources", resources);
  52257. const r0 = new Dict(xref);
  52258. extGState.set("R0", r0);
  52259. r0.set("BM", Name.get("Multiply"));
  52260. if (opacity !== 1) {
  52261. r0.set("ca", opacity);
  52262. r0.set("Type", Name.get("ExtGState"));
  52263. }
  52264. const ap = new StringStream(appearance);
  52265. ap.dict = appearanceStreamDict;
  52266. return ap;
  52267. }
  52268. }
  52269. class UnderlineAnnotation extends MarkupAnnotation {
  52270. constructor(params) {
  52271. super(params);
  52272. const {
  52273. dict,
  52274. xref
  52275. } = params;
  52276. this.data.annotationType = AnnotationType.UNDERLINE;
  52277. const quadPoints = this.data.quadPoints = getQuadPoints(dict, null);
  52278. if (quadPoints) {
  52279. if (!this.appearance) {
  52280. const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0];
  52281. const strokeAlpha = dict.get("CA");
  52282. this._setDefaultAppearance({
  52283. xref,
  52284. extra: "[] 0 d 0.571 w",
  52285. strokeColor,
  52286. strokeAlpha,
  52287. pointsCallback: (buffer, points) => {
  52288. buffer.push(`${points[4]} ${points[5] + 1.3} m`, `${points[6]} ${points[7] + 1.3} l`, "S");
  52289. return [points[0], points[2], points[7], points[3]];
  52290. }
  52291. });
  52292. }
  52293. } else {
  52294. this.data.popupRef = null;
  52295. }
  52296. }
  52297. }
  52298. class SquigglyAnnotation extends MarkupAnnotation {
  52299. constructor(params) {
  52300. super(params);
  52301. const {
  52302. dict,
  52303. xref
  52304. } = params;
  52305. this.data.annotationType = AnnotationType.SQUIGGLY;
  52306. const quadPoints = this.data.quadPoints = getQuadPoints(dict, null);
  52307. if (quadPoints) {
  52308. if (!this.appearance) {
  52309. const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0];
  52310. const strokeAlpha = dict.get("CA");
  52311. this._setDefaultAppearance({
  52312. xref,
  52313. extra: "[] 0 d 1 w",
  52314. strokeColor,
  52315. strokeAlpha,
  52316. pointsCallback: (buffer, points) => {
  52317. const dy = (points[1] - points[5]) / 6;
  52318. let shift = dy;
  52319. let x = points[4];
  52320. const y = points[5];
  52321. const xEnd = points[6];
  52322. buffer.push(`${x} ${y + shift} m`);
  52323. do {
  52324. x += 2;
  52325. shift = shift === 0 ? dy : 0;
  52326. buffer.push(`${x} ${y + shift} l`);
  52327. } while (x < xEnd);
  52328. buffer.push("S");
  52329. return [points[4], xEnd, y - 2 * dy, y + 2 * dy];
  52330. }
  52331. });
  52332. }
  52333. } else {
  52334. this.data.popupRef = null;
  52335. }
  52336. }
  52337. }
  52338. class StrikeOutAnnotation extends MarkupAnnotation {
  52339. constructor(params) {
  52340. super(params);
  52341. const {
  52342. dict,
  52343. xref
  52344. } = params;
  52345. this.data.annotationType = AnnotationType.STRIKEOUT;
  52346. const quadPoints = this.data.quadPoints = getQuadPoints(dict, null);
  52347. if (quadPoints) {
  52348. if (!this.appearance) {
  52349. const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0];
  52350. const strokeAlpha = dict.get("CA");
  52351. this._setDefaultAppearance({
  52352. xref,
  52353. extra: "[] 0 d 1 w",
  52354. strokeColor,
  52355. strokeAlpha,
  52356. pointsCallback: (buffer, points) => {
  52357. 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");
  52358. return [points[0], points[2], points[7], points[3]];
  52359. }
  52360. });
  52361. }
  52362. } else {
  52363. this.data.popupRef = null;
  52364. }
  52365. }
  52366. }
  52367. class StampAnnotation extends MarkupAnnotation {
  52368. constructor(params) {
  52369. super(params);
  52370. this.data.annotationType = AnnotationType.STAMP;
  52371. this.data.hasOwnCanvas = this.data.noRotate;
  52372. this.data.noHTML = false;
  52373. }
  52374. static async createImage(bitmap, xref) {
  52375. const {
  52376. width,
  52377. height
  52378. } = bitmap;
  52379. const canvas = new OffscreenCanvas(width, height);
  52380. const ctx = canvas.getContext("2d", {
  52381. alpha: true
  52382. });
  52383. ctx.drawImage(bitmap, 0, 0);
  52384. const data = ctx.getImageData(0, 0, width, height).data;
  52385. const buf32 = new Uint32Array(data.buffer);
  52386. const hasAlpha = buf32.some(FeatureTest.isLittleEndian ? x => x >>> 24 !== 0xff : x => (x & 0xff) !== 0xff);
  52387. if (hasAlpha) {
  52388. ctx.fillStyle = "white";
  52389. ctx.fillRect(0, 0, width, height);
  52390. ctx.drawImage(bitmap, 0, 0);
  52391. }
  52392. const jpegBufferPromise = canvas.convertToBlob({
  52393. type: "image/jpeg",
  52394. quality: 1
  52395. }).then(blob => blob.arrayBuffer());
  52396. const xobjectName = Name.get("XObject");
  52397. const imageName = Name.get("Image");
  52398. const image = new Dict(xref);
  52399. image.set("Type", xobjectName);
  52400. image.set("Subtype", imageName);
  52401. image.set("BitsPerComponent", 8);
  52402. image.set("ColorSpace", Name.get("DeviceRGB"));
  52403. image.set("Filter", Name.get("DCTDecode"));
  52404. image.set("BBox", [0, 0, width, height]);
  52405. image.set("Width", width);
  52406. image.set("Height", height);
  52407. let smaskStream = null;
  52408. if (hasAlpha) {
  52409. const alphaBuffer = new Uint8Array(buf32.length);
  52410. if (FeatureTest.isLittleEndian) {
  52411. for (let i = 0, ii = buf32.length; i < ii; i++) {
  52412. alphaBuffer[i] = buf32[i] >>> 24;
  52413. }
  52414. } else {
  52415. for (let i = 0, ii = buf32.length; i < ii; i++) {
  52416. alphaBuffer[i] = buf32[i] & 0xff;
  52417. }
  52418. }
  52419. const smask = new Dict(xref);
  52420. smask.set("Type", xobjectName);
  52421. smask.set("Subtype", imageName);
  52422. smask.set("BitsPerComponent", 8);
  52423. smask.set("ColorSpace", Name.get("DeviceGray"));
  52424. smask.set("Width", width);
  52425. smask.set("Height", height);
  52426. smaskStream = new Stream(alphaBuffer, 0, 0, smask);
  52427. }
  52428. const imageStream = new Stream(await jpegBufferPromise, 0, 0, image);
  52429. return {
  52430. imageStream,
  52431. smaskStream,
  52432. width,
  52433. height
  52434. };
  52435. }
  52436. static createNewDict(annotation, xref, {
  52437. apRef,
  52438. ap
  52439. }) {
  52440. const {
  52441. rect,
  52442. rotation,
  52443. user
  52444. } = annotation;
  52445. const stamp = new Dict(xref);
  52446. stamp.set("Type", Name.get("Annot"));
  52447. stamp.set("Subtype", Name.get("Stamp"));
  52448. stamp.set("CreationDate", `D:${getModificationDate()}`);
  52449. stamp.set("Rect", rect);
  52450. stamp.set("F", 4);
  52451. stamp.set("Border", [0, 0, 0]);
  52452. stamp.set("Rotate", rotation);
  52453. if (user) {
  52454. stamp.set("T", stringToAsciiOrUTF16BE(user));
  52455. }
  52456. if (apRef || ap) {
  52457. const n = new Dict(xref);
  52458. stamp.set("AP", n);
  52459. if (apRef) {
  52460. n.set("N", apRef);
  52461. } else {
  52462. n.set("N", ap);
  52463. }
  52464. }
  52465. return stamp;
  52466. }
  52467. static async createNewAppearanceStream(annotation, xref, params) {
  52468. const {
  52469. rotation
  52470. } = annotation;
  52471. const {
  52472. imageRef,
  52473. width,
  52474. height
  52475. } = params.image;
  52476. const resources = new Dict(xref);
  52477. const xobject = new Dict(xref);
  52478. resources.set("XObject", xobject);
  52479. xobject.set("Im0", imageRef);
  52480. const appearance = `q ${width} 0 0 ${height} 0 0 cm /Im0 Do Q`;
  52481. const appearanceStreamDict = new Dict(xref);
  52482. appearanceStreamDict.set("FormType", 1);
  52483. appearanceStreamDict.set("Subtype", Name.get("Form"));
  52484. appearanceStreamDict.set("Type", Name.get("XObject"));
  52485. appearanceStreamDict.set("BBox", [0, 0, width, height]);
  52486. appearanceStreamDict.set("Resources", resources);
  52487. if (rotation) {
  52488. const matrix = getRotationMatrix(rotation, width, height);
  52489. appearanceStreamDict.set("Matrix", matrix);
  52490. }
  52491. const ap = new StringStream(appearance);
  52492. ap.dict = appearanceStreamDict;
  52493. return ap;
  52494. }
  52495. }
  52496. class FileAttachmentAnnotation extends MarkupAnnotation {
  52497. constructor(params) {
  52498. super(params);
  52499. const {
  52500. dict,
  52501. xref
  52502. } = params;
  52503. const file = new FileSpec(dict.get("FS"), xref);
  52504. this.data.annotationType = AnnotationType.FILEATTACHMENT;
  52505. this.data.hasOwnCanvas = this.data.noRotate;
  52506. this.data.noHTML = false;
  52507. this.data.file = file.serializable;
  52508. const name = dict.get("Name");
  52509. this.data.name = name instanceof Name ? stringToPDFString(name.name) : "PushPin";
  52510. const fillAlpha = dict.get("ca");
  52511. this.data.fillAlpha = typeof fillAlpha === "number" && fillAlpha >= 0 && fillAlpha <= 1 ? fillAlpha : null;
  52512. }
  52513. }
  52514. ;// CONCATENATED MODULE: ./src/core/dataset_reader.js
  52515. function decodeString(str) {
  52516. try {
  52517. return stringToUTF8String(str);
  52518. } catch (ex) {
  52519. warn(`UTF-8 decoding failed: "${ex}".`);
  52520. return str;
  52521. }
  52522. }
  52523. class DatasetXMLParser extends SimpleXMLParser {
  52524. constructor(options) {
  52525. super(options);
  52526. this.node = null;
  52527. }
  52528. onEndElement(name) {
  52529. const node = super.onEndElement(name);
  52530. if (node && name === "xfa:datasets") {
  52531. this.node = node;
  52532. throw new Error("Aborting DatasetXMLParser.");
  52533. }
  52534. }
  52535. }
  52536. class DatasetReader {
  52537. constructor(data) {
  52538. if (data.datasets) {
  52539. this.node = new SimpleXMLParser({
  52540. hasAttributes: true
  52541. }).parseFromString(data.datasets).documentElement;
  52542. } else {
  52543. const parser = new DatasetXMLParser({
  52544. hasAttributes: true
  52545. });
  52546. try {
  52547. parser.parseFromString(data["xdp:xdp"]);
  52548. } catch {}
  52549. this.node = parser.node;
  52550. }
  52551. }
  52552. getValue(path) {
  52553. if (!this.node || !path) {
  52554. return "";
  52555. }
  52556. const node = this.node.searchNode(parseXFAPath(path), 0);
  52557. if (!node) {
  52558. return "";
  52559. }
  52560. const first = node.firstChild;
  52561. if (first?.nodeName === "value") {
  52562. return node.children.map(child => decodeString(child.textContent));
  52563. }
  52564. return decodeString(node.textContent);
  52565. }
  52566. }
  52567. ;// CONCATENATED MODULE: ./src/core/xref.js
  52568. class XRef {
  52569. #firstXRefStmPos = null;
  52570. constructor(stream, pdfManager) {
  52571. this.stream = stream;
  52572. this.pdfManager = pdfManager;
  52573. this.entries = [];
  52574. this._xrefStms = new Set();
  52575. this._cacheMap = new Map();
  52576. this._pendingRefs = new RefSet();
  52577. this._newPersistentRefNum = null;
  52578. this._newTemporaryRefNum = null;
  52579. this._persistentRefsCache = null;
  52580. }
  52581. getNewPersistentRef(obj) {
  52582. if (this._newPersistentRefNum === null) {
  52583. this._newPersistentRefNum = this.entries.length || 1;
  52584. }
  52585. const num = this._newPersistentRefNum++;
  52586. this._cacheMap.set(num, obj);
  52587. return Ref.get(num, 0);
  52588. }
  52589. getNewTemporaryRef() {
  52590. if (this._newTemporaryRefNum === null) {
  52591. this._newTemporaryRefNum = this.entries.length || 1;
  52592. if (this._newPersistentRefNum) {
  52593. this._persistentRefsCache = new Map();
  52594. for (let i = this._newTemporaryRefNum; i < this._newPersistentRefNum; i++) {
  52595. this._persistentRefsCache.set(i, this._cacheMap.get(i));
  52596. this._cacheMap.delete(i);
  52597. }
  52598. }
  52599. }
  52600. return Ref.get(this._newTemporaryRefNum++, 0);
  52601. }
  52602. resetNewTemporaryRef() {
  52603. this._newTemporaryRefNum = null;
  52604. if (this._persistentRefsCache) {
  52605. for (const [num, obj] of this._persistentRefsCache) {
  52606. this._cacheMap.set(num, obj);
  52607. }
  52608. }
  52609. this._persistentRefsCache = null;
  52610. }
  52611. setStartXRef(startXRef) {
  52612. this.startXRefQueue = [startXRef];
  52613. }
  52614. parse(recoveryMode = false) {
  52615. let trailerDict;
  52616. if (!recoveryMode) {
  52617. trailerDict = this.readXRef();
  52618. } else {
  52619. warn("Indexing all PDF objects");
  52620. trailerDict = this.indexObjects();
  52621. }
  52622. trailerDict.assignXref(this);
  52623. this.trailer = trailerDict;
  52624. let encrypt;
  52625. try {
  52626. encrypt = trailerDict.get("Encrypt");
  52627. } catch (ex) {
  52628. if (ex instanceof MissingDataException) {
  52629. throw ex;
  52630. }
  52631. warn(`XRef.parse - Invalid "Encrypt" reference: "${ex}".`);
  52632. }
  52633. if (encrypt instanceof Dict) {
  52634. const ids = trailerDict.get("ID");
  52635. const fileId = ids?.length ? ids[0] : "";
  52636. encrypt.suppressEncryption = true;
  52637. this.encrypt = new CipherTransformFactory(encrypt, fileId, this.pdfManager.password);
  52638. }
  52639. let root;
  52640. try {
  52641. root = trailerDict.get("Root");
  52642. } catch (ex) {
  52643. if (ex instanceof MissingDataException) {
  52644. throw ex;
  52645. }
  52646. warn(`XRef.parse - Invalid "Root" reference: "${ex}".`);
  52647. }
  52648. if (root instanceof Dict) {
  52649. try {
  52650. const pages = root.get("Pages");
  52651. if (pages instanceof Dict) {
  52652. this.root = root;
  52653. return;
  52654. }
  52655. } catch (ex) {
  52656. if (ex instanceof MissingDataException) {
  52657. throw ex;
  52658. }
  52659. warn(`XRef.parse - Invalid "Pages" reference: "${ex}".`);
  52660. }
  52661. }
  52662. if (!recoveryMode) {
  52663. throw new XRefParseException();
  52664. }
  52665. throw new InvalidPDFException("Invalid Root reference.");
  52666. }
  52667. processXRefTable(parser) {
  52668. if (!("tableState" in this)) {
  52669. this.tableState = {
  52670. entryNum: 0,
  52671. streamPos: parser.lexer.stream.pos,
  52672. parserBuf1: parser.buf1,
  52673. parserBuf2: parser.buf2
  52674. };
  52675. }
  52676. const obj = this.readXRefTable(parser);
  52677. if (!isCmd(obj, "trailer")) {
  52678. throw new FormatError("Invalid XRef table: could not find trailer dictionary");
  52679. }
  52680. let dict = parser.getObj();
  52681. if (!(dict instanceof Dict) && dict.dict) {
  52682. dict = dict.dict;
  52683. }
  52684. if (!(dict instanceof Dict)) {
  52685. throw new FormatError("Invalid XRef table: could not parse trailer dictionary");
  52686. }
  52687. delete this.tableState;
  52688. return dict;
  52689. }
  52690. readXRefTable(parser) {
  52691. const stream = parser.lexer.stream;
  52692. const tableState = this.tableState;
  52693. stream.pos = tableState.streamPos;
  52694. parser.buf1 = tableState.parserBuf1;
  52695. parser.buf2 = tableState.parserBuf2;
  52696. let obj;
  52697. while (true) {
  52698. if (!("firstEntryNum" in tableState) || !("entryCount" in tableState)) {
  52699. if (isCmd(obj = parser.getObj(), "trailer")) {
  52700. break;
  52701. }
  52702. tableState.firstEntryNum = obj;
  52703. tableState.entryCount = parser.getObj();
  52704. }
  52705. let first = tableState.firstEntryNum;
  52706. const count = tableState.entryCount;
  52707. if (!Number.isInteger(first) || !Number.isInteger(count)) {
  52708. throw new FormatError("Invalid XRef table: wrong types in subsection header");
  52709. }
  52710. for (let i = tableState.entryNum; i < count; i++) {
  52711. tableState.streamPos = stream.pos;
  52712. tableState.entryNum = i;
  52713. tableState.parserBuf1 = parser.buf1;
  52714. tableState.parserBuf2 = parser.buf2;
  52715. const entry = {};
  52716. entry.offset = parser.getObj();
  52717. entry.gen = parser.getObj();
  52718. const type = parser.getObj();
  52719. if (type instanceof Cmd) {
  52720. switch (type.cmd) {
  52721. case "f":
  52722. entry.free = true;
  52723. break;
  52724. case "n":
  52725. entry.uncompressed = true;
  52726. break;
  52727. }
  52728. }
  52729. if (!Number.isInteger(entry.offset) || !Number.isInteger(entry.gen) || !(entry.free || entry.uncompressed)) {
  52730. throw new FormatError(`Invalid entry in XRef subsection: ${first}, ${count}`);
  52731. }
  52732. if (i === 0 && entry.free && first === 1) {
  52733. first = 0;
  52734. }
  52735. if (!this.entries[i + first]) {
  52736. this.entries[i + first] = entry;
  52737. }
  52738. }
  52739. tableState.entryNum = 0;
  52740. tableState.streamPos = stream.pos;
  52741. tableState.parserBuf1 = parser.buf1;
  52742. tableState.parserBuf2 = parser.buf2;
  52743. delete tableState.firstEntryNum;
  52744. delete tableState.entryCount;
  52745. }
  52746. if (this.entries[0] && !this.entries[0].free) {
  52747. throw new FormatError("Invalid XRef table: unexpected first object");
  52748. }
  52749. return obj;
  52750. }
  52751. processXRefStream(stream) {
  52752. if (!("streamState" in this)) {
  52753. const streamParameters = stream.dict;
  52754. const byteWidths = streamParameters.get("W");
  52755. let range = streamParameters.get("Index");
  52756. if (!range) {
  52757. range = [0, streamParameters.get("Size")];
  52758. }
  52759. this.streamState = {
  52760. entryRanges: range,
  52761. byteWidths,
  52762. entryNum: 0,
  52763. streamPos: stream.pos
  52764. };
  52765. }
  52766. this.readXRefStream(stream);
  52767. delete this.streamState;
  52768. return stream.dict;
  52769. }
  52770. readXRefStream(stream) {
  52771. const streamState = this.streamState;
  52772. stream.pos = streamState.streamPos;
  52773. const [typeFieldWidth, offsetFieldWidth, generationFieldWidth] = streamState.byteWidths;
  52774. const entryRanges = streamState.entryRanges;
  52775. while (entryRanges.length > 0) {
  52776. const [first, n] = entryRanges;
  52777. if (!Number.isInteger(first) || !Number.isInteger(n)) {
  52778. throw new FormatError(`Invalid XRef range fields: ${first}, ${n}`);
  52779. }
  52780. if (!Number.isInteger(typeFieldWidth) || !Number.isInteger(offsetFieldWidth) || !Number.isInteger(generationFieldWidth)) {
  52781. throw new FormatError(`Invalid XRef entry fields length: ${first}, ${n}`);
  52782. }
  52783. for (let i = streamState.entryNum; i < n; ++i) {
  52784. streamState.entryNum = i;
  52785. streamState.streamPos = stream.pos;
  52786. let type = 0,
  52787. offset = 0,
  52788. generation = 0;
  52789. for (let j = 0; j < typeFieldWidth; ++j) {
  52790. const typeByte = stream.getByte();
  52791. if (typeByte === -1) {
  52792. throw new FormatError("Invalid XRef byteWidths 'type'.");
  52793. }
  52794. type = type << 8 | typeByte;
  52795. }
  52796. if (typeFieldWidth === 0) {
  52797. type = 1;
  52798. }
  52799. for (let j = 0; j < offsetFieldWidth; ++j) {
  52800. const offsetByte = stream.getByte();
  52801. if (offsetByte === -1) {
  52802. throw new FormatError("Invalid XRef byteWidths 'offset'.");
  52803. }
  52804. offset = offset << 8 | offsetByte;
  52805. }
  52806. for (let j = 0; j < generationFieldWidth; ++j) {
  52807. const generationByte = stream.getByte();
  52808. if (generationByte === -1) {
  52809. throw new FormatError("Invalid XRef byteWidths 'generation'.");
  52810. }
  52811. generation = generation << 8 | generationByte;
  52812. }
  52813. const entry = {};
  52814. entry.offset = offset;
  52815. entry.gen = generation;
  52816. switch (type) {
  52817. case 0:
  52818. entry.free = true;
  52819. break;
  52820. case 1:
  52821. entry.uncompressed = true;
  52822. break;
  52823. case 2:
  52824. break;
  52825. default:
  52826. throw new FormatError(`Invalid XRef entry type: ${type}`);
  52827. }
  52828. if (!this.entries[first + i]) {
  52829. this.entries[first + i] = entry;
  52830. }
  52831. }
  52832. streamState.entryNum = 0;
  52833. streamState.streamPos = stream.pos;
  52834. entryRanges.splice(0, 2);
  52835. }
  52836. }
  52837. indexObjects() {
  52838. const TAB = 0x9,
  52839. LF = 0xa,
  52840. CR = 0xd,
  52841. SPACE = 0x20;
  52842. const PERCENT = 0x25,
  52843. LT = 0x3c;
  52844. function readToken(data, offset) {
  52845. let token = "",
  52846. ch = data[offset];
  52847. while (ch !== LF && ch !== CR && ch !== LT) {
  52848. if (++offset >= data.length) {
  52849. break;
  52850. }
  52851. token += String.fromCharCode(ch);
  52852. ch = data[offset];
  52853. }
  52854. return token;
  52855. }
  52856. function skipUntil(data, offset, what) {
  52857. const length = what.length,
  52858. dataLength = data.length;
  52859. let skipped = 0;
  52860. while (offset < dataLength) {
  52861. let i = 0;
  52862. while (i < length && data[offset + i] === what[i]) {
  52863. ++i;
  52864. }
  52865. if (i >= length) {
  52866. break;
  52867. }
  52868. offset++;
  52869. skipped++;
  52870. }
  52871. return skipped;
  52872. }
  52873. const gEndobjRegExp = /\b(endobj|\d+\s+\d+\s+obj|xref|trailer\s*<<)\b/g;
  52874. const gStartxrefRegExp = /\b(startxref|\d+\s+\d+\s+obj)\b/g;
  52875. const objRegExp = /^(\d+)\s+(\d+)\s+obj\b/;
  52876. const trailerBytes = new Uint8Array([116, 114, 97, 105, 108, 101, 114]);
  52877. const startxrefBytes = new Uint8Array([115, 116, 97, 114, 116, 120, 114, 101, 102]);
  52878. const xrefBytes = new Uint8Array([47, 88, 82, 101, 102]);
  52879. this.entries.length = 0;
  52880. this._cacheMap.clear();
  52881. const stream = this.stream;
  52882. stream.pos = 0;
  52883. const buffer = stream.getBytes(),
  52884. bufferStr = bytesToString(buffer),
  52885. length = buffer.length;
  52886. let position = stream.start;
  52887. const trailers = [],
  52888. xrefStms = [];
  52889. while (position < length) {
  52890. let ch = buffer[position];
  52891. if (ch === TAB || ch === LF || ch === CR || ch === SPACE) {
  52892. ++position;
  52893. continue;
  52894. }
  52895. if (ch === PERCENT) {
  52896. do {
  52897. ++position;
  52898. if (position >= length) {
  52899. break;
  52900. }
  52901. ch = buffer[position];
  52902. } while (ch !== LF && ch !== CR);
  52903. continue;
  52904. }
  52905. const token = readToken(buffer, position);
  52906. let m;
  52907. if (token.startsWith("xref") && (token.length === 4 || /\s/.test(token[4]))) {
  52908. position += skipUntil(buffer, position, trailerBytes);
  52909. trailers.push(position);
  52910. position += skipUntil(buffer, position, startxrefBytes);
  52911. } else if (m = objRegExp.exec(token)) {
  52912. const num = m[1] | 0,
  52913. gen = m[2] | 0;
  52914. const startPos = position + token.length;
  52915. let contentLength,
  52916. updateEntries = false;
  52917. if (!this.entries[num]) {
  52918. updateEntries = true;
  52919. } else if (this.entries[num].gen === gen) {
  52920. try {
  52921. const parser = new Parser({
  52922. lexer: new Lexer(stream.makeSubStream(startPos))
  52923. });
  52924. parser.getObj();
  52925. updateEntries = true;
  52926. } catch (ex) {
  52927. if (ex instanceof ParserEOFException) {
  52928. warn(`indexObjects -- checking object (${token}): "${ex}".`);
  52929. } else {
  52930. updateEntries = true;
  52931. }
  52932. }
  52933. }
  52934. if (updateEntries) {
  52935. this.entries[num] = {
  52936. offset: position - stream.start,
  52937. gen,
  52938. uncompressed: true
  52939. };
  52940. }
  52941. gEndobjRegExp.lastIndex = startPos;
  52942. const match = gEndobjRegExp.exec(bufferStr);
  52943. if (match) {
  52944. const endPos = gEndobjRegExp.lastIndex + 1;
  52945. contentLength = endPos - position;
  52946. if (match[1] !== "endobj") {
  52947. warn(`indexObjects: Found "${match[1]}" inside of another "obj", ` + 'caused by missing "endobj" -- trying to recover.');
  52948. contentLength -= match[1].length + 1;
  52949. }
  52950. } else {
  52951. contentLength = length - position;
  52952. }
  52953. const content = buffer.subarray(position, position + contentLength);
  52954. const xrefTagOffset = skipUntil(content, 0, xrefBytes);
  52955. if (xrefTagOffset < contentLength && content[xrefTagOffset + 5] < 64) {
  52956. xrefStms.push(position - stream.start);
  52957. this._xrefStms.add(position - stream.start);
  52958. }
  52959. position += contentLength;
  52960. } else if (token.startsWith("trailer") && (token.length === 7 || /\s/.test(token[7]))) {
  52961. trailers.push(position);
  52962. const startPos = position + token.length;
  52963. let contentLength;
  52964. gStartxrefRegExp.lastIndex = startPos;
  52965. const match = gStartxrefRegExp.exec(bufferStr);
  52966. if (match) {
  52967. const endPos = gStartxrefRegExp.lastIndex + 1;
  52968. contentLength = endPos - position;
  52969. if (match[1] !== "startxref") {
  52970. warn(`indexObjects: Found "${match[1]}" after "trailer", ` + 'caused by missing "startxref" -- trying to recover.');
  52971. contentLength -= match[1].length + 1;
  52972. }
  52973. } else {
  52974. contentLength = length - position;
  52975. }
  52976. position += contentLength;
  52977. } else {
  52978. position += token.length + 1;
  52979. }
  52980. }
  52981. for (const xrefStm of xrefStms) {
  52982. this.startXRefQueue.push(xrefStm);
  52983. this.readXRef(true);
  52984. }
  52985. const trailerDicts = [];
  52986. let isEncrypted = false;
  52987. for (const trailer of trailers) {
  52988. stream.pos = trailer;
  52989. const parser = new Parser({
  52990. lexer: new Lexer(stream),
  52991. xref: this,
  52992. allowStreams: true,
  52993. recoveryMode: true
  52994. });
  52995. const obj = parser.getObj();
  52996. if (!isCmd(obj, "trailer")) {
  52997. continue;
  52998. }
  52999. const dict = parser.getObj();
  53000. if (!(dict instanceof Dict)) {
  53001. continue;
  53002. }
  53003. trailerDicts.push(dict);
  53004. if (dict.has("Encrypt")) {
  53005. isEncrypted = true;
  53006. }
  53007. }
  53008. let trailerDict, trailerError;
  53009. for (const dict of [...trailerDicts, "genFallback", ...trailerDicts]) {
  53010. if (dict === "genFallback") {
  53011. if (!trailerError) {
  53012. break;
  53013. }
  53014. this._generationFallback = true;
  53015. continue;
  53016. }
  53017. let validPagesDict = false;
  53018. try {
  53019. const rootDict = dict.get("Root");
  53020. if (!(rootDict instanceof Dict)) {
  53021. continue;
  53022. }
  53023. const pagesDict = rootDict.get("Pages");
  53024. if (!(pagesDict instanceof Dict)) {
  53025. continue;
  53026. }
  53027. const pagesCount = pagesDict.get("Count");
  53028. if (Number.isInteger(pagesCount)) {
  53029. validPagesDict = true;
  53030. }
  53031. } catch (ex) {
  53032. trailerError = ex;
  53033. continue;
  53034. }
  53035. if (validPagesDict && (!isEncrypted || dict.has("Encrypt")) && dict.has("ID")) {
  53036. return dict;
  53037. }
  53038. trailerDict = dict;
  53039. }
  53040. if (trailerDict) {
  53041. return trailerDict;
  53042. }
  53043. if (this.topDict) {
  53044. return this.topDict;
  53045. }
  53046. throw new InvalidPDFException("Invalid PDF structure.");
  53047. }
  53048. readXRef(recoveryMode = false) {
  53049. const stream = this.stream;
  53050. const startXRefParsedCache = new Set();
  53051. while (this.startXRefQueue.length) {
  53052. try {
  53053. const startXRef = this.startXRefQueue[0];
  53054. if (startXRefParsedCache.has(startXRef)) {
  53055. warn("readXRef - skipping XRef table since it was already parsed.");
  53056. this.startXRefQueue.shift();
  53057. continue;
  53058. }
  53059. startXRefParsedCache.add(startXRef);
  53060. stream.pos = startXRef + stream.start;
  53061. const parser = new Parser({
  53062. lexer: new Lexer(stream),
  53063. xref: this,
  53064. allowStreams: true
  53065. });
  53066. let obj = parser.getObj();
  53067. let dict;
  53068. if (isCmd(obj, "xref")) {
  53069. dict = this.processXRefTable(parser);
  53070. if (!this.topDict) {
  53071. this.topDict = dict;
  53072. }
  53073. obj = dict.get("XRefStm");
  53074. if (Number.isInteger(obj) && !this._xrefStms.has(obj)) {
  53075. this._xrefStms.add(obj);
  53076. this.startXRefQueue.push(obj);
  53077. this.#firstXRefStmPos ??= obj;
  53078. }
  53079. } else if (Number.isInteger(obj)) {
  53080. if (!Number.isInteger(parser.getObj()) || !isCmd(parser.getObj(), "obj") || !((obj = parser.getObj()) instanceof BaseStream)) {
  53081. throw new FormatError("Invalid XRef stream");
  53082. }
  53083. dict = this.processXRefStream(obj);
  53084. if (!this.topDict) {
  53085. this.topDict = dict;
  53086. }
  53087. if (!dict) {
  53088. throw new FormatError("Failed to read XRef stream");
  53089. }
  53090. } else {
  53091. throw new FormatError("Invalid XRef stream header");
  53092. }
  53093. obj = dict.get("Prev");
  53094. if (Number.isInteger(obj)) {
  53095. this.startXRefQueue.push(obj);
  53096. } else if (obj instanceof Ref) {
  53097. this.startXRefQueue.push(obj.num);
  53098. }
  53099. } catch (e) {
  53100. if (e instanceof MissingDataException) {
  53101. throw e;
  53102. }
  53103. info("(while reading XRef): " + e);
  53104. }
  53105. this.startXRefQueue.shift();
  53106. }
  53107. if (this.topDict) {
  53108. return this.topDict;
  53109. }
  53110. if (recoveryMode) {
  53111. return undefined;
  53112. }
  53113. throw new XRefParseException();
  53114. }
  53115. get lastXRefStreamPos() {
  53116. return this.#firstXRefStmPos ?? (this._xrefStms.size > 0 ? Math.max(...this._xrefStms) : null);
  53117. }
  53118. getEntry(i) {
  53119. const xrefEntry = this.entries[i];
  53120. if (xrefEntry && !xrefEntry.free && xrefEntry.offset) {
  53121. return xrefEntry;
  53122. }
  53123. return null;
  53124. }
  53125. fetchIfRef(obj, suppressEncryption = false) {
  53126. if (obj instanceof Ref) {
  53127. return this.fetch(obj, suppressEncryption);
  53128. }
  53129. return obj;
  53130. }
  53131. fetch(ref, suppressEncryption = false) {
  53132. if (!(ref instanceof Ref)) {
  53133. throw new Error("ref object is not a reference");
  53134. }
  53135. const num = ref.num;
  53136. const cacheEntry = this._cacheMap.get(num);
  53137. if (cacheEntry !== undefined) {
  53138. if (cacheEntry instanceof Dict && !cacheEntry.objId) {
  53139. cacheEntry.objId = ref.toString();
  53140. }
  53141. return cacheEntry;
  53142. }
  53143. let xrefEntry = this.getEntry(num);
  53144. if (xrefEntry === null) {
  53145. this._cacheMap.set(num, xrefEntry);
  53146. return xrefEntry;
  53147. }
  53148. if (this._pendingRefs.has(ref)) {
  53149. this._pendingRefs.remove(ref);
  53150. warn(`Ignoring circular reference: ${ref}.`);
  53151. return CIRCULAR_REF;
  53152. }
  53153. this._pendingRefs.put(ref);
  53154. try {
  53155. xrefEntry = xrefEntry.uncompressed ? this.fetchUncompressed(ref, xrefEntry, suppressEncryption) : this.fetchCompressed(ref, xrefEntry, suppressEncryption);
  53156. this._pendingRefs.remove(ref);
  53157. } catch (ex) {
  53158. this._pendingRefs.remove(ref);
  53159. throw ex;
  53160. }
  53161. if (xrefEntry instanceof Dict) {
  53162. xrefEntry.objId = ref.toString();
  53163. } else if (xrefEntry instanceof BaseStream) {
  53164. xrefEntry.dict.objId = ref.toString();
  53165. }
  53166. return xrefEntry;
  53167. }
  53168. fetchUncompressed(ref, xrefEntry, suppressEncryption = false) {
  53169. const gen = ref.gen;
  53170. let num = ref.num;
  53171. if (xrefEntry.gen !== gen) {
  53172. const msg = `Inconsistent generation in XRef: ${ref}`;
  53173. if (this._generationFallback && xrefEntry.gen < gen) {
  53174. warn(msg);
  53175. return this.fetchUncompressed(Ref.get(num, xrefEntry.gen), xrefEntry, suppressEncryption);
  53176. }
  53177. throw new XRefEntryException(msg);
  53178. }
  53179. const stream = this.stream.makeSubStream(xrefEntry.offset + this.stream.start);
  53180. const parser = new Parser({
  53181. lexer: new Lexer(stream),
  53182. xref: this,
  53183. allowStreams: true
  53184. });
  53185. const obj1 = parser.getObj();
  53186. const obj2 = parser.getObj();
  53187. const obj3 = parser.getObj();
  53188. if (obj1 !== num || obj2 !== gen || !(obj3 instanceof Cmd)) {
  53189. throw new XRefEntryException(`Bad (uncompressed) XRef entry: ${ref}`);
  53190. }
  53191. if (obj3.cmd !== "obj") {
  53192. if (obj3.cmd.startsWith("obj")) {
  53193. num = parseInt(obj3.cmd.substring(3), 10);
  53194. if (!Number.isNaN(num)) {
  53195. return num;
  53196. }
  53197. }
  53198. throw new XRefEntryException(`Bad (uncompressed) XRef entry: ${ref}`);
  53199. }
  53200. xrefEntry = this.encrypt && !suppressEncryption ? parser.getObj(this.encrypt.createCipherTransform(num, gen)) : parser.getObj();
  53201. if (!(xrefEntry instanceof BaseStream)) {
  53202. this._cacheMap.set(num, xrefEntry);
  53203. }
  53204. return xrefEntry;
  53205. }
  53206. fetchCompressed(ref, xrefEntry, suppressEncryption = false) {
  53207. const tableOffset = xrefEntry.offset;
  53208. const stream = this.fetch(Ref.get(tableOffset, 0));
  53209. if (!(stream instanceof BaseStream)) {
  53210. throw new FormatError("bad ObjStm stream");
  53211. }
  53212. const first = stream.dict.get("First");
  53213. const n = stream.dict.get("N");
  53214. if (!Number.isInteger(first) || !Number.isInteger(n)) {
  53215. throw new FormatError("invalid first and n parameters for ObjStm stream");
  53216. }
  53217. let parser = new Parser({
  53218. lexer: new Lexer(stream),
  53219. xref: this,
  53220. allowStreams: true
  53221. });
  53222. const nums = new Array(n);
  53223. const offsets = new Array(n);
  53224. for (let i = 0; i < n; ++i) {
  53225. const num = parser.getObj();
  53226. if (!Number.isInteger(num)) {
  53227. throw new FormatError(`invalid object number in the ObjStm stream: ${num}`);
  53228. }
  53229. const offset = parser.getObj();
  53230. if (!Number.isInteger(offset)) {
  53231. throw new FormatError(`invalid object offset in the ObjStm stream: ${offset}`);
  53232. }
  53233. nums[i] = num;
  53234. offsets[i] = offset;
  53235. }
  53236. const start = (stream.start || 0) + first;
  53237. const entries = new Array(n);
  53238. for (let i = 0; i < n; ++i) {
  53239. const length = i < n - 1 ? offsets[i + 1] - offsets[i] : undefined;
  53240. if (length < 0) {
  53241. throw new FormatError("Invalid offset in the ObjStm stream.");
  53242. }
  53243. parser = new Parser({
  53244. lexer: new Lexer(stream.makeSubStream(start + offsets[i], length, stream.dict)),
  53245. xref: this,
  53246. allowStreams: true
  53247. });
  53248. const obj = parser.getObj();
  53249. entries[i] = obj;
  53250. if (obj instanceof BaseStream) {
  53251. continue;
  53252. }
  53253. const num = nums[i],
  53254. entry = this.entries[num];
  53255. if (entry && entry.offset === tableOffset && entry.gen === i) {
  53256. this._cacheMap.set(num, obj);
  53257. }
  53258. }
  53259. xrefEntry = entries[xrefEntry.gen];
  53260. if (xrefEntry === undefined) {
  53261. throw new XRefEntryException(`Bad (compressed) XRef entry: ${ref}`);
  53262. }
  53263. return xrefEntry;
  53264. }
  53265. async fetchIfRefAsync(obj, suppressEncryption) {
  53266. if (obj instanceof Ref) {
  53267. return this.fetchAsync(obj, suppressEncryption);
  53268. }
  53269. return obj;
  53270. }
  53271. async fetchAsync(ref, suppressEncryption) {
  53272. try {
  53273. return this.fetch(ref, suppressEncryption);
  53274. } catch (ex) {
  53275. if (!(ex instanceof MissingDataException)) {
  53276. throw ex;
  53277. }
  53278. await this.pdfManager.requestRange(ex.begin, ex.end);
  53279. return this.fetchAsync(ref, suppressEncryption);
  53280. }
  53281. }
  53282. getCatalogObj() {
  53283. return this.root;
  53284. }
  53285. }
  53286. ;// CONCATENATED MODULE: ./src/core/document.js
  53287. const DEFAULT_USER_UNIT = 1.0;
  53288. const LETTER_SIZE_MEDIABOX = [0, 0, 612, 792];
  53289. class Page {
  53290. constructor({
  53291. pdfManager,
  53292. xref,
  53293. pageIndex,
  53294. pageDict,
  53295. ref,
  53296. globalIdFactory,
  53297. fontCache,
  53298. builtInCMapCache,
  53299. standardFontDataCache,
  53300. globalImageCache,
  53301. systemFontCache,
  53302. nonBlendModesSet,
  53303. xfaFactory
  53304. }) {
  53305. this.pdfManager = pdfManager;
  53306. this.pageIndex = pageIndex;
  53307. this.pageDict = pageDict;
  53308. this.xref = xref;
  53309. this.ref = ref;
  53310. this.fontCache = fontCache;
  53311. this.builtInCMapCache = builtInCMapCache;
  53312. this.standardFontDataCache = standardFontDataCache;
  53313. this.globalImageCache = globalImageCache;
  53314. this.systemFontCache = systemFontCache;
  53315. this.nonBlendModesSet = nonBlendModesSet;
  53316. this.evaluatorOptions = pdfManager.evaluatorOptions;
  53317. this.resourcesPromise = null;
  53318. this.xfaFactory = xfaFactory;
  53319. const idCounters = {
  53320. obj: 0
  53321. };
  53322. this._localIdFactory = class extends globalIdFactory {
  53323. static createObjId() {
  53324. return `p${pageIndex}_${++idCounters.obj}`;
  53325. }
  53326. static getPageObjId() {
  53327. return `p${ref.toString()}`;
  53328. }
  53329. };
  53330. }
  53331. _getInheritableProperty(key, getArray = false) {
  53332. const value = getInheritableProperty({
  53333. dict: this.pageDict,
  53334. key,
  53335. getArray,
  53336. stopWhenFound: false
  53337. });
  53338. if (!Array.isArray(value)) {
  53339. return value;
  53340. }
  53341. if (value.length === 1 || !(value[0] instanceof Dict)) {
  53342. return value[0];
  53343. }
  53344. return Dict.merge({
  53345. xref: this.xref,
  53346. dictArray: value
  53347. });
  53348. }
  53349. get content() {
  53350. return this.pageDict.getArray("Contents");
  53351. }
  53352. get resources() {
  53353. const resources = this._getInheritableProperty("Resources");
  53354. return shadow(this, "resources", resources instanceof Dict ? resources : Dict.empty);
  53355. }
  53356. _getBoundingBox(name) {
  53357. if (this.xfaData) {
  53358. return this.xfaData.bbox;
  53359. }
  53360. const box = lookupNormalRect(this._getInheritableProperty(name, true), null);
  53361. if (box) {
  53362. if (box[2] - box[0] > 0 && box[3] - box[1] > 0) {
  53363. return box;
  53364. }
  53365. warn(`Empty, or invalid, /${name} entry.`);
  53366. }
  53367. return null;
  53368. }
  53369. get mediaBox() {
  53370. return shadow(this, "mediaBox", this._getBoundingBox("MediaBox") || LETTER_SIZE_MEDIABOX);
  53371. }
  53372. get cropBox() {
  53373. return shadow(this, "cropBox", this._getBoundingBox("CropBox") || this.mediaBox);
  53374. }
  53375. get userUnit() {
  53376. let obj = this.pageDict.get("UserUnit");
  53377. if (typeof obj !== "number" || obj <= 0) {
  53378. obj = DEFAULT_USER_UNIT;
  53379. }
  53380. return shadow(this, "userUnit", obj);
  53381. }
  53382. get view() {
  53383. const {
  53384. cropBox,
  53385. mediaBox
  53386. } = this;
  53387. if (cropBox !== mediaBox && !isArrayEqual(cropBox, mediaBox)) {
  53388. const box = Util.intersect(cropBox, mediaBox);
  53389. if (box && box[2] - box[0] > 0 && box[3] - box[1] > 0) {
  53390. return shadow(this, "view", box);
  53391. }
  53392. warn("Empty /CropBox and /MediaBox intersection.");
  53393. }
  53394. return shadow(this, "view", mediaBox);
  53395. }
  53396. get rotate() {
  53397. let rotate = this._getInheritableProperty("Rotate") || 0;
  53398. if (rotate % 90 !== 0) {
  53399. rotate = 0;
  53400. } else if (rotate >= 360) {
  53401. rotate %= 360;
  53402. } else if (rotate < 0) {
  53403. rotate = (rotate % 360 + 360) % 360;
  53404. }
  53405. return shadow(this, "rotate", rotate);
  53406. }
  53407. _onSubStreamError(reason, objId) {
  53408. if (this.evaluatorOptions.ignoreErrors) {
  53409. warn(`getContentStream - ignoring sub-stream (${objId}): "${reason}".`);
  53410. return;
  53411. }
  53412. throw reason;
  53413. }
  53414. getContentStream() {
  53415. return this.pdfManager.ensure(this, "content").then(content => {
  53416. if (content instanceof BaseStream) {
  53417. return content;
  53418. }
  53419. if (Array.isArray(content)) {
  53420. return new StreamsSequenceStream(content, this._onSubStreamError.bind(this));
  53421. }
  53422. return new NullStream();
  53423. });
  53424. }
  53425. get xfaData() {
  53426. return shadow(this, "xfaData", this.xfaFactory ? {
  53427. bbox: this.xfaFactory.getBoundingBox(this.pageIndex)
  53428. } : null);
  53429. }
  53430. #replaceIdByRef(annotations, deletedAnnotations, existingAnnotations) {
  53431. for (const annotation of annotations) {
  53432. if (annotation.id) {
  53433. const ref = Ref.fromString(annotation.id);
  53434. if (!ref) {
  53435. warn(`A non-linked annotation cannot be modified: ${annotation.id}`);
  53436. continue;
  53437. }
  53438. if (annotation.deleted) {
  53439. deletedAnnotations.put(ref, ref);
  53440. continue;
  53441. }
  53442. existingAnnotations?.put(ref);
  53443. annotation.ref = ref;
  53444. delete annotation.id;
  53445. }
  53446. }
  53447. }
  53448. async saveNewAnnotations(handler, task, annotations, imagePromises) {
  53449. if (this.xfaFactory) {
  53450. throw new Error("XFA: Cannot save new annotations.");
  53451. }
  53452. const partialEvaluator = new PartialEvaluator({
  53453. xref: this.xref,
  53454. handler,
  53455. pageIndex: this.pageIndex,
  53456. idFactory: this._localIdFactory,
  53457. fontCache: this.fontCache,
  53458. builtInCMapCache: this.builtInCMapCache,
  53459. standardFontDataCache: this.standardFontDataCache,
  53460. globalImageCache: this.globalImageCache,
  53461. systemFontCache: this.systemFontCache,
  53462. options: this.evaluatorOptions
  53463. });
  53464. const deletedAnnotations = new RefSetCache();
  53465. const existingAnnotations = new RefSet();
  53466. this.#replaceIdByRef(annotations, deletedAnnotations, existingAnnotations);
  53467. const pageDict = this.pageDict;
  53468. const annotationsArray = this.annotations.filter(a => !(a instanceof Ref && deletedAnnotations.has(a)));
  53469. const newData = await AnnotationFactory.saveNewAnnotations(partialEvaluator, task, annotations, imagePromises);
  53470. for (const {
  53471. ref
  53472. } of newData.annotations) {
  53473. if (ref instanceof Ref && !existingAnnotations.has(ref)) {
  53474. annotationsArray.push(ref);
  53475. }
  53476. }
  53477. const savedDict = pageDict.get("Annots");
  53478. pageDict.set("Annots", annotationsArray);
  53479. const buffer = [];
  53480. await writeObject(this.ref, pageDict, buffer, this.xref);
  53481. if (savedDict) {
  53482. pageDict.set("Annots", savedDict);
  53483. }
  53484. const objects = newData.dependencies;
  53485. objects.push({
  53486. ref: this.ref,
  53487. data: buffer.join("")
  53488. }, ...newData.annotations);
  53489. for (const deletedRef of deletedAnnotations) {
  53490. objects.push({
  53491. ref: deletedRef,
  53492. data: null
  53493. });
  53494. }
  53495. return objects;
  53496. }
  53497. save(handler, task, annotationStorage) {
  53498. const partialEvaluator = new PartialEvaluator({
  53499. xref: this.xref,
  53500. handler,
  53501. pageIndex: this.pageIndex,
  53502. idFactory: this._localIdFactory,
  53503. fontCache: this.fontCache,
  53504. builtInCMapCache: this.builtInCMapCache,
  53505. standardFontDataCache: this.standardFontDataCache,
  53506. globalImageCache: this.globalImageCache,
  53507. systemFontCache: this.systemFontCache,
  53508. options: this.evaluatorOptions
  53509. });
  53510. return this._parsedAnnotations.then(function (annotations) {
  53511. const newRefsPromises = [];
  53512. for (const annotation of annotations) {
  53513. if (!annotation.mustBePrinted(annotationStorage)) {
  53514. continue;
  53515. }
  53516. newRefsPromises.push(annotation.save(partialEvaluator, task, annotationStorage).catch(function (reason) {
  53517. warn("save - ignoring annotation data during " + `"${task.name}" task: "${reason}".`);
  53518. return null;
  53519. }));
  53520. }
  53521. return Promise.all(newRefsPromises).then(function (newRefs) {
  53522. return newRefs.filter(newRef => !!newRef);
  53523. });
  53524. });
  53525. }
  53526. loadResources(keys) {
  53527. this.resourcesPromise ||= this.pdfManager.ensure(this, "resources");
  53528. return this.resourcesPromise.then(() => {
  53529. const objectLoader = new ObjectLoader(this.resources, keys, this.xref);
  53530. return objectLoader.load();
  53531. });
  53532. }
  53533. getOperatorList({
  53534. handler,
  53535. sink,
  53536. task,
  53537. intent,
  53538. cacheKey,
  53539. annotationStorage = null,
  53540. modifiedIds = null
  53541. }) {
  53542. const contentStreamPromise = this.getContentStream();
  53543. const resourcesPromise = this.loadResources(["ColorSpace", "ExtGState", "Font", "Pattern", "Properties", "Shading", "XObject"]);
  53544. const partialEvaluator = new PartialEvaluator({
  53545. xref: this.xref,
  53546. handler,
  53547. pageIndex: this.pageIndex,
  53548. idFactory: this._localIdFactory,
  53549. fontCache: this.fontCache,
  53550. builtInCMapCache: this.builtInCMapCache,
  53551. standardFontDataCache: this.standardFontDataCache,
  53552. globalImageCache: this.globalImageCache,
  53553. systemFontCache: this.systemFontCache,
  53554. options: this.evaluatorOptions
  53555. });
  53556. const newAnnotsByPage = !this.xfaFactory ? getNewAnnotationsMap(annotationStorage) : null;
  53557. const newAnnots = newAnnotsByPage?.get(this.pageIndex);
  53558. let newAnnotationsPromise = Promise.resolve(null);
  53559. let deletedAnnotations = null;
  53560. if (newAnnots) {
  53561. const annotationGlobalsPromise = this.pdfManager.ensureDoc("annotationGlobals");
  53562. let imagePromises;
  53563. const missingBitmaps = new Set();
  53564. for (const {
  53565. bitmapId,
  53566. bitmap
  53567. } of newAnnots) {
  53568. if (bitmapId && !bitmap && !missingBitmaps.has(bitmapId)) {
  53569. missingBitmaps.add(bitmapId);
  53570. }
  53571. }
  53572. const {
  53573. isOffscreenCanvasSupported
  53574. } = this.evaluatorOptions;
  53575. if (missingBitmaps.size > 0) {
  53576. const annotationWithBitmaps = newAnnots.slice();
  53577. for (const [key, annotation] of annotationStorage) {
  53578. if (!key.startsWith(AnnotationEditorPrefix)) {
  53579. continue;
  53580. }
  53581. if (annotation.bitmap && missingBitmaps.has(annotation.bitmapId)) {
  53582. annotationWithBitmaps.push(annotation);
  53583. }
  53584. }
  53585. imagePromises = AnnotationFactory.generateImages(annotationWithBitmaps, this.xref, isOffscreenCanvasSupported);
  53586. } else {
  53587. imagePromises = AnnotationFactory.generateImages(newAnnots, this.xref, isOffscreenCanvasSupported);
  53588. }
  53589. deletedAnnotations = new RefSet();
  53590. this.#replaceIdByRef(newAnnots, deletedAnnotations, null);
  53591. newAnnotationsPromise = annotationGlobalsPromise.then(annotationGlobals => {
  53592. if (!annotationGlobals) {
  53593. return null;
  53594. }
  53595. return AnnotationFactory.printNewAnnotations(annotationGlobals, partialEvaluator, task, newAnnots, imagePromises);
  53596. });
  53597. }
  53598. const pageListPromise = Promise.all([contentStreamPromise, resourcesPromise]).then(([contentStream]) => {
  53599. const opList = new OperatorList(intent, sink);
  53600. handler.send("StartRenderPage", {
  53601. transparency: partialEvaluator.hasBlendModes(this.resources, this.nonBlendModesSet),
  53602. pageIndex: this.pageIndex,
  53603. cacheKey
  53604. });
  53605. return partialEvaluator.getOperatorList({
  53606. stream: contentStream,
  53607. task,
  53608. resources: this.resources,
  53609. operatorList: opList
  53610. }).then(function () {
  53611. return opList;
  53612. });
  53613. });
  53614. return Promise.all([pageListPromise, this._parsedAnnotations, newAnnotationsPromise]).then(function ([pageOpList, annotations, newAnnotations]) {
  53615. if (newAnnotations) {
  53616. annotations = annotations.filter(a => !(a.ref && deletedAnnotations.has(a.ref)));
  53617. for (let i = 0, ii = newAnnotations.length; i < ii; i++) {
  53618. const newAnnotation = newAnnotations[i];
  53619. if (newAnnotation.refToReplace) {
  53620. const j = annotations.findIndex(a => a.ref && isRefsEqual(a.ref, newAnnotation.refToReplace));
  53621. if (j >= 0) {
  53622. annotations.splice(j, 1, newAnnotation);
  53623. newAnnotations.splice(i--, 1);
  53624. ii--;
  53625. }
  53626. }
  53627. }
  53628. annotations = annotations.concat(newAnnotations);
  53629. }
  53630. if (annotations.length === 0 || intent & RenderingIntentFlag.ANNOTATIONS_DISABLE) {
  53631. pageOpList.flush(true);
  53632. return {
  53633. length: pageOpList.totalLength
  53634. };
  53635. }
  53636. const renderForms = !!(intent & RenderingIntentFlag.ANNOTATIONS_FORMS),
  53637. isEditing = !!(intent & RenderingIntentFlag.IS_EDITING),
  53638. intentAny = !!(intent & RenderingIntentFlag.ANY),
  53639. intentDisplay = !!(intent & RenderingIntentFlag.DISPLAY),
  53640. intentPrint = !!(intent & RenderingIntentFlag.PRINT);
  53641. const opListPromises = [];
  53642. for (const annotation of annotations) {
  53643. if (intentAny || intentDisplay && annotation.mustBeViewed(annotationStorage, renderForms) && annotation.mustBeViewedWhenEditing(isEditing, modifiedIds) || intentPrint && annotation.mustBePrinted(annotationStorage)) {
  53644. opListPromises.push(annotation.getOperatorList(partialEvaluator, task, intent, annotationStorage).catch(function (reason) {
  53645. warn("getOperatorList - ignoring annotation data during " + `"${task.name}" task: "${reason}".`);
  53646. return {
  53647. opList: null,
  53648. separateForm: false,
  53649. separateCanvas: false
  53650. };
  53651. }));
  53652. }
  53653. }
  53654. return Promise.all(opListPromises).then(function (opLists) {
  53655. let form = false,
  53656. canvas = false;
  53657. for (const {
  53658. opList,
  53659. separateForm,
  53660. separateCanvas
  53661. } of opLists) {
  53662. pageOpList.addOpList(opList);
  53663. form ||= separateForm;
  53664. canvas ||= separateCanvas;
  53665. }
  53666. pageOpList.flush(true, {
  53667. form,
  53668. canvas
  53669. });
  53670. return {
  53671. length: pageOpList.totalLength
  53672. };
  53673. });
  53674. });
  53675. }
  53676. async extractTextContent({
  53677. handler,
  53678. task,
  53679. includeMarkedContent,
  53680. disableNormalization,
  53681. sink
  53682. }) {
  53683. const contentStreamPromise = this.getContentStream();
  53684. const resourcesPromise = this.loadResources(["ExtGState", "Font", "Properties", "XObject"]);
  53685. const langPromise = this.pdfManager.ensureCatalog("lang");
  53686. const [contentStream,, lang] = await Promise.all([contentStreamPromise, resourcesPromise, langPromise]);
  53687. const partialEvaluator = new PartialEvaluator({
  53688. xref: this.xref,
  53689. handler,
  53690. pageIndex: this.pageIndex,
  53691. idFactory: this._localIdFactory,
  53692. fontCache: this.fontCache,
  53693. builtInCMapCache: this.builtInCMapCache,
  53694. standardFontDataCache: this.standardFontDataCache,
  53695. globalImageCache: this.globalImageCache,
  53696. systemFontCache: this.systemFontCache,
  53697. options: this.evaluatorOptions
  53698. });
  53699. return partialEvaluator.getTextContent({
  53700. stream: contentStream,
  53701. task,
  53702. resources: this.resources,
  53703. includeMarkedContent,
  53704. disableNormalization,
  53705. sink,
  53706. viewBox: this.view,
  53707. lang
  53708. });
  53709. }
  53710. async getStructTree() {
  53711. const structTreeRoot = await this.pdfManager.ensureCatalog("structTreeRoot");
  53712. if (!structTreeRoot) {
  53713. return null;
  53714. }
  53715. await this._parsedAnnotations;
  53716. const structTree = await this.pdfManager.ensure(this, "_parseStructTree", [structTreeRoot]);
  53717. return structTree.serializable;
  53718. }
  53719. _parseStructTree(structTreeRoot) {
  53720. const tree = new StructTreePage(structTreeRoot, this.pageDict);
  53721. tree.parse(this.ref);
  53722. return tree;
  53723. }
  53724. async getAnnotationsData(handler, task, intent) {
  53725. const annotations = await this._parsedAnnotations;
  53726. if (annotations.length === 0) {
  53727. return annotations;
  53728. }
  53729. const annotationsData = [],
  53730. textContentPromises = [];
  53731. let partialEvaluator;
  53732. const intentAny = !!(intent & RenderingIntentFlag.ANY),
  53733. intentDisplay = !!(intent & RenderingIntentFlag.DISPLAY),
  53734. intentPrint = !!(intent & RenderingIntentFlag.PRINT);
  53735. for (const annotation of annotations) {
  53736. const isVisible = intentAny || intentDisplay && annotation.viewable;
  53737. if (isVisible || intentPrint && annotation.printable) {
  53738. annotationsData.push(annotation.data);
  53739. }
  53740. if (annotation.hasTextContent && isVisible) {
  53741. partialEvaluator ||= new PartialEvaluator({
  53742. xref: this.xref,
  53743. handler,
  53744. pageIndex: this.pageIndex,
  53745. idFactory: this._localIdFactory,
  53746. fontCache: this.fontCache,
  53747. builtInCMapCache: this.builtInCMapCache,
  53748. standardFontDataCache: this.standardFontDataCache,
  53749. globalImageCache: this.globalImageCache,
  53750. systemFontCache: this.systemFontCache,
  53751. options: this.evaluatorOptions
  53752. });
  53753. textContentPromises.push(annotation.extractTextContent(partialEvaluator, task, [-Infinity, -Infinity, Infinity, Infinity]).catch(function (reason) {
  53754. warn(`getAnnotationsData - ignoring textContent during "${task.name}" task: "${reason}".`);
  53755. }));
  53756. }
  53757. }
  53758. await Promise.all(textContentPromises);
  53759. return annotationsData;
  53760. }
  53761. get annotations() {
  53762. const annots = this._getInheritableProperty("Annots");
  53763. return shadow(this, "annotations", Array.isArray(annots) ? annots : []);
  53764. }
  53765. get _parsedAnnotations() {
  53766. const promise = this.pdfManager.ensure(this, "annotations").then(async annots => {
  53767. if (annots.length === 0) {
  53768. return annots;
  53769. }
  53770. const annotationGlobals = await this.pdfManager.ensureDoc("annotationGlobals");
  53771. if (!annotationGlobals) {
  53772. return [];
  53773. }
  53774. const annotationPromises = [];
  53775. for (const annotationRef of annots) {
  53776. annotationPromises.push(AnnotationFactory.create(this.xref, annotationRef, annotationGlobals, this._localIdFactory, false, this.ref).catch(function (reason) {
  53777. warn(`_parsedAnnotations: "${reason}".`);
  53778. return null;
  53779. }));
  53780. }
  53781. const sortedAnnotations = [];
  53782. let popupAnnotations, widgetAnnotations;
  53783. for (const annotation of await Promise.all(annotationPromises)) {
  53784. if (!annotation) {
  53785. continue;
  53786. }
  53787. if (annotation instanceof WidgetAnnotation) {
  53788. (widgetAnnotations ||= []).push(annotation);
  53789. continue;
  53790. }
  53791. if (annotation instanceof PopupAnnotation) {
  53792. (popupAnnotations ||= []).push(annotation);
  53793. continue;
  53794. }
  53795. sortedAnnotations.push(annotation);
  53796. }
  53797. if (widgetAnnotations) {
  53798. sortedAnnotations.push(...widgetAnnotations);
  53799. }
  53800. if (popupAnnotations) {
  53801. sortedAnnotations.push(...popupAnnotations);
  53802. }
  53803. return sortedAnnotations;
  53804. });
  53805. return shadow(this, "_parsedAnnotations", promise);
  53806. }
  53807. get jsActions() {
  53808. const actions = collectActions(this.xref, this.pageDict, PageActionEventType);
  53809. return shadow(this, "jsActions", actions);
  53810. }
  53811. }
  53812. const PDF_HEADER_SIGNATURE = new Uint8Array([0x25, 0x50, 0x44, 0x46, 0x2d]);
  53813. const STARTXREF_SIGNATURE = new Uint8Array([0x73, 0x74, 0x61, 0x72, 0x74, 0x78, 0x72, 0x65, 0x66]);
  53814. const ENDOBJ_SIGNATURE = new Uint8Array([0x65, 0x6e, 0x64, 0x6f, 0x62, 0x6a]);
  53815. const FINGERPRINT_FIRST_BYTES = 1024;
  53816. const EMPTY_FINGERPRINT = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00";
  53817. function find(stream, signature, limit = 1024, backwards = false) {
  53818. const signatureLength = signature.length;
  53819. const scanBytes = stream.peekBytes(limit);
  53820. const scanLength = scanBytes.length - signatureLength;
  53821. if (scanLength <= 0) {
  53822. return false;
  53823. }
  53824. if (backwards) {
  53825. const signatureEnd = signatureLength - 1;
  53826. let pos = scanBytes.length - 1;
  53827. while (pos >= signatureEnd) {
  53828. let j = 0;
  53829. while (j < signatureLength && scanBytes[pos - j] === signature[signatureEnd - j]) {
  53830. j++;
  53831. }
  53832. if (j >= signatureLength) {
  53833. stream.pos += pos - signatureEnd;
  53834. return true;
  53835. }
  53836. pos--;
  53837. }
  53838. } else {
  53839. let pos = 0;
  53840. while (pos <= scanLength) {
  53841. let j = 0;
  53842. while (j < signatureLength && scanBytes[pos + j] === signature[j]) {
  53843. j++;
  53844. }
  53845. if (j >= signatureLength) {
  53846. stream.pos += pos;
  53847. return true;
  53848. }
  53849. pos++;
  53850. }
  53851. }
  53852. return false;
  53853. }
  53854. class PDFDocument {
  53855. constructor(pdfManager, stream) {
  53856. if (stream.length <= 0) {
  53857. throw new InvalidPDFException("The PDF file is empty, i.e. its size is zero bytes.");
  53858. }
  53859. this.pdfManager = pdfManager;
  53860. this.stream = stream;
  53861. this.xref = new XRef(stream, pdfManager);
  53862. this._pagePromises = new Map();
  53863. this._version = null;
  53864. const idCounters = {
  53865. font: 0
  53866. };
  53867. this._globalIdFactory = class {
  53868. static getDocId() {
  53869. return `g_${pdfManager.docId}`;
  53870. }
  53871. static createFontId() {
  53872. return `f${++idCounters.font}`;
  53873. }
  53874. static createObjId() {
  53875. unreachable("Abstract method `createObjId` called.");
  53876. }
  53877. static getPageObjId() {
  53878. unreachable("Abstract method `getPageObjId` called.");
  53879. }
  53880. };
  53881. }
  53882. parse(recoveryMode) {
  53883. this.xref.parse(recoveryMode);
  53884. this.catalog = new Catalog(this.pdfManager, this.xref);
  53885. }
  53886. get linearization() {
  53887. let linearization = null;
  53888. try {
  53889. linearization = Linearization.create(this.stream);
  53890. } catch (err) {
  53891. if (err instanceof MissingDataException) {
  53892. throw err;
  53893. }
  53894. info(err);
  53895. }
  53896. return shadow(this, "linearization", linearization);
  53897. }
  53898. get startXRef() {
  53899. const stream = this.stream;
  53900. let startXRef = 0;
  53901. if (this.linearization) {
  53902. stream.reset();
  53903. if (find(stream, ENDOBJ_SIGNATURE)) {
  53904. stream.skip(6);
  53905. let ch = stream.peekByte();
  53906. while (isWhiteSpace(ch)) {
  53907. stream.pos++;
  53908. ch = stream.peekByte();
  53909. }
  53910. startXRef = stream.pos - stream.start;
  53911. }
  53912. } else {
  53913. const step = 1024;
  53914. const startXRefLength = STARTXREF_SIGNATURE.length;
  53915. let found = false,
  53916. pos = stream.end;
  53917. while (!found && pos > 0) {
  53918. pos -= step - startXRefLength;
  53919. if (pos < 0) {
  53920. pos = 0;
  53921. }
  53922. stream.pos = pos;
  53923. found = find(stream, STARTXREF_SIGNATURE, step, true);
  53924. }
  53925. if (found) {
  53926. stream.skip(9);
  53927. let ch;
  53928. do {
  53929. ch = stream.getByte();
  53930. } while (isWhiteSpace(ch));
  53931. let str = "";
  53932. while (ch >= 0x20 && ch <= 0x39) {
  53933. str += String.fromCharCode(ch);
  53934. ch = stream.getByte();
  53935. }
  53936. startXRef = parseInt(str, 10);
  53937. if (isNaN(startXRef)) {
  53938. startXRef = 0;
  53939. }
  53940. }
  53941. }
  53942. return shadow(this, "startXRef", startXRef);
  53943. }
  53944. checkHeader() {
  53945. const stream = this.stream;
  53946. stream.reset();
  53947. if (!find(stream, PDF_HEADER_SIGNATURE)) {
  53948. return;
  53949. }
  53950. stream.moveStart();
  53951. stream.skip(PDF_HEADER_SIGNATURE.length);
  53952. let version = "",
  53953. ch;
  53954. while ((ch = stream.getByte()) > 0x20 && version.length < 7) {
  53955. version += String.fromCharCode(ch);
  53956. }
  53957. if (PDF_VERSION_REGEXP.test(version)) {
  53958. this._version = version;
  53959. } else {
  53960. warn(`Invalid PDF header version: ${version}`);
  53961. }
  53962. }
  53963. parseStartXRef() {
  53964. this.xref.setStartXRef(this.startXRef);
  53965. }
  53966. get numPages() {
  53967. let num = 0;
  53968. if (this.catalog.hasActualNumPages) {
  53969. num = this.catalog.numPages;
  53970. } else if (this.xfaFactory) {
  53971. num = this.xfaFactory.getNumPages();
  53972. } else if (this.linearization) {
  53973. num = this.linearization.numPages;
  53974. } else {
  53975. num = this.catalog.numPages;
  53976. }
  53977. return shadow(this, "numPages", num);
  53978. }
  53979. _hasOnlyDocumentSignatures(fields, recursionDepth = 0) {
  53980. const RECURSION_LIMIT = 10;
  53981. if (!Array.isArray(fields)) {
  53982. return false;
  53983. }
  53984. return fields.every(field => {
  53985. field = this.xref.fetchIfRef(field);
  53986. if (!(field instanceof Dict)) {
  53987. return false;
  53988. }
  53989. if (field.has("Kids")) {
  53990. if (++recursionDepth > RECURSION_LIMIT) {
  53991. warn("_hasOnlyDocumentSignatures: maximum recursion depth reached");
  53992. return false;
  53993. }
  53994. return this._hasOnlyDocumentSignatures(field.get("Kids"), recursionDepth);
  53995. }
  53996. const isSignature = isName(field.get("FT"), "Sig");
  53997. const rectangle = field.get("Rect");
  53998. const isInvisible = Array.isArray(rectangle) && rectangle.every(value => value === 0);
  53999. return isSignature && isInvisible;
  54000. });
  54001. }
  54002. get _xfaStreams() {
  54003. const acroForm = this.catalog.acroForm;
  54004. if (!acroForm) {
  54005. return null;
  54006. }
  54007. const xfa = acroForm.get("XFA");
  54008. const entries = {
  54009. "xdp:xdp": "",
  54010. template: "",
  54011. datasets: "",
  54012. config: "",
  54013. connectionSet: "",
  54014. localeSet: "",
  54015. stylesheet: "",
  54016. "/xdp:xdp": ""
  54017. };
  54018. if (xfa instanceof BaseStream && !xfa.isEmpty) {
  54019. entries["xdp:xdp"] = xfa;
  54020. return entries;
  54021. }
  54022. if (!Array.isArray(xfa) || xfa.length === 0) {
  54023. return null;
  54024. }
  54025. for (let i = 0, ii = xfa.length; i < ii; i += 2) {
  54026. let name;
  54027. if (i === 0) {
  54028. name = "xdp:xdp";
  54029. } else if (i === ii - 2) {
  54030. name = "/xdp:xdp";
  54031. } else {
  54032. name = xfa[i];
  54033. }
  54034. if (!entries.hasOwnProperty(name)) {
  54035. continue;
  54036. }
  54037. const data = this.xref.fetchIfRef(xfa[i + 1]);
  54038. if (!(data instanceof BaseStream) || data.isEmpty) {
  54039. continue;
  54040. }
  54041. entries[name] = data;
  54042. }
  54043. return entries;
  54044. }
  54045. get xfaDatasets() {
  54046. const streams = this._xfaStreams;
  54047. if (!streams) {
  54048. return shadow(this, "xfaDatasets", null);
  54049. }
  54050. for (const key of ["datasets", "xdp:xdp"]) {
  54051. const stream = streams[key];
  54052. if (!stream) {
  54053. continue;
  54054. }
  54055. try {
  54056. const str = stringToUTF8String(stream.getString());
  54057. const data = {
  54058. [key]: str
  54059. };
  54060. return shadow(this, "xfaDatasets", new DatasetReader(data));
  54061. } catch {
  54062. warn("XFA - Invalid utf-8 string.");
  54063. break;
  54064. }
  54065. }
  54066. return shadow(this, "xfaDatasets", null);
  54067. }
  54068. get xfaData() {
  54069. const streams = this._xfaStreams;
  54070. if (!streams) {
  54071. return null;
  54072. }
  54073. const data = Object.create(null);
  54074. for (const [key, stream] of Object.entries(streams)) {
  54075. if (!stream) {
  54076. continue;
  54077. }
  54078. try {
  54079. data[key] = stringToUTF8String(stream.getString());
  54080. } catch {
  54081. warn("XFA - Invalid utf-8 string.");
  54082. return null;
  54083. }
  54084. }
  54085. return data;
  54086. }
  54087. get xfaFactory() {
  54088. let data;
  54089. if (this.pdfManager.enableXfa && this.catalog.needsRendering && this.formInfo.hasXfa && !this.formInfo.hasAcroForm) {
  54090. data = this.xfaData;
  54091. }
  54092. return shadow(this, "xfaFactory", data ? new XFAFactory(data) : null);
  54093. }
  54094. get isPureXfa() {
  54095. return this.xfaFactory ? this.xfaFactory.isValid() : false;
  54096. }
  54097. get htmlForXfa() {
  54098. return this.xfaFactory ? this.xfaFactory.getPages() : null;
  54099. }
  54100. async loadXfaImages() {
  54101. const xfaImagesDict = await this.pdfManager.ensureCatalog("xfaImages");
  54102. if (!xfaImagesDict) {
  54103. return;
  54104. }
  54105. const keys = xfaImagesDict.getKeys();
  54106. const objectLoader = new ObjectLoader(xfaImagesDict, keys, this.xref);
  54107. await objectLoader.load();
  54108. const xfaImages = new Map();
  54109. for (const key of keys) {
  54110. const stream = xfaImagesDict.get(key);
  54111. if (stream instanceof BaseStream) {
  54112. xfaImages.set(key, stream.getBytes());
  54113. }
  54114. }
  54115. this.xfaFactory.setImages(xfaImages);
  54116. }
  54117. async loadXfaFonts(handler, task) {
  54118. const acroForm = await this.pdfManager.ensureCatalog("acroForm");
  54119. if (!acroForm) {
  54120. return;
  54121. }
  54122. const resources = await acroForm.getAsync("DR");
  54123. if (!(resources instanceof Dict)) {
  54124. return;
  54125. }
  54126. const objectLoader = new ObjectLoader(resources, ["Font"], this.xref);
  54127. await objectLoader.load();
  54128. const fontRes = resources.get("Font");
  54129. if (!(fontRes instanceof Dict)) {
  54130. return;
  54131. }
  54132. const options = Object.assign(Object.create(null), this.pdfManager.evaluatorOptions);
  54133. options.useSystemFonts = false;
  54134. const partialEvaluator = new PartialEvaluator({
  54135. xref: this.xref,
  54136. handler,
  54137. pageIndex: -1,
  54138. idFactory: this._globalIdFactory,
  54139. fontCache: this.catalog.fontCache,
  54140. builtInCMapCache: this.catalog.builtInCMapCache,
  54141. standardFontDataCache: this.catalog.standardFontDataCache,
  54142. options
  54143. });
  54144. const operatorList = new OperatorList();
  54145. const pdfFonts = [];
  54146. const initialState = {
  54147. get font() {
  54148. return pdfFonts.at(-1);
  54149. },
  54150. set font(font) {
  54151. pdfFonts.push(font);
  54152. },
  54153. clone() {
  54154. return this;
  54155. }
  54156. };
  54157. const fonts = new Map();
  54158. fontRes.forEach((fontName, font) => {
  54159. fonts.set(fontName, font);
  54160. });
  54161. const promises = [];
  54162. for (const [fontName, font] of fonts) {
  54163. const descriptor = font.get("FontDescriptor");
  54164. if (!(descriptor instanceof Dict)) {
  54165. continue;
  54166. }
  54167. let fontFamily = descriptor.get("FontFamily");
  54168. fontFamily = fontFamily.replaceAll(/[ ]+(\d)/g, "$1");
  54169. const fontWeight = descriptor.get("FontWeight");
  54170. const italicAngle = -descriptor.get("ItalicAngle");
  54171. const cssFontInfo = {
  54172. fontFamily,
  54173. fontWeight,
  54174. italicAngle
  54175. };
  54176. if (!validateCSSFont(cssFontInfo)) {
  54177. continue;
  54178. }
  54179. promises.push(partialEvaluator.handleSetFont(resources, [Name.get(fontName), 1], null, operatorList, task, initialState, null, cssFontInfo).catch(function (reason) {
  54180. warn(`loadXfaFonts: "${reason}".`);
  54181. return null;
  54182. }));
  54183. }
  54184. await Promise.all(promises);
  54185. const missingFonts = this.xfaFactory.setFonts(pdfFonts);
  54186. if (!missingFonts) {
  54187. return;
  54188. }
  54189. options.ignoreErrors = true;
  54190. promises.length = 0;
  54191. pdfFonts.length = 0;
  54192. const reallyMissingFonts = new Set();
  54193. for (const missing of missingFonts) {
  54194. if (!getXfaFontName(`${missing}-Regular`)) {
  54195. reallyMissingFonts.add(missing);
  54196. }
  54197. }
  54198. if (reallyMissingFonts.size) {
  54199. missingFonts.push("PdfJS-Fallback");
  54200. }
  54201. for (const missing of missingFonts) {
  54202. if (reallyMissingFonts.has(missing)) {
  54203. continue;
  54204. }
  54205. for (const fontInfo of [{
  54206. name: "Regular",
  54207. fontWeight: 400,
  54208. italicAngle: 0
  54209. }, {
  54210. name: "Bold",
  54211. fontWeight: 700,
  54212. italicAngle: 0
  54213. }, {
  54214. name: "Italic",
  54215. fontWeight: 400,
  54216. italicAngle: 12
  54217. }, {
  54218. name: "BoldItalic",
  54219. fontWeight: 700,
  54220. italicAngle: 12
  54221. }]) {
  54222. const name = `${missing}-${fontInfo.name}`;
  54223. const dict = getXfaFontDict(name);
  54224. promises.push(partialEvaluator.handleSetFont(resources, [Name.get(name), 1], null, operatorList, task, initialState, dict, {
  54225. fontFamily: missing,
  54226. fontWeight: fontInfo.fontWeight,
  54227. italicAngle: fontInfo.italicAngle
  54228. }).catch(function (reason) {
  54229. warn(`loadXfaFonts: "${reason}".`);
  54230. return null;
  54231. }));
  54232. }
  54233. }
  54234. await Promise.all(promises);
  54235. this.xfaFactory.appendFonts(pdfFonts, reallyMissingFonts);
  54236. }
  54237. async serializeXfaData(annotationStorage) {
  54238. return this.xfaFactory ? this.xfaFactory.serializeData(annotationStorage) : null;
  54239. }
  54240. get version() {
  54241. return this.catalog.version || this._version;
  54242. }
  54243. get formInfo() {
  54244. const formInfo = {
  54245. hasFields: false,
  54246. hasAcroForm: false,
  54247. hasXfa: false,
  54248. hasSignatures: false
  54249. };
  54250. const acroForm = this.catalog.acroForm;
  54251. if (!acroForm) {
  54252. return shadow(this, "formInfo", formInfo);
  54253. }
  54254. try {
  54255. const fields = acroForm.get("Fields");
  54256. const hasFields = Array.isArray(fields) && fields.length > 0;
  54257. formInfo.hasFields = hasFields;
  54258. const xfa = acroForm.get("XFA");
  54259. formInfo.hasXfa = Array.isArray(xfa) && xfa.length > 0 || xfa instanceof BaseStream && !xfa.isEmpty;
  54260. const sigFlags = acroForm.get("SigFlags");
  54261. const hasSignatures = !!(sigFlags & 0x1);
  54262. const hasOnlyDocumentSignatures = hasSignatures && this._hasOnlyDocumentSignatures(fields);
  54263. formInfo.hasAcroForm = hasFields && !hasOnlyDocumentSignatures;
  54264. formInfo.hasSignatures = hasSignatures;
  54265. } catch (ex) {
  54266. if (ex instanceof MissingDataException) {
  54267. throw ex;
  54268. }
  54269. warn(`Cannot fetch form information: "${ex}".`);
  54270. }
  54271. return shadow(this, "formInfo", formInfo);
  54272. }
  54273. get documentInfo() {
  54274. const docInfo = {
  54275. PDFFormatVersion: this.version,
  54276. Language: this.catalog.lang,
  54277. EncryptFilterName: this.xref.encrypt ? this.xref.encrypt.filterName : null,
  54278. IsLinearized: !!this.linearization,
  54279. IsAcroFormPresent: this.formInfo.hasAcroForm,
  54280. IsXFAPresent: this.formInfo.hasXfa,
  54281. IsCollectionPresent: !!this.catalog.collection,
  54282. IsSignaturesPresent: this.formInfo.hasSignatures
  54283. };
  54284. let infoDict;
  54285. try {
  54286. infoDict = this.xref.trailer.get("Info");
  54287. } catch (err) {
  54288. if (err instanceof MissingDataException) {
  54289. throw err;
  54290. }
  54291. info("The document information dictionary is invalid.");
  54292. }
  54293. if (!(infoDict instanceof Dict)) {
  54294. return shadow(this, "documentInfo", docInfo);
  54295. }
  54296. for (const key of infoDict.getKeys()) {
  54297. const value = infoDict.get(key);
  54298. switch (key) {
  54299. case "Title":
  54300. case "Author":
  54301. case "Subject":
  54302. case "Keywords":
  54303. case "Creator":
  54304. case "Producer":
  54305. case "CreationDate":
  54306. case "ModDate":
  54307. if (typeof value === "string") {
  54308. docInfo[key] = stringToPDFString(value);
  54309. continue;
  54310. }
  54311. break;
  54312. case "Trapped":
  54313. if (value instanceof Name) {
  54314. docInfo[key] = value;
  54315. continue;
  54316. }
  54317. break;
  54318. default:
  54319. let customValue;
  54320. switch (typeof value) {
  54321. case "string":
  54322. customValue = stringToPDFString(value);
  54323. break;
  54324. case "number":
  54325. case "boolean":
  54326. customValue = value;
  54327. break;
  54328. default:
  54329. if (value instanceof Name) {
  54330. customValue = value;
  54331. }
  54332. break;
  54333. }
  54334. if (customValue === undefined) {
  54335. warn(`Bad value, for custom key "${key}", in Info: ${value}.`);
  54336. continue;
  54337. }
  54338. if (!docInfo.Custom) {
  54339. docInfo.Custom = Object.create(null);
  54340. }
  54341. docInfo.Custom[key] = customValue;
  54342. continue;
  54343. }
  54344. warn(`Bad value, for key "${key}", in Info: ${value}.`);
  54345. }
  54346. return shadow(this, "documentInfo", docInfo);
  54347. }
  54348. get fingerprints() {
  54349. function validate(data) {
  54350. return typeof data === "string" && data.length > 0 && data !== EMPTY_FINGERPRINT;
  54351. }
  54352. function hexString(hash) {
  54353. const buf = [];
  54354. for (const num of hash) {
  54355. const hex = num.toString(16);
  54356. buf.push(hex.padStart(2, "0"));
  54357. }
  54358. return buf.join("");
  54359. }
  54360. const idArray = this.xref.trailer.get("ID");
  54361. let hashOriginal, hashModified;
  54362. if (Array.isArray(idArray) && validate(idArray[0])) {
  54363. hashOriginal = stringToBytes(idArray[0]);
  54364. if (idArray[1] !== idArray[0] && validate(idArray[1])) {
  54365. hashModified = stringToBytes(idArray[1]);
  54366. }
  54367. } else {
  54368. hashOriginal = calculateMD5(this.stream.getByteRange(0, FINGERPRINT_FIRST_BYTES), 0, FINGERPRINT_FIRST_BYTES);
  54369. }
  54370. return shadow(this, "fingerprints", [hexString(hashOriginal), hashModified ? hexString(hashModified) : null]);
  54371. }
  54372. async _getLinearizationPage(pageIndex) {
  54373. const {
  54374. catalog,
  54375. linearization,
  54376. xref
  54377. } = this;
  54378. const ref = Ref.get(linearization.objectNumberFirst, 0);
  54379. try {
  54380. const obj = await xref.fetchAsync(ref);
  54381. if (obj instanceof Dict) {
  54382. let type = obj.getRaw("Type");
  54383. if (type instanceof Ref) {
  54384. type = await xref.fetchAsync(type);
  54385. }
  54386. if (isName(type, "Page") || !obj.has("Type") && !obj.has("Kids") && obj.has("Contents")) {
  54387. if (!catalog.pageKidsCountCache.has(ref)) {
  54388. catalog.pageKidsCountCache.put(ref, 1);
  54389. }
  54390. if (!catalog.pageIndexCache.has(ref)) {
  54391. catalog.pageIndexCache.put(ref, 0);
  54392. }
  54393. return [obj, ref];
  54394. }
  54395. }
  54396. throw new FormatError("The Linearization dictionary doesn't point to a valid Page dictionary.");
  54397. } catch (reason) {
  54398. warn(`_getLinearizationPage: "${reason.message}".`);
  54399. return catalog.getPageDict(pageIndex);
  54400. }
  54401. }
  54402. getPage(pageIndex) {
  54403. const cachedPromise = this._pagePromises.get(pageIndex);
  54404. if (cachedPromise) {
  54405. return cachedPromise;
  54406. }
  54407. const {
  54408. catalog,
  54409. linearization,
  54410. xfaFactory
  54411. } = this;
  54412. let promise;
  54413. if (xfaFactory) {
  54414. promise = Promise.resolve([Dict.empty, null]);
  54415. } else if (linearization?.pageFirst === pageIndex) {
  54416. promise = this._getLinearizationPage(pageIndex);
  54417. } else {
  54418. promise = catalog.getPageDict(pageIndex);
  54419. }
  54420. promise = promise.then(([pageDict, ref]) => {
  54421. return new Page({
  54422. pdfManager: this.pdfManager,
  54423. xref: this.xref,
  54424. pageIndex,
  54425. pageDict,
  54426. ref,
  54427. globalIdFactory: this._globalIdFactory,
  54428. fontCache: catalog.fontCache,
  54429. builtInCMapCache: catalog.builtInCMapCache,
  54430. standardFontDataCache: catalog.standardFontDataCache,
  54431. globalImageCache: catalog.globalImageCache,
  54432. systemFontCache: catalog.systemFontCache,
  54433. nonBlendModesSet: catalog.nonBlendModesSet,
  54434. xfaFactory
  54435. });
  54436. });
  54437. this._pagePromises.set(pageIndex, promise);
  54438. return promise;
  54439. }
  54440. async checkFirstPage(recoveryMode = false) {
  54441. if (recoveryMode) {
  54442. return;
  54443. }
  54444. try {
  54445. await this.getPage(0);
  54446. } catch (reason) {
  54447. if (reason instanceof XRefEntryException) {
  54448. this._pagePromises.delete(0);
  54449. await this.cleanup();
  54450. throw new XRefParseException();
  54451. }
  54452. }
  54453. }
  54454. async checkLastPage(recoveryMode = false) {
  54455. const {
  54456. catalog,
  54457. pdfManager
  54458. } = this;
  54459. catalog.setActualNumPages();
  54460. let numPages;
  54461. try {
  54462. await Promise.all([pdfManager.ensureDoc("xfaFactory"), pdfManager.ensureDoc("linearization"), pdfManager.ensureCatalog("numPages")]);
  54463. if (this.xfaFactory) {
  54464. return;
  54465. } else if (this.linearization) {
  54466. numPages = this.linearization.numPages;
  54467. } else {
  54468. numPages = catalog.numPages;
  54469. }
  54470. if (!Number.isInteger(numPages)) {
  54471. throw new FormatError("Page count is not an integer.");
  54472. } else if (numPages <= 1) {
  54473. return;
  54474. }
  54475. await this.getPage(numPages - 1);
  54476. } catch (reason) {
  54477. this._pagePromises.delete(numPages - 1);
  54478. await this.cleanup();
  54479. if (reason instanceof XRefEntryException && !recoveryMode) {
  54480. throw new XRefParseException();
  54481. }
  54482. warn(`checkLastPage - invalid /Pages tree /Count: ${numPages}.`);
  54483. let pagesTree;
  54484. try {
  54485. pagesTree = await catalog.getAllPageDicts(recoveryMode);
  54486. } catch (reasonAll) {
  54487. if (reasonAll instanceof XRefEntryException && !recoveryMode) {
  54488. throw new XRefParseException();
  54489. }
  54490. catalog.setActualNumPages(1);
  54491. return;
  54492. }
  54493. for (const [pageIndex, [pageDict, ref]] of pagesTree) {
  54494. let promise;
  54495. if (pageDict instanceof Error) {
  54496. promise = Promise.reject(pageDict);
  54497. promise.catch(() => {});
  54498. } else {
  54499. promise = Promise.resolve(new Page({
  54500. pdfManager,
  54501. xref: this.xref,
  54502. pageIndex,
  54503. pageDict,
  54504. ref,
  54505. globalIdFactory: this._globalIdFactory,
  54506. fontCache: catalog.fontCache,
  54507. builtInCMapCache: catalog.builtInCMapCache,
  54508. standardFontDataCache: catalog.standardFontDataCache,
  54509. globalImageCache: catalog.globalImageCache,
  54510. systemFontCache: catalog.systemFontCache,
  54511. nonBlendModesSet: catalog.nonBlendModesSet,
  54512. xfaFactory: null
  54513. }));
  54514. }
  54515. this._pagePromises.set(pageIndex, promise);
  54516. }
  54517. catalog.setActualNumPages(pagesTree.size);
  54518. }
  54519. }
  54520. fontFallback(id, handler) {
  54521. return this.catalog.fontFallback(id, handler);
  54522. }
  54523. async cleanup(manuallyTriggered = false) {
  54524. return this.catalog ? this.catalog.cleanup(manuallyTriggered) : clearGlobalCaches();
  54525. }
  54526. async #collectFieldObjects(name, fieldRef, promises, annotationGlobals, visitedRefs) {
  54527. const {
  54528. xref
  54529. } = this;
  54530. if (!(fieldRef instanceof Ref) || visitedRefs.has(fieldRef)) {
  54531. return;
  54532. }
  54533. visitedRefs.put(fieldRef);
  54534. const field = await xref.fetchAsync(fieldRef);
  54535. if (!(field instanceof Dict)) {
  54536. return;
  54537. }
  54538. if (field.has("T")) {
  54539. const partName = stringToPDFString(await field.getAsync("T"));
  54540. name = name === "" ? partName : `${name}.${partName}`;
  54541. } else {
  54542. let obj = field;
  54543. while (true) {
  54544. obj = obj.getRaw("Parent");
  54545. if (obj instanceof Ref) {
  54546. if (visitedRefs.has(obj)) {
  54547. break;
  54548. }
  54549. obj = await xref.fetchAsync(obj);
  54550. }
  54551. if (!(obj instanceof Dict)) {
  54552. break;
  54553. }
  54554. if (obj.has("T")) {
  54555. const partName = stringToPDFString(await obj.getAsync("T"));
  54556. name = name === "" ? partName : `${name}.${partName}`;
  54557. break;
  54558. }
  54559. }
  54560. }
  54561. if (!promises.has(name)) {
  54562. promises.set(name, []);
  54563. }
  54564. promises.get(name).push(AnnotationFactory.create(xref, fieldRef, annotationGlobals, null, true, null).then(annotation => annotation?.getFieldObject()).catch(function (reason) {
  54565. warn(`#collectFieldObjects: "${reason}".`);
  54566. return null;
  54567. }));
  54568. if (!field.has("Kids")) {
  54569. return;
  54570. }
  54571. const kids = await field.getAsync("Kids");
  54572. if (Array.isArray(kids)) {
  54573. for (const kid of kids) {
  54574. await this.#collectFieldObjects(name, kid, promises, annotationGlobals, visitedRefs);
  54575. }
  54576. }
  54577. }
  54578. get fieldObjects() {
  54579. if (!this.formInfo.hasFields) {
  54580. return shadow(this, "fieldObjects", Promise.resolve(null));
  54581. }
  54582. const promise = Promise.all([this.pdfManager.ensureDoc("annotationGlobals"), this.pdfManager.ensureCatalog("acroForm")]).then(async ([annotationGlobals, acroForm]) => {
  54583. if (!annotationGlobals) {
  54584. return null;
  54585. }
  54586. const visitedRefs = new RefSet();
  54587. const allFields = Object.create(null);
  54588. const fieldPromises = new Map();
  54589. for (const fieldRef of await acroForm.getAsync("Fields")) {
  54590. await this.#collectFieldObjects("", fieldRef, fieldPromises, annotationGlobals, visitedRefs);
  54591. }
  54592. const allPromises = [];
  54593. for (const [name, promises] of fieldPromises) {
  54594. allPromises.push(Promise.all(promises).then(fields => {
  54595. fields = fields.filter(field => !!field);
  54596. if (fields.length > 0) {
  54597. allFields[name] = fields;
  54598. }
  54599. }));
  54600. }
  54601. await Promise.all(allPromises);
  54602. return allFields;
  54603. });
  54604. return shadow(this, "fieldObjects", promise);
  54605. }
  54606. get hasJSActions() {
  54607. const promise = this.pdfManager.ensureDoc("_parseHasJSActions");
  54608. return shadow(this, "hasJSActions", promise);
  54609. }
  54610. async _parseHasJSActions() {
  54611. const [catalogJsActions, fieldObjects] = await Promise.all([this.pdfManager.ensureCatalog("jsActions"), this.pdfManager.ensureDoc("fieldObjects")]);
  54612. if (catalogJsActions) {
  54613. return true;
  54614. }
  54615. if (fieldObjects) {
  54616. return Object.values(fieldObjects).some(fieldObject => fieldObject.some(object => object.actions !== null));
  54617. }
  54618. return false;
  54619. }
  54620. get calculationOrderIds() {
  54621. const acroForm = this.catalog.acroForm;
  54622. if (!acroForm?.has("CO")) {
  54623. return shadow(this, "calculationOrderIds", null);
  54624. }
  54625. const calculationOrder = acroForm.get("CO");
  54626. if (!Array.isArray(calculationOrder) || calculationOrder.length === 0) {
  54627. return shadow(this, "calculationOrderIds", null);
  54628. }
  54629. const ids = [];
  54630. for (const id of calculationOrder) {
  54631. if (id instanceof Ref) {
  54632. ids.push(id.toString());
  54633. }
  54634. }
  54635. if (ids.length === 0) {
  54636. return shadow(this, "calculationOrderIds", null);
  54637. }
  54638. return shadow(this, "calculationOrderIds", ids);
  54639. }
  54640. get annotationGlobals() {
  54641. return shadow(this, "annotationGlobals", AnnotationFactory.createGlobals(this.pdfManager));
  54642. }
  54643. }
  54644. ;// CONCATENATED MODULE: ./src/core/pdf_manager.js
  54645. function parseDocBaseUrl(url) {
  54646. if (url) {
  54647. const absoluteUrl = createValidAbsoluteUrl(url);
  54648. if (absoluteUrl) {
  54649. return absoluteUrl.href;
  54650. }
  54651. warn(`Invalid absolute docBaseUrl: "${url}".`);
  54652. }
  54653. return null;
  54654. }
  54655. class BasePdfManager {
  54656. constructor(args) {
  54657. if (this.constructor === BasePdfManager) {
  54658. unreachable("Cannot initialize BasePdfManager.");
  54659. }
  54660. this._docBaseUrl = parseDocBaseUrl(args.docBaseUrl);
  54661. this._docId = args.docId;
  54662. this._password = args.password;
  54663. this.enableXfa = args.enableXfa;
  54664. args.evaluatorOptions.isOffscreenCanvasSupported &&= FeatureTest.isOffscreenCanvasSupported;
  54665. this.evaluatorOptions = Object.freeze(args.evaluatorOptions);
  54666. }
  54667. get docId() {
  54668. return this._docId;
  54669. }
  54670. get password() {
  54671. return this._password;
  54672. }
  54673. get docBaseUrl() {
  54674. return this._docBaseUrl;
  54675. }
  54676. get catalog() {
  54677. return this.pdfDocument.catalog;
  54678. }
  54679. ensureDoc(prop, args) {
  54680. return this.ensure(this.pdfDocument, prop, args);
  54681. }
  54682. ensureXRef(prop, args) {
  54683. return this.ensure(this.pdfDocument.xref, prop, args);
  54684. }
  54685. ensureCatalog(prop, args) {
  54686. return this.ensure(this.pdfDocument.catalog, prop, args);
  54687. }
  54688. getPage(pageIndex) {
  54689. return this.pdfDocument.getPage(pageIndex);
  54690. }
  54691. fontFallback(id, handler) {
  54692. return this.pdfDocument.fontFallback(id, handler);
  54693. }
  54694. loadXfaFonts(handler, task) {
  54695. return this.pdfDocument.loadXfaFonts(handler, task);
  54696. }
  54697. loadXfaImages() {
  54698. return this.pdfDocument.loadXfaImages();
  54699. }
  54700. serializeXfaData(annotationStorage) {
  54701. return this.pdfDocument.serializeXfaData(annotationStorage);
  54702. }
  54703. cleanup(manuallyTriggered = false) {
  54704. return this.pdfDocument.cleanup(manuallyTriggered);
  54705. }
  54706. async ensure(obj, prop, args) {
  54707. unreachable("Abstract method `ensure` called");
  54708. }
  54709. requestRange(begin, end) {
  54710. unreachable("Abstract method `requestRange` called");
  54711. }
  54712. requestLoadedStream(noFetch = false) {
  54713. unreachable("Abstract method `requestLoadedStream` called");
  54714. }
  54715. sendProgressiveData(chunk) {
  54716. unreachable("Abstract method `sendProgressiveData` called");
  54717. }
  54718. updatePassword(password) {
  54719. this._password = password;
  54720. }
  54721. terminate(reason) {
  54722. unreachable("Abstract method `terminate` called");
  54723. }
  54724. }
  54725. class LocalPdfManager extends BasePdfManager {
  54726. constructor(args) {
  54727. super(args);
  54728. const stream = new Stream(args.source);
  54729. this.pdfDocument = new PDFDocument(this, stream);
  54730. this._loadedStreamPromise = Promise.resolve(stream);
  54731. }
  54732. async ensure(obj, prop, args) {
  54733. const value = obj[prop];
  54734. if (typeof value === "function") {
  54735. return value.apply(obj, args);
  54736. }
  54737. return value;
  54738. }
  54739. requestRange(begin, end) {
  54740. return Promise.resolve();
  54741. }
  54742. requestLoadedStream(noFetch = false) {
  54743. return this._loadedStreamPromise;
  54744. }
  54745. terminate(reason) {}
  54746. }
  54747. class NetworkPdfManager extends BasePdfManager {
  54748. constructor(args) {
  54749. super(args);
  54750. this.streamManager = new ChunkedStreamManager(args.source, {
  54751. msgHandler: args.handler,
  54752. length: args.length,
  54753. disableAutoFetch: args.disableAutoFetch,
  54754. rangeChunkSize: args.rangeChunkSize
  54755. });
  54756. this.pdfDocument = new PDFDocument(this, this.streamManager.getStream());
  54757. }
  54758. async ensure(obj, prop, args) {
  54759. try {
  54760. const value = obj[prop];
  54761. if (typeof value === "function") {
  54762. return value.apply(obj, args);
  54763. }
  54764. return value;
  54765. } catch (ex) {
  54766. if (!(ex instanceof MissingDataException)) {
  54767. throw ex;
  54768. }
  54769. await this.requestRange(ex.begin, ex.end);
  54770. return this.ensure(obj, prop, args);
  54771. }
  54772. }
  54773. requestRange(begin, end) {
  54774. return this.streamManager.requestRange(begin, end);
  54775. }
  54776. requestLoadedStream(noFetch = false) {
  54777. return this.streamManager.requestAllChunks(noFetch);
  54778. }
  54779. sendProgressiveData(chunk) {
  54780. this.streamManager.onReceiveData({
  54781. chunk
  54782. });
  54783. }
  54784. terminate(reason) {
  54785. this.streamManager.abort(reason);
  54786. }
  54787. }
  54788. ;// CONCATENATED MODULE: ./src/shared/message_handler.js
  54789. const CallbackKind = {
  54790. UNKNOWN: 0,
  54791. DATA: 1,
  54792. ERROR: 2
  54793. };
  54794. const StreamKind = {
  54795. UNKNOWN: 0,
  54796. CANCEL: 1,
  54797. CANCEL_COMPLETE: 2,
  54798. CLOSE: 3,
  54799. ENQUEUE: 4,
  54800. ERROR: 5,
  54801. PULL: 6,
  54802. PULL_COMPLETE: 7,
  54803. START_COMPLETE: 8
  54804. };
  54805. function wrapReason(reason) {
  54806. if (!(reason instanceof Error || typeof reason === "object" && reason !== null)) {
  54807. unreachable('wrapReason: Expected "reason" to be a (possibly cloned) Error.');
  54808. }
  54809. switch (reason.name) {
  54810. case "AbortException":
  54811. return new AbortException(reason.message);
  54812. case "MissingPDFException":
  54813. return new MissingPDFException(reason.message);
  54814. case "PasswordException":
  54815. return new PasswordException(reason.message, reason.code);
  54816. case "UnexpectedResponseException":
  54817. return new UnexpectedResponseException(reason.message, reason.status);
  54818. case "UnknownErrorException":
  54819. return new UnknownErrorException(reason.message, reason.details);
  54820. default:
  54821. return new UnknownErrorException(reason.message, reason.toString());
  54822. }
  54823. }
  54824. class MessageHandler {
  54825. constructor(sourceName, targetName, comObj) {
  54826. this.sourceName = sourceName;
  54827. this.targetName = targetName;
  54828. this.comObj = comObj;
  54829. this.callbackId = 1;
  54830. this.streamId = 1;
  54831. this.streamSinks = Object.create(null);
  54832. this.streamControllers = Object.create(null);
  54833. this.callbackCapabilities = Object.create(null);
  54834. this.actionHandler = Object.create(null);
  54835. this._onComObjOnMessage = event => {
  54836. const data = event.data;
  54837. if (data.targetName !== this.sourceName) {
  54838. return;
  54839. }
  54840. if (data.stream) {
  54841. this.#processStreamMessage(data);
  54842. return;
  54843. }
  54844. if (data.callback) {
  54845. const callbackId = data.callbackId;
  54846. const capability = this.callbackCapabilities[callbackId];
  54847. if (!capability) {
  54848. throw new Error(`Cannot resolve callback ${callbackId}`);
  54849. }
  54850. delete this.callbackCapabilities[callbackId];
  54851. if (data.callback === CallbackKind.DATA) {
  54852. capability.resolve(data.data);
  54853. } else if (data.callback === CallbackKind.ERROR) {
  54854. capability.reject(wrapReason(data.reason));
  54855. } else {
  54856. throw new Error("Unexpected callback case");
  54857. }
  54858. return;
  54859. }
  54860. const action = this.actionHandler[data.action];
  54861. if (!action) {
  54862. throw new Error(`Unknown action from worker: ${data.action}`);
  54863. }
  54864. if (data.callbackId) {
  54865. const cbSourceName = this.sourceName;
  54866. const cbTargetName = data.sourceName;
  54867. new Promise(function (resolve) {
  54868. resolve(action(data.data));
  54869. }).then(function (result) {
  54870. comObj.postMessage({
  54871. sourceName: cbSourceName,
  54872. targetName: cbTargetName,
  54873. callback: CallbackKind.DATA,
  54874. callbackId: data.callbackId,
  54875. data: result
  54876. });
  54877. }, function (reason) {
  54878. comObj.postMessage({
  54879. sourceName: cbSourceName,
  54880. targetName: cbTargetName,
  54881. callback: CallbackKind.ERROR,
  54882. callbackId: data.callbackId,
  54883. reason: wrapReason(reason)
  54884. });
  54885. });
  54886. return;
  54887. }
  54888. if (data.streamId) {
  54889. this.#createStreamSink(data);
  54890. return;
  54891. }
  54892. action(data.data);
  54893. };
  54894. comObj.addEventListener("message", this._onComObjOnMessage);
  54895. }
  54896. on(actionName, handler) {
  54897. const ah = this.actionHandler;
  54898. if (ah[actionName]) {
  54899. throw new Error(`There is already an actionName called "${actionName}"`);
  54900. }
  54901. ah[actionName] = handler;
  54902. }
  54903. send(actionName, data, transfers) {
  54904. this.comObj.postMessage({
  54905. sourceName: this.sourceName,
  54906. targetName: this.targetName,
  54907. action: actionName,
  54908. data
  54909. }, transfers);
  54910. }
  54911. sendWithPromise(actionName, data, transfers) {
  54912. const callbackId = this.callbackId++;
  54913. const capability = Promise.withResolvers();
  54914. this.callbackCapabilities[callbackId] = capability;
  54915. try {
  54916. this.comObj.postMessage({
  54917. sourceName: this.sourceName,
  54918. targetName: this.targetName,
  54919. action: actionName,
  54920. callbackId,
  54921. data
  54922. }, transfers);
  54923. } catch (ex) {
  54924. capability.reject(ex);
  54925. }
  54926. return capability.promise;
  54927. }
  54928. sendWithStream(actionName, data, queueingStrategy, transfers) {
  54929. const streamId = this.streamId++,
  54930. sourceName = this.sourceName,
  54931. targetName = this.targetName,
  54932. comObj = this.comObj;
  54933. return new ReadableStream({
  54934. start: controller => {
  54935. const startCapability = Promise.withResolvers();
  54936. this.streamControllers[streamId] = {
  54937. controller,
  54938. startCall: startCapability,
  54939. pullCall: null,
  54940. cancelCall: null,
  54941. isClosed: false
  54942. };
  54943. comObj.postMessage({
  54944. sourceName,
  54945. targetName,
  54946. action: actionName,
  54947. streamId,
  54948. data,
  54949. desiredSize: controller.desiredSize
  54950. }, transfers);
  54951. return startCapability.promise;
  54952. },
  54953. pull: controller => {
  54954. const pullCapability = Promise.withResolvers();
  54955. this.streamControllers[streamId].pullCall = pullCapability;
  54956. comObj.postMessage({
  54957. sourceName,
  54958. targetName,
  54959. stream: StreamKind.PULL,
  54960. streamId,
  54961. desiredSize: controller.desiredSize
  54962. });
  54963. return pullCapability.promise;
  54964. },
  54965. cancel: reason => {
  54966. assert(reason instanceof Error, "cancel must have a valid reason");
  54967. const cancelCapability = Promise.withResolvers();
  54968. this.streamControllers[streamId].cancelCall = cancelCapability;
  54969. this.streamControllers[streamId].isClosed = true;
  54970. comObj.postMessage({
  54971. sourceName,
  54972. targetName,
  54973. stream: StreamKind.CANCEL,
  54974. streamId,
  54975. reason: wrapReason(reason)
  54976. });
  54977. return cancelCapability.promise;
  54978. }
  54979. }, queueingStrategy);
  54980. }
  54981. #createStreamSink(data) {
  54982. const streamId = data.streamId,
  54983. sourceName = this.sourceName,
  54984. targetName = data.sourceName,
  54985. comObj = this.comObj;
  54986. const self = this,
  54987. action = this.actionHandler[data.action];
  54988. const streamSink = {
  54989. enqueue(chunk, size = 1, transfers) {
  54990. if (this.isCancelled) {
  54991. return;
  54992. }
  54993. const lastDesiredSize = this.desiredSize;
  54994. this.desiredSize -= size;
  54995. if (lastDesiredSize > 0 && this.desiredSize <= 0) {
  54996. this.sinkCapability = Promise.withResolvers();
  54997. this.ready = this.sinkCapability.promise;
  54998. }
  54999. comObj.postMessage({
  55000. sourceName,
  55001. targetName,
  55002. stream: StreamKind.ENQUEUE,
  55003. streamId,
  55004. chunk
  55005. }, transfers);
  55006. },
  55007. close() {
  55008. if (this.isCancelled) {
  55009. return;
  55010. }
  55011. this.isCancelled = true;
  55012. comObj.postMessage({
  55013. sourceName,
  55014. targetName,
  55015. stream: StreamKind.CLOSE,
  55016. streamId
  55017. });
  55018. delete self.streamSinks[streamId];
  55019. },
  55020. error(reason) {
  55021. assert(reason instanceof Error, "error must have a valid reason");
  55022. if (this.isCancelled) {
  55023. return;
  55024. }
  55025. this.isCancelled = true;
  55026. comObj.postMessage({
  55027. sourceName,
  55028. targetName,
  55029. stream: StreamKind.ERROR,
  55030. streamId,
  55031. reason: wrapReason(reason)
  55032. });
  55033. },
  55034. sinkCapability: Promise.withResolvers(),
  55035. onPull: null,
  55036. onCancel: null,
  55037. isCancelled: false,
  55038. desiredSize: data.desiredSize,
  55039. ready: null
  55040. };
  55041. streamSink.sinkCapability.resolve();
  55042. streamSink.ready = streamSink.sinkCapability.promise;
  55043. this.streamSinks[streamId] = streamSink;
  55044. new Promise(function (resolve) {
  55045. resolve(action(data.data, streamSink));
  55046. }).then(function () {
  55047. comObj.postMessage({
  55048. sourceName,
  55049. targetName,
  55050. stream: StreamKind.START_COMPLETE,
  55051. streamId,
  55052. success: true
  55053. });
  55054. }, function (reason) {
  55055. comObj.postMessage({
  55056. sourceName,
  55057. targetName,
  55058. stream: StreamKind.START_COMPLETE,
  55059. streamId,
  55060. reason: wrapReason(reason)
  55061. });
  55062. });
  55063. }
  55064. #processStreamMessage(data) {
  55065. const streamId = data.streamId,
  55066. sourceName = this.sourceName,
  55067. targetName = data.sourceName,
  55068. comObj = this.comObj;
  55069. const streamController = this.streamControllers[streamId],
  55070. streamSink = this.streamSinks[streamId];
  55071. switch (data.stream) {
  55072. case StreamKind.START_COMPLETE:
  55073. if (data.success) {
  55074. streamController.startCall.resolve();
  55075. } else {
  55076. streamController.startCall.reject(wrapReason(data.reason));
  55077. }
  55078. break;
  55079. case StreamKind.PULL_COMPLETE:
  55080. if (data.success) {
  55081. streamController.pullCall.resolve();
  55082. } else {
  55083. streamController.pullCall.reject(wrapReason(data.reason));
  55084. }
  55085. break;
  55086. case StreamKind.PULL:
  55087. if (!streamSink) {
  55088. comObj.postMessage({
  55089. sourceName,
  55090. targetName,
  55091. stream: StreamKind.PULL_COMPLETE,
  55092. streamId,
  55093. success: true
  55094. });
  55095. break;
  55096. }
  55097. if (streamSink.desiredSize <= 0 && data.desiredSize > 0) {
  55098. streamSink.sinkCapability.resolve();
  55099. }
  55100. streamSink.desiredSize = data.desiredSize;
  55101. new Promise(function (resolve) {
  55102. resolve(streamSink.onPull?.());
  55103. }).then(function () {
  55104. comObj.postMessage({
  55105. sourceName,
  55106. targetName,
  55107. stream: StreamKind.PULL_COMPLETE,
  55108. streamId,
  55109. success: true
  55110. });
  55111. }, function (reason) {
  55112. comObj.postMessage({
  55113. sourceName,
  55114. targetName,
  55115. stream: StreamKind.PULL_COMPLETE,
  55116. streamId,
  55117. reason: wrapReason(reason)
  55118. });
  55119. });
  55120. break;
  55121. case StreamKind.ENQUEUE:
  55122. assert(streamController, "enqueue should have stream controller");
  55123. if (streamController.isClosed) {
  55124. break;
  55125. }
  55126. streamController.controller.enqueue(data.chunk);
  55127. break;
  55128. case StreamKind.CLOSE:
  55129. assert(streamController, "close should have stream controller");
  55130. if (streamController.isClosed) {
  55131. break;
  55132. }
  55133. streamController.isClosed = true;
  55134. streamController.controller.close();
  55135. this.#deleteStreamController(streamController, streamId);
  55136. break;
  55137. case StreamKind.ERROR:
  55138. assert(streamController, "error should have stream controller");
  55139. streamController.controller.error(wrapReason(data.reason));
  55140. this.#deleteStreamController(streamController, streamId);
  55141. break;
  55142. case StreamKind.CANCEL_COMPLETE:
  55143. if (data.success) {
  55144. streamController.cancelCall.resolve();
  55145. } else {
  55146. streamController.cancelCall.reject(wrapReason(data.reason));
  55147. }
  55148. this.#deleteStreamController(streamController, streamId);
  55149. break;
  55150. case StreamKind.CANCEL:
  55151. if (!streamSink) {
  55152. break;
  55153. }
  55154. new Promise(function (resolve) {
  55155. resolve(streamSink.onCancel?.(wrapReason(data.reason)));
  55156. }).then(function () {
  55157. comObj.postMessage({
  55158. sourceName,
  55159. targetName,
  55160. stream: StreamKind.CANCEL_COMPLETE,
  55161. streamId,
  55162. success: true
  55163. });
  55164. }, function (reason) {
  55165. comObj.postMessage({
  55166. sourceName,
  55167. targetName,
  55168. stream: StreamKind.CANCEL_COMPLETE,
  55169. streamId,
  55170. reason: wrapReason(reason)
  55171. });
  55172. });
  55173. streamSink.sinkCapability.reject(wrapReason(data.reason));
  55174. streamSink.isCancelled = true;
  55175. delete this.streamSinks[streamId];
  55176. break;
  55177. default:
  55178. throw new Error("Unexpected stream case");
  55179. }
  55180. }
  55181. async #deleteStreamController(streamController, streamId) {
  55182. await Promise.allSettled([streamController.startCall?.promise, streamController.pullCall?.promise, streamController.cancelCall?.promise]);
  55183. delete this.streamControllers[streamId];
  55184. }
  55185. destroy() {
  55186. this.comObj.removeEventListener("message", this._onComObjOnMessage);
  55187. }
  55188. }
  55189. ;// CONCATENATED MODULE: ./src/core/worker_stream.js
  55190. class PDFWorkerStream {
  55191. constructor(msgHandler) {
  55192. this._msgHandler = msgHandler;
  55193. this._contentLength = null;
  55194. this._fullRequestReader = null;
  55195. this._rangeRequestReaders = [];
  55196. }
  55197. getFullReader() {
  55198. assert(!this._fullRequestReader, "PDFWorkerStream.getFullReader can only be called once.");
  55199. this._fullRequestReader = new PDFWorkerStreamReader(this._msgHandler);
  55200. return this._fullRequestReader;
  55201. }
  55202. getRangeReader(begin, end) {
  55203. const reader = new PDFWorkerStreamRangeReader(begin, end, this._msgHandler);
  55204. this._rangeRequestReaders.push(reader);
  55205. return reader;
  55206. }
  55207. cancelAllRequests(reason) {
  55208. this._fullRequestReader?.cancel(reason);
  55209. for (const reader of this._rangeRequestReaders.slice(0)) {
  55210. reader.cancel(reason);
  55211. }
  55212. }
  55213. }
  55214. class PDFWorkerStreamReader {
  55215. constructor(msgHandler) {
  55216. this._msgHandler = msgHandler;
  55217. this.onProgress = null;
  55218. this._contentLength = null;
  55219. this._isRangeSupported = false;
  55220. this._isStreamingSupported = false;
  55221. const readableStream = this._msgHandler.sendWithStream("GetReader");
  55222. this._reader = readableStream.getReader();
  55223. this._headersReady = this._msgHandler.sendWithPromise("ReaderHeadersReady").then(data => {
  55224. this._isStreamingSupported = data.isStreamingSupported;
  55225. this._isRangeSupported = data.isRangeSupported;
  55226. this._contentLength = data.contentLength;
  55227. });
  55228. }
  55229. get headersReady() {
  55230. return this._headersReady;
  55231. }
  55232. get contentLength() {
  55233. return this._contentLength;
  55234. }
  55235. get isStreamingSupported() {
  55236. return this._isStreamingSupported;
  55237. }
  55238. get isRangeSupported() {
  55239. return this._isRangeSupported;
  55240. }
  55241. async read() {
  55242. const {
  55243. value,
  55244. done
  55245. } = await this._reader.read();
  55246. if (done) {
  55247. return {
  55248. value: undefined,
  55249. done: true
  55250. };
  55251. }
  55252. return {
  55253. value: value.buffer,
  55254. done: false
  55255. };
  55256. }
  55257. cancel(reason) {
  55258. this._reader.cancel(reason);
  55259. }
  55260. }
  55261. class PDFWorkerStreamRangeReader {
  55262. constructor(begin, end, msgHandler) {
  55263. this._msgHandler = msgHandler;
  55264. this.onProgress = null;
  55265. const readableStream = this._msgHandler.sendWithStream("GetRangeReader", {
  55266. begin,
  55267. end
  55268. });
  55269. this._reader = readableStream.getReader();
  55270. }
  55271. get isStreamingSupported() {
  55272. return false;
  55273. }
  55274. async read() {
  55275. const {
  55276. value,
  55277. done
  55278. } = await this._reader.read();
  55279. if (done) {
  55280. return {
  55281. value: undefined,
  55282. done: true
  55283. };
  55284. }
  55285. return {
  55286. value: value.buffer,
  55287. done: false
  55288. };
  55289. }
  55290. cancel(reason) {
  55291. this._reader.cancel(reason);
  55292. }
  55293. }
  55294. ;// CONCATENATED MODULE: ./src/core/worker.js
  55295. class WorkerTask {
  55296. constructor(name) {
  55297. this.name = name;
  55298. this.terminated = false;
  55299. this._capability = Promise.withResolvers();
  55300. }
  55301. get finished() {
  55302. return this._capability.promise;
  55303. }
  55304. finish() {
  55305. this._capability.resolve();
  55306. }
  55307. terminate() {
  55308. this.terminated = true;
  55309. }
  55310. ensureNotTerminated() {
  55311. if (this.terminated) {
  55312. throw new Error("Worker task was terminated");
  55313. }
  55314. }
  55315. }
  55316. class WorkerMessageHandler {
  55317. static setup(handler, port) {
  55318. let testMessageProcessed = false;
  55319. handler.on("test", function (data) {
  55320. if (testMessageProcessed) {
  55321. return;
  55322. }
  55323. testMessageProcessed = true;
  55324. handler.send("test", data instanceof Uint8Array);
  55325. });
  55326. handler.on("configure", function (data) {
  55327. setVerbosityLevel(data.verbosity);
  55328. });
  55329. handler.on("GetDocRequest", function (data) {
  55330. return WorkerMessageHandler.createDocumentHandler(data, port);
  55331. });
  55332. }
  55333. static createDocumentHandler(docParams, port) {
  55334. let pdfManager;
  55335. let terminated = false;
  55336. let cancelXHRs = null;
  55337. const WorkerTasks = new Set();
  55338. const verbosity = getVerbosityLevel();
  55339. const {
  55340. docId,
  55341. apiVersion
  55342. } = docParams;
  55343. const workerVersion = "4.5.136";
  55344. if (apiVersion !== workerVersion) {
  55345. throw new Error(`The API version "${apiVersion}" does not match ` + `the Worker version "${workerVersion}".`);
  55346. }
  55347. const enumerableProperties = [];
  55348. for (const property in []) {
  55349. enumerableProperties.push(property);
  55350. }
  55351. if (enumerableProperties.length) {
  55352. throw new Error("The `Array.prototype` contains unexpected enumerable properties: " + enumerableProperties.join(", ") + "; thus breaking e.g. `for...in` iteration of `Array`s.");
  55353. }
  55354. const workerHandlerName = docId + "_worker";
  55355. let handler = new MessageHandler(workerHandlerName, docId, port);
  55356. function ensureNotTerminated() {
  55357. if (terminated) {
  55358. throw new Error("Worker was terminated");
  55359. }
  55360. }
  55361. function startWorkerTask(task) {
  55362. WorkerTasks.add(task);
  55363. }
  55364. function finishWorkerTask(task) {
  55365. task.finish();
  55366. WorkerTasks.delete(task);
  55367. }
  55368. async function loadDocument(recoveryMode) {
  55369. await pdfManager.ensureDoc("checkHeader");
  55370. await pdfManager.ensureDoc("parseStartXRef");
  55371. await pdfManager.ensureDoc("parse", [recoveryMode]);
  55372. await pdfManager.ensureDoc("checkFirstPage", [recoveryMode]);
  55373. await pdfManager.ensureDoc("checkLastPage", [recoveryMode]);
  55374. const isPureXfa = await pdfManager.ensureDoc("isPureXfa");
  55375. if (isPureXfa) {
  55376. const task = new WorkerTask("loadXfaFonts");
  55377. startWorkerTask(task);
  55378. await Promise.all([pdfManager.loadXfaFonts(handler, task).catch(reason => {}).then(() => finishWorkerTask(task)), pdfManager.loadXfaImages()]);
  55379. }
  55380. const [numPages, fingerprints] = await Promise.all([pdfManager.ensureDoc("numPages"), pdfManager.ensureDoc("fingerprints")]);
  55381. const htmlForXfa = isPureXfa ? await pdfManager.ensureDoc("htmlForXfa") : null;
  55382. return {
  55383. numPages,
  55384. fingerprints,
  55385. htmlForXfa
  55386. };
  55387. }
  55388. function getPdfManager({
  55389. data,
  55390. password,
  55391. disableAutoFetch,
  55392. rangeChunkSize,
  55393. length,
  55394. docBaseUrl,
  55395. enableXfa,
  55396. evaluatorOptions
  55397. }) {
  55398. const pdfManagerArgs = {
  55399. source: null,
  55400. disableAutoFetch,
  55401. docBaseUrl,
  55402. docId,
  55403. enableXfa,
  55404. evaluatorOptions,
  55405. handler,
  55406. length,
  55407. password,
  55408. rangeChunkSize
  55409. };
  55410. const pdfManagerCapability = Promise.withResolvers();
  55411. let newPdfManager;
  55412. if (data) {
  55413. try {
  55414. pdfManagerArgs.source = data;
  55415. newPdfManager = new LocalPdfManager(pdfManagerArgs);
  55416. pdfManagerCapability.resolve(newPdfManager);
  55417. } catch (ex) {
  55418. pdfManagerCapability.reject(ex);
  55419. }
  55420. return pdfManagerCapability.promise;
  55421. }
  55422. let pdfStream,
  55423. cachedChunks = [];
  55424. try {
  55425. pdfStream = new PDFWorkerStream(handler);
  55426. } catch (ex) {
  55427. pdfManagerCapability.reject(ex);
  55428. return pdfManagerCapability.promise;
  55429. }
  55430. const fullRequest = pdfStream.getFullReader();
  55431. fullRequest.headersReady.then(function () {
  55432. if (!fullRequest.isRangeSupported) {
  55433. return;
  55434. }
  55435. pdfManagerArgs.source = pdfStream;
  55436. pdfManagerArgs.length = fullRequest.contentLength;
  55437. pdfManagerArgs.disableAutoFetch ||= fullRequest.isStreamingSupported;
  55438. newPdfManager = new NetworkPdfManager(pdfManagerArgs);
  55439. for (const chunk of cachedChunks) {
  55440. newPdfManager.sendProgressiveData(chunk);
  55441. }
  55442. cachedChunks = [];
  55443. pdfManagerCapability.resolve(newPdfManager);
  55444. cancelXHRs = null;
  55445. }).catch(function (reason) {
  55446. pdfManagerCapability.reject(reason);
  55447. cancelXHRs = null;
  55448. });
  55449. let loaded = 0;
  55450. const flushChunks = function () {
  55451. const pdfFile = arrayBuffersToBytes(cachedChunks);
  55452. if (length && pdfFile.length !== length) {
  55453. warn("reported HTTP length is different from actual");
  55454. }
  55455. try {
  55456. pdfManagerArgs.source = pdfFile;
  55457. newPdfManager = new LocalPdfManager(pdfManagerArgs);
  55458. pdfManagerCapability.resolve(newPdfManager);
  55459. } catch (ex) {
  55460. pdfManagerCapability.reject(ex);
  55461. }
  55462. cachedChunks = [];
  55463. };
  55464. new Promise(function (resolve, reject) {
  55465. const readChunk = function ({
  55466. value,
  55467. done
  55468. }) {
  55469. try {
  55470. ensureNotTerminated();
  55471. if (done) {
  55472. if (!newPdfManager) {
  55473. flushChunks();
  55474. }
  55475. cancelXHRs = null;
  55476. return;
  55477. }
  55478. loaded += value.byteLength;
  55479. if (!fullRequest.isStreamingSupported) {
  55480. handler.send("DocProgress", {
  55481. loaded,
  55482. total: Math.max(loaded, fullRequest.contentLength || 0)
  55483. });
  55484. }
  55485. if (newPdfManager) {
  55486. newPdfManager.sendProgressiveData(value);
  55487. } else {
  55488. cachedChunks.push(value);
  55489. }
  55490. fullRequest.read().then(readChunk, reject);
  55491. } catch (e) {
  55492. reject(e);
  55493. }
  55494. };
  55495. fullRequest.read().then(readChunk, reject);
  55496. }).catch(function (e) {
  55497. pdfManagerCapability.reject(e);
  55498. cancelXHRs = null;
  55499. });
  55500. cancelXHRs = function (reason) {
  55501. pdfStream.cancelAllRequests(reason);
  55502. };
  55503. return pdfManagerCapability.promise;
  55504. }
  55505. function setupDoc(data) {
  55506. function onSuccess(doc) {
  55507. ensureNotTerminated();
  55508. handler.send("GetDoc", {
  55509. pdfInfo: doc
  55510. });
  55511. }
  55512. function onFailure(ex) {
  55513. ensureNotTerminated();
  55514. if (ex instanceof PasswordException) {
  55515. const task = new WorkerTask(`PasswordException: response ${ex.code}`);
  55516. startWorkerTask(task);
  55517. handler.sendWithPromise("PasswordRequest", ex).then(function ({
  55518. password
  55519. }) {
  55520. finishWorkerTask(task);
  55521. pdfManager.updatePassword(password);
  55522. pdfManagerReady();
  55523. }).catch(function () {
  55524. finishWorkerTask(task);
  55525. handler.send("DocException", ex);
  55526. });
  55527. } else if (ex instanceof InvalidPDFException || ex instanceof MissingPDFException || ex instanceof UnexpectedResponseException || ex instanceof UnknownErrorException) {
  55528. handler.send("DocException", ex);
  55529. } else {
  55530. handler.send("DocException", new UnknownErrorException(ex.message, ex.toString()));
  55531. }
  55532. }
  55533. function pdfManagerReady() {
  55534. ensureNotTerminated();
  55535. loadDocument(false).then(onSuccess, function (reason) {
  55536. ensureNotTerminated();
  55537. if (!(reason instanceof XRefParseException)) {
  55538. onFailure(reason);
  55539. return;
  55540. }
  55541. pdfManager.requestLoadedStream().then(function () {
  55542. ensureNotTerminated();
  55543. loadDocument(true).then(onSuccess, onFailure);
  55544. });
  55545. });
  55546. }
  55547. ensureNotTerminated();
  55548. getPdfManager(data).then(function (newPdfManager) {
  55549. if (terminated) {
  55550. newPdfManager.terminate(new AbortException("Worker was terminated."));
  55551. throw new Error("Worker was terminated");
  55552. }
  55553. pdfManager = newPdfManager;
  55554. pdfManager.requestLoadedStream(true).then(stream => {
  55555. handler.send("DataLoaded", {
  55556. length: stream.bytes.byteLength
  55557. });
  55558. });
  55559. }).then(pdfManagerReady, onFailure);
  55560. }
  55561. handler.on("GetPage", function (data) {
  55562. return pdfManager.getPage(data.pageIndex).then(function (page) {
  55563. 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]) {
  55564. return {
  55565. rotate,
  55566. ref,
  55567. refStr: ref?.toString() ?? null,
  55568. userUnit,
  55569. view
  55570. };
  55571. });
  55572. });
  55573. });
  55574. handler.on("GetPageIndex", function (data) {
  55575. const pageRef = Ref.get(data.num, data.gen);
  55576. return pdfManager.ensureCatalog("getPageIndex", [pageRef]);
  55577. });
  55578. handler.on("GetDestinations", function (data) {
  55579. return pdfManager.ensureCatalog("destinations");
  55580. });
  55581. handler.on("GetDestination", function (data) {
  55582. return pdfManager.ensureCatalog("getDestination", [data.id]);
  55583. });
  55584. handler.on("GetPageLabels", function (data) {
  55585. return pdfManager.ensureCatalog("pageLabels");
  55586. });
  55587. handler.on("GetPageLayout", function (data) {
  55588. return pdfManager.ensureCatalog("pageLayout");
  55589. });
  55590. handler.on("GetPageMode", function (data) {
  55591. return pdfManager.ensureCatalog("pageMode");
  55592. });
  55593. handler.on("GetViewerPreferences", function (data) {
  55594. return pdfManager.ensureCatalog("viewerPreferences");
  55595. });
  55596. handler.on("GetOpenAction", function (data) {
  55597. return pdfManager.ensureCatalog("openAction");
  55598. });
  55599. handler.on("GetAttachments", function (data) {
  55600. return pdfManager.ensureCatalog("attachments");
  55601. });
  55602. handler.on("GetDocJSActions", function (data) {
  55603. return pdfManager.ensureCatalog("jsActions");
  55604. });
  55605. handler.on("GetPageJSActions", function ({
  55606. pageIndex
  55607. }) {
  55608. return pdfManager.getPage(pageIndex).then(function (page) {
  55609. return pdfManager.ensure(page, "jsActions");
  55610. });
  55611. });
  55612. handler.on("GetOutline", function (data) {
  55613. return pdfManager.ensureCatalog("documentOutline");
  55614. });
  55615. handler.on("GetOptionalContentConfig", function (data) {
  55616. return pdfManager.ensureCatalog("optionalContentConfig");
  55617. });
  55618. handler.on("GetPermissions", function (data) {
  55619. return pdfManager.ensureCatalog("permissions");
  55620. });
  55621. handler.on("GetMetadata", function (data) {
  55622. return Promise.all([pdfManager.ensureDoc("documentInfo"), pdfManager.ensureCatalog("metadata")]);
  55623. });
  55624. handler.on("GetMarkInfo", function (data) {
  55625. return pdfManager.ensureCatalog("markInfo");
  55626. });
  55627. handler.on("GetData", function (data) {
  55628. return pdfManager.requestLoadedStream().then(function (stream) {
  55629. return stream.bytes;
  55630. });
  55631. });
  55632. handler.on("GetAnnotations", function ({
  55633. pageIndex,
  55634. intent
  55635. }) {
  55636. return pdfManager.getPage(pageIndex).then(function (page) {
  55637. const task = new WorkerTask(`GetAnnotations: page ${pageIndex}`);
  55638. startWorkerTask(task);
  55639. return page.getAnnotationsData(handler, task, intent).then(data => {
  55640. finishWorkerTask(task);
  55641. return data;
  55642. }, reason => {
  55643. finishWorkerTask(task);
  55644. throw reason;
  55645. });
  55646. });
  55647. });
  55648. handler.on("GetFieldObjects", function (data) {
  55649. return pdfManager.ensureDoc("fieldObjects");
  55650. });
  55651. handler.on("HasJSActions", function (data) {
  55652. return pdfManager.ensureDoc("hasJSActions");
  55653. });
  55654. handler.on("GetCalculationOrderIds", function (data) {
  55655. return pdfManager.ensureDoc("calculationOrderIds");
  55656. });
  55657. handler.on("SaveDocument", async function ({
  55658. isPureXfa,
  55659. numPages,
  55660. annotationStorage,
  55661. filename
  55662. }) {
  55663. const globalPromises = [pdfManager.requestLoadedStream(), pdfManager.ensureCatalog("acroForm"), pdfManager.ensureCatalog("acroFormRef"), pdfManager.ensureDoc("startXRef"), pdfManager.ensureDoc("xref"), pdfManager.ensureDoc("linearization"), pdfManager.ensureCatalog("structTreeRoot")];
  55664. const promises = [];
  55665. const newAnnotationsByPage = !isPureXfa ? getNewAnnotationsMap(annotationStorage) : null;
  55666. const [stream, acroForm, acroFormRef, startXRef, xref, linearization, _structTreeRoot] = await Promise.all(globalPromises);
  55667. const catalogRef = xref.trailer.getRaw("Root") || null;
  55668. let structTreeRoot;
  55669. if (newAnnotationsByPage) {
  55670. if (!_structTreeRoot) {
  55671. if (await StructTreeRoot.canCreateStructureTree({
  55672. catalogRef,
  55673. pdfManager,
  55674. newAnnotationsByPage
  55675. })) {
  55676. structTreeRoot = null;
  55677. }
  55678. } else if (await _structTreeRoot.canUpdateStructTree({
  55679. pdfManager,
  55680. xref,
  55681. newAnnotationsByPage
  55682. })) {
  55683. structTreeRoot = _structTreeRoot;
  55684. }
  55685. const imagePromises = AnnotationFactory.generateImages(annotationStorage.values(), xref, pdfManager.evaluatorOptions.isOffscreenCanvasSupported);
  55686. const newAnnotationPromises = structTreeRoot === undefined ? promises : [];
  55687. for (const [pageIndex, annotations] of newAnnotationsByPage) {
  55688. newAnnotationPromises.push(pdfManager.getPage(pageIndex).then(page => {
  55689. const task = new WorkerTask(`Save (editor): page ${pageIndex}`);
  55690. return page.saveNewAnnotations(handler, task, annotations, imagePromises).finally(function () {
  55691. finishWorkerTask(task);
  55692. });
  55693. }));
  55694. }
  55695. if (structTreeRoot === null) {
  55696. promises.push(Promise.all(newAnnotationPromises).then(async newRefs => {
  55697. await StructTreeRoot.createStructureTree({
  55698. newAnnotationsByPage,
  55699. xref,
  55700. catalogRef,
  55701. pdfManager,
  55702. newRefs
  55703. });
  55704. return newRefs;
  55705. }));
  55706. } else if (structTreeRoot) {
  55707. promises.push(Promise.all(newAnnotationPromises).then(async newRefs => {
  55708. await structTreeRoot.updateStructureTree({
  55709. newAnnotationsByPage,
  55710. pdfManager,
  55711. newRefs
  55712. });
  55713. return newRefs;
  55714. }));
  55715. }
  55716. }
  55717. if (isPureXfa) {
  55718. promises.push(pdfManager.serializeXfaData(annotationStorage));
  55719. } else {
  55720. for (let pageIndex = 0; pageIndex < numPages; pageIndex++) {
  55721. promises.push(pdfManager.getPage(pageIndex).then(function (page) {
  55722. const task = new WorkerTask(`Save: page ${pageIndex}`);
  55723. return page.save(handler, task, annotationStorage).finally(function () {
  55724. finishWorkerTask(task);
  55725. });
  55726. }));
  55727. }
  55728. }
  55729. const refs = await Promise.all(promises);
  55730. let newRefs = [];
  55731. let xfaData = null;
  55732. if (isPureXfa) {
  55733. xfaData = refs[0];
  55734. if (!xfaData) {
  55735. return stream.bytes;
  55736. }
  55737. } else {
  55738. newRefs = refs.flat(2);
  55739. if (newRefs.length === 0) {
  55740. return stream.bytes;
  55741. }
  55742. }
  55743. const needAppearances = acroFormRef && acroForm instanceof Dict && newRefs.some(ref => ref.needAppearances);
  55744. const xfa = acroForm instanceof Dict && acroForm.get("XFA") || null;
  55745. let xfaDatasetsRef = null;
  55746. let hasXfaDatasetsEntry = false;
  55747. if (Array.isArray(xfa)) {
  55748. for (let i = 0, ii = xfa.length; i < ii; i += 2) {
  55749. if (xfa[i] === "datasets") {
  55750. xfaDatasetsRef = xfa[i + 1];
  55751. hasXfaDatasetsEntry = true;
  55752. }
  55753. }
  55754. if (xfaDatasetsRef === null) {
  55755. xfaDatasetsRef = xref.getNewTemporaryRef();
  55756. }
  55757. } else if (xfa) {
  55758. warn("Unsupported XFA type.");
  55759. }
  55760. let newXrefInfo = Object.create(null);
  55761. if (xref.trailer) {
  55762. const infoObj = Object.create(null);
  55763. const xrefInfo = xref.trailer.get("Info") || null;
  55764. if (xrefInfo instanceof Dict) {
  55765. xrefInfo.forEach((key, value) => {
  55766. if (typeof value === "string") {
  55767. infoObj[key] = stringToPDFString(value);
  55768. }
  55769. });
  55770. }
  55771. newXrefInfo = {
  55772. rootRef: catalogRef,
  55773. encryptRef: xref.trailer.getRaw("Encrypt") || null,
  55774. newRef: xref.getNewTemporaryRef(),
  55775. infoRef: xref.trailer.getRaw("Info") || null,
  55776. info: infoObj,
  55777. fileIds: xref.trailer.get("ID") || null,
  55778. startXRef: linearization ? startXRef : xref.lastXRefStreamPos ?? startXRef,
  55779. filename
  55780. };
  55781. }
  55782. return incrementalUpdate({
  55783. originalData: stream.bytes,
  55784. xrefInfo: newXrefInfo,
  55785. newRefs,
  55786. xref,
  55787. hasXfa: !!xfa,
  55788. xfaDatasetsRef,
  55789. hasXfaDatasetsEntry,
  55790. needAppearances,
  55791. acroFormRef,
  55792. acroForm,
  55793. xfaData,
  55794. useXrefStream: isDict(xref.topDict, "XRef")
  55795. }).finally(() => {
  55796. xref.resetNewTemporaryRef();
  55797. });
  55798. });
  55799. handler.on("GetOperatorList", function (data, sink) {
  55800. const pageIndex = data.pageIndex;
  55801. pdfManager.getPage(pageIndex).then(function (page) {
  55802. const task = new WorkerTask(`GetOperatorList: page ${pageIndex}`);
  55803. startWorkerTask(task);
  55804. const start = verbosity >= VerbosityLevel.INFOS ? Date.now() : 0;
  55805. page.getOperatorList({
  55806. handler,
  55807. sink,
  55808. task,
  55809. intent: data.intent,
  55810. cacheKey: data.cacheKey,
  55811. annotationStorage: data.annotationStorage,
  55812. modifiedIds: data.modifiedIds
  55813. }).then(function (operatorListInfo) {
  55814. finishWorkerTask(task);
  55815. if (start) {
  55816. info(`page=${pageIndex + 1} - getOperatorList: time=` + `${Date.now() - start}ms, len=${operatorListInfo.length}`);
  55817. }
  55818. sink.close();
  55819. }, function (reason) {
  55820. finishWorkerTask(task);
  55821. if (task.terminated) {
  55822. return;
  55823. }
  55824. sink.error(reason);
  55825. });
  55826. });
  55827. });
  55828. handler.on("GetTextContent", function (data, sink) {
  55829. const {
  55830. pageIndex,
  55831. includeMarkedContent,
  55832. disableNormalization
  55833. } = data;
  55834. pdfManager.getPage(pageIndex).then(function (page) {
  55835. const task = new WorkerTask("GetTextContent: page " + pageIndex);
  55836. startWorkerTask(task);
  55837. const start = verbosity >= VerbosityLevel.INFOS ? Date.now() : 0;
  55838. page.extractTextContent({
  55839. handler,
  55840. task,
  55841. sink,
  55842. includeMarkedContent,
  55843. disableNormalization
  55844. }).then(function () {
  55845. finishWorkerTask(task);
  55846. if (start) {
  55847. info(`page=${pageIndex + 1} - getTextContent: time=` + `${Date.now() - start}ms`);
  55848. }
  55849. sink.close();
  55850. }, function (reason) {
  55851. finishWorkerTask(task);
  55852. if (task.terminated) {
  55853. return;
  55854. }
  55855. sink.error(reason);
  55856. });
  55857. });
  55858. });
  55859. handler.on("GetStructTree", function (data) {
  55860. return pdfManager.getPage(data.pageIndex).then(function (page) {
  55861. return pdfManager.ensure(page, "getStructTree");
  55862. });
  55863. });
  55864. handler.on("FontFallback", function (data) {
  55865. return pdfManager.fontFallback(data.id, handler);
  55866. });
  55867. handler.on("Cleanup", function (data) {
  55868. return pdfManager.cleanup(true);
  55869. });
  55870. handler.on("Terminate", function (data) {
  55871. terminated = true;
  55872. const waitOn = [];
  55873. if (pdfManager) {
  55874. pdfManager.terminate(new AbortException("Worker was terminated."));
  55875. const cleanupPromise = pdfManager.cleanup();
  55876. waitOn.push(cleanupPromise);
  55877. pdfManager = null;
  55878. } else {
  55879. clearGlobalCaches();
  55880. }
  55881. if (cancelXHRs) {
  55882. cancelXHRs(new AbortException("Worker was terminated."));
  55883. }
  55884. for (const task of WorkerTasks) {
  55885. waitOn.push(task.finished);
  55886. task.terminate();
  55887. }
  55888. return Promise.all(waitOn).then(function () {
  55889. handler.destroy();
  55890. handler = null;
  55891. });
  55892. });
  55893. handler.on("Ready", function (data) {
  55894. setupDoc(docParams);
  55895. docParams = null;
  55896. });
  55897. return workerHandlerName;
  55898. }
  55899. static initializeFromPort(port) {
  55900. const handler = new MessageHandler("worker", "main", port);
  55901. WorkerMessageHandler.setup(handler, port);
  55902. handler.send("ready", null);
  55903. }
  55904. }
  55905. function isMessagePort(maybePort) {
  55906. return typeof maybePort.postMessage === "function" && "onmessage" in maybePort;
  55907. }
  55908. if (typeof window === "undefined" && !isNodeJS && typeof self !== "undefined" && isMessagePort(self)) {
  55909. WorkerMessageHandler.initializeFromPort(self);
  55910. }
  55911. ;// CONCATENATED MODULE: ./src/pdf.worker.js
  55912. const pdfjsVersion = "4.5.136";
  55913. const pdfjsBuild = "3a21f03b0";
  55914. var __webpack_exports__WorkerMessageHandler = __webpack_exports__.WorkerMessageHandler;
  55915. export { __webpack_exports__WorkerMessageHandler as WorkerMessageHandler };
  55916. //# sourceMappingURL=pdf.worker.mjs.map