pdf_viewer3.mjs 393 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391
  1. /**
  2. * @licstart The following is the entire license notice for the
  3. * JavaScript code in this page
  4. *
  5. * Copyright 2023 Mozilla Foundation
  6. *
  7. * Licensed under the Apache License, Version 2.0 (the "License");
  8. * you may not use this file except in compliance with the License.
  9. * You may obtain a copy of the License at
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing, software
  14. * distributed under the License is distributed on an "AS IS" BASIS,
  15. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16. * See the License for the specific language governing permissions and
  17. * limitations under the License.
  18. *
  19. * @licend The above is the entire license notice for the
  20. * JavaScript code in this page
  21. */
  22. /******/ var __webpack_modules__ = ({
  23. /***/ 9306:
  24. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  25. var isCallable = __webpack_require__(4901);
  26. var tryToString = __webpack_require__(6823);
  27. var $TypeError = TypeError;
  28. // `Assert: IsCallable(argument) is true`
  29. module.exports = function (argument) {
  30. if (isCallable(argument)) return argument;
  31. throw new $TypeError(tryToString(argument) + ' is not a function');
  32. };
  33. /***/ }),
  34. /***/ 7080:
  35. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  36. var has = (__webpack_require__(4402).has);
  37. // Perform ? RequireInternalSlot(M, [[SetData]])
  38. module.exports = function (it) {
  39. has(it);
  40. return it;
  41. };
  42. /***/ }),
  43. /***/ 679:
  44. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  45. var isPrototypeOf = __webpack_require__(1625);
  46. var $TypeError = TypeError;
  47. module.exports = function (it, Prototype) {
  48. if (isPrototypeOf(Prototype, it)) return it;
  49. throw new $TypeError('Incorrect invocation');
  50. };
  51. /***/ }),
  52. /***/ 8551:
  53. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  54. var isObject = __webpack_require__(34);
  55. var $String = String;
  56. var $TypeError = TypeError;
  57. // `Assert: Type(argument) is Object`
  58. module.exports = function (argument) {
  59. if (isObject(argument)) return argument;
  60. throw new $TypeError($String(argument) + ' is not an object');
  61. };
  62. /***/ }),
  63. /***/ 9617:
  64. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  65. var toIndexedObject = __webpack_require__(5397);
  66. var toAbsoluteIndex = __webpack_require__(5610);
  67. var lengthOfArrayLike = __webpack_require__(6198);
  68. // `Array.prototype.{ indexOf, includes }` methods implementation
  69. var createMethod = function (IS_INCLUDES) {
  70. return function ($this, el, fromIndex) {
  71. var O = toIndexedObject($this);
  72. var length = lengthOfArrayLike(O);
  73. if (length === 0) return !IS_INCLUDES && -1;
  74. var index = toAbsoluteIndex(fromIndex, length);
  75. var value;
  76. // Array#includes uses SameValueZero equality algorithm
  77. // eslint-disable-next-line no-self-compare -- NaN check
  78. if (IS_INCLUDES && el !== el) while (length > index) {
  79. value = O[index++];
  80. // eslint-disable-next-line no-self-compare -- NaN check
  81. if (value !== value) return true;
  82. // Array#indexOf ignores holes, Array#includes - not
  83. } else for (;length > index; index++) {
  84. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  85. } return !IS_INCLUDES && -1;
  86. };
  87. };
  88. module.exports = {
  89. // `Array.prototype.includes` method
  90. // https://tc39.es/ecma262/#sec-array.prototype.includes
  91. includes: createMethod(true),
  92. // `Array.prototype.indexOf` method
  93. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  94. indexOf: createMethod(false)
  95. };
  96. /***/ }),
  97. /***/ 4527:
  98. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  99. var DESCRIPTORS = __webpack_require__(3724);
  100. var isArray = __webpack_require__(4376);
  101. var $TypeError = TypeError;
  102. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  103. var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  104. // Safari < 13 does not throw an error in this case
  105. var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS && !function () {
  106. // makes no sense without proper strict mode support
  107. if (this !== undefined) return true;
  108. try {
  109. // eslint-disable-next-line es/no-object-defineproperty -- safe
  110. Object.defineProperty([], 'length', { writable: false }).length = 1;
  111. } catch (error) {
  112. return error instanceof TypeError;
  113. }
  114. }();
  115. module.exports = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) {
  116. if (isArray(O) && !getOwnPropertyDescriptor(O, 'length').writable) {
  117. throw new $TypeError('Cannot set read only .length');
  118. } return O.length = length;
  119. } : function (O, length) {
  120. return O.length = length;
  121. };
  122. /***/ }),
  123. /***/ 6319:
  124. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  125. var anObject = __webpack_require__(8551);
  126. var iteratorClose = __webpack_require__(9539);
  127. // call something on iterator step with safe closing on error
  128. module.exports = function (iterator, fn, value, ENTRIES) {
  129. try {
  130. return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
  131. } catch (error) {
  132. iteratorClose(iterator, 'throw', error);
  133. }
  134. };
  135. /***/ }),
  136. /***/ 4576:
  137. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  138. var uncurryThis = __webpack_require__(9504);
  139. var toString = uncurryThis({}.toString);
  140. var stringSlice = uncurryThis(''.slice);
  141. module.exports = function (it) {
  142. return stringSlice(toString(it), 8, -1);
  143. };
  144. /***/ }),
  145. /***/ 6955:
  146. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  147. var TO_STRING_TAG_SUPPORT = __webpack_require__(2140);
  148. var isCallable = __webpack_require__(4901);
  149. var classofRaw = __webpack_require__(4576);
  150. var wellKnownSymbol = __webpack_require__(8227);
  151. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  152. var $Object = Object;
  153. // ES3 wrong here
  154. var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments';
  155. // fallback for IE11 Script Access Denied error
  156. var tryGet = function (it, key) {
  157. try {
  158. return it[key];
  159. } catch (error) { /* empty */ }
  160. };
  161. // getting tag from ES6+ `Object.prototype.toString`
  162. module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
  163. var O, tag, result;
  164. return it === undefined ? 'Undefined' : it === null ? 'Null'
  165. // @@toStringTag case
  166. : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
  167. // builtinTag case
  168. : CORRECT_ARGUMENTS ? classofRaw(O)
  169. // ES3 arguments fallback
  170. : (result = classofRaw(O)) === 'Object' && isCallable(O.callee) ? 'Arguments' : result;
  171. };
  172. /***/ }),
  173. /***/ 7740:
  174. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  175. var hasOwn = __webpack_require__(9297);
  176. var ownKeys = __webpack_require__(5031);
  177. var getOwnPropertyDescriptorModule = __webpack_require__(7347);
  178. var definePropertyModule = __webpack_require__(4913);
  179. module.exports = function (target, source, exceptions) {
  180. var keys = ownKeys(source);
  181. var defineProperty = definePropertyModule.f;
  182. var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
  183. for (var i = 0; i < keys.length; i++) {
  184. var key = keys[i];
  185. if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
  186. defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  187. }
  188. }
  189. };
  190. /***/ }),
  191. /***/ 2211:
  192. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  193. var fails = __webpack_require__(9039);
  194. module.exports = !fails(function () {
  195. function F() { /* empty */ }
  196. F.prototype.constructor = null;
  197. // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
  198. return Object.getPrototypeOf(new F()) !== F.prototype;
  199. });
  200. /***/ }),
  201. /***/ 2529:
  202. /***/ ((module) => {
  203. // `CreateIterResultObject` abstract operation
  204. // https://tc39.es/ecma262/#sec-createiterresultobject
  205. module.exports = function (value, done) {
  206. return { value: value, done: done };
  207. };
  208. /***/ }),
  209. /***/ 6699:
  210. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  211. var DESCRIPTORS = __webpack_require__(3724);
  212. var definePropertyModule = __webpack_require__(4913);
  213. var createPropertyDescriptor = __webpack_require__(6980);
  214. module.exports = DESCRIPTORS ? function (object, key, value) {
  215. return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
  216. } : function (object, key, value) {
  217. object[key] = value;
  218. return object;
  219. };
  220. /***/ }),
  221. /***/ 6980:
  222. /***/ ((module) => {
  223. module.exports = function (bitmap, value) {
  224. return {
  225. enumerable: !(bitmap & 1),
  226. configurable: !(bitmap & 2),
  227. writable: !(bitmap & 4),
  228. value: value
  229. };
  230. };
  231. /***/ }),
  232. /***/ 4659:
  233. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  234. var DESCRIPTORS = __webpack_require__(3724);
  235. var definePropertyModule = __webpack_require__(4913);
  236. var createPropertyDescriptor = __webpack_require__(6980);
  237. module.exports = function (object, key, value) {
  238. if (DESCRIPTORS) definePropertyModule.f(object, key, createPropertyDescriptor(0, value));
  239. else object[key] = value;
  240. };
  241. /***/ }),
  242. /***/ 2106:
  243. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  244. var makeBuiltIn = __webpack_require__(283);
  245. var defineProperty = __webpack_require__(4913);
  246. module.exports = function (target, name, descriptor) {
  247. if (descriptor.get) makeBuiltIn(descriptor.get, name, { getter: true });
  248. if (descriptor.set) makeBuiltIn(descriptor.set, name, { setter: true });
  249. return defineProperty.f(target, name, descriptor);
  250. };
  251. /***/ }),
  252. /***/ 6840:
  253. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  254. var isCallable = __webpack_require__(4901);
  255. var definePropertyModule = __webpack_require__(4913);
  256. var makeBuiltIn = __webpack_require__(283);
  257. var defineGlobalProperty = __webpack_require__(9433);
  258. module.exports = function (O, key, value, options) {
  259. if (!options) options = {};
  260. var simple = options.enumerable;
  261. var name = options.name !== undefined ? options.name : key;
  262. if (isCallable(value)) makeBuiltIn(value, name, options);
  263. if (options.global) {
  264. if (simple) O[key] = value;
  265. else defineGlobalProperty(key, value);
  266. } else {
  267. try {
  268. if (!options.unsafe) delete O[key];
  269. else if (O[key]) simple = true;
  270. } catch (error) { /* empty */ }
  271. if (simple) O[key] = value;
  272. else definePropertyModule.f(O, key, {
  273. value: value,
  274. enumerable: false,
  275. configurable: !options.nonConfigurable,
  276. writable: !options.nonWritable
  277. });
  278. } return O;
  279. };
  280. /***/ }),
  281. /***/ 6279:
  282. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  283. var defineBuiltIn = __webpack_require__(6840);
  284. module.exports = function (target, src, options) {
  285. for (var key in src) defineBuiltIn(target, key, src[key], options);
  286. return target;
  287. };
  288. /***/ }),
  289. /***/ 9433:
  290. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  291. var global = __webpack_require__(4475);
  292. // eslint-disable-next-line es/no-object-defineproperty -- safe
  293. var defineProperty = Object.defineProperty;
  294. module.exports = function (key, value) {
  295. try {
  296. defineProperty(global, key, { value: value, configurable: true, writable: true });
  297. } catch (error) {
  298. global[key] = value;
  299. } return value;
  300. };
  301. /***/ }),
  302. /***/ 3724:
  303. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  304. var fails = __webpack_require__(9039);
  305. // Detect IE8's incomplete defineProperty implementation
  306. module.exports = !fails(function () {
  307. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  308. return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;
  309. });
  310. /***/ }),
  311. /***/ 4055:
  312. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  313. var global = __webpack_require__(4475);
  314. var isObject = __webpack_require__(34);
  315. var document = global.document;
  316. // typeof document.createElement is 'object' in old IE
  317. var EXISTS = isObject(document) && isObject(document.createElement);
  318. module.exports = function (it) {
  319. return EXISTS ? document.createElement(it) : {};
  320. };
  321. /***/ }),
  322. /***/ 6837:
  323. /***/ ((module) => {
  324. var $TypeError = TypeError;
  325. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991
  326. module.exports = function (it) {
  327. if (it > MAX_SAFE_INTEGER) throw $TypeError('Maximum allowed index exceeded');
  328. return it;
  329. };
  330. /***/ }),
  331. /***/ 9392:
  332. /***/ ((module) => {
  333. module.exports = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
  334. /***/ }),
  335. /***/ 7388:
  336. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  337. var global = __webpack_require__(4475);
  338. var userAgent = __webpack_require__(9392);
  339. var process = global.process;
  340. var Deno = global.Deno;
  341. var versions = process && process.versions || Deno && Deno.version;
  342. var v8 = versions && versions.v8;
  343. var match, version;
  344. if (v8) {
  345. match = v8.split('.');
  346. // in old Chrome, versions of V8 isn't V8 = Chrome / 10
  347. // but their correct versions are not interesting for us
  348. version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
  349. }
  350. // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
  351. // so check `userAgent` even if `.v8` exists, but 0
  352. if (!version && userAgent) {
  353. match = userAgent.match(/Edge\/(\d+)/);
  354. if (!match || match[1] >= 74) {
  355. match = userAgent.match(/Chrome\/(\d+)/);
  356. if (match) version = +match[1];
  357. }
  358. }
  359. module.exports = version;
  360. /***/ }),
  361. /***/ 8727:
  362. /***/ ((module) => {
  363. // IE8- don't enum bug keys
  364. module.exports = [
  365. 'constructor',
  366. 'hasOwnProperty',
  367. 'isPrototypeOf',
  368. 'propertyIsEnumerable',
  369. 'toLocaleString',
  370. 'toString',
  371. 'valueOf'
  372. ];
  373. /***/ }),
  374. /***/ 6518:
  375. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  376. var global = __webpack_require__(4475);
  377. var getOwnPropertyDescriptor = (__webpack_require__(7347).f);
  378. var createNonEnumerableProperty = __webpack_require__(6699);
  379. var defineBuiltIn = __webpack_require__(6840);
  380. var defineGlobalProperty = __webpack_require__(9433);
  381. var copyConstructorProperties = __webpack_require__(7740);
  382. var isForced = __webpack_require__(2796);
  383. /*
  384. options.target - name of the target object
  385. options.global - target is the global object
  386. options.stat - export as static methods of target
  387. options.proto - export as prototype methods of target
  388. options.real - real prototype method for the `pure` version
  389. options.forced - export even if the native feature is available
  390. options.bind - bind methods to the target, required for the `pure` version
  391. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  392. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  393. options.sham - add a flag to not completely full polyfills
  394. options.enumerable - export as enumerable property
  395. options.dontCallGetSet - prevent calling a getter on target
  396. options.name - the .name of the function if it does not match the key
  397. */
  398. module.exports = function (options, source) {
  399. var TARGET = options.target;
  400. var GLOBAL = options.global;
  401. var STATIC = options.stat;
  402. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  403. if (GLOBAL) {
  404. target = global;
  405. } else if (STATIC) {
  406. target = global[TARGET] || defineGlobalProperty(TARGET, {});
  407. } else {
  408. target = global[TARGET] && global[TARGET].prototype;
  409. }
  410. if (target) for (key in source) {
  411. sourceProperty = source[key];
  412. if (options.dontCallGetSet) {
  413. descriptor = getOwnPropertyDescriptor(target, key);
  414. targetProperty = descriptor && descriptor.value;
  415. } else targetProperty = target[key];
  416. FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  417. // contained in target
  418. if (!FORCED && targetProperty !== undefined) {
  419. if (typeof sourceProperty == typeof targetProperty) continue;
  420. copyConstructorProperties(sourceProperty, targetProperty);
  421. }
  422. // add a flag to not completely full polyfills
  423. if (options.sham || (targetProperty && targetProperty.sham)) {
  424. createNonEnumerableProperty(sourceProperty, 'sham', true);
  425. }
  426. defineBuiltIn(target, key, sourceProperty, options);
  427. }
  428. };
  429. /***/ }),
  430. /***/ 9039:
  431. /***/ ((module) => {
  432. module.exports = function (exec) {
  433. try {
  434. return !!exec();
  435. } catch (error) {
  436. return true;
  437. }
  438. };
  439. /***/ }),
  440. /***/ 6080:
  441. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  442. var uncurryThis = __webpack_require__(7476);
  443. var aCallable = __webpack_require__(9306);
  444. var NATIVE_BIND = __webpack_require__(616);
  445. var bind = uncurryThis(uncurryThis.bind);
  446. // optional / simple context binding
  447. module.exports = function (fn, that) {
  448. aCallable(fn);
  449. return that === undefined ? fn : NATIVE_BIND ? bind(fn, that) : function (/* ...args */) {
  450. return fn.apply(that, arguments);
  451. };
  452. };
  453. /***/ }),
  454. /***/ 616:
  455. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  456. var fails = __webpack_require__(9039);
  457. module.exports = !fails(function () {
  458. // eslint-disable-next-line es/no-function-prototype-bind -- safe
  459. var test = (function () { /* empty */ }).bind();
  460. // eslint-disable-next-line no-prototype-builtins -- safe
  461. return typeof test != 'function' || test.hasOwnProperty('prototype');
  462. });
  463. /***/ }),
  464. /***/ 9565:
  465. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  466. var NATIVE_BIND = __webpack_require__(616);
  467. var call = Function.prototype.call;
  468. module.exports = NATIVE_BIND ? call.bind(call) : function () {
  469. return call.apply(call, arguments);
  470. };
  471. /***/ }),
  472. /***/ 350:
  473. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  474. var DESCRIPTORS = __webpack_require__(3724);
  475. var hasOwn = __webpack_require__(9297);
  476. var FunctionPrototype = Function.prototype;
  477. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  478. var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;
  479. var EXISTS = hasOwn(FunctionPrototype, 'name');
  480. // additional protection from minified / mangled / dropped function names
  481. var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
  482. var CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));
  483. module.exports = {
  484. EXISTS: EXISTS,
  485. PROPER: PROPER,
  486. CONFIGURABLE: CONFIGURABLE
  487. };
  488. /***/ }),
  489. /***/ 6706:
  490. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  491. var uncurryThis = __webpack_require__(9504);
  492. var aCallable = __webpack_require__(9306);
  493. module.exports = function (object, key, method) {
  494. try {
  495. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  496. return uncurryThis(aCallable(Object.getOwnPropertyDescriptor(object, key)[method]));
  497. } catch (error) { /* empty */ }
  498. };
  499. /***/ }),
  500. /***/ 7476:
  501. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  502. var classofRaw = __webpack_require__(4576);
  503. var uncurryThis = __webpack_require__(9504);
  504. module.exports = function (fn) {
  505. // Nashorn bug:
  506. // https://github.com/zloirock/core-js/issues/1128
  507. // https://github.com/zloirock/core-js/issues/1130
  508. if (classofRaw(fn) === 'Function') return uncurryThis(fn);
  509. };
  510. /***/ }),
  511. /***/ 9504:
  512. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  513. var NATIVE_BIND = __webpack_require__(616);
  514. var FunctionPrototype = Function.prototype;
  515. var call = FunctionPrototype.call;
  516. var uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call);
  517. module.exports = NATIVE_BIND ? uncurryThisWithBind : function (fn) {
  518. return function () {
  519. return call.apply(fn, arguments);
  520. };
  521. };
  522. /***/ }),
  523. /***/ 7751:
  524. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  525. var global = __webpack_require__(4475);
  526. var isCallable = __webpack_require__(4901);
  527. var aFunction = function (argument) {
  528. return isCallable(argument) ? argument : undefined;
  529. };
  530. module.exports = function (namespace, method) {
  531. return arguments.length < 2 ? aFunction(global[namespace]) : global[namespace] && global[namespace][method];
  532. };
  533. /***/ }),
  534. /***/ 1767:
  535. /***/ ((module) => {
  536. // `GetIteratorDirect(obj)` abstract operation
  537. // https://tc39.es/proposal-iterator-helpers/#sec-getiteratordirect
  538. module.exports = function (obj) {
  539. return {
  540. iterator: obj,
  541. next: obj.next,
  542. done: false
  543. };
  544. };
  545. /***/ }),
  546. /***/ 851:
  547. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  548. var classof = __webpack_require__(6955);
  549. var getMethod = __webpack_require__(5966);
  550. var isNullOrUndefined = __webpack_require__(4117);
  551. var Iterators = __webpack_require__(6269);
  552. var wellKnownSymbol = __webpack_require__(8227);
  553. var ITERATOR = wellKnownSymbol('iterator');
  554. module.exports = function (it) {
  555. if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR)
  556. || getMethod(it, '@@iterator')
  557. || Iterators[classof(it)];
  558. };
  559. /***/ }),
  560. /***/ 81:
  561. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  562. var call = __webpack_require__(9565);
  563. var aCallable = __webpack_require__(9306);
  564. var anObject = __webpack_require__(8551);
  565. var tryToString = __webpack_require__(6823);
  566. var getIteratorMethod = __webpack_require__(851);
  567. var $TypeError = TypeError;
  568. module.exports = function (argument, usingIterator) {
  569. var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
  570. if (aCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument));
  571. throw new $TypeError(tryToString(argument) + ' is not iterable');
  572. };
  573. /***/ }),
  574. /***/ 5966:
  575. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  576. var aCallable = __webpack_require__(9306);
  577. var isNullOrUndefined = __webpack_require__(4117);
  578. // `GetMethod` abstract operation
  579. // https://tc39.es/ecma262/#sec-getmethod
  580. module.exports = function (V, P) {
  581. var func = V[P];
  582. return isNullOrUndefined(func) ? undefined : aCallable(func);
  583. };
  584. /***/ }),
  585. /***/ 3789:
  586. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  587. var aCallable = __webpack_require__(9306);
  588. var anObject = __webpack_require__(8551);
  589. var call = __webpack_require__(9565);
  590. var toIntegerOrInfinity = __webpack_require__(1291);
  591. var getIteratorDirect = __webpack_require__(1767);
  592. var INVALID_SIZE = 'Invalid size';
  593. var $RangeError = RangeError;
  594. var $TypeError = TypeError;
  595. var max = Math.max;
  596. var SetRecord = function (set, intSize) {
  597. this.set = set;
  598. this.size = max(intSize, 0);
  599. this.has = aCallable(set.has);
  600. this.keys = aCallable(set.keys);
  601. };
  602. SetRecord.prototype = {
  603. getIterator: function () {
  604. return getIteratorDirect(anObject(call(this.keys, this.set)));
  605. },
  606. includes: function (it) {
  607. return call(this.has, this.set, it);
  608. }
  609. };
  610. // `GetSetRecord` abstract operation
  611. // https://tc39.es/proposal-set-methods/#sec-getsetrecord
  612. module.exports = function (obj) {
  613. anObject(obj);
  614. var numSize = +obj.size;
  615. // NOTE: If size is undefined, then numSize will be NaN
  616. // eslint-disable-next-line no-self-compare -- NaN check
  617. if (numSize !== numSize) throw new $TypeError(INVALID_SIZE);
  618. var intSize = toIntegerOrInfinity(numSize);
  619. if (intSize < 0) throw new $RangeError(INVALID_SIZE);
  620. return new SetRecord(obj, intSize);
  621. };
  622. /***/ }),
  623. /***/ 4475:
  624. /***/ (function(module) {
  625. var check = function (it) {
  626. return it && it.Math === Math && it;
  627. };
  628. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  629. module.exports =
  630. // eslint-disable-next-line es/no-global-this -- safe
  631. check(typeof globalThis == 'object' && globalThis) ||
  632. check(typeof window == 'object' && window) ||
  633. // eslint-disable-next-line no-restricted-globals -- safe
  634. check(typeof self == 'object' && self) ||
  635. check(typeof global == 'object' && global) ||
  636. check(typeof this == 'object' && this) ||
  637. // eslint-disable-next-line no-new-func -- fallback
  638. (function () { return this; })() || Function('return this')();
  639. /***/ }),
  640. /***/ 9297:
  641. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  642. var uncurryThis = __webpack_require__(9504);
  643. var toObject = __webpack_require__(8981);
  644. var hasOwnProperty = uncurryThis({}.hasOwnProperty);
  645. // `HasOwnProperty` abstract operation
  646. // https://tc39.es/ecma262/#sec-hasownproperty
  647. // eslint-disable-next-line es/no-object-hasown -- safe
  648. module.exports = Object.hasOwn || function hasOwn(it, key) {
  649. return hasOwnProperty(toObject(it), key);
  650. };
  651. /***/ }),
  652. /***/ 421:
  653. /***/ ((module) => {
  654. module.exports = {};
  655. /***/ }),
  656. /***/ 397:
  657. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  658. var getBuiltIn = __webpack_require__(7751);
  659. module.exports = getBuiltIn('document', 'documentElement');
  660. /***/ }),
  661. /***/ 5917:
  662. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  663. var DESCRIPTORS = __webpack_require__(3724);
  664. var fails = __webpack_require__(9039);
  665. var createElement = __webpack_require__(4055);
  666. // Thanks to IE8 for its funny defineProperty
  667. module.exports = !DESCRIPTORS && !fails(function () {
  668. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  669. return Object.defineProperty(createElement('div'), 'a', {
  670. get: function () { return 7; }
  671. }).a !== 7;
  672. });
  673. /***/ }),
  674. /***/ 7055:
  675. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  676. var uncurryThis = __webpack_require__(9504);
  677. var fails = __webpack_require__(9039);
  678. var classof = __webpack_require__(4576);
  679. var $Object = Object;
  680. var split = uncurryThis(''.split);
  681. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  682. module.exports = fails(function () {
  683. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  684. // eslint-disable-next-line no-prototype-builtins -- safe
  685. return !$Object('z').propertyIsEnumerable(0);
  686. }) ? function (it) {
  687. return classof(it) === 'String' ? split(it, '') : $Object(it);
  688. } : $Object;
  689. /***/ }),
  690. /***/ 3706:
  691. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  692. var uncurryThis = __webpack_require__(9504);
  693. var isCallable = __webpack_require__(4901);
  694. var store = __webpack_require__(7629);
  695. var functionToString = uncurryThis(Function.toString);
  696. // this helper broken in `[email protected]`, so we can't use `shared` helper
  697. if (!isCallable(store.inspectSource)) {
  698. store.inspectSource = function (it) {
  699. return functionToString(it);
  700. };
  701. }
  702. module.exports = store.inspectSource;
  703. /***/ }),
  704. /***/ 1181:
  705. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  706. var NATIVE_WEAK_MAP = __webpack_require__(8622);
  707. var global = __webpack_require__(4475);
  708. var isObject = __webpack_require__(34);
  709. var createNonEnumerableProperty = __webpack_require__(6699);
  710. var hasOwn = __webpack_require__(9297);
  711. var shared = __webpack_require__(7629);
  712. var sharedKey = __webpack_require__(6119);
  713. var hiddenKeys = __webpack_require__(421);
  714. var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
  715. var TypeError = global.TypeError;
  716. var WeakMap = global.WeakMap;
  717. var set, get, has;
  718. var enforce = function (it) {
  719. return has(it) ? get(it) : set(it, {});
  720. };
  721. var getterFor = function (TYPE) {
  722. return function (it) {
  723. var state;
  724. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  725. throw new TypeError('Incompatible receiver, ' + TYPE + ' required');
  726. } return state;
  727. };
  728. };
  729. if (NATIVE_WEAK_MAP || shared.state) {
  730. var store = shared.state || (shared.state = new WeakMap());
  731. /* eslint-disable no-self-assign -- prototype methods protection */
  732. store.get = store.get;
  733. store.has = store.has;
  734. store.set = store.set;
  735. /* eslint-enable no-self-assign -- prototype methods protection */
  736. set = function (it, metadata) {
  737. if (store.has(it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
  738. metadata.facade = it;
  739. store.set(it, metadata);
  740. return metadata;
  741. };
  742. get = function (it) {
  743. return store.get(it) || {};
  744. };
  745. has = function (it) {
  746. return store.has(it);
  747. };
  748. } else {
  749. var STATE = sharedKey('state');
  750. hiddenKeys[STATE] = true;
  751. set = function (it, metadata) {
  752. if (hasOwn(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
  753. metadata.facade = it;
  754. createNonEnumerableProperty(it, STATE, metadata);
  755. return metadata;
  756. };
  757. get = function (it) {
  758. return hasOwn(it, STATE) ? it[STATE] : {};
  759. };
  760. has = function (it) {
  761. return hasOwn(it, STATE);
  762. };
  763. }
  764. module.exports = {
  765. set: set,
  766. get: get,
  767. has: has,
  768. enforce: enforce,
  769. getterFor: getterFor
  770. };
  771. /***/ }),
  772. /***/ 4209:
  773. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  774. var wellKnownSymbol = __webpack_require__(8227);
  775. var Iterators = __webpack_require__(6269);
  776. var ITERATOR = wellKnownSymbol('iterator');
  777. var ArrayPrototype = Array.prototype;
  778. // check on default Array iterator
  779. module.exports = function (it) {
  780. return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
  781. };
  782. /***/ }),
  783. /***/ 4376:
  784. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  785. var classof = __webpack_require__(4576);
  786. // `IsArray` abstract operation
  787. // https://tc39.es/ecma262/#sec-isarray
  788. // eslint-disable-next-line es/no-array-isarray -- safe
  789. module.exports = Array.isArray || function isArray(argument) {
  790. return classof(argument) === 'Array';
  791. };
  792. /***/ }),
  793. /***/ 4901:
  794. /***/ ((module) => {
  795. // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
  796. var documentAll = typeof document == 'object' && document.all;
  797. // `IsCallable` abstract operation
  798. // https://tc39.es/ecma262/#sec-iscallable
  799. // eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
  800. module.exports = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) {
  801. return typeof argument == 'function' || argument === documentAll;
  802. } : function (argument) {
  803. return typeof argument == 'function';
  804. };
  805. /***/ }),
  806. /***/ 2796:
  807. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  808. var fails = __webpack_require__(9039);
  809. var isCallable = __webpack_require__(4901);
  810. var replacement = /#|\.prototype\./;
  811. var isForced = function (feature, detection) {
  812. var value = data[normalize(feature)];
  813. return value === POLYFILL ? true
  814. : value === NATIVE ? false
  815. : isCallable(detection) ? fails(detection)
  816. : !!detection;
  817. };
  818. var normalize = isForced.normalize = function (string) {
  819. return String(string).replace(replacement, '.').toLowerCase();
  820. };
  821. var data = isForced.data = {};
  822. var NATIVE = isForced.NATIVE = 'N';
  823. var POLYFILL = isForced.POLYFILL = 'P';
  824. module.exports = isForced;
  825. /***/ }),
  826. /***/ 4117:
  827. /***/ ((module) => {
  828. // we can't use just `it == null` since of `document.all` special case
  829. // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
  830. module.exports = function (it) {
  831. return it === null || it === undefined;
  832. };
  833. /***/ }),
  834. /***/ 34:
  835. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  836. var isCallable = __webpack_require__(4901);
  837. module.exports = function (it) {
  838. return typeof it == 'object' ? it !== null : isCallable(it);
  839. };
  840. /***/ }),
  841. /***/ 6395:
  842. /***/ ((module) => {
  843. module.exports = false;
  844. /***/ }),
  845. /***/ 757:
  846. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  847. var getBuiltIn = __webpack_require__(7751);
  848. var isCallable = __webpack_require__(4901);
  849. var isPrototypeOf = __webpack_require__(1625);
  850. var USE_SYMBOL_AS_UID = __webpack_require__(7040);
  851. var $Object = Object;
  852. module.exports = USE_SYMBOL_AS_UID ? function (it) {
  853. return typeof it == 'symbol';
  854. } : function (it) {
  855. var $Symbol = getBuiltIn('Symbol');
  856. return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));
  857. };
  858. /***/ }),
  859. /***/ 507:
  860. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  861. var call = __webpack_require__(9565);
  862. module.exports = function (record, fn, ITERATOR_INSTEAD_OF_RECORD) {
  863. var iterator = ITERATOR_INSTEAD_OF_RECORD ? record : record.iterator;
  864. var next = record.next;
  865. var step, result;
  866. while (!(step = call(next, iterator)).done) {
  867. result = fn(step.value);
  868. if (result !== undefined) return result;
  869. }
  870. };
  871. /***/ }),
  872. /***/ 2652:
  873. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  874. var bind = __webpack_require__(6080);
  875. var call = __webpack_require__(9565);
  876. var anObject = __webpack_require__(8551);
  877. var tryToString = __webpack_require__(6823);
  878. var isArrayIteratorMethod = __webpack_require__(4209);
  879. var lengthOfArrayLike = __webpack_require__(6198);
  880. var isPrototypeOf = __webpack_require__(1625);
  881. var getIterator = __webpack_require__(81);
  882. var getIteratorMethod = __webpack_require__(851);
  883. var iteratorClose = __webpack_require__(9539);
  884. var $TypeError = TypeError;
  885. var Result = function (stopped, result) {
  886. this.stopped = stopped;
  887. this.result = result;
  888. };
  889. var ResultPrototype = Result.prototype;
  890. module.exports = function (iterable, unboundFunction, options) {
  891. var that = options && options.that;
  892. var AS_ENTRIES = !!(options && options.AS_ENTRIES);
  893. var IS_RECORD = !!(options && options.IS_RECORD);
  894. var IS_ITERATOR = !!(options && options.IS_ITERATOR);
  895. var INTERRUPTED = !!(options && options.INTERRUPTED);
  896. var fn = bind(unboundFunction, that);
  897. var iterator, iterFn, index, length, result, next, step;
  898. var stop = function (condition) {
  899. if (iterator) iteratorClose(iterator, 'normal', condition);
  900. return new Result(true, condition);
  901. };
  902. var callFn = function (value) {
  903. if (AS_ENTRIES) {
  904. anObject(value);
  905. return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
  906. } return INTERRUPTED ? fn(value, stop) : fn(value);
  907. };
  908. if (IS_RECORD) {
  909. iterator = iterable.iterator;
  910. } else if (IS_ITERATOR) {
  911. iterator = iterable;
  912. } else {
  913. iterFn = getIteratorMethod(iterable);
  914. if (!iterFn) throw new $TypeError(tryToString(iterable) + ' is not iterable');
  915. // optimisation for array iterators
  916. if (isArrayIteratorMethod(iterFn)) {
  917. for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
  918. result = callFn(iterable[index]);
  919. if (result && isPrototypeOf(ResultPrototype, result)) return result;
  920. } return new Result(false);
  921. }
  922. iterator = getIterator(iterable, iterFn);
  923. }
  924. next = IS_RECORD ? iterable.next : iterator.next;
  925. while (!(step = call(next, iterator)).done) {
  926. try {
  927. result = callFn(step.value);
  928. } catch (error) {
  929. iteratorClose(iterator, 'throw', error);
  930. }
  931. if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
  932. } return new Result(false);
  933. };
  934. /***/ }),
  935. /***/ 9539:
  936. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  937. var call = __webpack_require__(9565);
  938. var anObject = __webpack_require__(8551);
  939. var getMethod = __webpack_require__(5966);
  940. module.exports = function (iterator, kind, value) {
  941. var innerResult, innerError;
  942. anObject(iterator);
  943. try {
  944. innerResult = getMethod(iterator, 'return');
  945. if (!innerResult) {
  946. if (kind === 'throw') throw value;
  947. return value;
  948. }
  949. innerResult = call(innerResult, iterator);
  950. } catch (error) {
  951. innerError = true;
  952. innerResult = error;
  953. }
  954. if (kind === 'throw') throw value;
  955. if (innerError) throw innerResult;
  956. anObject(innerResult);
  957. return value;
  958. };
  959. /***/ }),
  960. /***/ 9462:
  961. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  962. var call = __webpack_require__(9565);
  963. var create = __webpack_require__(2360);
  964. var createNonEnumerableProperty = __webpack_require__(6699);
  965. var defineBuiltIns = __webpack_require__(6279);
  966. var wellKnownSymbol = __webpack_require__(8227);
  967. var InternalStateModule = __webpack_require__(1181);
  968. var getMethod = __webpack_require__(5966);
  969. var IteratorPrototype = (__webpack_require__(7657).IteratorPrototype);
  970. var createIterResultObject = __webpack_require__(2529);
  971. var iteratorClose = __webpack_require__(9539);
  972. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  973. var ITERATOR_HELPER = 'IteratorHelper';
  974. var WRAP_FOR_VALID_ITERATOR = 'WrapForValidIterator';
  975. var setInternalState = InternalStateModule.set;
  976. var createIteratorProxyPrototype = function (IS_ITERATOR) {
  977. var getInternalState = InternalStateModule.getterFor(IS_ITERATOR ? WRAP_FOR_VALID_ITERATOR : ITERATOR_HELPER);
  978. return defineBuiltIns(create(IteratorPrototype), {
  979. next: function next() {
  980. var state = getInternalState(this);
  981. // for simplification:
  982. // for `%WrapForValidIteratorPrototype%.next` our `nextHandler` returns `IterResultObject`
  983. // for `%IteratorHelperPrototype%.next` - just a value
  984. if (IS_ITERATOR) return state.nextHandler();
  985. try {
  986. var result = state.done ? undefined : state.nextHandler();
  987. return createIterResultObject(result, state.done);
  988. } catch (error) {
  989. state.done = true;
  990. throw error;
  991. }
  992. },
  993. 'return': function () {
  994. var state = getInternalState(this);
  995. var iterator = state.iterator;
  996. state.done = true;
  997. if (IS_ITERATOR) {
  998. var returnMethod = getMethod(iterator, 'return');
  999. return returnMethod ? call(returnMethod, iterator) : createIterResultObject(undefined, true);
  1000. }
  1001. if (state.inner) try {
  1002. iteratorClose(state.inner.iterator, 'normal');
  1003. } catch (error) {
  1004. return iteratorClose(iterator, 'throw', error);
  1005. }
  1006. iteratorClose(iterator, 'normal');
  1007. return createIterResultObject(undefined, true);
  1008. }
  1009. });
  1010. };
  1011. var WrapForValidIteratorPrototype = createIteratorProxyPrototype(true);
  1012. var IteratorHelperPrototype = createIteratorProxyPrototype(false);
  1013. createNonEnumerableProperty(IteratorHelperPrototype, TO_STRING_TAG, 'Iterator Helper');
  1014. module.exports = function (nextHandler, IS_ITERATOR) {
  1015. var IteratorProxy = function Iterator(record, state) {
  1016. if (state) {
  1017. state.iterator = record.iterator;
  1018. state.next = record.next;
  1019. } else state = record;
  1020. state.type = IS_ITERATOR ? WRAP_FOR_VALID_ITERATOR : ITERATOR_HELPER;
  1021. state.nextHandler = nextHandler;
  1022. state.counter = 0;
  1023. state.done = false;
  1024. setInternalState(this, state);
  1025. };
  1026. IteratorProxy.prototype = IS_ITERATOR ? WrapForValidIteratorPrototype : IteratorHelperPrototype;
  1027. return IteratorProxy;
  1028. };
  1029. /***/ }),
  1030. /***/ 713:
  1031. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1032. var call = __webpack_require__(9565);
  1033. var aCallable = __webpack_require__(9306);
  1034. var anObject = __webpack_require__(8551);
  1035. var getIteratorDirect = __webpack_require__(1767);
  1036. var createIteratorProxy = __webpack_require__(9462);
  1037. var callWithSafeIterationClosing = __webpack_require__(6319);
  1038. var IteratorProxy = createIteratorProxy(function () {
  1039. var iterator = this.iterator;
  1040. var result = anObject(call(this.next, iterator));
  1041. var done = this.done = !!result.done;
  1042. if (!done) return callWithSafeIterationClosing(iterator, this.mapper, [result.value, this.counter++], true);
  1043. });
  1044. // `Iterator.prototype.map` method
  1045. // https://github.com/tc39/proposal-iterator-helpers
  1046. module.exports = function map(mapper) {
  1047. anObject(this);
  1048. aCallable(mapper);
  1049. return new IteratorProxy(getIteratorDirect(this), {
  1050. mapper: mapper
  1051. });
  1052. };
  1053. /***/ }),
  1054. /***/ 7657:
  1055. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1056. var fails = __webpack_require__(9039);
  1057. var isCallable = __webpack_require__(4901);
  1058. var isObject = __webpack_require__(34);
  1059. var create = __webpack_require__(2360);
  1060. var getPrototypeOf = __webpack_require__(2787);
  1061. var defineBuiltIn = __webpack_require__(6840);
  1062. var wellKnownSymbol = __webpack_require__(8227);
  1063. var IS_PURE = __webpack_require__(6395);
  1064. var ITERATOR = wellKnownSymbol('iterator');
  1065. var BUGGY_SAFARI_ITERATORS = false;
  1066. // `%IteratorPrototype%` object
  1067. // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
  1068. var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
  1069. /* eslint-disable es/no-array-prototype-keys -- safe */
  1070. if ([].keys) {
  1071. arrayIterator = [].keys();
  1072. // Safari 8 has buggy iterators w/o `next`
  1073. if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
  1074. else {
  1075. PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));
  1076. if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
  1077. }
  1078. }
  1079. var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype) || fails(function () {
  1080. var test = {};
  1081. // FF44- legacy iterators case
  1082. return IteratorPrototype[ITERATOR].call(test) !== test;
  1083. });
  1084. if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {};
  1085. else if (IS_PURE) IteratorPrototype = create(IteratorPrototype);
  1086. // `%IteratorPrototype%[@@iterator]()` method
  1087. // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
  1088. if (!isCallable(IteratorPrototype[ITERATOR])) {
  1089. defineBuiltIn(IteratorPrototype, ITERATOR, function () {
  1090. return this;
  1091. });
  1092. }
  1093. module.exports = {
  1094. IteratorPrototype: IteratorPrototype,
  1095. BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
  1096. };
  1097. /***/ }),
  1098. /***/ 6269:
  1099. /***/ ((module) => {
  1100. module.exports = {};
  1101. /***/ }),
  1102. /***/ 6198:
  1103. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1104. var toLength = __webpack_require__(8014);
  1105. // `LengthOfArrayLike` abstract operation
  1106. // https://tc39.es/ecma262/#sec-lengthofarraylike
  1107. module.exports = function (obj) {
  1108. return toLength(obj.length);
  1109. };
  1110. /***/ }),
  1111. /***/ 283:
  1112. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1113. var uncurryThis = __webpack_require__(9504);
  1114. var fails = __webpack_require__(9039);
  1115. var isCallable = __webpack_require__(4901);
  1116. var hasOwn = __webpack_require__(9297);
  1117. var DESCRIPTORS = __webpack_require__(3724);
  1118. var CONFIGURABLE_FUNCTION_NAME = (__webpack_require__(350).CONFIGURABLE);
  1119. var inspectSource = __webpack_require__(3706);
  1120. var InternalStateModule = __webpack_require__(1181);
  1121. var enforceInternalState = InternalStateModule.enforce;
  1122. var getInternalState = InternalStateModule.get;
  1123. var $String = String;
  1124. // eslint-disable-next-line es/no-object-defineproperty -- safe
  1125. var defineProperty = Object.defineProperty;
  1126. var stringSlice = uncurryThis(''.slice);
  1127. var replace = uncurryThis(''.replace);
  1128. var join = uncurryThis([].join);
  1129. var CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function () {
  1130. return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
  1131. });
  1132. var TEMPLATE = String(String).split('String');
  1133. var makeBuiltIn = module.exports = function (value, name, options) {
  1134. if (stringSlice($String(name), 0, 7) === 'Symbol(') {
  1135. name = '[' + replace($String(name), /^Symbol\(([^)]*)\).*$/, '$1') + ']';
  1136. }
  1137. if (options && options.getter) name = 'get ' + name;
  1138. if (options && options.setter) name = 'set ' + name;
  1139. if (!hasOwn(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
  1140. if (DESCRIPTORS) defineProperty(value, 'name', { value: name, configurable: true });
  1141. else value.name = name;
  1142. }
  1143. if (CONFIGURABLE_LENGTH && options && hasOwn(options, 'arity') && value.length !== options.arity) {
  1144. defineProperty(value, 'length', { value: options.arity });
  1145. }
  1146. try {
  1147. if (options && hasOwn(options, 'constructor') && options.constructor) {
  1148. if (DESCRIPTORS) defineProperty(value, 'prototype', { writable: false });
  1149. // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
  1150. } else if (value.prototype) value.prototype = undefined;
  1151. } catch (error) { /* empty */ }
  1152. var state = enforceInternalState(value);
  1153. if (!hasOwn(state, 'source')) {
  1154. state.source = join(TEMPLATE, typeof name == 'string' ? name : '');
  1155. } return value;
  1156. };
  1157. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  1158. // eslint-disable-next-line no-extend-native -- required
  1159. Function.prototype.toString = makeBuiltIn(function toString() {
  1160. return isCallable(this) && getInternalState(this).source || inspectSource(this);
  1161. }, 'toString');
  1162. /***/ }),
  1163. /***/ 741:
  1164. /***/ ((module) => {
  1165. var ceil = Math.ceil;
  1166. var floor = Math.floor;
  1167. // `Math.trunc` method
  1168. // https://tc39.es/ecma262/#sec-math.trunc
  1169. // eslint-disable-next-line es/no-math-trunc -- safe
  1170. module.exports = Math.trunc || function trunc(x) {
  1171. var n = +x;
  1172. return (n > 0 ? floor : ceil)(n);
  1173. };
  1174. /***/ }),
  1175. /***/ 6043:
  1176. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1177. var aCallable = __webpack_require__(9306);
  1178. var $TypeError = TypeError;
  1179. var PromiseCapability = function (C) {
  1180. var resolve, reject;
  1181. this.promise = new C(function ($$resolve, $$reject) {
  1182. if (resolve !== undefined || reject !== undefined) throw new $TypeError('Bad Promise constructor');
  1183. resolve = $$resolve;
  1184. reject = $$reject;
  1185. });
  1186. this.resolve = aCallable(resolve);
  1187. this.reject = aCallable(reject);
  1188. };
  1189. // `NewPromiseCapability` abstract operation
  1190. // https://tc39.es/ecma262/#sec-newpromisecapability
  1191. module.exports.f = function (C) {
  1192. return new PromiseCapability(C);
  1193. };
  1194. /***/ }),
  1195. /***/ 2360:
  1196. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1197. /* global ActiveXObject -- old IE, WSH */
  1198. var anObject = __webpack_require__(8551);
  1199. var definePropertiesModule = __webpack_require__(6801);
  1200. var enumBugKeys = __webpack_require__(8727);
  1201. var hiddenKeys = __webpack_require__(421);
  1202. var html = __webpack_require__(397);
  1203. var documentCreateElement = __webpack_require__(4055);
  1204. var sharedKey = __webpack_require__(6119);
  1205. var GT = '>';
  1206. var LT = '<';
  1207. var PROTOTYPE = 'prototype';
  1208. var SCRIPT = 'script';
  1209. var IE_PROTO = sharedKey('IE_PROTO');
  1210. var EmptyConstructor = function () { /* empty */ };
  1211. var scriptTag = function (content) {
  1212. return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
  1213. };
  1214. // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
  1215. var NullProtoObjectViaActiveX = function (activeXDocument) {
  1216. activeXDocument.write(scriptTag(''));
  1217. activeXDocument.close();
  1218. var temp = activeXDocument.parentWindow.Object;
  1219. activeXDocument = null; // avoid memory leak
  1220. return temp;
  1221. };
  1222. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  1223. var NullProtoObjectViaIFrame = function () {
  1224. // Thrash, waste and sodomy: IE GC bug
  1225. var iframe = documentCreateElement('iframe');
  1226. var JS = 'java' + SCRIPT + ':';
  1227. var iframeDocument;
  1228. iframe.style.display = 'none';
  1229. html.appendChild(iframe);
  1230. // https://github.com/zloirock/core-js/issues/475
  1231. iframe.src = String(JS);
  1232. iframeDocument = iframe.contentWindow.document;
  1233. iframeDocument.open();
  1234. iframeDocument.write(scriptTag('document.F=Object'));
  1235. iframeDocument.close();
  1236. return iframeDocument.F;
  1237. };
  1238. // Check for document.domain and active x support
  1239. // No need to use active x approach when document.domain is not set
  1240. // see https://github.com/es-shims/es5-shim/issues/150
  1241. // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
  1242. // avoid IE GC bug
  1243. var activeXDocument;
  1244. var NullProtoObject = function () {
  1245. try {
  1246. activeXDocument = new ActiveXObject('htmlfile');
  1247. } catch (error) { /* ignore */ }
  1248. NullProtoObject = typeof document != 'undefined'
  1249. ? document.domain && activeXDocument
  1250. ? NullProtoObjectViaActiveX(activeXDocument) // old IE
  1251. : NullProtoObjectViaIFrame()
  1252. : NullProtoObjectViaActiveX(activeXDocument); // WSH
  1253. var length = enumBugKeys.length;
  1254. while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
  1255. return NullProtoObject();
  1256. };
  1257. hiddenKeys[IE_PROTO] = true;
  1258. // `Object.create` method
  1259. // https://tc39.es/ecma262/#sec-object.create
  1260. // eslint-disable-next-line es/no-object-create -- safe
  1261. module.exports = Object.create || function create(O, Properties) {
  1262. var result;
  1263. if (O !== null) {
  1264. EmptyConstructor[PROTOTYPE] = anObject(O);
  1265. result = new EmptyConstructor();
  1266. EmptyConstructor[PROTOTYPE] = null;
  1267. // add "__proto__" for Object.getPrototypeOf polyfill
  1268. result[IE_PROTO] = O;
  1269. } else result = NullProtoObject();
  1270. return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
  1271. };
  1272. /***/ }),
  1273. /***/ 6801:
  1274. /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
  1275. var DESCRIPTORS = __webpack_require__(3724);
  1276. var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(8686);
  1277. var definePropertyModule = __webpack_require__(4913);
  1278. var anObject = __webpack_require__(8551);
  1279. var toIndexedObject = __webpack_require__(5397);
  1280. var objectKeys = __webpack_require__(1072);
  1281. // `Object.defineProperties` method
  1282. // https://tc39.es/ecma262/#sec-object.defineproperties
  1283. // eslint-disable-next-line es/no-object-defineproperties -- safe
  1284. exports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
  1285. anObject(O);
  1286. var props = toIndexedObject(Properties);
  1287. var keys = objectKeys(Properties);
  1288. var length = keys.length;
  1289. var index = 0;
  1290. var key;
  1291. while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
  1292. return O;
  1293. };
  1294. /***/ }),
  1295. /***/ 4913:
  1296. /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
  1297. var DESCRIPTORS = __webpack_require__(3724);
  1298. var IE8_DOM_DEFINE = __webpack_require__(5917);
  1299. var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(8686);
  1300. var anObject = __webpack_require__(8551);
  1301. var toPropertyKey = __webpack_require__(6969);
  1302. var $TypeError = TypeError;
  1303. // eslint-disable-next-line es/no-object-defineproperty -- safe
  1304. var $defineProperty = Object.defineProperty;
  1305. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  1306. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  1307. var ENUMERABLE = 'enumerable';
  1308. var CONFIGURABLE = 'configurable';
  1309. var WRITABLE = 'writable';
  1310. // `Object.defineProperty` method
  1311. // https://tc39.es/ecma262/#sec-object.defineproperty
  1312. exports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {
  1313. anObject(O);
  1314. P = toPropertyKey(P);
  1315. anObject(Attributes);
  1316. if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
  1317. var current = $getOwnPropertyDescriptor(O, P);
  1318. if (current && current[WRITABLE]) {
  1319. O[P] = Attributes.value;
  1320. Attributes = {
  1321. configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],
  1322. enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
  1323. writable: false
  1324. };
  1325. }
  1326. } return $defineProperty(O, P, Attributes);
  1327. } : $defineProperty : function defineProperty(O, P, Attributes) {
  1328. anObject(O);
  1329. P = toPropertyKey(P);
  1330. anObject(Attributes);
  1331. if (IE8_DOM_DEFINE) try {
  1332. return $defineProperty(O, P, Attributes);
  1333. } catch (error) { /* empty */ }
  1334. if ('get' in Attributes || 'set' in Attributes) throw new $TypeError('Accessors not supported');
  1335. if ('value' in Attributes) O[P] = Attributes.value;
  1336. return O;
  1337. };
  1338. /***/ }),
  1339. /***/ 7347:
  1340. /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
  1341. var DESCRIPTORS = __webpack_require__(3724);
  1342. var call = __webpack_require__(9565);
  1343. var propertyIsEnumerableModule = __webpack_require__(8773);
  1344. var createPropertyDescriptor = __webpack_require__(6980);
  1345. var toIndexedObject = __webpack_require__(5397);
  1346. var toPropertyKey = __webpack_require__(6969);
  1347. var hasOwn = __webpack_require__(9297);
  1348. var IE8_DOM_DEFINE = __webpack_require__(5917);
  1349. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  1350. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  1351. // `Object.getOwnPropertyDescriptor` method
  1352. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
  1353. exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
  1354. O = toIndexedObject(O);
  1355. P = toPropertyKey(P);
  1356. if (IE8_DOM_DEFINE) try {
  1357. return $getOwnPropertyDescriptor(O, P);
  1358. } catch (error) { /* empty */ }
  1359. if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);
  1360. };
  1361. /***/ }),
  1362. /***/ 8480:
  1363. /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
  1364. var internalObjectKeys = __webpack_require__(1828);
  1365. var enumBugKeys = __webpack_require__(8727);
  1366. var hiddenKeys = enumBugKeys.concat('length', 'prototype');
  1367. // `Object.getOwnPropertyNames` method
  1368. // https://tc39.es/ecma262/#sec-object.getownpropertynames
  1369. // eslint-disable-next-line es/no-object-getownpropertynames -- safe
  1370. exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  1371. return internalObjectKeys(O, hiddenKeys);
  1372. };
  1373. /***/ }),
  1374. /***/ 3717:
  1375. /***/ ((__unused_webpack_module, exports) => {
  1376. // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
  1377. exports.f = Object.getOwnPropertySymbols;
  1378. /***/ }),
  1379. /***/ 2787:
  1380. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1381. var hasOwn = __webpack_require__(9297);
  1382. var isCallable = __webpack_require__(4901);
  1383. var toObject = __webpack_require__(8981);
  1384. var sharedKey = __webpack_require__(6119);
  1385. var CORRECT_PROTOTYPE_GETTER = __webpack_require__(2211);
  1386. var IE_PROTO = sharedKey('IE_PROTO');
  1387. var $Object = Object;
  1388. var ObjectPrototype = $Object.prototype;
  1389. // `Object.getPrototypeOf` method
  1390. // https://tc39.es/ecma262/#sec-object.getprototypeof
  1391. // eslint-disable-next-line es/no-object-getprototypeof -- safe
  1392. module.exports = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {
  1393. var object = toObject(O);
  1394. if (hasOwn(object, IE_PROTO)) return object[IE_PROTO];
  1395. var constructor = object.constructor;
  1396. if (isCallable(constructor) && object instanceof constructor) {
  1397. return constructor.prototype;
  1398. } return object instanceof $Object ? ObjectPrototype : null;
  1399. };
  1400. /***/ }),
  1401. /***/ 1625:
  1402. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1403. var uncurryThis = __webpack_require__(9504);
  1404. module.exports = uncurryThis({}.isPrototypeOf);
  1405. /***/ }),
  1406. /***/ 1828:
  1407. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1408. var uncurryThis = __webpack_require__(9504);
  1409. var hasOwn = __webpack_require__(9297);
  1410. var toIndexedObject = __webpack_require__(5397);
  1411. var indexOf = (__webpack_require__(9617).indexOf);
  1412. var hiddenKeys = __webpack_require__(421);
  1413. var push = uncurryThis([].push);
  1414. module.exports = function (object, names) {
  1415. var O = toIndexedObject(object);
  1416. var i = 0;
  1417. var result = [];
  1418. var key;
  1419. for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);
  1420. // Don't enum bug & hidden keys
  1421. while (names.length > i) if (hasOwn(O, key = names[i++])) {
  1422. ~indexOf(result, key) || push(result, key);
  1423. }
  1424. return result;
  1425. };
  1426. /***/ }),
  1427. /***/ 1072:
  1428. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1429. var internalObjectKeys = __webpack_require__(1828);
  1430. var enumBugKeys = __webpack_require__(8727);
  1431. // `Object.keys` method
  1432. // https://tc39.es/ecma262/#sec-object.keys
  1433. // eslint-disable-next-line es/no-object-keys -- safe
  1434. module.exports = Object.keys || function keys(O) {
  1435. return internalObjectKeys(O, enumBugKeys);
  1436. };
  1437. /***/ }),
  1438. /***/ 8773:
  1439. /***/ ((__unused_webpack_module, exports) => {
  1440. var $propertyIsEnumerable = {}.propertyIsEnumerable;
  1441. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  1442. var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  1443. // Nashorn ~ JDK8 bug
  1444. var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);
  1445. // `Object.prototype.propertyIsEnumerable` method implementation
  1446. // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
  1447. exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
  1448. var descriptor = getOwnPropertyDescriptor(this, V);
  1449. return !!descriptor && descriptor.enumerable;
  1450. } : $propertyIsEnumerable;
  1451. /***/ }),
  1452. /***/ 4270:
  1453. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1454. var call = __webpack_require__(9565);
  1455. var isCallable = __webpack_require__(4901);
  1456. var isObject = __webpack_require__(34);
  1457. var $TypeError = TypeError;
  1458. // `OrdinaryToPrimitive` abstract operation
  1459. // https://tc39.es/ecma262/#sec-ordinarytoprimitive
  1460. module.exports = function (input, pref) {
  1461. var fn, val;
  1462. if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
  1463. if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;
  1464. if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
  1465. throw new $TypeError("Can't convert object to primitive value");
  1466. };
  1467. /***/ }),
  1468. /***/ 5031:
  1469. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1470. var getBuiltIn = __webpack_require__(7751);
  1471. var uncurryThis = __webpack_require__(9504);
  1472. var getOwnPropertyNamesModule = __webpack_require__(8480);
  1473. var getOwnPropertySymbolsModule = __webpack_require__(3717);
  1474. var anObject = __webpack_require__(8551);
  1475. var concat = uncurryThis([].concat);
  1476. // all object keys, includes non-enumerable and symbols
  1477. module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  1478. var keys = getOwnPropertyNamesModule.f(anObject(it));
  1479. var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
  1480. return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
  1481. };
  1482. /***/ }),
  1483. /***/ 8235:
  1484. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1485. var uncurryThis = __webpack_require__(9504);
  1486. var hasOwn = __webpack_require__(9297);
  1487. var $SyntaxError = SyntaxError;
  1488. var $parseInt = parseInt;
  1489. var fromCharCode = String.fromCharCode;
  1490. var at = uncurryThis(''.charAt);
  1491. var slice = uncurryThis(''.slice);
  1492. var exec = uncurryThis(/./.exec);
  1493. var codePoints = {
  1494. '\\"': '"',
  1495. '\\\\': '\\',
  1496. '\\/': '/',
  1497. '\\b': '\b',
  1498. '\\f': '\f',
  1499. '\\n': '\n',
  1500. '\\r': '\r',
  1501. '\\t': '\t'
  1502. };
  1503. var IS_4_HEX_DIGITS = /^[\da-f]{4}$/i;
  1504. // eslint-disable-next-line regexp/no-control-character -- safe
  1505. var IS_C0_CONTROL_CODE = /^[\u0000-\u001F]$/;
  1506. module.exports = function (source, i) {
  1507. var unterminated = true;
  1508. var value = '';
  1509. while (i < source.length) {
  1510. var chr = at(source, i);
  1511. if (chr === '\\') {
  1512. var twoChars = slice(source, i, i + 2);
  1513. if (hasOwn(codePoints, twoChars)) {
  1514. value += codePoints[twoChars];
  1515. i += 2;
  1516. } else if (twoChars === '\\u') {
  1517. i += 2;
  1518. var fourHexDigits = slice(source, i, i + 4);
  1519. if (!exec(IS_4_HEX_DIGITS, fourHexDigits)) throw new $SyntaxError('Bad Unicode escape at: ' + i);
  1520. value += fromCharCode($parseInt(fourHexDigits, 16));
  1521. i += 4;
  1522. } else throw new $SyntaxError('Unknown escape sequence: "' + twoChars + '"');
  1523. } else if (chr === '"') {
  1524. unterminated = false;
  1525. i++;
  1526. break;
  1527. } else {
  1528. if (exec(IS_C0_CONTROL_CODE, chr)) throw new $SyntaxError('Bad control character in string literal at: ' + i);
  1529. value += chr;
  1530. i++;
  1531. }
  1532. }
  1533. if (unterminated) throw new $SyntaxError('Unterminated string at: ' + i);
  1534. return { value: value, end: i };
  1535. };
  1536. /***/ }),
  1537. /***/ 7750:
  1538. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1539. var isNullOrUndefined = __webpack_require__(4117);
  1540. var $TypeError = TypeError;
  1541. // `RequireObjectCoercible` abstract operation
  1542. // https://tc39.es/ecma262/#sec-requireobjectcoercible
  1543. module.exports = function (it) {
  1544. if (isNullOrUndefined(it)) throw new $TypeError("Can't call method on " + it);
  1545. return it;
  1546. };
  1547. /***/ }),
  1548. /***/ 9286:
  1549. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1550. var SetHelpers = __webpack_require__(4402);
  1551. var iterate = __webpack_require__(8469);
  1552. var Set = SetHelpers.Set;
  1553. var add = SetHelpers.add;
  1554. module.exports = function (set) {
  1555. var result = new Set();
  1556. iterate(set, function (it) {
  1557. add(result, it);
  1558. });
  1559. return result;
  1560. };
  1561. /***/ }),
  1562. /***/ 3440:
  1563. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1564. var aSet = __webpack_require__(7080);
  1565. var SetHelpers = __webpack_require__(4402);
  1566. var clone = __webpack_require__(9286);
  1567. var size = __webpack_require__(5170);
  1568. var getSetRecord = __webpack_require__(3789);
  1569. var iterateSet = __webpack_require__(8469);
  1570. var iterateSimple = __webpack_require__(507);
  1571. var has = SetHelpers.has;
  1572. var remove = SetHelpers.remove;
  1573. // `Set.prototype.difference` method
  1574. // https://github.com/tc39/proposal-set-methods
  1575. module.exports = function difference(other) {
  1576. var O = aSet(this);
  1577. var otherRec = getSetRecord(other);
  1578. var result = clone(O);
  1579. if (size(O) <= otherRec.size) iterateSet(O, function (e) {
  1580. if (otherRec.includes(e)) remove(result, e);
  1581. });
  1582. else iterateSimple(otherRec.getIterator(), function (e) {
  1583. if (has(O, e)) remove(result, e);
  1584. });
  1585. return result;
  1586. };
  1587. /***/ }),
  1588. /***/ 4402:
  1589. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1590. var uncurryThis = __webpack_require__(9504);
  1591. // eslint-disable-next-line es/no-set -- safe
  1592. var SetPrototype = Set.prototype;
  1593. module.exports = {
  1594. // eslint-disable-next-line es/no-set -- safe
  1595. Set: Set,
  1596. add: uncurryThis(SetPrototype.add),
  1597. has: uncurryThis(SetPrototype.has),
  1598. remove: uncurryThis(SetPrototype['delete']),
  1599. proto: SetPrototype
  1600. };
  1601. /***/ }),
  1602. /***/ 8750:
  1603. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1604. var aSet = __webpack_require__(7080);
  1605. var SetHelpers = __webpack_require__(4402);
  1606. var size = __webpack_require__(5170);
  1607. var getSetRecord = __webpack_require__(3789);
  1608. var iterateSet = __webpack_require__(8469);
  1609. var iterateSimple = __webpack_require__(507);
  1610. var Set = SetHelpers.Set;
  1611. var add = SetHelpers.add;
  1612. var has = SetHelpers.has;
  1613. // `Set.prototype.intersection` method
  1614. // https://github.com/tc39/proposal-set-methods
  1615. module.exports = function intersection(other) {
  1616. var O = aSet(this);
  1617. var otherRec = getSetRecord(other);
  1618. var result = new Set();
  1619. if (size(O) > otherRec.size) {
  1620. iterateSimple(otherRec.getIterator(), function (e) {
  1621. if (has(O, e)) add(result, e);
  1622. });
  1623. } else {
  1624. iterateSet(O, function (e) {
  1625. if (otherRec.includes(e)) add(result, e);
  1626. });
  1627. }
  1628. return result;
  1629. };
  1630. /***/ }),
  1631. /***/ 4449:
  1632. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1633. var aSet = __webpack_require__(7080);
  1634. var has = (__webpack_require__(4402).has);
  1635. var size = __webpack_require__(5170);
  1636. var getSetRecord = __webpack_require__(3789);
  1637. var iterateSet = __webpack_require__(8469);
  1638. var iterateSimple = __webpack_require__(507);
  1639. var iteratorClose = __webpack_require__(9539);
  1640. // `Set.prototype.isDisjointFrom` method
  1641. // https://tc39.github.io/proposal-set-methods/#Set.prototype.isDisjointFrom
  1642. module.exports = function isDisjointFrom(other) {
  1643. var O = aSet(this);
  1644. var otherRec = getSetRecord(other);
  1645. if (size(O) <= otherRec.size) return iterateSet(O, function (e) {
  1646. if (otherRec.includes(e)) return false;
  1647. }, true) !== false;
  1648. var iterator = otherRec.getIterator();
  1649. return iterateSimple(iterator, function (e) {
  1650. if (has(O, e)) return iteratorClose(iterator, 'normal', false);
  1651. }) !== false;
  1652. };
  1653. /***/ }),
  1654. /***/ 3838:
  1655. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1656. var aSet = __webpack_require__(7080);
  1657. var size = __webpack_require__(5170);
  1658. var iterate = __webpack_require__(8469);
  1659. var getSetRecord = __webpack_require__(3789);
  1660. // `Set.prototype.isSubsetOf` method
  1661. // https://tc39.github.io/proposal-set-methods/#Set.prototype.isSubsetOf
  1662. module.exports = function isSubsetOf(other) {
  1663. var O = aSet(this);
  1664. var otherRec = getSetRecord(other);
  1665. if (size(O) > otherRec.size) return false;
  1666. return iterate(O, function (e) {
  1667. if (!otherRec.includes(e)) return false;
  1668. }, true) !== false;
  1669. };
  1670. /***/ }),
  1671. /***/ 8527:
  1672. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1673. var aSet = __webpack_require__(7080);
  1674. var has = (__webpack_require__(4402).has);
  1675. var size = __webpack_require__(5170);
  1676. var getSetRecord = __webpack_require__(3789);
  1677. var iterateSimple = __webpack_require__(507);
  1678. var iteratorClose = __webpack_require__(9539);
  1679. // `Set.prototype.isSupersetOf` method
  1680. // https://tc39.github.io/proposal-set-methods/#Set.prototype.isSupersetOf
  1681. module.exports = function isSupersetOf(other) {
  1682. var O = aSet(this);
  1683. var otherRec = getSetRecord(other);
  1684. if (size(O) < otherRec.size) return false;
  1685. var iterator = otherRec.getIterator();
  1686. return iterateSimple(iterator, function (e) {
  1687. if (!has(O, e)) return iteratorClose(iterator, 'normal', false);
  1688. }) !== false;
  1689. };
  1690. /***/ }),
  1691. /***/ 8469:
  1692. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1693. var uncurryThis = __webpack_require__(9504);
  1694. var iterateSimple = __webpack_require__(507);
  1695. var SetHelpers = __webpack_require__(4402);
  1696. var Set = SetHelpers.Set;
  1697. var SetPrototype = SetHelpers.proto;
  1698. var forEach = uncurryThis(SetPrototype.forEach);
  1699. var keys = uncurryThis(SetPrototype.keys);
  1700. var next = keys(new Set()).next;
  1701. module.exports = function (set, fn, interruptible) {
  1702. return interruptible ? iterateSimple({ iterator: keys(set), next: next }, fn) : forEach(set, fn);
  1703. };
  1704. /***/ }),
  1705. /***/ 4916:
  1706. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1707. var getBuiltIn = __webpack_require__(7751);
  1708. var createSetLike = function (size) {
  1709. return {
  1710. size: size,
  1711. has: function () {
  1712. return false;
  1713. },
  1714. keys: function () {
  1715. return {
  1716. next: function () {
  1717. return { done: true };
  1718. }
  1719. };
  1720. }
  1721. };
  1722. };
  1723. module.exports = function (name) {
  1724. var Set = getBuiltIn('Set');
  1725. try {
  1726. new Set()[name](createSetLike(0));
  1727. try {
  1728. // late spec change, early WebKit ~ Safari 17.0 beta implementation does not pass it
  1729. // https://github.com/tc39/proposal-set-methods/pull/88
  1730. new Set()[name](createSetLike(-1));
  1731. return false;
  1732. } catch (error2) {
  1733. return true;
  1734. }
  1735. } catch (error) {
  1736. return false;
  1737. }
  1738. };
  1739. /***/ }),
  1740. /***/ 5170:
  1741. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1742. var uncurryThisAccessor = __webpack_require__(6706);
  1743. var SetHelpers = __webpack_require__(4402);
  1744. module.exports = uncurryThisAccessor(SetHelpers.proto, 'size', 'get') || function (set) {
  1745. return set.size;
  1746. };
  1747. /***/ }),
  1748. /***/ 3650:
  1749. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1750. var aSet = __webpack_require__(7080);
  1751. var SetHelpers = __webpack_require__(4402);
  1752. var clone = __webpack_require__(9286);
  1753. var getSetRecord = __webpack_require__(3789);
  1754. var iterateSimple = __webpack_require__(507);
  1755. var add = SetHelpers.add;
  1756. var has = SetHelpers.has;
  1757. var remove = SetHelpers.remove;
  1758. // `Set.prototype.symmetricDifference` method
  1759. // https://github.com/tc39/proposal-set-methods
  1760. module.exports = function symmetricDifference(other) {
  1761. var O = aSet(this);
  1762. var keysIter = getSetRecord(other).getIterator();
  1763. var result = clone(O);
  1764. iterateSimple(keysIter, function (e) {
  1765. if (has(O, e)) remove(result, e);
  1766. else add(result, e);
  1767. });
  1768. return result;
  1769. };
  1770. /***/ }),
  1771. /***/ 4204:
  1772. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1773. var aSet = __webpack_require__(7080);
  1774. var add = (__webpack_require__(4402).add);
  1775. var clone = __webpack_require__(9286);
  1776. var getSetRecord = __webpack_require__(3789);
  1777. var iterateSimple = __webpack_require__(507);
  1778. // `Set.prototype.union` method
  1779. // https://github.com/tc39/proposal-set-methods
  1780. module.exports = function union(other) {
  1781. var O = aSet(this);
  1782. var keysIter = getSetRecord(other).getIterator();
  1783. var result = clone(O);
  1784. iterateSimple(keysIter, function (it) {
  1785. add(result, it);
  1786. });
  1787. return result;
  1788. };
  1789. /***/ }),
  1790. /***/ 6119:
  1791. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1792. var shared = __webpack_require__(5745);
  1793. var uid = __webpack_require__(3392);
  1794. var keys = shared('keys');
  1795. module.exports = function (key) {
  1796. return keys[key] || (keys[key] = uid(key));
  1797. };
  1798. /***/ }),
  1799. /***/ 7629:
  1800. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1801. var IS_PURE = __webpack_require__(6395);
  1802. var globalThis = __webpack_require__(4475);
  1803. var defineGlobalProperty = __webpack_require__(9433);
  1804. var SHARED = '__core-js_shared__';
  1805. var store = module.exports = globalThis[SHARED] || defineGlobalProperty(SHARED, {});
  1806. (store.versions || (store.versions = [])).push({
  1807. version: '3.37.0',
  1808. mode: IS_PURE ? 'pure' : 'global',
  1809. copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',
  1810. license: 'https://github.com/zloirock/core-js/blob/v3.37.0/LICENSE',
  1811. source: 'https://github.com/zloirock/core-js'
  1812. });
  1813. /***/ }),
  1814. /***/ 5745:
  1815. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1816. var store = __webpack_require__(7629);
  1817. module.exports = function (key, value) {
  1818. return store[key] || (store[key] = value || {});
  1819. };
  1820. /***/ }),
  1821. /***/ 4495:
  1822. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1823. /* eslint-disable es/no-symbol -- required for testing */
  1824. var V8_VERSION = __webpack_require__(7388);
  1825. var fails = __webpack_require__(9039);
  1826. var global = __webpack_require__(4475);
  1827. var $String = global.String;
  1828. // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
  1829. module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
  1830. var symbol = Symbol('symbol detection');
  1831. // Chrome 38 Symbol has incorrect toString conversion
  1832. // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
  1833. // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
  1834. // of course, fail.
  1835. return !$String(symbol) || !(Object(symbol) instanceof Symbol) ||
  1836. // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
  1837. !Symbol.sham && V8_VERSION && V8_VERSION < 41;
  1838. });
  1839. /***/ }),
  1840. /***/ 5610:
  1841. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1842. var toIntegerOrInfinity = __webpack_require__(1291);
  1843. var max = Math.max;
  1844. var min = Math.min;
  1845. // Helper for a popular repeating case of the spec:
  1846. // Let integer be ? ToInteger(index).
  1847. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  1848. module.exports = function (index, length) {
  1849. var integer = toIntegerOrInfinity(index);
  1850. return integer < 0 ? max(integer + length, 0) : min(integer, length);
  1851. };
  1852. /***/ }),
  1853. /***/ 5397:
  1854. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1855. // toObject with fallback for non-array-like ES3 strings
  1856. var IndexedObject = __webpack_require__(7055);
  1857. var requireObjectCoercible = __webpack_require__(7750);
  1858. module.exports = function (it) {
  1859. return IndexedObject(requireObjectCoercible(it));
  1860. };
  1861. /***/ }),
  1862. /***/ 1291:
  1863. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1864. var trunc = __webpack_require__(741);
  1865. // `ToIntegerOrInfinity` abstract operation
  1866. // https://tc39.es/ecma262/#sec-tointegerorinfinity
  1867. module.exports = function (argument) {
  1868. var number = +argument;
  1869. // eslint-disable-next-line no-self-compare -- NaN check
  1870. return number !== number || number === 0 ? 0 : trunc(number);
  1871. };
  1872. /***/ }),
  1873. /***/ 8014:
  1874. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1875. var toIntegerOrInfinity = __webpack_require__(1291);
  1876. var min = Math.min;
  1877. // `ToLength` abstract operation
  1878. // https://tc39.es/ecma262/#sec-tolength
  1879. module.exports = function (argument) {
  1880. var len = toIntegerOrInfinity(argument);
  1881. return len > 0 ? min(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  1882. };
  1883. /***/ }),
  1884. /***/ 8981:
  1885. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1886. var requireObjectCoercible = __webpack_require__(7750);
  1887. var $Object = Object;
  1888. // `ToObject` abstract operation
  1889. // https://tc39.es/ecma262/#sec-toobject
  1890. module.exports = function (argument) {
  1891. return $Object(requireObjectCoercible(argument));
  1892. };
  1893. /***/ }),
  1894. /***/ 2777:
  1895. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1896. var call = __webpack_require__(9565);
  1897. var isObject = __webpack_require__(34);
  1898. var isSymbol = __webpack_require__(757);
  1899. var getMethod = __webpack_require__(5966);
  1900. var ordinaryToPrimitive = __webpack_require__(4270);
  1901. var wellKnownSymbol = __webpack_require__(8227);
  1902. var $TypeError = TypeError;
  1903. var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
  1904. // `ToPrimitive` abstract operation
  1905. // https://tc39.es/ecma262/#sec-toprimitive
  1906. module.exports = function (input, pref) {
  1907. if (!isObject(input) || isSymbol(input)) return input;
  1908. var exoticToPrim = getMethod(input, TO_PRIMITIVE);
  1909. var result;
  1910. if (exoticToPrim) {
  1911. if (pref === undefined) pref = 'default';
  1912. result = call(exoticToPrim, input, pref);
  1913. if (!isObject(result) || isSymbol(result)) return result;
  1914. throw new $TypeError("Can't convert object to primitive value");
  1915. }
  1916. if (pref === undefined) pref = 'number';
  1917. return ordinaryToPrimitive(input, pref);
  1918. };
  1919. /***/ }),
  1920. /***/ 6969:
  1921. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1922. var toPrimitive = __webpack_require__(2777);
  1923. var isSymbol = __webpack_require__(757);
  1924. // `ToPropertyKey` abstract operation
  1925. // https://tc39.es/ecma262/#sec-topropertykey
  1926. module.exports = function (argument) {
  1927. var key = toPrimitive(argument, 'string');
  1928. return isSymbol(key) ? key : key + '';
  1929. };
  1930. /***/ }),
  1931. /***/ 2140:
  1932. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1933. var wellKnownSymbol = __webpack_require__(8227);
  1934. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  1935. var test = {};
  1936. test[TO_STRING_TAG] = 'z';
  1937. module.exports = String(test) === '[object z]';
  1938. /***/ }),
  1939. /***/ 655:
  1940. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1941. var classof = __webpack_require__(6955);
  1942. var $String = String;
  1943. module.exports = function (argument) {
  1944. if (classof(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string');
  1945. return $String(argument);
  1946. };
  1947. /***/ }),
  1948. /***/ 6823:
  1949. /***/ ((module) => {
  1950. var $String = String;
  1951. module.exports = function (argument) {
  1952. try {
  1953. return $String(argument);
  1954. } catch (error) {
  1955. return 'Object';
  1956. }
  1957. };
  1958. /***/ }),
  1959. /***/ 3392:
  1960. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1961. var uncurryThis = __webpack_require__(9504);
  1962. var id = 0;
  1963. var postfix = Math.random();
  1964. var toString = uncurryThis(1.0.toString);
  1965. module.exports = function (key) {
  1966. return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
  1967. };
  1968. /***/ }),
  1969. /***/ 7040:
  1970. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1971. /* eslint-disable es/no-symbol -- required for testing */
  1972. var NATIVE_SYMBOL = __webpack_require__(4495);
  1973. module.exports = NATIVE_SYMBOL
  1974. && !Symbol.sham
  1975. && typeof Symbol.iterator == 'symbol';
  1976. /***/ }),
  1977. /***/ 8686:
  1978. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1979. var DESCRIPTORS = __webpack_require__(3724);
  1980. var fails = __webpack_require__(9039);
  1981. // V8 ~ Chrome 36-
  1982. // https://bugs.chromium.org/p/v8/issues/detail?id=3334
  1983. module.exports = DESCRIPTORS && fails(function () {
  1984. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  1985. return Object.defineProperty(function () { /* empty */ }, 'prototype', {
  1986. value: 42,
  1987. writable: false
  1988. }).prototype !== 42;
  1989. });
  1990. /***/ }),
  1991. /***/ 2812:
  1992. /***/ ((module) => {
  1993. var $TypeError = TypeError;
  1994. module.exports = function (passed, required) {
  1995. if (passed < required) throw new $TypeError('Not enough arguments');
  1996. return passed;
  1997. };
  1998. /***/ }),
  1999. /***/ 8622:
  2000. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  2001. var global = __webpack_require__(4475);
  2002. var isCallable = __webpack_require__(4901);
  2003. var WeakMap = global.WeakMap;
  2004. module.exports = isCallable(WeakMap) && /native code/.test(String(WeakMap));
  2005. /***/ }),
  2006. /***/ 8227:
  2007. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  2008. var global = __webpack_require__(4475);
  2009. var shared = __webpack_require__(5745);
  2010. var hasOwn = __webpack_require__(9297);
  2011. var uid = __webpack_require__(3392);
  2012. var NATIVE_SYMBOL = __webpack_require__(4495);
  2013. var USE_SYMBOL_AS_UID = __webpack_require__(7040);
  2014. var Symbol = global.Symbol;
  2015. var WellKnownSymbolsStore = shared('wks');
  2016. var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol['for'] || Symbol : Symbol && Symbol.withoutSetter || uid;
  2017. module.exports = function (name) {
  2018. if (!hasOwn(WellKnownSymbolsStore, name)) {
  2019. WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn(Symbol, name)
  2020. ? Symbol[name]
  2021. : createWellKnownSymbol('Symbol.' + name);
  2022. } return WellKnownSymbolsStore[name];
  2023. };
  2024. /***/ }),
  2025. /***/ 4114:
  2026. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2027. var $ = __webpack_require__(6518);
  2028. var toObject = __webpack_require__(8981);
  2029. var lengthOfArrayLike = __webpack_require__(6198);
  2030. var setArrayLength = __webpack_require__(4527);
  2031. var doesNotExceedSafeInteger = __webpack_require__(6837);
  2032. var fails = __webpack_require__(9039);
  2033. var INCORRECT_TO_LENGTH = fails(function () {
  2034. return [].push.call({ length: 0x100000000 }, 1) !== 4294967297;
  2035. });
  2036. // V8 <= 121 and Safari <= 15.4; FF < 23 throws InternalError
  2037. // https://bugs.chromium.org/p/v8/issues/detail?id=12681
  2038. var properErrorOnNonWritableLength = function () {
  2039. try {
  2040. // eslint-disable-next-line es/no-object-defineproperty -- safe
  2041. Object.defineProperty([], 'length', { writable: false }).push();
  2042. } catch (error) {
  2043. return error instanceof TypeError;
  2044. }
  2045. };
  2046. var FORCED = INCORRECT_TO_LENGTH || !properErrorOnNonWritableLength();
  2047. // `Array.prototype.push` method
  2048. // https://tc39.es/ecma262/#sec-array.prototype.push
  2049. $({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {
  2050. // eslint-disable-next-line no-unused-vars -- required for `.length`
  2051. push: function push(item) {
  2052. var O = toObject(this);
  2053. var len = lengthOfArrayLike(O);
  2054. var argCount = arguments.length;
  2055. doesNotExceedSafeInteger(len + argCount);
  2056. for (var i = 0; i < argCount; i++) {
  2057. O[len] = arguments[i];
  2058. len++;
  2059. }
  2060. setArrayLength(O, len);
  2061. return len;
  2062. }
  2063. });
  2064. /***/ }),
  2065. /***/ 4628:
  2066. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2067. var $ = __webpack_require__(6518);
  2068. var newPromiseCapabilityModule = __webpack_require__(6043);
  2069. // `Promise.withResolvers` method
  2070. // https://github.com/tc39/proposal-promise-with-resolvers
  2071. $({ target: 'Promise', stat: true }, {
  2072. withResolvers: function withResolvers() {
  2073. var promiseCapability = newPromiseCapabilityModule.f(this);
  2074. return {
  2075. promise: promiseCapability.promise,
  2076. resolve: promiseCapability.resolve,
  2077. reject: promiseCapability.reject
  2078. };
  2079. }
  2080. });
  2081. /***/ }),
  2082. /***/ 7642:
  2083. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2084. var $ = __webpack_require__(6518);
  2085. var difference = __webpack_require__(3440);
  2086. var setMethodAcceptSetLike = __webpack_require__(4916);
  2087. // `Set.prototype.difference` method
  2088. // https://github.com/tc39/proposal-set-methods
  2089. $({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('difference') }, {
  2090. difference: difference
  2091. });
  2092. /***/ }),
  2093. /***/ 8004:
  2094. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2095. var $ = __webpack_require__(6518);
  2096. var fails = __webpack_require__(9039);
  2097. var intersection = __webpack_require__(8750);
  2098. var setMethodAcceptSetLike = __webpack_require__(4916);
  2099. var INCORRECT = !setMethodAcceptSetLike('intersection') || fails(function () {
  2100. // eslint-disable-next-line es/no-array-from, es/no-set -- testing
  2101. return String(Array.from(new Set([1, 2, 3]).intersection(new Set([3, 2])))) !== '3,2';
  2102. });
  2103. // `Set.prototype.intersection` method
  2104. // https://github.com/tc39/proposal-set-methods
  2105. $({ target: 'Set', proto: true, real: true, forced: INCORRECT }, {
  2106. intersection: intersection
  2107. });
  2108. /***/ }),
  2109. /***/ 3853:
  2110. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2111. var $ = __webpack_require__(6518);
  2112. var isDisjointFrom = __webpack_require__(4449);
  2113. var setMethodAcceptSetLike = __webpack_require__(4916);
  2114. // `Set.prototype.isDisjointFrom` method
  2115. // https://github.com/tc39/proposal-set-methods
  2116. $({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('isDisjointFrom') }, {
  2117. isDisjointFrom: isDisjointFrom
  2118. });
  2119. /***/ }),
  2120. /***/ 5876:
  2121. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2122. var $ = __webpack_require__(6518);
  2123. var isSubsetOf = __webpack_require__(3838);
  2124. var setMethodAcceptSetLike = __webpack_require__(4916);
  2125. // `Set.prototype.isSubsetOf` method
  2126. // https://github.com/tc39/proposal-set-methods
  2127. $({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('isSubsetOf') }, {
  2128. isSubsetOf: isSubsetOf
  2129. });
  2130. /***/ }),
  2131. /***/ 2475:
  2132. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2133. var $ = __webpack_require__(6518);
  2134. var isSupersetOf = __webpack_require__(8527);
  2135. var setMethodAcceptSetLike = __webpack_require__(4916);
  2136. // `Set.prototype.isSupersetOf` method
  2137. // https://github.com/tc39/proposal-set-methods
  2138. $({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('isSupersetOf') }, {
  2139. isSupersetOf: isSupersetOf
  2140. });
  2141. /***/ }),
  2142. /***/ 5024:
  2143. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2144. var $ = __webpack_require__(6518);
  2145. var symmetricDifference = __webpack_require__(3650);
  2146. var setMethodAcceptSetLike = __webpack_require__(4916);
  2147. // `Set.prototype.symmetricDifference` method
  2148. // https://github.com/tc39/proposal-set-methods
  2149. $({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('symmetricDifference') }, {
  2150. symmetricDifference: symmetricDifference
  2151. });
  2152. /***/ }),
  2153. /***/ 1698:
  2154. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2155. var $ = __webpack_require__(6518);
  2156. var union = __webpack_require__(4204);
  2157. var setMethodAcceptSetLike = __webpack_require__(4916);
  2158. // `Set.prototype.union` method
  2159. // https://github.com/tc39/proposal-set-methods
  2160. $({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('union') }, {
  2161. union: union
  2162. });
  2163. /***/ }),
  2164. /***/ 8992:
  2165. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2166. var $ = __webpack_require__(6518);
  2167. var global = __webpack_require__(4475);
  2168. var anInstance = __webpack_require__(679);
  2169. var anObject = __webpack_require__(8551);
  2170. var isCallable = __webpack_require__(4901);
  2171. var getPrototypeOf = __webpack_require__(2787);
  2172. var defineBuiltInAccessor = __webpack_require__(2106);
  2173. var createProperty = __webpack_require__(4659);
  2174. var fails = __webpack_require__(9039);
  2175. var hasOwn = __webpack_require__(9297);
  2176. var wellKnownSymbol = __webpack_require__(8227);
  2177. var IteratorPrototype = (__webpack_require__(7657).IteratorPrototype);
  2178. var DESCRIPTORS = __webpack_require__(3724);
  2179. var IS_PURE = __webpack_require__(6395);
  2180. var CONSTRUCTOR = 'constructor';
  2181. var ITERATOR = 'Iterator';
  2182. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  2183. var $TypeError = TypeError;
  2184. var NativeIterator = global[ITERATOR];
  2185. // FF56- have non-standard global helper `Iterator`
  2186. var FORCED = IS_PURE
  2187. || !isCallable(NativeIterator)
  2188. || NativeIterator.prototype !== IteratorPrototype
  2189. // FF44- non-standard `Iterator` passes previous tests
  2190. || !fails(function () { NativeIterator({}); });
  2191. var IteratorConstructor = function Iterator() {
  2192. anInstance(this, IteratorPrototype);
  2193. if (getPrototypeOf(this) === IteratorPrototype) throw new $TypeError('Abstract class Iterator not directly constructable');
  2194. };
  2195. var defineIteratorPrototypeAccessor = function (key, value) {
  2196. if (DESCRIPTORS) {
  2197. defineBuiltInAccessor(IteratorPrototype, key, {
  2198. configurable: true,
  2199. get: function () {
  2200. return value;
  2201. },
  2202. set: function (replacement) {
  2203. anObject(this);
  2204. if (this === IteratorPrototype) throw new $TypeError("You can't redefine this property");
  2205. if (hasOwn(this, key)) this[key] = replacement;
  2206. else createProperty(this, key, replacement);
  2207. }
  2208. });
  2209. } else IteratorPrototype[key] = value;
  2210. };
  2211. if (!hasOwn(IteratorPrototype, TO_STRING_TAG)) defineIteratorPrototypeAccessor(TO_STRING_TAG, ITERATOR);
  2212. if (FORCED || !hasOwn(IteratorPrototype, CONSTRUCTOR) || IteratorPrototype[CONSTRUCTOR] === Object) {
  2213. defineIteratorPrototypeAccessor(CONSTRUCTOR, IteratorConstructor);
  2214. }
  2215. IteratorConstructor.prototype = IteratorPrototype;
  2216. // `Iterator` constructor
  2217. // https://github.com/tc39/proposal-iterator-helpers
  2218. $({ global: true, constructor: true, forced: FORCED }, {
  2219. Iterator: IteratorConstructor
  2220. });
  2221. /***/ }),
  2222. /***/ 3215:
  2223. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2224. var $ = __webpack_require__(6518);
  2225. var iterate = __webpack_require__(2652);
  2226. var aCallable = __webpack_require__(9306);
  2227. var anObject = __webpack_require__(8551);
  2228. var getIteratorDirect = __webpack_require__(1767);
  2229. // `Iterator.prototype.every` method
  2230. // https://github.com/tc39/proposal-iterator-helpers
  2231. $({ target: 'Iterator', proto: true, real: true }, {
  2232. every: function every(predicate) {
  2233. anObject(this);
  2234. aCallable(predicate);
  2235. var record = getIteratorDirect(this);
  2236. var counter = 0;
  2237. return !iterate(record, function (value, stop) {
  2238. if (!predicate(value, counter++)) return stop();
  2239. }, { IS_RECORD: true, INTERRUPTED: true }).stopped;
  2240. }
  2241. });
  2242. /***/ }),
  2243. /***/ 4520:
  2244. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2245. var $ = __webpack_require__(6518);
  2246. var call = __webpack_require__(9565);
  2247. var aCallable = __webpack_require__(9306);
  2248. var anObject = __webpack_require__(8551);
  2249. var getIteratorDirect = __webpack_require__(1767);
  2250. var createIteratorProxy = __webpack_require__(9462);
  2251. var callWithSafeIterationClosing = __webpack_require__(6319);
  2252. var IS_PURE = __webpack_require__(6395);
  2253. var IteratorProxy = createIteratorProxy(function () {
  2254. var iterator = this.iterator;
  2255. var predicate = this.predicate;
  2256. var next = this.next;
  2257. var result, done, value;
  2258. while (true) {
  2259. result = anObject(call(next, iterator));
  2260. done = this.done = !!result.done;
  2261. if (done) return;
  2262. value = result.value;
  2263. if (callWithSafeIterationClosing(iterator, predicate, [value, this.counter++], true)) return value;
  2264. }
  2265. });
  2266. // `Iterator.prototype.filter` method
  2267. // https://github.com/tc39/proposal-iterator-helpers
  2268. $({ target: 'Iterator', proto: true, real: true, forced: IS_PURE }, {
  2269. filter: function filter(predicate) {
  2270. anObject(this);
  2271. aCallable(predicate);
  2272. return new IteratorProxy(getIteratorDirect(this), {
  2273. predicate: predicate
  2274. });
  2275. }
  2276. });
  2277. /***/ }),
  2278. /***/ 3949:
  2279. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2280. var $ = __webpack_require__(6518);
  2281. var iterate = __webpack_require__(2652);
  2282. var aCallable = __webpack_require__(9306);
  2283. var anObject = __webpack_require__(8551);
  2284. var getIteratorDirect = __webpack_require__(1767);
  2285. // `Iterator.prototype.forEach` method
  2286. // https://github.com/tc39/proposal-iterator-helpers
  2287. $({ target: 'Iterator', proto: true, real: true }, {
  2288. forEach: function forEach(fn) {
  2289. anObject(this);
  2290. aCallable(fn);
  2291. var record = getIteratorDirect(this);
  2292. var counter = 0;
  2293. iterate(record, function (value) {
  2294. fn(value, counter++);
  2295. }, { IS_RECORD: true });
  2296. }
  2297. });
  2298. /***/ }),
  2299. /***/ 1454:
  2300. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2301. var $ = __webpack_require__(6518);
  2302. var map = __webpack_require__(713);
  2303. var IS_PURE = __webpack_require__(6395);
  2304. // `Iterator.prototype.map` method
  2305. // https://github.com/tc39/proposal-iterator-helpers
  2306. $({ target: 'Iterator', proto: true, real: true, forced: IS_PURE }, {
  2307. map: map
  2308. });
  2309. /***/ }),
  2310. /***/ 8335:
  2311. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2312. var $ = __webpack_require__(6518);
  2313. var DESCRIPTORS = __webpack_require__(3724);
  2314. var global = __webpack_require__(4475);
  2315. var getBuiltIn = __webpack_require__(7751);
  2316. var uncurryThis = __webpack_require__(9504);
  2317. var call = __webpack_require__(9565);
  2318. var isCallable = __webpack_require__(4901);
  2319. var isObject = __webpack_require__(34);
  2320. var isArray = __webpack_require__(4376);
  2321. var hasOwn = __webpack_require__(9297);
  2322. var toString = __webpack_require__(655);
  2323. var lengthOfArrayLike = __webpack_require__(6198);
  2324. var createProperty = __webpack_require__(4659);
  2325. var fails = __webpack_require__(9039);
  2326. var parseJSONString = __webpack_require__(8235);
  2327. var NATIVE_SYMBOL = __webpack_require__(4495);
  2328. var JSON = global.JSON;
  2329. var Number = global.Number;
  2330. var SyntaxError = global.SyntaxError;
  2331. var nativeParse = JSON && JSON.parse;
  2332. var enumerableOwnProperties = getBuiltIn('Object', 'keys');
  2333. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  2334. var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  2335. var at = uncurryThis(''.charAt);
  2336. var slice = uncurryThis(''.slice);
  2337. var exec = uncurryThis(/./.exec);
  2338. var push = uncurryThis([].push);
  2339. var IS_DIGIT = /^\d$/;
  2340. var IS_NON_ZERO_DIGIT = /^[1-9]$/;
  2341. var IS_NUMBER_START = /^(?:-|\d)$/;
  2342. var IS_WHITESPACE = /^[\t\n\r ]$/;
  2343. var PRIMITIVE = 0;
  2344. var OBJECT = 1;
  2345. var $parse = function (source, reviver) {
  2346. source = toString(source);
  2347. var context = new Context(source, 0, '');
  2348. var root = context.parse();
  2349. var value = root.value;
  2350. var endIndex = context.skip(IS_WHITESPACE, root.end);
  2351. if (endIndex < source.length) {
  2352. throw new SyntaxError('Unexpected extra character: "' + at(source, endIndex) + '" after the parsed data at: ' + endIndex);
  2353. }
  2354. return isCallable(reviver) ? internalize({ '': value }, '', reviver, root) : value;
  2355. };
  2356. var internalize = function (holder, name, reviver, node) {
  2357. var val = holder[name];
  2358. var unmodified = node && val === node.value;
  2359. var context = unmodified && typeof node.source == 'string' ? { source: node.source } : {};
  2360. var elementRecordsLen, keys, len, i, P;
  2361. if (isObject(val)) {
  2362. var nodeIsArray = isArray(val);
  2363. var nodes = unmodified ? node.nodes : nodeIsArray ? [] : {};
  2364. if (nodeIsArray) {
  2365. elementRecordsLen = nodes.length;
  2366. len = lengthOfArrayLike(val);
  2367. for (i = 0; i < len; i++) {
  2368. internalizeProperty(val, i, internalize(val, '' + i, reviver, i < elementRecordsLen ? nodes[i] : undefined));
  2369. }
  2370. } else {
  2371. keys = enumerableOwnProperties(val);
  2372. len = lengthOfArrayLike(keys);
  2373. for (i = 0; i < len; i++) {
  2374. P = keys[i];
  2375. internalizeProperty(val, P, internalize(val, P, reviver, hasOwn(nodes, P) ? nodes[P] : undefined));
  2376. }
  2377. }
  2378. }
  2379. return call(reviver, holder, name, val, context);
  2380. };
  2381. var internalizeProperty = function (object, key, value) {
  2382. if (DESCRIPTORS) {
  2383. var descriptor = getOwnPropertyDescriptor(object, key);
  2384. if (descriptor && !descriptor.configurable) return;
  2385. }
  2386. if (value === undefined) delete object[key];
  2387. else createProperty(object, key, value);
  2388. };
  2389. var Node = function (value, end, source, nodes) {
  2390. this.value = value;
  2391. this.end = end;
  2392. this.source = source;
  2393. this.nodes = nodes;
  2394. };
  2395. var Context = function (source, index) {
  2396. this.source = source;
  2397. this.index = index;
  2398. };
  2399. // https://www.json.org/json-en.html
  2400. Context.prototype = {
  2401. fork: function (nextIndex) {
  2402. return new Context(this.source, nextIndex);
  2403. },
  2404. parse: function () {
  2405. var source = this.source;
  2406. var i = this.skip(IS_WHITESPACE, this.index);
  2407. var fork = this.fork(i);
  2408. var chr = at(source, i);
  2409. if (exec(IS_NUMBER_START, chr)) return fork.number();
  2410. switch (chr) {
  2411. case '{':
  2412. return fork.object();
  2413. case '[':
  2414. return fork.array();
  2415. case '"':
  2416. return fork.string();
  2417. case 't':
  2418. return fork.keyword(true);
  2419. case 'f':
  2420. return fork.keyword(false);
  2421. case 'n':
  2422. return fork.keyword(null);
  2423. } throw new SyntaxError('Unexpected character: "' + chr + '" at: ' + i);
  2424. },
  2425. node: function (type, value, start, end, nodes) {
  2426. return new Node(value, end, type ? null : slice(this.source, start, end), nodes);
  2427. },
  2428. object: function () {
  2429. var source = this.source;
  2430. var i = this.index + 1;
  2431. var expectKeypair = false;
  2432. var object = {};
  2433. var nodes = {};
  2434. while (i < source.length) {
  2435. i = this.until(['"', '}'], i);
  2436. if (at(source, i) === '}' && !expectKeypair) {
  2437. i++;
  2438. break;
  2439. }
  2440. // Parsing the key
  2441. var result = this.fork(i).string();
  2442. var key = result.value;
  2443. i = result.end;
  2444. i = this.until([':'], i) + 1;
  2445. // Parsing value
  2446. i = this.skip(IS_WHITESPACE, i);
  2447. result = this.fork(i).parse();
  2448. createProperty(nodes, key, result);
  2449. createProperty(object, key, result.value);
  2450. i = this.until([',', '}'], result.end);
  2451. var chr = at(source, i);
  2452. if (chr === ',') {
  2453. expectKeypair = true;
  2454. i++;
  2455. } else if (chr === '}') {
  2456. i++;
  2457. break;
  2458. }
  2459. }
  2460. return this.node(OBJECT, object, this.index, i, nodes);
  2461. },
  2462. array: function () {
  2463. var source = this.source;
  2464. var i = this.index + 1;
  2465. var expectElement = false;
  2466. var array = [];
  2467. var nodes = [];
  2468. while (i < source.length) {
  2469. i = this.skip(IS_WHITESPACE, i);
  2470. if (at(source, i) === ']' && !expectElement) {
  2471. i++;
  2472. break;
  2473. }
  2474. var result = this.fork(i).parse();
  2475. push(nodes, result);
  2476. push(array, result.value);
  2477. i = this.until([',', ']'], result.end);
  2478. if (at(source, i) === ',') {
  2479. expectElement = true;
  2480. i++;
  2481. } else if (at(source, i) === ']') {
  2482. i++;
  2483. break;
  2484. }
  2485. }
  2486. return this.node(OBJECT, array, this.index, i, nodes);
  2487. },
  2488. string: function () {
  2489. var index = this.index;
  2490. var parsed = parseJSONString(this.source, this.index + 1);
  2491. return this.node(PRIMITIVE, parsed.value, index, parsed.end);
  2492. },
  2493. number: function () {
  2494. var source = this.source;
  2495. var startIndex = this.index;
  2496. var i = startIndex;
  2497. if (at(source, i) === '-') i++;
  2498. if (at(source, i) === '0') i++;
  2499. else if (exec(IS_NON_ZERO_DIGIT, at(source, i))) i = this.skip(IS_DIGIT, ++i);
  2500. else throw new SyntaxError('Failed to parse number at: ' + i);
  2501. if (at(source, i) === '.') i = this.skip(IS_DIGIT, ++i);
  2502. if (at(source, i) === 'e' || at(source, i) === 'E') {
  2503. i++;
  2504. if (at(source, i) === '+' || at(source, i) === '-') i++;
  2505. var exponentStartIndex = i;
  2506. i = this.skip(IS_DIGIT, i);
  2507. if (exponentStartIndex === i) throw new SyntaxError("Failed to parse number's exponent value at: " + i);
  2508. }
  2509. return this.node(PRIMITIVE, Number(slice(source, startIndex, i)), startIndex, i);
  2510. },
  2511. keyword: function (value) {
  2512. var keyword = '' + value;
  2513. var index = this.index;
  2514. var endIndex = index + keyword.length;
  2515. if (slice(this.source, index, endIndex) !== keyword) throw new SyntaxError('Failed to parse value at: ' + index);
  2516. return this.node(PRIMITIVE, value, index, endIndex);
  2517. },
  2518. skip: function (regex, i) {
  2519. var source = this.source;
  2520. for (; i < source.length; i++) if (!exec(regex, at(source, i))) break;
  2521. return i;
  2522. },
  2523. until: function (array, i) {
  2524. i = this.skip(IS_WHITESPACE, i);
  2525. var chr = at(this.source, i);
  2526. for (var j = 0; j < array.length; j++) if (array[j] === chr) return i;
  2527. throw new SyntaxError('Unexpected character: "' + chr + '" at: ' + i);
  2528. }
  2529. };
  2530. var NO_SOURCE_SUPPORT = fails(function () {
  2531. var unsafeInt = '9007199254740993';
  2532. var source;
  2533. nativeParse(unsafeInt, function (key, value, context) {
  2534. source = context.source;
  2535. });
  2536. return source !== unsafeInt;
  2537. });
  2538. var PROPER_BASE_PARSE = NATIVE_SYMBOL && !fails(function () {
  2539. // Safari 9 bug
  2540. return 1 / nativeParse('-0 \t') !== -Infinity;
  2541. });
  2542. // `JSON.parse` method
  2543. // https://tc39.es/ecma262/#sec-json.parse
  2544. // https://github.com/tc39/proposal-json-parse-with-source
  2545. $({ target: 'JSON', stat: true, forced: NO_SOURCE_SUPPORT }, {
  2546. parse: function parse(text, reviver) {
  2547. return PROPER_BASE_PARSE && !isCallable(reviver) ? nativeParse(text) : $parse(text, reviver);
  2548. }
  2549. });
  2550. /***/ }),
  2551. /***/ 3375:
  2552. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2553. // TODO: Remove from `core-js@4`
  2554. __webpack_require__(7642);
  2555. /***/ }),
  2556. /***/ 9225:
  2557. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2558. // TODO: Remove from `core-js@4`
  2559. __webpack_require__(8004);
  2560. /***/ }),
  2561. /***/ 3972:
  2562. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2563. // TODO: Remove from `core-js@4`
  2564. __webpack_require__(3853);
  2565. /***/ }),
  2566. /***/ 9209:
  2567. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2568. // TODO: Remove from `core-js@4`
  2569. __webpack_require__(5876);
  2570. /***/ }),
  2571. /***/ 5714:
  2572. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2573. // TODO: Remove from `core-js@4`
  2574. __webpack_require__(2475);
  2575. /***/ }),
  2576. /***/ 7561:
  2577. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2578. // TODO: Remove from `core-js@4`
  2579. __webpack_require__(5024);
  2580. /***/ }),
  2581. /***/ 6197:
  2582. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2583. // TODO: Remove from `core-js@4`
  2584. __webpack_require__(1698);
  2585. /***/ }),
  2586. /***/ 4603:
  2587. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2588. var defineBuiltIn = __webpack_require__(6840);
  2589. var uncurryThis = __webpack_require__(9504);
  2590. var toString = __webpack_require__(655);
  2591. var validateArgumentsLength = __webpack_require__(2812);
  2592. var $URLSearchParams = URLSearchParams;
  2593. var URLSearchParamsPrototype = $URLSearchParams.prototype;
  2594. var append = uncurryThis(URLSearchParamsPrototype.append);
  2595. var $delete = uncurryThis(URLSearchParamsPrototype['delete']);
  2596. var forEach = uncurryThis(URLSearchParamsPrototype.forEach);
  2597. var push = uncurryThis([].push);
  2598. var params = new $URLSearchParams('a=1&a=2&b=3');
  2599. params['delete']('a', 1);
  2600. // `undefined` case is a Chromium 117 bug
  2601. // https://bugs.chromium.org/p/v8/issues/detail?id=14222
  2602. params['delete']('b', undefined);
  2603. if (params + '' !== 'a=2') {
  2604. defineBuiltIn(URLSearchParamsPrototype, 'delete', function (name /* , value */) {
  2605. var length = arguments.length;
  2606. var $value = length < 2 ? undefined : arguments[1];
  2607. if (length && $value === undefined) return $delete(this, name);
  2608. var entries = [];
  2609. forEach(this, function (v, k) { // also validates `this`
  2610. push(entries, { key: k, value: v });
  2611. });
  2612. validateArgumentsLength(length, 1);
  2613. var key = toString(name);
  2614. var value = toString($value);
  2615. var index = 0;
  2616. var dindex = 0;
  2617. var found = false;
  2618. var entriesLength = entries.length;
  2619. var entry;
  2620. while (index < entriesLength) {
  2621. entry = entries[index++];
  2622. if (found || entry.key === key) {
  2623. found = true;
  2624. $delete(this, entry.key);
  2625. } else dindex++;
  2626. }
  2627. while (dindex < entriesLength) {
  2628. entry = entries[dindex++];
  2629. if (!(entry.key === key && entry.value === value)) append(this, entry.key, entry.value);
  2630. }
  2631. }, { enumerable: true, unsafe: true });
  2632. }
  2633. /***/ }),
  2634. /***/ 7566:
  2635. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2636. var defineBuiltIn = __webpack_require__(6840);
  2637. var uncurryThis = __webpack_require__(9504);
  2638. var toString = __webpack_require__(655);
  2639. var validateArgumentsLength = __webpack_require__(2812);
  2640. var $URLSearchParams = URLSearchParams;
  2641. var URLSearchParamsPrototype = $URLSearchParams.prototype;
  2642. var getAll = uncurryThis(URLSearchParamsPrototype.getAll);
  2643. var $has = uncurryThis(URLSearchParamsPrototype.has);
  2644. var params = new $URLSearchParams('a=1');
  2645. // `undefined` case is a Chromium 117 bug
  2646. // https://bugs.chromium.org/p/v8/issues/detail?id=14222
  2647. if (params.has('a', 2) || !params.has('a', undefined)) {
  2648. defineBuiltIn(URLSearchParamsPrototype, 'has', function has(name /* , value */) {
  2649. var length = arguments.length;
  2650. var $value = length < 2 ? undefined : arguments[1];
  2651. if (length && $value === undefined) return $has(this, name);
  2652. var values = getAll(this, name); // also validates `this`
  2653. validateArgumentsLength(length, 1);
  2654. var value = toString($value);
  2655. var index = 0;
  2656. while (index < values.length) {
  2657. if (values[index++] === value) return true;
  2658. } return false;
  2659. }, { enumerable: true, unsafe: true });
  2660. }
  2661. /***/ }),
  2662. /***/ 8721:
  2663. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2664. var DESCRIPTORS = __webpack_require__(3724);
  2665. var uncurryThis = __webpack_require__(9504);
  2666. var defineBuiltInAccessor = __webpack_require__(2106);
  2667. var URLSearchParamsPrototype = URLSearchParams.prototype;
  2668. var forEach = uncurryThis(URLSearchParamsPrototype.forEach);
  2669. // `URLSearchParams.prototype.size` getter
  2670. // https://github.com/whatwg/url/pull/734
  2671. if (DESCRIPTORS && !('size' in URLSearchParamsPrototype)) {
  2672. defineBuiltInAccessor(URLSearchParamsPrototype, 'size', {
  2673. get: function size() {
  2674. var count = 0;
  2675. forEach(this, function () { count++; });
  2676. return count;
  2677. },
  2678. configurable: true,
  2679. enumerable: true
  2680. });
  2681. }
  2682. /***/ }),
  2683. /***/ 588:
  2684. /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
  2685. // EXPORTS
  2686. __webpack_require__.d(__webpack_exports__, {
  2687. FluentBundle: () => (/* reexport */ FluentBundle),
  2688. FluentResource: () => (/* reexport */ FluentResource)
  2689. });
  2690. // UNUSED EXPORTS: FluentDateTime, FluentNone, FluentNumber, FluentType
  2691. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.push.js
  2692. var es_array_push = __webpack_require__(4114);
  2693. ;// CONCATENATED MODULE: ./node_modules/@fluent/bundle/esm/types.js
  2694. class FluentType {
  2695. constructor(value) {
  2696. this.value = value;
  2697. }
  2698. valueOf() {
  2699. return this.value;
  2700. }
  2701. }
  2702. class FluentNone extends FluentType {
  2703. constructor(value = "???") {
  2704. super(value);
  2705. }
  2706. toString(scope) {
  2707. return `{${this.value}}`;
  2708. }
  2709. }
  2710. class FluentNumber extends FluentType {
  2711. constructor(value, opts = {}) {
  2712. super(value);
  2713. this.opts = opts;
  2714. }
  2715. toString(scope) {
  2716. try {
  2717. const nf = scope.memoizeIntlObject(Intl.NumberFormat, this.opts);
  2718. return nf.format(this.value);
  2719. } catch (err) {
  2720. scope.reportError(err);
  2721. return this.value.toString(10);
  2722. }
  2723. }
  2724. }
  2725. class FluentDateTime extends FluentType {
  2726. constructor(value, opts = {}) {
  2727. super(value);
  2728. this.opts = opts;
  2729. }
  2730. toString(scope) {
  2731. try {
  2732. const dtf = scope.memoizeIntlObject(Intl.DateTimeFormat, this.opts);
  2733. return dtf.format(this.value);
  2734. } catch (err) {
  2735. scope.reportError(err);
  2736. return new Date(this.value).toISOString();
  2737. }
  2738. }
  2739. }
  2740. ;// CONCATENATED MODULE: ./node_modules/@fluent/bundle/esm/resolver.js
  2741. const MAX_PLACEABLES = 100;
  2742. const FSI = "\u2068";
  2743. const PDI = "\u2069";
  2744. function match(scope, selector, key) {
  2745. if (key === selector) {
  2746. return true;
  2747. }
  2748. if (key instanceof FluentNumber && selector instanceof FluentNumber && key.value === selector.value) {
  2749. return true;
  2750. }
  2751. if (selector instanceof FluentNumber && typeof key === "string") {
  2752. let category = scope.memoizeIntlObject(Intl.PluralRules, selector.opts).select(selector.value);
  2753. if (key === category) {
  2754. return true;
  2755. }
  2756. }
  2757. return false;
  2758. }
  2759. function getDefault(scope, variants, star) {
  2760. if (variants[star]) {
  2761. return resolvePattern(scope, variants[star].value);
  2762. }
  2763. scope.reportError(new RangeError("No default"));
  2764. return new FluentNone();
  2765. }
  2766. function getArguments(scope, args) {
  2767. const positional = [];
  2768. const named = Object.create(null);
  2769. for (const arg of args) {
  2770. if (arg.type === "narg") {
  2771. named[arg.name] = resolveExpression(scope, arg.value);
  2772. } else {
  2773. positional.push(resolveExpression(scope, arg));
  2774. }
  2775. }
  2776. return {
  2777. positional,
  2778. named
  2779. };
  2780. }
  2781. function resolveExpression(scope, expr) {
  2782. switch (expr.type) {
  2783. case "str":
  2784. return expr.value;
  2785. case "num":
  2786. return new FluentNumber(expr.value, {
  2787. minimumFractionDigits: expr.precision
  2788. });
  2789. case "var":
  2790. return resolveVariableReference(scope, expr);
  2791. case "mesg":
  2792. return resolveMessageReference(scope, expr);
  2793. case "term":
  2794. return resolveTermReference(scope, expr);
  2795. case "func":
  2796. return resolveFunctionReference(scope, expr);
  2797. case "select":
  2798. return resolveSelectExpression(scope, expr);
  2799. default:
  2800. return new FluentNone();
  2801. }
  2802. }
  2803. function resolveVariableReference(scope, {
  2804. name
  2805. }) {
  2806. let arg;
  2807. if (scope.params) {
  2808. if (Object.prototype.hasOwnProperty.call(scope.params, name)) {
  2809. arg = scope.params[name];
  2810. } else {
  2811. return new FluentNone(`$${name}`);
  2812. }
  2813. } else if (scope.args && Object.prototype.hasOwnProperty.call(scope.args, name)) {
  2814. arg = scope.args[name];
  2815. } else {
  2816. scope.reportError(new ReferenceError(`Unknown variable: $${name}`));
  2817. return new FluentNone(`$${name}`);
  2818. }
  2819. if (arg instanceof FluentType) {
  2820. return arg;
  2821. }
  2822. switch (typeof arg) {
  2823. case "string":
  2824. return arg;
  2825. case "number":
  2826. return new FluentNumber(arg);
  2827. case "object":
  2828. if (arg instanceof Date) {
  2829. return new FluentDateTime(arg.getTime());
  2830. }
  2831. default:
  2832. scope.reportError(new TypeError(`Variable type not supported: $${name}, ${typeof arg}`));
  2833. return new FluentNone(`$${name}`);
  2834. }
  2835. }
  2836. function resolveMessageReference(scope, {
  2837. name,
  2838. attr
  2839. }) {
  2840. const message = scope.bundle._messages.get(name);
  2841. if (!message) {
  2842. scope.reportError(new ReferenceError(`Unknown message: ${name}`));
  2843. return new FluentNone(name);
  2844. }
  2845. if (attr) {
  2846. const attribute = message.attributes[attr];
  2847. if (attribute) {
  2848. return resolvePattern(scope, attribute);
  2849. }
  2850. scope.reportError(new ReferenceError(`Unknown attribute: ${attr}`));
  2851. return new FluentNone(`${name}.${attr}`);
  2852. }
  2853. if (message.value) {
  2854. return resolvePattern(scope, message.value);
  2855. }
  2856. scope.reportError(new ReferenceError(`No value: ${name}`));
  2857. return new FluentNone(name);
  2858. }
  2859. function resolveTermReference(scope, {
  2860. name,
  2861. attr,
  2862. args
  2863. }) {
  2864. const id = `-${name}`;
  2865. const term = scope.bundle._terms.get(id);
  2866. if (!term) {
  2867. scope.reportError(new ReferenceError(`Unknown term: ${id}`));
  2868. return new FluentNone(id);
  2869. }
  2870. if (attr) {
  2871. const attribute = term.attributes[attr];
  2872. if (attribute) {
  2873. scope.params = getArguments(scope, args).named;
  2874. const resolved = resolvePattern(scope, attribute);
  2875. scope.params = null;
  2876. return resolved;
  2877. }
  2878. scope.reportError(new ReferenceError(`Unknown attribute: ${attr}`));
  2879. return new FluentNone(`${id}.${attr}`);
  2880. }
  2881. scope.params = getArguments(scope, args).named;
  2882. const resolved = resolvePattern(scope, term.value);
  2883. scope.params = null;
  2884. return resolved;
  2885. }
  2886. function resolveFunctionReference(scope, {
  2887. name,
  2888. args
  2889. }) {
  2890. let func = scope.bundle._functions[name];
  2891. if (!func) {
  2892. scope.reportError(new ReferenceError(`Unknown function: ${name}()`));
  2893. return new FluentNone(`${name}()`);
  2894. }
  2895. if (typeof func !== "function") {
  2896. scope.reportError(new TypeError(`Function ${name}() is not callable`));
  2897. return new FluentNone(`${name}()`);
  2898. }
  2899. try {
  2900. let resolved = getArguments(scope, args);
  2901. return func(resolved.positional, resolved.named);
  2902. } catch (err) {
  2903. scope.reportError(err);
  2904. return new FluentNone(`${name}()`);
  2905. }
  2906. }
  2907. function resolveSelectExpression(scope, {
  2908. selector,
  2909. variants,
  2910. star
  2911. }) {
  2912. let sel = resolveExpression(scope, selector);
  2913. if (sel instanceof FluentNone) {
  2914. return getDefault(scope, variants, star);
  2915. }
  2916. for (const variant of variants) {
  2917. const key = resolveExpression(scope, variant.key);
  2918. if (match(scope, sel, key)) {
  2919. return resolvePattern(scope, variant.value);
  2920. }
  2921. }
  2922. return getDefault(scope, variants, star);
  2923. }
  2924. function resolveComplexPattern(scope, ptn) {
  2925. if (scope.dirty.has(ptn)) {
  2926. scope.reportError(new RangeError("Cyclic reference"));
  2927. return new FluentNone();
  2928. }
  2929. scope.dirty.add(ptn);
  2930. const result = [];
  2931. const useIsolating = scope.bundle._useIsolating && ptn.length > 1;
  2932. for (const elem of ptn) {
  2933. if (typeof elem === "string") {
  2934. result.push(scope.bundle._transform(elem));
  2935. continue;
  2936. }
  2937. scope.placeables++;
  2938. if (scope.placeables > MAX_PLACEABLES) {
  2939. scope.dirty.delete(ptn);
  2940. throw new RangeError(`Too many placeables expanded: ${scope.placeables}, ` + `max allowed is ${MAX_PLACEABLES}`);
  2941. }
  2942. if (useIsolating) {
  2943. result.push(FSI);
  2944. }
  2945. result.push(resolveExpression(scope, elem).toString(scope));
  2946. if (useIsolating) {
  2947. result.push(PDI);
  2948. }
  2949. }
  2950. scope.dirty.delete(ptn);
  2951. return result.join("");
  2952. }
  2953. function resolvePattern(scope, value) {
  2954. if (typeof value === "string") {
  2955. return scope.bundle._transform(value);
  2956. }
  2957. return resolveComplexPattern(scope, value);
  2958. }
  2959. ;// CONCATENATED MODULE: ./node_modules/@fluent/bundle/esm/scope.js
  2960. class Scope {
  2961. constructor(bundle, errors, args) {
  2962. this.dirty = new WeakSet();
  2963. this.params = null;
  2964. this.placeables = 0;
  2965. this.bundle = bundle;
  2966. this.errors = errors;
  2967. this.args = args;
  2968. }
  2969. reportError(error) {
  2970. if (!this.errors || !(error instanceof Error)) {
  2971. throw error;
  2972. }
  2973. this.errors.push(error);
  2974. }
  2975. memoizeIntlObject(ctor, opts) {
  2976. let cache = this.bundle._intls.get(ctor);
  2977. if (!cache) {
  2978. cache = {};
  2979. this.bundle._intls.set(ctor, cache);
  2980. }
  2981. let id = JSON.stringify(opts);
  2982. if (!cache[id]) {
  2983. cache[id] = new ctor(this.bundle.locales, opts);
  2984. }
  2985. return cache[id];
  2986. }
  2987. }
  2988. ;// CONCATENATED MODULE: ./node_modules/@fluent/bundle/esm/builtins.js
  2989. function values(opts, allowed) {
  2990. const unwrapped = Object.create(null);
  2991. for (const [name, opt] of Object.entries(opts)) {
  2992. if (allowed.includes(name)) {
  2993. unwrapped[name] = opt.valueOf();
  2994. }
  2995. }
  2996. return unwrapped;
  2997. }
  2998. const NUMBER_ALLOWED = ["unitDisplay", "currencyDisplay", "useGrouping", "minimumIntegerDigits", "minimumFractionDigits", "maximumFractionDigits", "minimumSignificantDigits", "maximumSignificantDigits"];
  2999. function NUMBER(args, opts) {
  3000. let arg = args[0];
  3001. if (arg instanceof FluentNone) {
  3002. return new FluentNone(`NUMBER(${arg.valueOf()})`);
  3003. }
  3004. if (arg instanceof FluentNumber) {
  3005. return new FluentNumber(arg.valueOf(), {
  3006. ...arg.opts,
  3007. ...values(opts, NUMBER_ALLOWED)
  3008. });
  3009. }
  3010. if (arg instanceof FluentDateTime) {
  3011. return new FluentNumber(arg.valueOf(), {
  3012. ...values(opts, NUMBER_ALLOWED)
  3013. });
  3014. }
  3015. throw new TypeError("Invalid argument to NUMBER");
  3016. }
  3017. const DATETIME_ALLOWED = ["dateStyle", "timeStyle", "fractionalSecondDigits", "dayPeriod", "hour12", "weekday", "era", "year", "month", "day", "hour", "minute", "second", "timeZoneName"];
  3018. function DATETIME(args, opts) {
  3019. let arg = args[0];
  3020. if (arg instanceof FluentNone) {
  3021. return new FluentNone(`DATETIME(${arg.valueOf()})`);
  3022. }
  3023. if (arg instanceof FluentDateTime) {
  3024. return new FluentDateTime(arg.valueOf(), {
  3025. ...arg.opts,
  3026. ...values(opts, DATETIME_ALLOWED)
  3027. });
  3028. }
  3029. if (arg instanceof FluentNumber) {
  3030. return new FluentDateTime(arg.valueOf(), {
  3031. ...values(opts, DATETIME_ALLOWED)
  3032. });
  3033. }
  3034. throw new TypeError("Invalid argument to DATETIME");
  3035. }
  3036. ;// CONCATENATED MODULE: ./node_modules/@fluent/bundle/esm/memoizer.js
  3037. const cache = new Map();
  3038. function getMemoizerForLocale(locales) {
  3039. const stringLocale = Array.isArray(locales) ? locales.join(" ") : locales;
  3040. let memoizer = cache.get(stringLocale);
  3041. if (memoizer === undefined) {
  3042. memoizer = new Map();
  3043. cache.set(stringLocale, memoizer);
  3044. }
  3045. return memoizer;
  3046. }
  3047. ;// CONCATENATED MODULE: ./node_modules/@fluent/bundle/esm/bundle.js
  3048. class FluentBundle {
  3049. constructor(locales, {
  3050. functions,
  3051. useIsolating = true,
  3052. transform = v => v
  3053. } = {}) {
  3054. this._terms = new Map();
  3055. this._messages = new Map();
  3056. this.locales = Array.isArray(locales) ? locales : [locales];
  3057. this._functions = {
  3058. NUMBER: NUMBER,
  3059. DATETIME: DATETIME,
  3060. ...functions
  3061. };
  3062. this._useIsolating = useIsolating;
  3063. this._transform = transform;
  3064. this._intls = getMemoizerForLocale(locales);
  3065. }
  3066. hasMessage(id) {
  3067. return this._messages.has(id);
  3068. }
  3069. getMessage(id) {
  3070. return this._messages.get(id);
  3071. }
  3072. addResource(res, {
  3073. allowOverrides = false
  3074. } = {}) {
  3075. const errors = [];
  3076. for (let i = 0; i < res.body.length; i++) {
  3077. let entry = res.body[i];
  3078. if (entry.id.startsWith("-")) {
  3079. if (allowOverrides === false && this._terms.has(entry.id)) {
  3080. errors.push(new Error(`Attempt to override an existing term: "${entry.id}"`));
  3081. continue;
  3082. }
  3083. this._terms.set(entry.id, entry);
  3084. } else {
  3085. if (allowOverrides === false && this._messages.has(entry.id)) {
  3086. errors.push(new Error(`Attempt to override an existing message: "${entry.id}"`));
  3087. continue;
  3088. }
  3089. this._messages.set(entry.id, entry);
  3090. }
  3091. }
  3092. return errors;
  3093. }
  3094. formatPattern(pattern, args = null, errors = null) {
  3095. if (typeof pattern === "string") {
  3096. return this._transform(pattern);
  3097. }
  3098. let scope = new Scope(this, errors, args);
  3099. try {
  3100. let value = resolveComplexPattern(scope, pattern);
  3101. return value.toString(scope);
  3102. } catch (err) {
  3103. if (scope.errors && err instanceof Error) {
  3104. scope.errors.push(err);
  3105. return new FluentNone().toString(scope);
  3106. }
  3107. throw err;
  3108. }
  3109. }
  3110. }
  3111. ;// CONCATENATED MODULE: ./node_modules/@fluent/bundle/esm/resource.js
  3112. const RE_MESSAGE_START = /^(-?[a-zA-Z][\w-]*) *= */gm;
  3113. const RE_ATTRIBUTE_START = /\.([a-zA-Z][\w-]*) *= */y;
  3114. const RE_VARIANT_START = /\*?\[/y;
  3115. const RE_NUMBER_LITERAL = /(-?[0-9]+(?:\.([0-9]+))?)/y;
  3116. const RE_IDENTIFIER = /([a-zA-Z][\w-]*)/y;
  3117. const RE_REFERENCE = /([$-])?([a-zA-Z][\w-]*)(?:\.([a-zA-Z][\w-]*))?/y;
  3118. const RE_FUNCTION_NAME = /^[A-Z][A-Z0-9_-]*$/;
  3119. const RE_TEXT_RUN = /([^{}\n\r]+)/y;
  3120. const RE_STRING_RUN = /([^\\"\n\r]*)/y;
  3121. const RE_STRING_ESCAPE = /\\([\\"])/y;
  3122. const RE_UNICODE_ESCAPE = /\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{6})/y;
  3123. const RE_LEADING_NEWLINES = /^\n+/;
  3124. const RE_TRAILING_SPACES = / +$/;
  3125. const RE_BLANK_LINES = / *\r?\n/g;
  3126. const RE_INDENT = /( *)$/;
  3127. const TOKEN_BRACE_OPEN = /{\s*/y;
  3128. const TOKEN_BRACE_CLOSE = /\s*}/y;
  3129. const TOKEN_BRACKET_OPEN = /\[\s*/y;
  3130. const TOKEN_BRACKET_CLOSE = /\s*] */y;
  3131. const TOKEN_PAREN_OPEN = /\s*\(\s*/y;
  3132. const TOKEN_ARROW = /\s*->\s*/y;
  3133. const TOKEN_COLON = /\s*:\s*/y;
  3134. const TOKEN_COMMA = /\s*,?\s*/y;
  3135. const TOKEN_BLANK = /\s+/y;
  3136. class FluentResource {
  3137. constructor(source) {
  3138. this.body = [];
  3139. RE_MESSAGE_START.lastIndex = 0;
  3140. let cursor = 0;
  3141. while (true) {
  3142. let next = RE_MESSAGE_START.exec(source);
  3143. if (next === null) {
  3144. break;
  3145. }
  3146. cursor = RE_MESSAGE_START.lastIndex;
  3147. try {
  3148. this.body.push(parseMessage(next[1]));
  3149. } catch (err) {
  3150. if (err instanceof SyntaxError) {
  3151. continue;
  3152. }
  3153. throw err;
  3154. }
  3155. }
  3156. function test(re) {
  3157. re.lastIndex = cursor;
  3158. return re.test(source);
  3159. }
  3160. function consumeChar(char, errorClass) {
  3161. if (source[cursor] === char) {
  3162. cursor++;
  3163. return true;
  3164. }
  3165. if (errorClass) {
  3166. throw new errorClass(`Expected ${char}`);
  3167. }
  3168. return false;
  3169. }
  3170. function consumeToken(re, errorClass) {
  3171. if (test(re)) {
  3172. cursor = re.lastIndex;
  3173. return true;
  3174. }
  3175. if (errorClass) {
  3176. throw new errorClass(`Expected ${re.toString()}`);
  3177. }
  3178. return false;
  3179. }
  3180. function match(re) {
  3181. re.lastIndex = cursor;
  3182. let result = re.exec(source);
  3183. if (result === null) {
  3184. throw new SyntaxError(`Expected ${re.toString()}`);
  3185. }
  3186. cursor = re.lastIndex;
  3187. return result;
  3188. }
  3189. function match1(re) {
  3190. return match(re)[1];
  3191. }
  3192. function parseMessage(id) {
  3193. let value = parsePattern();
  3194. let attributes = parseAttributes();
  3195. if (value === null && Object.keys(attributes).length === 0) {
  3196. throw new SyntaxError("Expected message value or attributes");
  3197. }
  3198. return {
  3199. id,
  3200. value,
  3201. attributes
  3202. };
  3203. }
  3204. function parseAttributes() {
  3205. let attrs = Object.create(null);
  3206. while (test(RE_ATTRIBUTE_START)) {
  3207. let name = match1(RE_ATTRIBUTE_START);
  3208. let value = parsePattern();
  3209. if (value === null) {
  3210. throw new SyntaxError("Expected attribute value");
  3211. }
  3212. attrs[name] = value;
  3213. }
  3214. return attrs;
  3215. }
  3216. function parsePattern() {
  3217. let first;
  3218. if (test(RE_TEXT_RUN)) {
  3219. first = match1(RE_TEXT_RUN);
  3220. }
  3221. if (source[cursor] === "{" || source[cursor] === "}") {
  3222. return parsePatternElements(first ? [first] : [], Infinity);
  3223. }
  3224. let indent = parseIndent();
  3225. if (indent) {
  3226. if (first) {
  3227. return parsePatternElements([first, indent], indent.length);
  3228. }
  3229. indent.value = trim(indent.value, RE_LEADING_NEWLINES);
  3230. return parsePatternElements([indent], indent.length);
  3231. }
  3232. if (first) {
  3233. return trim(first, RE_TRAILING_SPACES);
  3234. }
  3235. return null;
  3236. }
  3237. function parsePatternElements(elements = [], commonIndent) {
  3238. while (true) {
  3239. if (test(RE_TEXT_RUN)) {
  3240. elements.push(match1(RE_TEXT_RUN));
  3241. continue;
  3242. }
  3243. if (source[cursor] === "{") {
  3244. elements.push(parsePlaceable());
  3245. continue;
  3246. }
  3247. if (source[cursor] === "}") {
  3248. throw new SyntaxError("Unbalanced closing brace");
  3249. }
  3250. let indent = parseIndent();
  3251. if (indent) {
  3252. elements.push(indent);
  3253. commonIndent = Math.min(commonIndent, indent.length);
  3254. continue;
  3255. }
  3256. break;
  3257. }
  3258. let lastIndex = elements.length - 1;
  3259. let lastElement = elements[lastIndex];
  3260. if (typeof lastElement === "string") {
  3261. elements[lastIndex] = trim(lastElement, RE_TRAILING_SPACES);
  3262. }
  3263. let baked = [];
  3264. for (let element of elements) {
  3265. if (element instanceof Indent) {
  3266. element = element.value.slice(0, element.value.length - commonIndent);
  3267. }
  3268. if (element) {
  3269. baked.push(element);
  3270. }
  3271. }
  3272. return baked;
  3273. }
  3274. function parsePlaceable() {
  3275. consumeToken(TOKEN_BRACE_OPEN, SyntaxError);
  3276. let selector = parseInlineExpression();
  3277. if (consumeToken(TOKEN_BRACE_CLOSE)) {
  3278. return selector;
  3279. }
  3280. if (consumeToken(TOKEN_ARROW)) {
  3281. let variants = parseVariants();
  3282. consumeToken(TOKEN_BRACE_CLOSE, SyntaxError);
  3283. return {
  3284. type: "select",
  3285. selector,
  3286. ...variants
  3287. };
  3288. }
  3289. throw new SyntaxError("Unclosed placeable");
  3290. }
  3291. function parseInlineExpression() {
  3292. if (source[cursor] === "{") {
  3293. return parsePlaceable();
  3294. }
  3295. if (test(RE_REFERENCE)) {
  3296. let [, sigil, name, attr = null] = match(RE_REFERENCE);
  3297. if (sigil === "$") {
  3298. return {
  3299. type: "var",
  3300. name
  3301. };
  3302. }
  3303. if (consumeToken(TOKEN_PAREN_OPEN)) {
  3304. let args = parseArguments();
  3305. if (sigil === "-") {
  3306. return {
  3307. type: "term",
  3308. name,
  3309. attr,
  3310. args
  3311. };
  3312. }
  3313. if (RE_FUNCTION_NAME.test(name)) {
  3314. return {
  3315. type: "func",
  3316. name,
  3317. args
  3318. };
  3319. }
  3320. throw new SyntaxError("Function names must be all upper-case");
  3321. }
  3322. if (sigil === "-") {
  3323. return {
  3324. type: "term",
  3325. name,
  3326. attr,
  3327. args: []
  3328. };
  3329. }
  3330. return {
  3331. type: "mesg",
  3332. name,
  3333. attr
  3334. };
  3335. }
  3336. return parseLiteral();
  3337. }
  3338. function parseArguments() {
  3339. let args = [];
  3340. while (true) {
  3341. switch (source[cursor]) {
  3342. case ")":
  3343. cursor++;
  3344. return args;
  3345. case undefined:
  3346. throw new SyntaxError("Unclosed argument list");
  3347. }
  3348. args.push(parseArgument());
  3349. consumeToken(TOKEN_COMMA);
  3350. }
  3351. }
  3352. function parseArgument() {
  3353. let expr = parseInlineExpression();
  3354. if (expr.type !== "mesg") {
  3355. return expr;
  3356. }
  3357. if (consumeToken(TOKEN_COLON)) {
  3358. return {
  3359. type: "narg",
  3360. name: expr.name,
  3361. value: parseLiteral()
  3362. };
  3363. }
  3364. return expr;
  3365. }
  3366. function parseVariants() {
  3367. let variants = [];
  3368. let count = 0;
  3369. let star;
  3370. while (test(RE_VARIANT_START)) {
  3371. if (consumeChar("*")) {
  3372. star = count;
  3373. }
  3374. let key = parseVariantKey();
  3375. let value = parsePattern();
  3376. if (value === null) {
  3377. throw new SyntaxError("Expected variant value");
  3378. }
  3379. variants[count++] = {
  3380. key,
  3381. value
  3382. };
  3383. }
  3384. if (count === 0) {
  3385. return null;
  3386. }
  3387. if (star === undefined) {
  3388. throw new SyntaxError("Expected default variant");
  3389. }
  3390. return {
  3391. variants,
  3392. star
  3393. };
  3394. }
  3395. function parseVariantKey() {
  3396. consumeToken(TOKEN_BRACKET_OPEN, SyntaxError);
  3397. let key;
  3398. if (test(RE_NUMBER_LITERAL)) {
  3399. key = parseNumberLiteral();
  3400. } else {
  3401. key = {
  3402. type: "str",
  3403. value: match1(RE_IDENTIFIER)
  3404. };
  3405. }
  3406. consumeToken(TOKEN_BRACKET_CLOSE, SyntaxError);
  3407. return key;
  3408. }
  3409. function parseLiteral() {
  3410. if (test(RE_NUMBER_LITERAL)) {
  3411. return parseNumberLiteral();
  3412. }
  3413. if (source[cursor] === '"') {
  3414. return parseStringLiteral();
  3415. }
  3416. throw new SyntaxError("Invalid expression");
  3417. }
  3418. function parseNumberLiteral() {
  3419. let [, value, fraction = ""] = match(RE_NUMBER_LITERAL);
  3420. let precision = fraction.length;
  3421. return {
  3422. type: "num",
  3423. value: parseFloat(value),
  3424. precision
  3425. };
  3426. }
  3427. function parseStringLiteral() {
  3428. consumeChar('"', SyntaxError);
  3429. let value = "";
  3430. while (true) {
  3431. value += match1(RE_STRING_RUN);
  3432. if (source[cursor] === "\\") {
  3433. value += parseEscapeSequence();
  3434. continue;
  3435. }
  3436. if (consumeChar('"')) {
  3437. return {
  3438. type: "str",
  3439. value
  3440. };
  3441. }
  3442. throw new SyntaxError("Unclosed string literal");
  3443. }
  3444. }
  3445. function parseEscapeSequence() {
  3446. if (test(RE_STRING_ESCAPE)) {
  3447. return match1(RE_STRING_ESCAPE);
  3448. }
  3449. if (test(RE_UNICODE_ESCAPE)) {
  3450. let [, codepoint4, codepoint6] = match(RE_UNICODE_ESCAPE);
  3451. let codepoint = parseInt(codepoint4 || codepoint6, 16);
  3452. return codepoint <= 0xd7ff || 0xe000 <= codepoint ? String.fromCodePoint(codepoint) : "�";
  3453. }
  3454. throw new SyntaxError("Unknown escape sequence");
  3455. }
  3456. function parseIndent() {
  3457. let start = cursor;
  3458. consumeToken(TOKEN_BLANK);
  3459. switch (source[cursor]) {
  3460. case ".":
  3461. case "[":
  3462. case "*":
  3463. case "}":
  3464. case undefined:
  3465. return false;
  3466. case "{":
  3467. return makeIndent(source.slice(start, cursor));
  3468. }
  3469. if (source[cursor - 1] === " ") {
  3470. return makeIndent(source.slice(start, cursor));
  3471. }
  3472. return false;
  3473. }
  3474. function trim(text, re) {
  3475. return text.replace(re, "");
  3476. }
  3477. function makeIndent(blank) {
  3478. let value = blank.replace(RE_BLANK_LINES, "\n");
  3479. let length = RE_INDENT.exec(blank)[1].length;
  3480. return new Indent(value, length);
  3481. }
  3482. }
  3483. }
  3484. class Indent {
  3485. constructor(value, length) {
  3486. this.value = value;
  3487. this.length = length;
  3488. }
  3489. }
  3490. ;// CONCATENATED MODULE: ./node_modules/@fluent/bundle/esm/index.js
  3491. /***/ }),
  3492. /***/ 5273:
  3493. /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
  3494. // EXPORTS
  3495. __webpack_require__.d(__webpack_exports__, {
  3496. DOMLocalization: () => (/* reexport */ DOMLocalization)
  3497. });
  3498. // UNUSED EXPORTS: Localization
  3499. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.push.js
  3500. var es_array_push = __webpack_require__(4114);
  3501. // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.iterator.map.js
  3502. var esnext_iterator_map = __webpack_require__(1454);
  3503. // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.json.parse.js
  3504. var esnext_json_parse = __webpack_require__(8335);
  3505. // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.set.difference.v2.js
  3506. var esnext_set_difference_v2 = __webpack_require__(3375);
  3507. // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.set.intersection.v2.js
  3508. var esnext_set_intersection_v2 = __webpack_require__(9225);
  3509. // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.set.is-disjoint-from.v2.js
  3510. var esnext_set_is_disjoint_from_v2 = __webpack_require__(3972);
  3511. // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.set.is-subset-of.v2.js
  3512. var esnext_set_is_subset_of_v2 = __webpack_require__(9209);
  3513. // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.set.is-superset-of.v2.js
  3514. var esnext_set_is_superset_of_v2 = __webpack_require__(5714);
  3515. // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.set.symmetric-difference.v2.js
  3516. var esnext_set_symmetric_difference_v2 = __webpack_require__(7561);
  3517. // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.set.union.v2.js
  3518. var esnext_set_union_v2 = __webpack_require__(6197);
  3519. ;// CONCATENATED MODULE: ./node_modules/@fluent/dom/esm/overlay.js
  3520. const reOverlay = /<|&#?\w+;/;
  3521. const TEXT_LEVEL_ELEMENTS = {
  3522. "http://www.w3.org/1999/xhtml": ["em", "strong", "small", "s", "cite", "q", "dfn", "abbr", "data", "time", "code", "var", "samp", "kbd", "sub", "sup", "i", "b", "u", "mark", "bdi", "bdo", "span", "br", "wbr"]
  3523. };
  3524. const LOCALIZABLE_ATTRIBUTES = {
  3525. "http://www.w3.org/1999/xhtml": {
  3526. global: ["title", "aria-label", "aria-valuetext"],
  3527. a: ["download"],
  3528. area: ["download", "alt"],
  3529. input: ["alt", "placeholder"],
  3530. menuitem: ["label"],
  3531. menu: ["label"],
  3532. optgroup: ["label"],
  3533. option: ["label"],
  3534. track: ["label"],
  3535. img: ["alt"],
  3536. textarea: ["placeholder"],
  3537. th: ["abbr"]
  3538. },
  3539. "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul": {
  3540. global: ["accesskey", "aria-label", "aria-valuetext", "label", "title", "tooltiptext"],
  3541. description: ["value"],
  3542. key: ["key", "keycode"],
  3543. label: ["value"],
  3544. textbox: ["placeholder", "value"]
  3545. }
  3546. };
  3547. function translateElement(element, translation) {
  3548. const {
  3549. value
  3550. } = translation;
  3551. if (typeof value === "string") {
  3552. if (element.localName === "title" && element.namespaceURI === "http://www.w3.org/1999/xhtml") {
  3553. element.textContent = value;
  3554. } else if (!reOverlay.test(value)) {
  3555. element.textContent = value;
  3556. } else {
  3557. const templateElement = element.ownerDocument.createElementNS("http://www.w3.org/1999/xhtml", "template");
  3558. templateElement.innerHTML = value;
  3559. overlayChildNodes(templateElement.content, element);
  3560. }
  3561. }
  3562. overlayAttributes(translation, element);
  3563. }
  3564. function overlayChildNodes(fromFragment, toElement) {
  3565. for (const childNode of fromFragment.childNodes) {
  3566. if (childNode.nodeType === childNode.TEXT_NODE) {
  3567. continue;
  3568. }
  3569. if (childNode.hasAttribute("data-l10n-name")) {
  3570. const sanitized = getNodeForNamedElement(toElement, childNode);
  3571. fromFragment.replaceChild(sanitized, childNode);
  3572. continue;
  3573. }
  3574. if (isElementAllowed(childNode)) {
  3575. const sanitized = createSanitizedElement(childNode);
  3576. fromFragment.replaceChild(sanitized, childNode);
  3577. continue;
  3578. }
  3579. console.warn(`An element of forbidden type "${childNode.localName}" was found in ` + "the translation. Only safe text-level elements and elements with " + "data-l10n-name are allowed.");
  3580. fromFragment.replaceChild(createTextNodeFromTextContent(childNode), childNode);
  3581. }
  3582. toElement.textContent = "";
  3583. toElement.appendChild(fromFragment);
  3584. }
  3585. function hasAttribute(attributes, name) {
  3586. if (!attributes) {
  3587. return false;
  3588. }
  3589. for (let attr of attributes) {
  3590. if (attr.name === name) {
  3591. return true;
  3592. }
  3593. }
  3594. return false;
  3595. }
  3596. function overlayAttributes(fromElement, toElement) {
  3597. const explicitlyAllowed = toElement.hasAttribute("data-l10n-attrs") ? toElement.getAttribute("data-l10n-attrs").split(",").map(i => i.trim()) : null;
  3598. for (const attr of Array.from(toElement.attributes)) {
  3599. if (isAttrNameLocalizable(attr.name, toElement, explicitlyAllowed) && !hasAttribute(fromElement.attributes, attr.name)) {
  3600. toElement.removeAttribute(attr.name);
  3601. }
  3602. }
  3603. if (!fromElement.attributes) {
  3604. return;
  3605. }
  3606. for (const attr of Array.from(fromElement.attributes)) {
  3607. if (isAttrNameLocalizable(attr.name, toElement, explicitlyAllowed) && toElement.getAttribute(attr.name) !== attr.value) {
  3608. toElement.setAttribute(attr.name, attr.value);
  3609. }
  3610. }
  3611. }
  3612. function getNodeForNamedElement(sourceElement, translatedChild) {
  3613. const childName = translatedChild.getAttribute("data-l10n-name");
  3614. const sourceChild = sourceElement.querySelector(`[data-l10n-name="${childName}"]`);
  3615. if (!sourceChild) {
  3616. console.warn(`An element named "${childName}" wasn't found in the source.`);
  3617. return createTextNodeFromTextContent(translatedChild);
  3618. }
  3619. if (sourceChild.localName !== translatedChild.localName) {
  3620. console.warn(`An element named "${childName}" was found in the translation ` + `but its type ${translatedChild.localName} didn't match the ` + `element found in the source (${sourceChild.localName}).`);
  3621. return createTextNodeFromTextContent(translatedChild);
  3622. }
  3623. sourceElement.removeChild(sourceChild);
  3624. const clone = sourceChild.cloneNode(false);
  3625. return shallowPopulateUsing(translatedChild, clone);
  3626. }
  3627. function createSanitizedElement(element) {
  3628. const clone = element.ownerDocument.createElement(element.localName);
  3629. return shallowPopulateUsing(element, clone);
  3630. }
  3631. function createTextNodeFromTextContent(element) {
  3632. return element.ownerDocument.createTextNode(element.textContent);
  3633. }
  3634. function isElementAllowed(element) {
  3635. const allowed = TEXT_LEVEL_ELEMENTS[element.namespaceURI];
  3636. return allowed && allowed.includes(element.localName);
  3637. }
  3638. function isAttrNameLocalizable(name, element, explicitlyAllowed = null) {
  3639. if (explicitlyAllowed && explicitlyAllowed.includes(name)) {
  3640. return true;
  3641. }
  3642. const allowed = LOCALIZABLE_ATTRIBUTES[element.namespaceURI];
  3643. if (!allowed) {
  3644. return false;
  3645. }
  3646. const attrName = name.toLowerCase();
  3647. const elemName = element.localName;
  3648. if (allowed.global.includes(attrName)) {
  3649. return true;
  3650. }
  3651. if (!allowed[elemName]) {
  3652. return false;
  3653. }
  3654. if (allowed[elemName].includes(attrName)) {
  3655. return true;
  3656. }
  3657. if (element.namespaceURI === "http://www.w3.org/1999/xhtml" && elemName === "input" && attrName === "value") {
  3658. const type = element.type.toLowerCase();
  3659. if (type === "submit" || type === "button" || type === "reset") {
  3660. return true;
  3661. }
  3662. }
  3663. return false;
  3664. }
  3665. function shallowPopulateUsing(fromElement, toElement) {
  3666. toElement.textContent = fromElement.textContent;
  3667. overlayAttributes(fromElement, toElement);
  3668. return toElement;
  3669. }
  3670. // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.iterator.constructor.js
  3671. var esnext_iterator_constructor = __webpack_require__(8992);
  3672. // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.iterator.filter.js
  3673. var esnext_iterator_filter = __webpack_require__(4520);
  3674. // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.iterator.for-each.js
  3675. var esnext_iterator_for_each = __webpack_require__(3949);
  3676. ;// CONCATENATED MODULE: ./node_modules/cached-iterable/src/cached_iterable.mjs
  3677. class CachedIterable extends Array {
  3678. static from(iterable) {
  3679. if (iterable instanceof this) {
  3680. return iterable;
  3681. }
  3682. return new this(iterable);
  3683. }
  3684. }
  3685. ;// CONCATENATED MODULE: ./node_modules/cached-iterable/src/cached_sync_iterable.mjs
  3686. class CachedSyncIterable extends CachedIterable {
  3687. constructor(iterable) {
  3688. super();
  3689. if (Symbol.iterator in Object(iterable)) {
  3690. this.iterator = iterable[Symbol.iterator]();
  3691. } else {
  3692. throw new TypeError("Argument must implement the iteration protocol.");
  3693. }
  3694. }
  3695. [Symbol.iterator]() {
  3696. const cached = this;
  3697. let cur = 0;
  3698. return {
  3699. next() {
  3700. if (cached.length <= cur) {
  3701. cached.push(cached.iterator.next());
  3702. }
  3703. return cached[cur++];
  3704. }
  3705. };
  3706. }
  3707. touchNext(count = 1) {
  3708. let idx = 0;
  3709. while (idx++ < count) {
  3710. const last = this[this.length - 1];
  3711. if (last && last.done) {
  3712. break;
  3713. }
  3714. this.push(this.iterator.next());
  3715. }
  3716. return this[this.length - 1];
  3717. }
  3718. }
  3719. ;// CONCATENATED MODULE: ./node_modules/cached-iterable/src/cached_async_iterable.mjs
  3720. class CachedAsyncIterable extends CachedIterable {
  3721. constructor(iterable) {
  3722. super();
  3723. if (Symbol.asyncIterator in Object(iterable)) {
  3724. this.iterator = iterable[Symbol.asyncIterator]();
  3725. } else if (Symbol.iterator in Object(iterable)) {
  3726. this.iterator = iterable[Symbol.iterator]();
  3727. } else {
  3728. throw new TypeError("Argument must implement the iteration protocol.");
  3729. }
  3730. }
  3731. [Symbol.asyncIterator]() {
  3732. const cached = this;
  3733. let cur = 0;
  3734. return {
  3735. async next() {
  3736. if (cached.length <= cur) {
  3737. cached.push(cached.iterator.next());
  3738. }
  3739. return cached[cur++];
  3740. }
  3741. };
  3742. }
  3743. async touchNext(count = 1) {
  3744. let idx = 0;
  3745. while (idx++ < count) {
  3746. const last = this[this.length - 1];
  3747. if (last && (await last).done) {
  3748. break;
  3749. }
  3750. this.push(this.iterator.next());
  3751. }
  3752. return this[this.length - 1];
  3753. }
  3754. }
  3755. ;// CONCATENATED MODULE: ./node_modules/cached-iterable/src/index.mjs
  3756. ;// CONCATENATED MODULE: ./node_modules/@fluent/dom/esm/localization.js
  3757. class Localization {
  3758. constructor(resourceIds = [], generateBundles) {
  3759. this.resourceIds = resourceIds;
  3760. this.generateBundles = generateBundles;
  3761. this.onChange(true);
  3762. }
  3763. addResourceIds(resourceIds, eager = false) {
  3764. this.resourceIds.push(...resourceIds);
  3765. this.onChange(eager);
  3766. return this.resourceIds.length;
  3767. }
  3768. removeResourceIds(resourceIds) {
  3769. this.resourceIds = this.resourceIds.filter(r => !resourceIds.includes(r));
  3770. this.onChange();
  3771. return this.resourceIds.length;
  3772. }
  3773. async formatWithFallback(keys, method) {
  3774. const translations = [];
  3775. let hasAtLeastOneBundle = false;
  3776. for await (const bundle of this.bundles) {
  3777. hasAtLeastOneBundle = true;
  3778. const missingIds = keysFromBundle(method, bundle, keys, translations);
  3779. if (missingIds.size === 0) {
  3780. break;
  3781. }
  3782. if (typeof console !== "undefined") {
  3783. const locale = bundle.locales[0];
  3784. const ids = Array.from(missingIds).join(", ");
  3785. console.warn(`[fluent] Missing translations in ${locale}: ${ids}`);
  3786. }
  3787. }
  3788. if (!hasAtLeastOneBundle && typeof console !== "undefined") {
  3789. console.warn(`[fluent] Request for keys failed because no resource bundles got generated.
  3790. keys: ${JSON.stringify(keys)}.
  3791. resourceIds: ${JSON.stringify(this.resourceIds)}.`);
  3792. }
  3793. return translations;
  3794. }
  3795. formatMessages(keys) {
  3796. return this.formatWithFallback(keys, messageFromBundle);
  3797. }
  3798. formatValues(keys) {
  3799. return this.formatWithFallback(keys, valueFromBundle);
  3800. }
  3801. async formatValue(id, args) {
  3802. const [val] = await this.formatValues([{
  3803. id,
  3804. args
  3805. }]);
  3806. return val;
  3807. }
  3808. handleEvent() {
  3809. this.onChange();
  3810. }
  3811. onChange(eager = false) {
  3812. this.bundles = CachedAsyncIterable.from(this.generateBundles(this.resourceIds));
  3813. if (eager) {
  3814. this.bundles.touchNext(2);
  3815. }
  3816. }
  3817. }
  3818. function valueFromBundle(bundle, errors, message, args) {
  3819. if (message.value) {
  3820. return bundle.formatPattern(message.value, args, errors);
  3821. }
  3822. return null;
  3823. }
  3824. function messageFromBundle(bundle, errors, message, args) {
  3825. const formatted = {
  3826. value: null,
  3827. attributes: null
  3828. };
  3829. if (message.value) {
  3830. formatted.value = bundle.formatPattern(message.value, args, errors);
  3831. }
  3832. let attrNames = Object.keys(message.attributes);
  3833. if (attrNames.length > 0) {
  3834. formatted.attributes = new Array(attrNames.length);
  3835. for (let [i, name] of attrNames.entries()) {
  3836. let value = bundle.formatPattern(message.attributes[name], args, errors);
  3837. formatted.attributes[i] = {
  3838. name,
  3839. value
  3840. };
  3841. }
  3842. }
  3843. return formatted;
  3844. }
  3845. function keysFromBundle(method, bundle, keys, translations) {
  3846. const messageErrors = [];
  3847. const missingIds = new Set();
  3848. keys.forEach(({
  3849. id,
  3850. args
  3851. }, i) => {
  3852. if (translations[i] !== undefined) {
  3853. return;
  3854. }
  3855. let message = bundle.getMessage(id);
  3856. if (message) {
  3857. messageErrors.length = 0;
  3858. translations[i] = method(bundle, messageErrors, message, args);
  3859. if (messageErrors.length > 0 && typeof console !== "undefined") {
  3860. const locale = bundle.locales[0];
  3861. const errors = messageErrors.join(", ");
  3862. console.warn(`[fluent][resolver] errors in ${locale}/${id}: ${errors}.`);
  3863. }
  3864. } else {
  3865. missingIds.add(id);
  3866. }
  3867. });
  3868. return missingIds;
  3869. }
  3870. ;// CONCATENATED MODULE: ./node_modules/@fluent/dom/esm/dom_localization.js
  3871. const L10NID_ATTR_NAME = "data-l10n-id";
  3872. const L10NARGS_ATTR_NAME = "data-l10n-args";
  3873. const L10N_ELEMENT_QUERY = `[${L10NID_ATTR_NAME}]`;
  3874. class DOMLocalization extends Localization {
  3875. constructor(resourceIds, generateBundles) {
  3876. super(resourceIds, generateBundles);
  3877. this.roots = new Set();
  3878. this.pendingrAF = null;
  3879. this.pendingElements = new Set();
  3880. this.windowElement = null;
  3881. this.mutationObserver = null;
  3882. this.observerConfig = {
  3883. attributes: true,
  3884. characterData: false,
  3885. childList: true,
  3886. subtree: true,
  3887. attributeFilter: [L10NID_ATTR_NAME, L10NARGS_ATTR_NAME]
  3888. };
  3889. }
  3890. onChange(eager = false) {
  3891. super.onChange(eager);
  3892. if (this.roots) {
  3893. this.translateRoots();
  3894. }
  3895. }
  3896. setAttributes(element, id, args) {
  3897. element.setAttribute(L10NID_ATTR_NAME, id);
  3898. if (args) {
  3899. element.setAttribute(L10NARGS_ATTR_NAME, JSON.stringify(args));
  3900. } else {
  3901. element.removeAttribute(L10NARGS_ATTR_NAME);
  3902. }
  3903. return element;
  3904. }
  3905. getAttributes(element) {
  3906. return {
  3907. id: element.getAttribute(L10NID_ATTR_NAME),
  3908. args: JSON.parse(element.getAttribute(L10NARGS_ATTR_NAME) || null)
  3909. };
  3910. }
  3911. connectRoot(newRoot) {
  3912. for (const root of this.roots) {
  3913. if (root === newRoot || root.contains(newRoot) || newRoot.contains(root)) {
  3914. throw new Error("Cannot add a root that overlaps with existing root.");
  3915. }
  3916. }
  3917. if (this.windowElement) {
  3918. if (this.windowElement !== newRoot.ownerDocument.defaultView) {
  3919. throw new Error(`Cannot connect a root:
  3920. DOMLocalization already has a root from a different window.`);
  3921. }
  3922. } else {
  3923. this.windowElement = newRoot.ownerDocument.defaultView;
  3924. this.mutationObserver = new this.windowElement.MutationObserver(mutations => this.translateMutations(mutations));
  3925. }
  3926. this.roots.add(newRoot);
  3927. this.mutationObserver.observe(newRoot, this.observerConfig);
  3928. }
  3929. disconnectRoot(root) {
  3930. this.roots.delete(root);
  3931. this.pauseObserving();
  3932. if (this.roots.size === 0) {
  3933. this.mutationObserver = null;
  3934. this.windowElement = null;
  3935. this.pendingrAF = null;
  3936. this.pendingElements.clear();
  3937. return true;
  3938. }
  3939. this.resumeObserving();
  3940. return false;
  3941. }
  3942. translateRoots() {
  3943. const roots = Array.from(this.roots);
  3944. return Promise.all(roots.map(root => this.translateFragment(root)));
  3945. }
  3946. pauseObserving() {
  3947. if (!this.mutationObserver) {
  3948. return;
  3949. }
  3950. this.translateMutations(this.mutationObserver.takeRecords());
  3951. this.mutationObserver.disconnect();
  3952. }
  3953. resumeObserving() {
  3954. if (!this.mutationObserver) {
  3955. return;
  3956. }
  3957. for (const root of this.roots) {
  3958. this.mutationObserver.observe(root, this.observerConfig);
  3959. }
  3960. }
  3961. translateMutations(mutations) {
  3962. for (const mutation of mutations) {
  3963. switch (mutation.type) {
  3964. case "attributes":
  3965. if (mutation.target.hasAttribute("data-l10n-id")) {
  3966. this.pendingElements.add(mutation.target);
  3967. }
  3968. break;
  3969. case "childList":
  3970. for (const addedNode of mutation.addedNodes) {
  3971. if (addedNode.nodeType === addedNode.ELEMENT_NODE) {
  3972. if (addedNode.childElementCount) {
  3973. for (const element of this.getTranslatables(addedNode)) {
  3974. this.pendingElements.add(element);
  3975. }
  3976. } else if (addedNode.hasAttribute(L10NID_ATTR_NAME)) {
  3977. this.pendingElements.add(addedNode);
  3978. }
  3979. }
  3980. }
  3981. break;
  3982. }
  3983. }
  3984. if (this.pendingElements.size > 0) {
  3985. if (this.pendingrAF === null) {
  3986. this.pendingrAF = this.windowElement.requestAnimationFrame(() => {
  3987. this.translateElements(Array.from(this.pendingElements));
  3988. this.pendingElements.clear();
  3989. this.pendingrAF = null;
  3990. });
  3991. }
  3992. }
  3993. }
  3994. translateFragment(frag) {
  3995. return this.translateElements(this.getTranslatables(frag));
  3996. }
  3997. async translateElements(elements) {
  3998. if (!elements.length) {
  3999. return undefined;
  4000. }
  4001. const keys = elements.map(this.getKeysForElement);
  4002. const translations = await this.formatMessages(keys);
  4003. return this.applyTranslations(elements, translations);
  4004. }
  4005. applyTranslations(elements, translations) {
  4006. this.pauseObserving();
  4007. for (let i = 0; i < elements.length; i++) {
  4008. if (translations[i] !== undefined) {
  4009. translateElement(elements[i], translations[i]);
  4010. }
  4011. }
  4012. this.resumeObserving();
  4013. }
  4014. getTranslatables(element) {
  4015. const nodes = Array.from(element.querySelectorAll(L10N_ELEMENT_QUERY));
  4016. if (typeof element.hasAttribute === "function" && element.hasAttribute(L10NID_ATTR_NAME)) {
  4017. nodes.push(element);
  4018. }
  4019. return nodes;
  4020. }
  4021. getKeysForElement(element) {
  4022. return {
  4023. id: element.getAttribute(L10NID_ATTR_NAME),
  4024. args: JSON.parse(element.getAttribute(L10NARGS_ATTR_NAME) || null)
  4025. };
  4026. }
  4027. }
  4028. ;// CONCATENATED MODULE: ./node_modules/@fluent/dom/esm/index.js
  4029. /***/ }),
  4030. /***/ 2664:
  4031. /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
  4032. __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
  4033. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  4034. /* harmony export */ AnnotationEditorLayerBuilder: () => (/* binding */ AnnotationEditorLayerBuilder)
  4035. /* harmony export */ });
  4036. /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2603);
  4037. /* harmony import */ var web_null_l10n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(410);
  4038. var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__, web_null_l10n__WEBPACK_IMPORTED_MODULE_1__]);
  4039. ([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__, web_null_l10n__WEBPACK_IMPORTED_MODULE_1__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
  4040. class AnnotationEditorLayerBuilder {
  4041. #annotationLayer = null;
  4042. #drawLayer = null;
  4043. #onAppend = null;
  4044. #textLayer = null;
  4045. #uiManager;
  4046. constructor(options) {
  4047. this.pdfPage = options.pdfPage;
  4048. this.accessibilityManager = options.accessibilityManager;
  4049. this.l10n = options.l10n;
  4050. this.l10n ||= new web_null_l10n__WEBPACK_IMPORTED_MODULE_1__.GenericL10n();
  4051. this.annotationEditorLayer = null;
  4052. this.div = null;
  4053. this._cancelled = false;
  4054. this.#uiManager = options.uiManager;
  4055. this.#annotationLayer = options.annotationLayer || null;
  4056. this.#textLayer = options.textLayer || null;
  4057. this.#drawLayer = options.drawLayer || null;
  4058. this.#onAppend = options.onAppend || null;
  4059. }
  4060. async render(viewport, intent = "display") {
  4061. if (intent !== "display") {
  4062. return;
  4063. }
  4064. if (this._cancelled) {
  4065. return;
  4066. }
  4067. const clonedViewport = viewport.clone({
  4068. dontFlip: true
  4069. });
  4070. if (this.div) {
  4071. this.annotationEditorLayer.update({
  4072. viewport: clonedViewport
  4073. });
  4074. this.show();
  4075. return;
  4076. }
  4077. const div = this.div = document.createElement("div");
  4078. div.className = "annotationEditorLayer";
  4079. div.hidden = true;
  4080. div.dir = this.#uiManager.direction;
  4081. this.#onAppend?.(div);
  4082. this.annotationEditorLayer = new pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.AnnotationEditorLayer({
  4083. uiManager: this.#uiManager,
  4084. div,
  4085. accessibilityManager: this.accessibilityManager,
  4086. pageIndex: this.pdfPage.pageNumber - 1,
  4087. l10n: this.l10n,
  4088. viewport: clonedViewport,
  4089. annotationLayer: this.#annotationLayer,
  4090. textLayer: this.#textLayer,
  4091. drawLayer: this.#drawLayer
  4092. });
  4093. const parameters = {
  4094. viewport: clonedViewport,
  4095. div,
  4096. annotations: null,
  4097. intent
  4098. };
  4099. this.annotationEditorLayer.render(parameters);
  4100. this.show();
  4101. }
  4102. cancel() {
  4103. this._cancelled = true;
  4104. if (!this.div) {
  4105. return;
  4106. }
  4107. this.annotationEditorLayer.destroy();
  4108. }
  4109. hide() {
  4110. if (!this.div) {
  4111. return;
  4112. }
  4113. this.div.hidden = true;
  4114. }
  4115. show() {
  4116. if (!this.div || this.annotationEditorLayer.isInvisible) {
  4117. return;
  4118. }
  4119. this.div.hidden = false;
  4120. }
  4121. }
  4122. __webpack_async_result__();
  4123. } catch(e) { __webpack_async_result__(e); } });
  4124. /***/ }),
  4125. /***/ 2707:
  4126. /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
  4127. __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
  4128. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  4129. /* harmony export */ AnnotationLayerBuilder: () => (/* binding */ AnnotationLayerBuilder)
  4130. /* harmony export */ });
  4131. /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2603);
  4132. /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7256);
  4133. var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__]);
  4134. pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
  4135. class AnnotationLayerBuilder {
  4136. #onAppend = null;
  4137. #eventAbortController = null;
  4138. constructor({
  4139. pdfPage,
  4140. linkService,
  4141. downloadManager,
  4142. annotationStorage = null,
  4143. imageResourcesPath = "",
  4144. renderForms = true,
  4145. enableScripting = false,
  4146. hasJSActionsPromise = null,
  4147. fieldObjectsPromise = null,
  4148. annotationCanvasMap = null,
  4149. accessibilityManager = null,
  4150. annotationEditorUIManager = null,
  4151. onAppend = null
  4152. }) {
  4153. this.pdfPage = pdfPage;
  4154. this.linkService = linkService;
  4155. this.downloadManager = downloadManager;
  4156. this.imageResourcesPath = imageResourcesPath;
  4157. this.renderForms = renderForms;
  4158. this.annotationStorage = annotationStorage;
  4159. this.enableScripting = enableScripting;
  4160. this._hasJSActionsPromise = hasJSActionsPromise || Promise.resolve(false);
  4161. this._fieldObjectsPromise = fieldObjectsPromise || Promise.resolve(null);
  4162. this._annotationCanvasMap = annotationCanvasMap;
  4163. this._accessibilityManager = accessibilityManager;
  4164. this._annotationEditorUIManager = annotationEditorUIManager;
  4165. this.#onAppend = onAppend;
  4166. this.annotationLayer = null;
  4167. this.div = null;
  4168. this._cancelled = false;
  4169. this._eventBus = linkService.eventBus;
  4170. }
  4171. async render(viewport, intent = "display") {
  4172. if (this.div) {
  4173. if (this._cancelled || !this.annotationLayer) {
  4174. return;
  4175. }
  4176. this.annotationLayer.update({
  4177. viewport: viewport.clone({
  4178. dontFlip: true
  4179. })
  4180. });
  4181. return;
  4182. }
  4183. const [annotations, hasJSActions, fieldObjects] = await Promise.all([this.pdfPage.getAnnotations({
  4184. intent
  4185. }), this._hasJSActionsPromise, this._fieldObjectsPromise]);
  4186. if (this._cancelled) {
  4187. return;
  4188. }
  4189. const div = this.div = document.createElement("div");
  4190. div.className = "annotationLayer";
  4191. this.#onAppend?.(div);
  4192. if (annotations.length === 0) {
  4193. this.hide();
  4194. return;
  4195. }
  4196. this.annotationLayer = new pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.AnnotationLayer({
  4197. div,
  4198. accessibilityManager: this._accessibilityManager,
  4199. annotationCanvasMap: this._annotationCanvasMap,
  4200. annotationEditorUIManager: this._annotationEditorUIManager,
  4201. page: this.pdfPage,
  4202. viewport: viewport.clone({
  4203. dontFlip: true
  4204. })
  4205. });
  4206. await this.annotationLayer.render({
  4207. annotations,
  4208. imageResourcesPath: this.imageResourcesPath,
  4209. renderForms: this.renderForms,
  4210. linkService: this.linkService,
  4211. downloadManager: this.downloadManager,
  4212. annotationStorage: this.annotationStorage,
  4213. enableScripting: this.enableScripting,
  4214. hasJSActions,
  4215. fieldObjects
  4216. });
  4217. if (this.linkService.isInPresentationMode) {
  4218. this.#updatePresentationModeState(_ui_utils_js__WEBPACK_IMPORTED_MODULE_1__.PresentationModeState.FULLSCREEN);
  4219. }
  4220. if (!this.#eventAbortController) {
  4221. this.#eventAbortController = new AbortController();
  4222. this._eventBus?._on("presentationmodechanged", evt => {
  4223. this.#updatePresentationModeState(evt.state);
  4224. }, {
  4225. signal: this.#eventAbortController.signal
  4226. });
  4227. }
  4228. }
  4229. cancel() {
  4230. this._cancelled = true;
  4231. this.#eventAbortController?.abort();
  4232. this.#eventAbortController = null;
  4233. }
  4234. hide() {
  4235. if (!this.div) {
  4236. return;
  4237. }
  4238. this.div.hidden = true;
  4239. }
  4240. #updatePresentationModeState(state) {
  4241. if (!this.div) {
  4242. return;
  4243. }
  4244. let disableFormElements = false;
  4245. switch (state) {
  4246. case _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__.PresentationModeState.FULLSCREEN:
  4247. disableFormElements = true;
  4248. break;
  4249. case _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__.PresentationModeState.NORMAL:
  4250. break;
  4251. default:
  4252. return;
  4253. }
  4254. for (const section of this.div.childNodes) {
  4255. if (section.hasAttribute("data-internal-link")) {
  4256. continue;
  4257. }
  4258. section.inert = disableFormElements;
  4259. }
  4260. }
  4261. }
  4262. __webpack_async_result__();
  4263. } catch(e) { __webpack_async_result__(e); } });
  4264. /***/ }),
  4265. /***/ 9840:
  4266. /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
  4267. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  4268. /* harmony export */ AppOptions: () => (/* binding */ AppOptions)
  4269. /* harmony export */ });
  4270. /* unused harmony export OptionKind */
  4271. {
  4272. var compatibilityParams = Object.create(null);
  4273. const userAgent = navigator.userAgent || "";
  4274. const platform = navigator.platform || "";
  4275. const maxTouchPoints = navigator.maxTouchPoints || 1;
  4276. const isAndroid = /Android/.test(userAgent);
  4277. const isIOS = /\b(iPad|iPhone|iPod)(?=;)/.test(userAgent) || platform === "MacIntel" && maxTouchPoints > 1;
  4278. (function checkCanvasSizeLimitation() {
  4279. if (isIOS || isAndroid) {
  4280. compatibilityParams.maxCanvasPixels = 5242880;
  4281. }
  4282. })();
  4283. }
  4284. const OptionKind = {
  4285. BROWSER: 0x01,
  4286. VIEWER: 0x02,
  4287. API: 0x04,
  4288. WORKER: 0x08,
  4289. PREFERENCE: 0x80
  4290. };
  4291. const defaultOptions = {
  4292. canvasMaxAreaInBytes: {
  4293. value: -1,
  4294. kind: OptionKind.BROWSER + OptionKind.API
  4295. },
  4296. isInAutomation: {
  4297. value: false,
  4298. kind: OptionKind.BROWSER
  4299. },
  4300. supportsCaretBrowsingMode: {
  4301. value: false,
  4302. kind: OptionKind.BROWSER
  4303. },
  4304. supportsDocumentFonts: {
  4305. value: true,
  4306. kind: OptionKind.BROWSER
  4307. },
  4308. supportsIntegratedFind: {
  4309. value: false,
  4310. kind: OptionKind.BROWSER
  4311. },
  4312. supportsMouseWheelZoomCtrlKey: {
  4313. value: true,
  4314. kind: OptionKind.BROWSER
  4315. },
  4316. supportsMouseWheelZoomMetaKey: {
  4317. value: true,
  4318. kind: OptionKind.BROWSER
  4319. },
  4320. supportsPinchToZoom: {
  4321. value: true,
  4322. kind: OptionKind.BROWSER
  4323. },
  4324. annotationEditorMode: {
  4325. value: 0,
  4326. kind: OptionKind.VIEWER + OptionKind.PREFERENCE
  4327. },
  4328. annotationMode: {
  4329. value: 2,
  4330. kind: OptionKind.VIEWER + OptionKind.PREFERENCE
  4331. },
  4332. cursorToolOnLoad: {
  4333. value: 0,
  4334. kind: OptionKind.VIEWER + OptionKind.PREFERENCE
  4335. },
  4336. debuggerSrc: {
  4337. value: "./debugger.mjs",
  4338. kind: OptionKind.VIEWER
  4339. },
  4340. defaultZoomDelay: {
  4341. value: 400,
  4342. kind: OptionKind.VIEWER + OptionKind.PREFERENCE
  4343. },
  4344. defaultZoomValue: {
  4345. value: "",
  4346. kind: OptionKind.VIEWER + OptionKind.PREFERENCE
  4347. },
  4348. disableHistory: {
  4349. value: false,
  4350. kind: OptionKind.VIEWER
  4351. },
  4352. disablePageLabels: {
  4353. value: false,
  4354. kind: OptionKind.VIEWER + OptionKind.PREFERENCE
  4355. },
  4356. enableHighlightEditor: {
  4357. value: false,
  4358. kind: OptionKind.VIEWER + OptionKind.PREFERENCE
  4359. },
  4360. enableHighlightFloatingButton: {
  4361. value: false,
  4362. kind: OptionKind.VIEWER + OptionKind.PREFERENCE
  4363. },
  4364. enableML: {
  4365. value: false,
  4366. kind: OptionKind.VIEWER + OptionKind.PREFERENCE
  4367. },
  4368. enablePermissions: {
  4369. value: false,
  4370. kind: OptionKind.VIEWER + OptionKind.PREFERENCE
  4371. },
  4372. enablePrintAutoRotate: {
  4373. value: true,
  4374. kind: OptionKind.VIEWER + OptionKind.PREFERENCE
  4375. },
  4376. enableScripting: {
  4377. value: true,
  4378. kind: OptionKind.VIEWER + OptionKind.PREFERENCE
  4379. },
  4380. enableStampEditor: {
  4381. value: true,
  4382. kind: OptionKind.VIEWER + OptionKind.PREFERENCE
  4383. },
  4384. externalLinkRel: {
  4385. value: "noopener noreferrer nofollow",
  4386. kind: OptionKind.VIEWER
  4387. },
  4388. externalLinkTarget: {
  4389. value: 0,
  4390. kind: OptionKind.VIEWER + OptionKind.PREFERENCE
  4391. },
  4392. highlightEditorColors: {
  4393. value: "yellow=#FFFF98,green=#53FFBC,blue=#80EBFF,pink=#FFCBE6,red=#FF4F5F",
  4394. kind: OptionKind.VIEWER + OptionKind.PREFERENCE
  4395. },
  4396. historyUpdateUrl: {
  4397. value: false,
  4398. kind: OptionKind.VIEWER + OptionKind.PREFERENCE
  4399. },
  4400. ignoreDestinationZoom: {
  4401. value: false,
  4402. kind: OptionKind.VIEWER + OptionKind.PREFERENCE
  4403. },
  4404. imageResourcesPath: {
  4405. value: "./images/",
  4406. kind: OptionKind.VIEWER
  4407. },
  4408. maxCanvasPixels: {
  4409. value: 2 ** 25,
  4410. kind: OptionKind.VIEWER
  4411. },
  4412. forcePageColors: {
  4413. value: false,
  4414. kind: OptionKind.VIEWER + OptionKind.PREFERENCE
  4415. },
  4416. pageColorsBackground: {
  4417. value: "Canvas",
  4418. kind: OptionKind.VIEWER + OptionKind.PREFERENCE
  4419. },
  4420. pageColorsForeground: {
  4421. value: "CanvasText",
  4422. kind: OptionKind.VIEWER + OptionKind.PREFERENCE
  4423. },
  4424. pdfBugEnabled: {
  4425. value: false,
  4426. kind: OptionKind.VIEWER + OptionKind.PREFERENCE
  4427. },
  4428. printResolution: {
  4429. value: 150,
  4430. kind: OptionKind.VIEWER
  4431. },
  4432. sidebarViewOnLoad: {
  4433. value: -1,
  4434. kind: OptionKind.VIEWER + OptionKind.PREFERENCE
  4435. },
  4436. scrollModeOnLoad: {
  4437. value: -1,
  4438. kind: OptionKind.VIEWER + OptionKind.PREFERENCE
  4439. },
  4440. spreadModeOnLoad: {
  4441. value: -1,
  4442. kind: OptionKind.VIEWER + OptionKind.PREFERENCE
  4443. },
  4444. textLayerMode: {
  4445. value: 1,
  4446. kind: OptionKind.VIEWER + OptionKind.PREFERENCE
  4447. },
  4448. viewOnLoad: {
  4449. value: 0,
  4450. kind: OptionKind.VIEWER + OptionKind.PREFERENCE
  4451. },
  4452. cMapPacked: {
  4453. value: true,
  4454. kind: OptionKind.API
  4455. },
  4456. cMapUrl: {
  4457. value: "../web/cmaps/",
  4458. kind: OptionKind.API
  4459. },
  4460. disableAutoFetch: {
  4461. value: false,
  4462. kind: OptionKind.API + OptionKind.PREFERENCE
  4463. },
  4464. disableFontFace: {
  4465. value: false,
  4466. kind: OptionKind.API + OptionKind.PREFERENCE
  4467. },
  4468. disableRange: {
  4469. value: false,
  4470. kind: OptionKind.API + OptionKind.PREFERENCE
  4471. },
  4472. disableStream: {
  4473. value: false,
  4474. kind: OptionKind.API + OptionKind.PREFERENCE
  4475. },
  4476. docBaseUrl: {
  4477. value: "",
  4478. kind: OptionKind.API
  4479. },
  4480. enableXfa: {
  4481. value: true,
  4482. kind: OptionKind.API + OptionKind.PREFERENCE
  4483. },
  4484. fontExtraProperties: {
  4485. value: false,
  4486. kind: OptionKind.API
  4487. },
  4488. isEvalSupported: {
  4489. value: true,
  4490. kind: OptionKind.API
  4491. },
  4492. isOffscreenCanvasSupported: {
  4493. value: true,
  4494. kind: OptionKind.API
  4495. },
  4496. maxImageSize: {
  4497. value: -1,
  4498. kind: OptionKind.API
  4499. },
  4500. pdfBug: {
  4501. value: false,
  4502. kind: OptionKind.API
  4503. },
  4504. standardFontDataUrl: {
  4505. value: "../web/standard_fonts/",
  4506. kind: OptionKind.API
  4507. },
  4508. verbosity: {
  4509. value: 1,
  4510. kind: OptionKind.API
  4511. },
  4512. workerPort: {
  4513. value: null,
  4514. kind: OptionKind.WORKER
  4515. },
  4516. workerSrc: {
  4517. value: "./pdfjs/pdf.worker.mjs",
  4518. kind: OptionKind.WORKER
  4519. }
  4520. };
  4521. {
  4522. defaultOptions.defaultUrl = {
  4523. value: "compressed.tracemonkey-pldi-09.pdf",
  4524. kind: OptionKind.VIEWER
  4525. };
  4526. defaultOptions.sandboxBundleSrc = {
  4527. value: "../build/pdf.sandbox.mjs",
  4528. kind: OptionKind.VIEWER
  4529. };
  4530. defaultOptions.viewerCssTheme = {
  4531. value: 0,
  4532. kind: OptionKind.VIEWER + OptionKind.PREFERENCE
  4533. };
  4534. }
  4535. {
  4536. defaultOptions.disablePreferences = {
  4537. value: false,
  4538. kind: OptionKind.VIEWER
  4539. };
  4540. defaultOptions.locale = {
  4541. value: navigator.language || "en-US",
  4542. kind: OptionKind.VIEWER
  4543. };
  4544. }
  4545. const userOptions = Object.create(null);
  4546. {
  4547. for (const name in compatibilityParams) {
  4548. userOptions[name] = compatibilityParams[name];
  4549. }
  4550. }
  4551. class AppOptions {
  4552. constructor() {
  4553. throw new Error("Cannot initialize AppOptions.");
  4554. }
  4555. static get(name) {
  4556. return userOptions[name] ?? defaultOptions[name]?.value ?? undefined;
  4557. }
  4558. static getAll(kind = null, defaultOnly = false) {
  4559. const options = Object.create(null);
  4560. for (const name in defaultOptions) {
  4561. const defaultOption = defaultOptions[name];
  4562. if (kind && !(kind & defaultOption.kind)) {
  4563. continue;
  4564. }
  4565. options[name] = defaultOnly ? defaultOption.value : userOptions[name] ?? defaultOption.value;
  4566. }
  4567. return options;
  4568. }
  4569. static set(name, value) {
  4570. userOptions[name] = value;
  4571. }
  4572. static setAll(options, init = false) {
  4573. if (init) {
  4574. if (this.get("disablePreferences")) {
  4575. return;
  4576. }
  4577. for (const name in userOptions) {
  4578. if (compatibilityParams[name] !== undefined) {
  4579. continue;
  4580. }
  4581. console.warn("setAll: The Preferences may override manually set AppOptions; " + 'please use the "disablePreferences"-option in order to prevent that.');
  4582. break;
  4583. }
  4584. }
  4585. for (const name in options) {
  4586. userOptions[name] = options[name];
  4587. }
  4588. }
  4589. static remove(name) {
  4590. delete userOptions[name];
  4591. const val = compatibilityParams[name];
  4592. if (val !== undefined) {
  4593. userOptions[name] = val;
  4594. }
  4595. }
  4596. }
  4597. /***/ }),
  4598. /***/ 1544:
  4599. /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
  4600. __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
  4601. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  4602. /* harmony export */ DownloadManager: () => (/* binding */ DownloadManager)
  4603. /* harmony export */ });
  4604. /* harmony import */ var core_js_modules_web_url_search_params_delete_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4603);
  4605. /* harmony import */ var core_js_modules_web_url_search_params_has_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7566);
  4606. /* harmony import */ var core_js_modules_web_url_search_params_size_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8721);
  4607. /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2603);
  4608. var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_3__]);
  4609. pdfjs_lib__WEBPACK_IMPORTED_MODULE_3__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
  4610. function download(blobUrl, filename) {
  4611. const a = document.createElement("a");
  4612. if (!a.click) {
  4613. throw new Error('DownloadManager: "a.click()" is not supported.');
  4614. }
  4615. a.href = blobUrl;
  4616. a.target = "_parent";
  4617. if ("download" in a) {
  4618. a.download = filename;
  4619. }
  4620. (document.body || document.documentElement).append(a);
  4621. a.click();
  4622. a.remove();
  4623. }
  4624. class DownloadManager {
  4625. #openBlobUrls = new WeakMap();
  4626. downloadUrl(url, filename, _options) {
  4627. if (!(0,pdfjs_lib__WEBPACK_IMPORTED_MODULE_3__.createValidAbsoluteUrl)(url, "http://example.com")) {
  4628. console.error(`downloadUrl - not a valid URL: ${url}`);
  4629. return;
  4630. }
  4631. download(url + "#pdfjs.action=download", filename);
  4632. }
  4633. downloadData(data, filename, contentType) {
  4634. const blobUrl = URL.createObjectURL(new Blob([data], {
  4635. type: contentType
  4636. }));
  4637. download(blobUrl, filename);
  4638. }
  4639. openOrDownloadData(data, filename, dest = null) {
  4640. const isPdfData = (0,pdfjs_lib__WEBPACK_IMPORTED_MODULE_3__.isPdfFile)(filename);
  4641. const contentType = isPdfData ? "application/pdf" : "";
  4642. this.downloadData(data, filename, contentType);
  4643. return false;
  4644. }
  4645. download(blob, url, filename, _options) {
  4646. const blobUrl = URL.createObjectURL(blob);
  4647. download(blobUrl, filename);
  4648. }
  4649. }
  4650. __webpack_async_result__();
  4651. } catch(e) { __webpack_async_result__(e); } });
  4652. /***/ }),
  4653. /***/ 3088:
  4654. /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
  4655. __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
  4656. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  4657. /* harmony export */ DrawLayerBuilder: () => (/* binding */ DrawLayerBuilder)
  4658. /* harmony export */ });
  4659. /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2603);
  4660. var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__]);
  4661. pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
  4662. class DrawLayerBuilder {
  4663. #drawLayer = null;
  4664. constructor(options) {
  4665. this.pageIndex = options.pageIndex;
  4666. }
  4667. async render(intent = "display") {
  4668. if (intent !== "display" || this.#drawLayer || this._cancelled) {
  4669. return;
  4670. }
  4671. this.#drawLayer = new pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.DrawLayer({
  4672. pageIndex: this.pageIndex
  4673. });
  4674. }
  4675. cancel() {
  4676. this._cancelled = true;
  4677. if (!this.#drawLayer) {
  4678. return;
  4679. }
  4680. this.#drawLayer.destroy();
  4681. this.#drawLayer = null;
  4682. }
  4683. setParent(parent) {
  4684. this.#drawLayer?.setParent(parent);
  4685. }
  4686. getDrawLayer() {
  4687. return this.#drawLayer;
  4688. }
  4689. }
  4690. __webpack_async_result__();
  4691. } catch(e) { __webpack_async_result__(e); } });
  4692. /***/ }),
  4693. /***/ 5656:
  4694. /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
  4695. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  4696. /* harmony export */ EventBus: () => (/* binding */ EventBus),
  4697. /* harmony export */ waitOnEventOrTimeout: () => (/* binding */ waitOnEventOrTimeout)
  4698. /* harmony export */ });
  4699. /* unused harmony exports AutomationEventBus, WaitOnType */
  4700. /* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4114);
  4701. /* harmony import */ var core_js_modules_es_promise_with_resolvers_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4628);
  4702. const WaitOnType = {
  4703. EVENT: "event",
  4704. TIMEOUT: "timeout"
  4705. };
  4706. async function waitOnEventOrTimeout({
  4707. target,
  4708. name,
  4709. delay = 0
  4710. }) {
  4711. if (typeof target !== "object" || !(name && typeof name === "string") || !(Number.isInteger(delay) && delay >= 0)) {
  4712. throw new Error("waitOnEventOrTimeout - invalid parameters.");
  4713. }
  4714. const {
  4715. promise,
  4716. resolve
  4717. } = Promise.withResolvers();
  4718. const ac = new AbortController();
  4719. function handler(type) {
  4720. ac.abort();
  4721. clearTimeout(timeout);
  4722. resolve(type);
  4723. }
  4724. const evtMethod = target instanceof EventBus ? "_on" : "addEventListener";
  4725. target[evtMethod](name, handler.bind(null, WaitOnType.EVENT), {
  4726. signal: ac.signal
  4727. });
  4728. const timeout = setTimeout(handler.bind(null, WaitOnType.TIMEOUT), delay);
  4729. return promise;
  4730. }
  4731. class EventBus {
  4732. #listeners = Object.create(null);
  4733. on(eventName, listener, options = null) {
  4734. this._on(eventName, listener, {
  4735. external: true,
  4736. once: options?.once,
  4737. signal: options?.signal
  4738. });
  4739. }
  4740. off(eventName, listener, options = null) {
  4741. this._off(eventName, listener);
  4742. }
  4743. dispatch(eventName, data) {
  4744. const eventListeners = this.#listeners[eventName];
  4745. if (!eventListeners || eventListeners.length === 0) {
  4746. return;
  4747. }
  4748. let externalListeners;
  4749. for (const {
  4750. listener,
  4751. external,
  4752. once
  4753. } of eventListeners.slice(0)) {
  4754. if (once) {
  4755. this._off(eventName, listener);
  4756. }
  4757. if (external) {
  4758. (externalListeners ||= []).push(listener);
  4759. continue;
  4760. }
  4761. listener(data);
  4762. }
  4763. if (externalListeners) {
  4764. for (const listener of externalListeners) {
  4765. listener(data);
  4766. }
  4767. externalListeners = null;
  4768. }
  4769. }
  4770. _on(eventName, listener, options = null) {
  4771. let rmAbort = null;
  4772. if (options?.signal instanceof AbortSignal) {
  4773. const {
  4774. signal
  4775. } = options;
  4776. if (signal.aborted) {
  4777. console.error("Cannot use an `aborted` signal.");
  4778. return;
  4779. }
  4780. const onAbort = () => this._off(eventName, listener);
  4781. rmAbort = () => signal.removeEventListener("abort", onAbort);
  4782. signal.addEventListener("abort", onAbort);
  4783. }
  4784. const eventListeners = this.#listeners[eventName] ||= [];
  4785. eventListeners.push({
  4786. listener,
  4787. external: options?.external === true,
  4788. once: options?.once === true,
  4789. rmAbort
  4790. });
  4791. }
  4792. _off(eventName, listener, options = null) {
  4793. const eventListeners = this.#listeners[eventName];
  4794. if (!eventListeners) {
  4795. return;
  4796. }
  4797. for (let i = 0, ii = eventListeners.length; i < ii; i++) {
  4798. const evt = eventListeners[i];
  4799. if (evt.listener === listener) {
  4800. evt.rmAbort?.();
  4801. eventListeners.splice(i, 1);
  4802. return;
  4803. }
  4804. }
  4805. }
  4806. }
  4807. class AutomationEventBus extends (/* unused pure expression or super */ null && (EventBus)) {
  4808. dispatch(eventName, data) {
  4809. throw new Error("Not implemented: AutomationEventBus.dispatch");
  4810. }
  4811. }
  4812. /***/ }),
  4813. /***/ 289:
  4814. /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
  4815. __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
  4816. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  4817. /* harmony export */ GenericScripting: () => (/* binding */ GenericScripting),
  4818. /* harmony export */ docProperties: () => (/* binding */ docProperties)
  4819. /* harmony export */ });
  4820. /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2603);
  4821. var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__]);
  4822. pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
  4823. async function docProperties(pdfDocument) {
  4824. const url = "",
  4825. baseUrl = url.split("#", 1)[0];
  4826. let {
  4827. info,
  4828. metadata,
  4829. contentDispositionFilename,
  4830. contentLength
  4831. } = await pdfDocument.getMetadata();
  4832. if (!contentLength) {
  4833. const {
  4834. length
  4835. } = await pdfDocument.getDownloadInfo();
  4836. contentLength = length;
  4837. }
  4838. return {
  4839. ...info,
  4840. baseURL: baseUrl,
  4841. filesize: contentLength,
  4842. filename: contentDispositionFilename || (0,pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.getPdfFilenameFromUrl)(url),
  4843. metadata: metadata?.getRaw(),
  4844. authors: metadata?.get("dc:creator"),
  4845. numPages: pdfDocument.numPages,
  4846. URL: url
  4847. };
  4848. }
  4849. class GenericScripting {
  4850. constructor(sandboxBundleSrc) {
  4851. this._ready = new Promise((resolve, reject) => {
  4852. const sandbox = import( /*webpackIgnore: true*/sandboxBundleSrc);
  4853. sandbox.then(pdfjsSandbox => {
  4854. resolve(pdfjsSandbox.QuickJSSandbox());
  4855. }).catch(reject);
  4856. });
  4857. }
  4858. async createSandbox(data) {
  4859. const sandbox = await this._ready;
  4860. sandbox.create(data);
  4861. }
  4862. async dispatchEventInSandbox(event) {
  4863. const sandbox = await this._ready;
  4864. setTimeout(() => sandbox.dispatchEvent(event), 0);
  4865. }
  4866. async destroySandbox() {
  4867. const sandbox = await this._ready;
  4868. sandbox.nukeSandbox();
  4869. }
  4870. }
  4871. __webpack_async_result__();
  4872. } catch(e) { __webpack_async_result__(e); } });
  4873. /***/ }),
  4874. /***/ 410:
  4875. /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
  4876. __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
  4877. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  4878. /* harmony export */ GenericL10n: () => (/* binding */ GenericL10n)
  4879. /* harmony export */ });
  4880. /* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4114);
  4881. /* harmony import */ var core_js_modules_web_url_search_params_delete_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4603);
  4882. /* harmony import */ var core_js_modules_web_url_search_params_has_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7566);
  4883. /* harmony import */ var core_js_modules_web_url_search_params_size_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8721);
  4884. /* harmony import */ var fluent_bundle__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(588);
  4885. /* harmony import */ var fluent_dom__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5273);
  4886. /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2603);
  4887. /* harmony import */ var _l10n_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(4693);
  4888. var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_6__]);
  4889. pdfjs_lib__WEBPACK_IMPORTED_MODULE_6__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
  4890. function createBundle(lang, text) {
  4891. const resource = new fluent_bundle__WEBPACK_IMPORTED_MODULE_4__.FluentResource(text);
  4892. const bundle = new fluent_bundle__WEBPACK_IMPORTED_MODULE_4__.FluentBundle(lang);
  4893. const errors = bundle.addResource(resource);
  4894. if (errors.length) {
  4895. console.error("L10n errors", errors);
  4896. }
  4897. return bundle;
  4898. }
  4899. class GenericL10n extends _l10n_js__WEBPACK_IMPORTED_MODULE_7__.L10n {
  4900. constructor(lang) {
  4901. super({
  4902. lang
  4903. });
  4904. const generateBundles = !lang ? GenericL10n.#generateBundlesFallback.bind(GenericL10n, this.getLanguage()) : GenericL10n.#generateBundles.bind(GenericL10n, "en-us", this.getLanguage());
  4905. this._setL10n(new fluent_dom__WEBPACK_IMPORTED_MODULE_5__.DOMLocalization([], generateBundles));
  4906. }
  4907. static async *#generateBundles(defaultLang, baseLang) {
  4908. const {
  4909. baseURL,
  4910. paths
  4911. } = await this.#getPaths();
  4912. const langs = [baseLang];
  4913. if (defaultLang !== baseLang) {
  4914. const shortLang = baseLang.split("-", 1)[0];
  4915. if (shortLang !== baseLang) {
  4916. langs.push(shortLang);
  4917. }
  4918. langs.push(defaultLang);
  4919. }
  4920. for (const lang of langs) {
  4921. const bundle = await this.#createBundle(lang, baseURL, paths);
  4922. if (bundle) {
  4923. yield bundle;
  4924. }
  4925. if (lang === "en-us") {
  4926. yield this.#createBundleFallback(lang);
  4927. }
  4928. }
  4929. }
  4930. static async #createBundle(lang, baseURL, paths) {
  4931. const path = paths[lang];
  4932. if (!path) {
  4933. return null;
  4934. }
  4935. const url = new URL(path, baseURL);
  4936. const text = await (0,pdfjs_lib__WEBPACK_IMPORTED_MODULE_6__.fetchData)(url, "text");
  4937. return createBundle(lang, text);
  4938. }
  4939. static async #getPaths() {
  4940. try {
  4941. const {
  4942. href
  4943. } = document.querySelector(`link[type="application/l10n"]`);
  4944. const paths = await (0,pdfjs_lib__WEBPACK_IMPORTED_MODULE_6__.fetchData)(href, "json");
  4945. return {
  4946. baseURL: href.replace(/[^/]*$/, "") || "./",
  4947. paths
  4948. };
  4949. } catch {}
  4950. return {
  4951. baseURL: "./",
  4952. paths: Object.create(null)
  4953. };
  4954. }
  4955. static async *#generateBundlesFallback(lang) {
  4956. yield this.#createBundleFallback(lang);
  4957. }
  4958. static async #createBundleFallback(lang) {
  4959. const text = "pdfjs-previous-button =\n .title = Previous Page\npdfjs-previous-button-label = Previous\npdfjs-next-button =\n .title = Next Page\npdfjs-next-button-label = Next\npdfjs-page-input =\n .title = Page\npdfjs-of-pages = of { $pagesCount }\npdfjs-page-of-pages = ({ $pageNumber } of { $pagesCount })\npdfjs-zoom-out-button =\n .title = Zoom Out\npdfjs-zoom-out-button-label = Zoom Out\npdfjs-zoom-in-button =\n .title = Zoom In\npdfjs-zoom-in-button-label = Zoom In\npdfjs-zoom-select =\n .title = Zoom\npdfjs-presentation-mode-button =\n .title = Switch to Presentation Mode\npdfjs-presentation-mode-button-label = Presentation Mode\npdfjs-open-file-button =\n .title = Open File\npdfjs-open-file-button-label = Open\npdfjs-print-button =\n .title = Print\npdfjs-print-button-label = Print\npdfjs-save-button =\n .title = Save\npdfjs-save-button-label = Save\npdfjs-download-button =\n .title = Download\npdfjs-download-button-label = Download\npdfjs-bookmark-button =\n .title = Current Page (View URL from Current Page)\npdfjs-bookmark-button-label = Current Page\npdfjs-tools-button =\n .title = Tools\npdfjs-tools-button-label = Tools\npdfjs-first-page-button =\n .title = Go to First Page\npdfjs-first-page-button-label = Go to First Page\npdfjs-last-page-button =\n .title = Go to Last Page\npdfjs-last-page-button-label = Go to Last Page\npdfjs-page-rotate-cw-button =\n .title = Rotate Clockwise\npdfjs-page-rotate-cw-button-label = Rotate Clockwise\npdfjs-page-rotate-ccw-button =\n .title = Rotate Counterclockwise\npdfjs-page-rotate-ccw-button-label = Rotate Counterclockwise\npdfjs-cursor-text-select-tool-button =\n .title = Enable Text Selection Tool\npdfjs-cursor-text-select-tool-button-label = Text Selection Tool\npdfjs-cursor-hand-tool-button =\n .title = Enable Hand Tool\npdfjs-cursor-hand-tool-button-label = Hand Tool\npdfjs-scroll-page-button =\n .title = Use Page Scrolling\npdfjs-scroll-page-button-label = Page Scrolling\npdfjs-scroll-vertical-button =\n .title = Use Vertical Scrolling\npdfjs-scroll-vertical-button-label = Vertical Scrolling\npdfjs-scroll-horizontal-button =\n .title = Use Horizontal Scrolling\npdfjs-scroll-horizontal-button-label = Horizontal Scrolling\npdfjs-scroll-wrapped-button =\n .title = Use Wrapped Scrolling\npdfjs-scroll-wrapped-button-label = Wrapped Scrolling\npdfjs-spread-none-button =\n .title = Do not join page spreads\npdfjs-spread-none-button-label = No Spreads\npdfjs-spread-odd-button =\n .title = Join page spreads starting with odd-numbered pages\npdfjs-spread-odd-button-label = Odd Spreads\npdfjs-spread-even-button =\n .title = Join page spreads starting with even-numbered pages\npdfjs-spread-even-button-label = Even Spreads\npdfjs-document-properties-button =\n .title = Document Properties\u2026\npdfjs-document-properties-button-label = Document Properties\u2026\npdfjs-document-properties-file-name = File name:\npdfjs-document-properties-file-size = File size:\npdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bytes)\npdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes)\npdfjs-document-properties-title = Title:\npdfjs-document-properties-author = Author:\npdfjs-document-properties-subject = Subject:\npdfjs-document-properties-keywords = Keywords:\npdfjs-document-properties-creation-date = Creation Date:\npdfjs-document-properties-modification-date = Modification Date:\npdfjs-document-properties-date-string = { $date }, { $time }\npdfjs-document-properties-creator = Creator:\npdfjs-document-properties-producer = PDF Producer:\npdfjs-document-properties-version = PDF Version:\npdfjs-document-properties-page-count = Page Count:\npdfjs-document-properties-page-size = Page Size:\npdfjs-document-properties-page-size-unit-inches = in\npdfjs-document-properties-page-size-unit-millimeters = mm\npdfjs-document-properties-page-size-orientation-portrait = portrait\npdfjs-document-properties-page-size-orientation-landscape = landscape\npdfjs-document-properties-page-size-name-a-three = A3\npdfjs-document-properties-page-size-name-a-four = A4\npdfjs-document-properties-page-size-name-letter = Letter\npdfjs-document-properties-page-size-name-legal = Legal\npdfjs-document-properties-page-size-dimension-string = { $width } \xD7 { $height } { $unit } ({ $orientation })\npdfjs-document-properties-page-size-dimension-name-string = { $width } \xD7 { $height } { $unit } ({ $name }, { $orientation })\npdfjs-document-properties-linearized = Fast Web View:\npdfjs-document-properties-linearized-yes = Yes\npdfjs-document-properties-linearized-no = No\npdfjs-document-properties-close-button = Close\npdfjs-print-progress-message = Preparing document for printing\u2026\npdfjs-print-progress-percent = { $progress }%\npdfjs-print-progress-close-button = Cancel\npdfjs-printing-not-supported = Warning: Printing is not fully supported by this browser.\npdfjs-printing-not-ready = Warning: The PDF is not fully loaded for printing.\npdfjs-toggle-sidebar-button =\n .title = Toggle Sidebar\npdfjs-toggle-sidebar-notification-button =\n .title = Toggle Sidebar (document contains outline/attachments/layers)\npdfjs-toggle-sidebar-button-label = Toggle Sidebar\npdfjs-document-outline-button =\n .title = Show Document Outline (double-click to expand/collapse all items)\npdfjs-document-outline-button-label = Document Outline\npdfjs-attachments-button =\n .title = Show Attachments\npdfjs-attachments-button-label = Attachments\npdfjs-layers-button =\n .title = Show Layers (double-click to reset all layers to the default state)\npdfjs-layers-button-label = Layers\npdfjs-thumbs-button =\n .title = Show Thumbnails\npdfjs-thumbs-button-label = Thumbnails\npdfjs-current-outline-item-button =\n .title = Find Current Outline Item\npdfjs-current-outline-item-button-label = Current Outline Item\npdfjs-findbar-button =\n .title = Find in Document\npdfjs-findbar-button-label = Find\npdfjs-additional-layers = Additional Layers\npdfjs-thumb-page-title =\n .title = Page { $page }\npdfjs-thumb-page-canvas =\n .aria-label = Thumbnail of Page { $page }\npdfjs-find-input =\n .title = Find\n .placeholder = Find in document\u2026\npdfjs-find-previous-button =\n .title = Find the previous occurrence of the phrase\npdfjs-find-previous-button-label = Previous\npdfjs-find-next-button =\n .title = Find the next occurrence of the phrase\npdfjs-find-next-button-label = Next\npdfjs-find-highlight-checkbox = Highlight All\npdfjs-find-match-case-checkbox-label = Match Case\npdfjs-find-match-diacritics-checkbox-label = Match Diacritics\npdfjs-find-entire-word-checkbox-label = Whole Words\npdfjs-find-reached-top = Reached top of document, continued from bottom\npdfjs-find-reached-bottom = Reached end of document, continued from top\npdfjs-find-match-count =\n { $total ->\n [one] { $current } of { $total } match\n *[other] { $current } of { $total } matches\n }\npdfjs-find-match-count-limit =\n { $limit ->\n [one] More than { $limit } match\n *[other] More than { $limit } matches\n }\npdfjs-find-not-found = Phrase not found\npdfjs-page-scale-width = Page Width\npdfjs-page-scale-fit = Page Fit\npdfjs-page-scale-auto = Automatic Zoom\npdfjs-page-scale-actual = Actual Size\npdfjs-page-scale-percent = { $scale }%\npdfjs-page-landmark =\n .aria-label = Page { $page }\npdfjs-loading-error = An error occurred while loading the PDF.\npdfjs-invalid-file-error = Invalid or corrupted PDF file.\npdfjs-missing-file-error = Missing PDF file.\npdfjs-unexpected-response-error = Unexpected server response.\npdfjs-rendering-error = An error occurred while rendering the page.\npdfjs-annotation-date-string = { $date }, { $time }\npdfjs-text-annotation-type =\n .alt = [{ $type } Annotation]\npdfjs-password-label = Enter the password to open this PDF file.\npdfjs-password-invalid = Invalid password. Please try again.\npdfjs-password-ok-button = OK\npdfjs-password-cancel-button = Cancel\npdfjs-web-fonts-disabled = Web fonts are disabled: unable to use embedded PDF fonts.\npdfjs-editor-free-text-button =\n .title = Text\npdfjs-editor-free-text-button-label = Text\npdfjs-editor-ink-button =\n .title = Draw\npdfjs-editor-ink-button-label = Draw\npdfjs-editor-stamp-button =\n .title = Add or edit images\npdfjs-editor-stamp-button-label = Add or edit images\npdfjs-editor-highlight-button =\n .title = Highlight\npdfjs-editor-highlight-button-label = Highlight\npdfjs-highlight-floating-button1 =\n .title = Highlight\n .aria-label = Highlight\npdfjs-highlight-floating-button-label = Highlight\npdfjs-editor-remove-ink-button =\n .title = Remove drawing\npdfjs-editor-remove-freetext-button =\n .title = Remove text\npdfjs-editor-remove-stamp-button =\n .title = Remove image\npdfjs-editor-remove-highlight-button =\n .title = Remove highlight\npdfjs-editor-free-text-color-input = Color\npdfjs-editor-free-text-size-input = Size\npdfjs-editor-ink-color-input = Color\npdfjs-editor-ink-thickness-input = Thickness\npdfjs-editor-ink-opacity-input = Opacity\npdfjs-editor-stamp-add-image-button =\n .title = Add image\npdfjs-editor-stamp-add-image-button-label = Add image\npdfjs-editor-free-highlight-thickness-input = Thickness\npdfjs-editor-free-highlight-thickness-title =\n .title = Change thickness when highlighting items other than text\npdfjs-free-text =\n .aria-label = Text Editor\npdfjs-free-text-default-content = Start typing\u2026\npdfjs-ink =\n .aria-label = Draw Editor\npdfjs-ink-canvas =\n .aria-label = User-created image\npdfjs-editor-alt-text-button-label = Alt text\npdfjs-editor-alt-text-edit-button-label = Edit alt text\npdfjs-editor-alt-text-dialog-label = Choose an option\npdfjs-editor-alt-text-dialog-description = Alt text (alternative text) helps when people can\u2019t see the image or when it doesn\u2019t load.\npdfjs-editor-alt-text-add-description-label = Add a description\npdfjs-editor-alt-text-add-description-description = Aim for 1-2 sentences that describe the subject, setting, or actions.\npdfjs-editor-alt-text-mark-decorative-label = Mark as decorative\npdfjs-editor-alt-text-mark-decorative-description = This is used for ornamental images, like borders or watermarks.\npdfjs-editor-alt-text-cancel-button = Cancel\npdfjs-editor-alt-text-save-button = Save\npdfjs-editor-alt-text-decorative-tooltip = Marked as decorative\npdfjs-editor-alt-text-textarea =\n .placeholder = For example, \u201CA young man sits down at a table to eat a meal\u201D\npdfjs-editor-resizer-label-top-left = Top left corner \u2014 resize\npdfjs-editor-resizer-label-top-middle = Top middle \u2014 resize\npdfjs-editor-resizer-label-top-right = Top right corner \u2014 resize\npdfjs-editor-resizer-label-middle-right = Middle right \u2014 resize\npdfjs-editor-resizer-label-bottom-right = Bottom right corner \u2014 resize\npdfjs-editor-resizer-label-bottom-middle = Bottom middle \u2014 resize\npdfjs-editor-resizer-label-bottom-left = Bottom left corner \u2014 resize\npdfjs-editor-resizer-label-middle-left = Middle left \u2014 resize\npdfjs-editor-highlight-colorpicker-label = Highlight color\npdfjs-editor-colorpicker-button =\n .title = Change color\npdfjs-editor-colorpicker-dropdown =\n .aria-label = Color choices\npdfjs-editor-colorpicker-yellow =\n .title = Yellow\npdfjs-editor-colorpicker-green =\n .title = Green\npdfjs-editor-colorpicker-blue =\n .title = Blue\npdfjs-editor-colorpicker-pink =\n .title = Pink\npdfjs-editor-colorpicker-red =\n .title = Red\npdfjs-editor-highlight-show-all-button-label = Show all\npdfjs-editor-highlight-show-all-button =\n .title = Show all";
  4960. return createBundle(lang, text);
  4961. }
  4962. }
  4963. __webpack_async_result__();
  4964. } catch(e) { __webpack_async_result__(e); } });
  4965. /***/ }),
  4966. /***/ 4693:
  4967. /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
  4968. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  4969. /* harmony export */ L10n: () => (/* binding */ L10n)
  4970. /* harmony export */ });
  4971. /* unused harmony export GenericL10n */
  4972. /* harmony import */ var core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1454);
  4973. class L10n {
  4974. #dir;
  4975. #lang;
  4976. #l10n;
  4977. constructor({
  4978. lang,
  4979. isRTL
  4980. }, l10n = null) {
  4981. this.#lang = L10n.#fixupLangCode(lang);
  4982. this.#l10n = l10n;
  4983. this.#dir = isRTL ?? L10n.#isRTL(this.#lang) ? "rtl" : "ltr";
  4984. }
  4985. _setL10n(l10n) {
  4986. this.#l10n = l10n;
  4987. }
  4988. getLanguage() {
  4989. return this.#lang;
  4990. }
  4991. getDirection() {
  4992. return this.#dir;
  4993. }
  4994. async get(ids, args = null, fallback) {
  4995. if (Array.isArray(ids)) {
  4996. ids = ids.map(id => ({
  4997. id
  4998. }));
  4999. const messages = await this.#l10n.formatMessages(ids);
  5000. return messages.map(message => message.value);
  5001. }
  5002. const messages = await this.#l10n.formatMessages([{
  5003. id: ids,
  5004. args
  5005. }]);
  5006. return messages?.[0].value || fallback;
  5007. }
  5008. async translate(element) {
  5009. try {
  5010. this.#l10n.connectRoot(element);
  5011. await this.#l10n.translateRoots();
  5012. } catch {}
  5013. }
  5014. pause() {
  5015. this.#l10n.pauseObserving();
  5016. }
  5017. resume() {
  5018. this.#l10n.resumeObserving();
  5019. }
  5020. static #fixupLangCode(langCode) {
  5021. langCode = langCode?.toLowerCase() || "en-us";
  5022. const PARTIAL_LANG_CODES = {
  5023. en: "en-us",
  5024. es: "es-es",
  5025. fy: "fy-nl",
  5026. ga: "ga-ie",
  5027. gu: "gu-in",
  5028. hi: "hi-in",
  5029. hy: "hy-am",
  5030. nb: "nb-no",
  5031. ne: "ne-np",
  5032. nn: "nn-no",
  5033. pa: "pa-in",
  5034. pt: "pt-pt",
  5035. sv: "sv-se",
  5036. zh: "zh-cn"
  5037. };
  5038. return PARTIAL_LANG_CODES[langCode] || langCode;
  5039. }
  5040. static #isRTL(lang) {
  5041. const shortCode = lang.split("-", 1)[0];
  5042. return ["ar", "he", "fa", "ps", "ur"].includes(shortCode);
  5043. }
  5044. }
  5045. const GenericL10n = null;
  5046. /***/ }),
  5047. /***/ 9814:
  5048. /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
  5049. // EXPORTS
  5050. __webpack_require__.d(__webpack_exports__, {
  5051. FindState: () => (/* binding */ FindState),
  5052. PDFFindController: () => (/* binding */ PDFFindController)
  5053. });
  5054. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.push.js
  5055. var es_array_push = __webpack_require__(4114);
  5056. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.promise.with-resolvers.js
  5057. var es_promise_with_resolvers = __webpack_require__(4628);
  5058. // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.iterator.constructor.js
  5059. var esnext_iterator_constructor = __webpack_require__(8992);
  5060. // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.iterator.filter.js
  5061. var esnext_iterator_filter = __webpack_require__(4520);
  5062. // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.iterator.map.js
  5063. var esnext_iterator_map = __webpack_require__(1454);
  5064. // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.set.difference.v2.js
  5065. var esnext_set_difference_v2 = __webpack_require__(3375);
  5066. // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.set.intersection.v2.js
  5067. var esnext_set_intersection_v2 = __webpack_require__(9225);
  5068. // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.set.is-disjoint-from.v2.js
  5069. var esnext_set_is_disjoint_from_v2 = __webpack_require__(3972);
  5070. // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.set.is-subset-of.v2.js
  5071. var esnext_set_is_subset_of_v2 = __webpack_require__(9209);
  5072. // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.set.is-superset-of.v2.js
  5073. var esnext_set_is_superset_of_v2 = __webpack_require__(5714);
  5074. // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.set.symmetric-difference.v2.js
  5075. var esnext_set_symmetric_difference_v2 = __webpack_require__(7561);
  5076. // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.set.union.v2.js
  5077. var esnext_set_union_v2 = __webpack_require__(6197);
  5078. // EXTERNAL MODULE: ./web/ui_utils.js
  5079. var ui_utils = __webpack_require__(7256);
  5080. ;// CONCATENATED MODULE: ./web/pdf_find_utils.js
  5081. const CharacterType = {
  5082. SPACE: 0,
  5083. ALPHA_LETTER: 1,
  5084. PUNCT: 2,
  5085. HAN_LETTER: 3,
  5086. KATAKANA_LETTER: 4,
  5087. HIRAGANA_LETTER: 5,
  5088. HALFWIDTH_KATAKANA_LETTER: 6,
  5089. THAI_LETTER: 7
  5090. };
  5091. function isAlphabeticalScript(charCode) {
  5092. return charCode < 0x2e80;
  5093. }
  5094. function isAscii(charCode) {
  5095. return (charCode & 0xff80) === 0;
  5096. }
  5097. function isAsciiAlpha(charCode) {
  5098. return charCode >= 0x61 && charCode <= 0x7a || charCode >= 0x41 && charCode <= 0x5a;
  5099. }
  5100. function isAsciiDigit(charCode) {
  5101. return charCode >= 0x30 && charCode <= 0x39;
  5102. }
  5103. function isAsciiSpace(charCode) {
  5104. return charCode === 0x20 || charCode === 0x09 || charCode === 0x0d || charCode === 0x0a;
  5105. }
  5106. function isHan(charCode) {
  5107. return charCode >= 0x3400 && charCode <= 0x9fff || charCode >= 0xf900 && charCode <= 0xfaff;
  5108. }
  5109. function isKatakana(charCode) {
  5110. return charCode >= 0x30a0 && charCode <= 0x30ff;
  5111. }
  5112. function isHiragana(charCode) {
  5113. return charCode >= 0x3040 && charCode <= 0x309f;
  5114. }
  5115. function isHalfwidthKatakana(charCode) {
  5116. return charCode >= 0xff60 && charCode <= 0xff9f;
  5117. }
  5118. function isThai(charCode) {
  5119. return (charCode & 0xff80) === 0x0e00;
  5120. }
  5121. function getCharacterType(charCode) {
  5122. if (isAlphabeticalScript(charCode)) {
  5123. if (isAscii(charCode)) {
  5124. if (isAsciiSpace(charCode)) {
  5125. return CharacterType.SPACE;
  5126. } else if (isAsciiAlpha(charCode) || isAsciiDigit(charCode) || charCode === 0x5f) {
  5127. return CharacterType.ALPHA_LETTER;
  5128. }
  5129. return CharacterType.PUNCT;
  5130. } else if (isThai(charCode)) {
  5131. return CharacterType.THAI_LETTER;
  5132. } else if (charCode === 0xa0) {
  5133. return CharacterType.SPACE;
  5134. }
  5135. return CharacterType.ALPHA_LETTER;
  5136. }
  5137. if (isHan(charCode)) {
  5138. return CharacterType.HAN_LETTER;
  5139. } else if (isKatakana(charCode)) {
  5140. return CharacterType.KATAKANA_LETTER;
  5141. } else if (isHiragana(charCode)) {
  5142. return CharacterType.HIRAGANA_LETTER;
  5143. } else if (isHalfwidthKatakana(charCode)) {
  5144. return CharacterType.HALFWIDTH_KATAKANA_LETTER;
  5145. }
  5146. return CharacterType.ALPHA_LETTER;
  5147. }
  5148. let NormalizeWithNFKC;
  5149. function getNormalizeWithNFKC() {
  5150. NormalizeWithNFKC ||= ` ¨ª¯²-µ¸-º¼-¾IJ-ijĿ-ŀʼnſDŽ-njDZ-dzʰ-ʸ˘-˝ˠ-ˤʹͺ;΄-΅·ϐ-ϖϰ-ϲϴ-ϵϹևٵ-ٸक़-य़ড়-ঢ়য়ਲ਼ਸ਼ਖ਼-ਜ਼ਫ਼ଡ଼-ଢ଼ำຳໜ-ໝ༌གྷཌྷདྷབྷཛྷཀྵჼᴬ-ᴮᴰ-ᴺᴼ-ᵍᵏ-ᵪᵸᶛ-ᶿẚ-ẛάέήίόύώΆ᾽-῁ΈΉ῍-῏ΐΊ῝-῟ΰΎ῭-`ΌΏ´-῾ - ‑‗․-… ″-‴‶-‷‼‾⁇-⁉⁗ ⁰-ⁱ⁴-₎ₐ-ₜ₨℀-℃℅-ℇ℉-ℓℕ-№ℙ-ℝ℠-™ℤΩℨK-ℭℯ-ℱℳ-ℹ℻-⅀ⅅ-ⅉ⅐-ⅿ↉∬-∭∯-∰〈-〉①-⓪⨌⩴-⩶⫝̸ⱼ-ⱽⵯ⺟⻳⼀-⿕ 〶〸-〺゛-゜ゟヿㄱ-ㆎ㆒-㆟㈀-㈞㈠-㉇㉐-㉾㊀-㏿ꚜ-ꚝꝰꟲ-ꟴꟸ-ꟹꭜ-ꭟꭩ豈-嗀塚晴凞-羽蘒諸逸-都飯-舘並-龎ff-stﬓ-ﬗיִײַ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-﷼︐-︙︰-﹄﹇-﹒﹔-﹦﹨-﹫ﹰ-ﹲﹴﹶ-ﻼ!-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ¢-₩`;
  5151. return NormalizeWithNFKC;
  5152. }
  5153. ;// CONCATENATED MODULE: ./web/pdf_find_controller.js
  5154. const FindState = {
  5155. FOUND: 0,
  5156. NOT_FOUND: 1,
  5157. WRAPPED: 2,
  5158. PENDING: 3
  5159. };
  5160. const FIND_TIMEOUT = 250;
  5161. const MATCH_SCROLL_OFFSET_TOP = -50;
  5162. const MATCH_SCROLL_OFFSET_LEFT = -400;
  5163. const CHARACTERS_TO_NORMALIZE = {
  5164. "\u2010": "-",
  5165. "\u2018": "'",
  5166. "\u2019": "'",
  5167. "\u201A": "'",
  5168. "\u201B": "'",
  5169. "\u201C": '"',
  5170. "\u201D": '"',
  5171. "\u201E": '"',
  5172. "\u201F": '"',
  5173. "\u00BC": "1/4",
  5174. "\u00BD": "1/2",
  5175. "\u00BE": "3/4"
  5176. };
  5177. const DIACRITICS_EXCEPTION = new Set([0x3099, 0x309a, 0x094d, 0x09cd, 0x0a4d, 0x0acd, 0x0b4d, 0x0bcd, 0x0c4d, 0x0ccd, 0x0d3b, 0x0d3c, 0x0d4d, 0x0dca, 0x0e3a, 0x0eba, 0x0f84, 0x1039, 0x103a, 0x1714, 0x1734, 0x17d2, 0x1a60, 0x1b44, 0x1baa, 0x1bab, 0x1bf2, 0x1bf3, 0x2d7f, 0xa806, 0xa82c, 0xa8c4, 0xa953, 0xa9c0, 0xaaf6, 0xabed, 0x0c56, 0x0f71, 0x0f72, 0x0f7a, 0x0f7b, 0x0f7c, 0x0f7d, 0x0f80, 0x0f74]);
  5178. let DIACRITICS_EXCEPTION_STR;
  5179. const DIACRITICS_REG_EXP = /\p{M}+/gu;
  5180. const SPECIAL_CHARS_REG_EXP = /([.*+?^${}()|[\]\\])|(\p{P})|(\s+)|(\p{M})|(\p{L})/gu;
  5181. const NOT_DIACRITIC_FROM_END_REG_EXP = /([^\p{M}])\p{M}*$/u;
  5182. const NOT_DIACRITIC_FROM_START_REG_EXP = /^\p{M}*([^\p{M}])/u;
  5183. const SYLLABLES_REG_EXP = /[\uAC00-\uD7AF\uFA6C\uFACF-\uFAD1\uFAD5-\uFAD7]+/g;
  5184. const SYLLABLES_LENGTHS = new Map();
  5185. const FIRST_CHAR_SYLLABLES_REG_EXP = "[\\u1100-\\u1112\\ud7a4-\\ud7af\\ud84a\\ud84c\\ud850\\ud854\\ud857\\ud85f]";
  5186. const NFKC_CHARS_TO_NORMALIZE = new Map();
  5187. let noSyllablesRegExp = null;
  5188. let withSyllablesRegExp = null;
  5189. function normalize(text) {
  5190. const syllablePositions = [];
  5191. let m;
  5192. while ((m = SYLLABLES_REG_EXP.exec(text)) !== null) {
  5193. let {
  5194. index
  5195. } = m;
  5196. for (const char of m[0]) {
  5197. let len = SYLLABLES_LENGTHS.get(char);
  5198. if (!len) {
  5199. len = char.normalize("NFD").length;
  5200. SYLLABLES_LENGTHS.set(char, len);
  5201. }
  5202. syllablePositions.push([len, index++]);
  5203. }
  5204. }
  5205. let normalizationRegex;
  5206. if (syllablePositions.length === 0 && noSyllablesRegExp) {
  5207. normalizationRegex = noSyllablesRegExp;
  5208. } else if (syllablePositions.length > 0 && withSyllablesRegExp) {
  5209. normalizationRegex = withSyllablesRegExp;
  5210. } else {
  5211. const replace = Object.keys(CHARACTERS_TO_NORMALIZE).join("");
  5212. const toNormalizeWithNFKC = getNormalizeWithNFKC();
  5213. const CJK = "(?:\\p{Ideographic}|[\u3040-\u30FF])";
  5214. const HKDiacritics = "(?:\u3099|\u309A)";
  5215. const regexp = `([${replace}])|([${toNormalizeWithNFKC}])|(${HKDiacritics}\\n)|(\\p{M}+(?:-\\n)?)|(\\S-\\n)|(${CJK}\\n)|(\\n)`;
  5216. if (syllablePositions.length === 0) {
  5217. normalizationRegex = noSyllablesRegExp = new RegExp(regexp + "|(\\u0000)", "gum");
  5218. } else {
  5219. normalizationRegex = withSyllablesRegExp = new RegExp(regexp + `|(${FIRST_CHAR_SYLLABLES_REG_EXP})`, "gum");
  5220. }
  5221. }
  5222. const rawDiacriticsPositions = [];
  5223. while ((m = DIACRITICS_REG_EXP.exec(text)) !== null) {
  5224. rawDiacriticsPositions.push([m[0].length, m.index]);
  5225. }
  5226. let normalized = text.normalize("NFD");
  5227. const positions = [[0, 0]];
  5228. let rawDiacriticsIndex = 0;
  5229. let syllableIndex = 0;
  5230. let shift = 0;
  5231. let shiftOrigin = 0;
  5232. let eol = 0;
  5233. let hasDiacritics = false;
  5234. normalized = normalized.replace(normalizationRegex, (match, p1, p2, p3, p4, p5, p6, p7, p8, i) => {
  5235. i -= shiftOrigin;
  5236. if (p1) {
  5237. const replacement = CHARACTERS_TO_NORMALIZE[p1];
  5238. const jj = replacement.length;
  5239. for (let j = 1; j < jj; j++) {
  5240. positions.push([i - shift + j, shift - j]);
  5241. }
  5242. shift -= jj - 1;
  5243. return replacement;
  5244. }
  5245. if (p2) {
  5246. let replacement = NFKC_CHARS_TO_NORMALIZE.get(p2);
  5247. if (!replacement) {
  5248. replacement = p2.normalize("NFKC");
  5249. NFKC_CHARS_TO_NORMALIZE.set(p2, replacement);
  5250. }
  5251. const jj = replacement.length;
  5252. for (let j = 1; j < jj; j++) {
  5253. positions.push([i - shift + j, shift - j]);
  5254. }
  5255. shift -= jj - 1;
  5256. return replacement;
  5257. }
  5258. if (p3) {
  5259. hasDiacritics = true;
  5260. if (i + eol === rawDiacriticsPositions[rawDiacriticsIndex]?.[1]) {
  5261. ++rawDiacriticsIndex;
  5262. } else {
  5263. positions.push([i - 1 - shift + 1, shift - 1]);
  5264. shift -= 1;
  5265. shiftOrigin += 1;
  5266. }
  5267. positions.push([i - shift + 1, shift]);
  5268. shiftOrigin += 1;
  5269. eol += 1;
  5270. return p3.charAt(0);
  5271. }
  5272. if (p4) {
  5273. const hasTrailingDashEOL = p4.endsWith("\n");
  5274. const len = hasTrailingDashEOL ? p4.length - 2 : p4.length;
  5275. hasDiacritics = true;
  5276. let jj = len;
  5277. if (i + eol === rawDiacriticsPositions[rawDiacriticsIndex]?.[1]) {
  5278. jj -= rawDiacriticsPositions[rawDiacriticsIndex][0];
  5279. ++rawDiacriticsIndex;
  5280. }
  5281. for (let j = 1; j <= jj; j++) {
  5282. positions.push([i - 1 - shift + j, shift - j]);
  5283. }
  5284. shift -= jj;
  5285. shiftOrigin += jj;
  5286. if (hasTrailingDashEOL) {
  5287. i += len - 1;
  5288. positions.push([i - shift + 1, 1 + shift]);
  5289. shift += 1;
  5290. shiftOrigin += 1;
  5291. eol += 1;
  5292. return p4.slice(0, len);
  5293. }
  5294. return p4;
  5295. }
  5296. if (p5) {
  5297. const len = p5.length - 2;
  5298. positions.push([i - shift + len, 1 + shift]);
  5299. shift += 1;
  5300. shiftOrigin += 1;
  5301. eol += 1;
  5302. return p5.slice(0, -2);
  5303. }
  5304. if (p6) {
  5305. const len = p6.length - 1;
  5306. positions.push([i - shift + len, shift]);
  5307. shiftOrigin += 1;
  5308. eol += 1;
  5309. return p6.slice(0, -1);
  5310. }
  5311. if (p7) {
  5312. positions.push([i - shift + 1, shift - 1]);
  5313. shift -= 1;
  5314. shiftOrigin += 1;
  5315. eol += 1;
  5316. return " ";
  5317. }
  5318. if (i + eol === syllablePositions[syllableIndex]?.[1]) {
  5319. const newCharLen = syllablePositions[syllableIndex][0] - 1;
  5320. ++syllableIndex;
  5321. for (let j = 1; j <= newCharLen; j++) {
  5322. positions.push([i - (shift - j), shift - j]);
  5323. }
  5324. shift -= newCharLen;
  5325. shiftOrigin += newCharLen;
  5326. }
  5327. return p8;
  5328. });
  5329. positions.push([normalized.length, shift]);
  5330. return [normalized, positions, hasDiacritics];
  5331. }
  5332. function getOriginalIndex(diffs, pos, len) {
  5333. if (!diffs) {
  5334. return [pos, len];
  5335. }
  5336. const start = pos;
  5337. const end = pos + len - 1;
  5338. let i = (0,ui_utils.binarySearchFirstItem)(diffs, x => x[0] >= start);
  5339. if (diffs[i][0] > start) {
  5340. --i;
  5341. }
  5342. let j = (0,ui_utils.binarySearchFirstItem)(diffs, x => x[0] >= end, i);
  5343. if (diffs[j][0] > end) {
  5344. --j;
  5345. }
  5346. const oldStart = start + diffs[i][1];
  5347. const oldEnd = end + diffs[j][1];
  5348. const oldLen = oldEnd + 1 - oldStart;
  5349. return [oldStart, oldLen];
  5350. }
  5351. class PDFFindController {
  5352. #state = null;
  5353. #updateMatchesCountOnProgress = true;
  5354. #visitedPagesCount = 0;
  5355. constructor({
  5356. linkService,
  5357. eventBus,
  5358. updateMatchesCountOnProgress = true
  5359. }) {
  5360. this._linkService = linkService;
  5361. this._eventBus = eventBus;
  5362. this.#updateMatchesCountOnProgress = updateMatchesCountOnProgress;
  5363. this.onIsPageVisible = null;
  5364. this.#reset();
  5365. eventBus._on("find", this.#onFind.bind(this));
  5366. eventBus._on("findbarclose", this.#onFindBarClose.bind(this));
  5367. }
  5368. get highlightMatches() {
  5369. return this._highlightMatches;
  5370. }
  5371. get pageMatches() {
  5372. return this._pageMatches;
  5373. }
  5374. get pageMatchesLength() {
  5375. return this._pageMatchesLength;
  5376. }
  5377. get selected() {
  5378. return this._selected;
  5379. }
  5380. get state() {
  5381. return this.#state;
  5382. }
  5383. setDocument(pdfDocument) {
  5384. if (this._pdfDocument) {
  5385. this.#reset();
  5386. }
  5387. if (!pdfDocument) {
  5388. return;
  5389. }
  5390. this._pdfDocument = pdfDocument;
  5391. this._firstPageCapability.resolve();
  5392. }
  5393. #onFind(state) {
  5394. if (!state) {
  5395. return;
  5396. }
  5397. const pdfDocument = this._pdfDocument;
  5398. const {
  5399. type
  5400. } = state;
  5401. if (this.#state === null || this.#shouldDirtyMatch(state)) {
  5402. this._dirtyMatch = true;
  5403. }
  5404. this.#state = state;
  5405. if (type !== "highlightallchange") {
  5406. this.#updateUIState(FindState.PENDING);
  5407. }
  5408. this._firstPageCapability.promise.then(() => {
  5409. if (!this._pdfDocument || pdfDocument && this._pdfDocument !== pdfDocument) {
  5410. return;
  5411. }
  5412. this.#extractText();
  5413. const findbarClosed = !this._highlightMatches;
  5414. const pendingTimeout = !!this._findTimeout;
  5415. if (this._findTimeout) {
  5416. clearTimeout(this._findTimeout);
  5417. this._findTimeout = null;
  5418. }
  5419. if (!type) {
  5420. this._findTimeout = setTimeout(() => {
  5421. this.#nextMatch();
  5422. this._findTimeout = null;
  5423. }, FIND_TIMEOUT);
  5424. } else if (this._dirtyMatch) {
  5425. this.#nextMatch();
  5426. } else if (type === "again") {
  5427. this.#nextMatch();
  5428. if (findbarClosed && this.#state.highlightAll) {
  5429. this.#updateAllPages();
  5430. }
  5431. } else if (type === "highlightallchange") {
  5432. if (pendingTimeout) {
  5433. this.#nextMatch();
  5434. } else {
  5435. this._highlightMatches = true;
  5436. }
  5437. this.#updateAllPages();
  5438. } else {
  5439. this.#nextMatch();
  5440. }
  5441. });
  5442. }
  5443. scrollMatchIntoView({
  5444. element = null,
  5445. selectedLeft = 0,
  5446. pageIndex = -1,
  5447. matchIndex = -1
  5448. }) {
  5449. if (!this._scrollMatches || !element) {
  5450. return;
  5451. } else if (matchIndex === -1 || matchIndex !== this._selected.matchIdx) {
  5452. return;
  5453. } else if (pageIndex === -1 || pageIndex !== this._selected.pageIdx) {
  5454. return;
  5455. }
  5456. this._scrollMatches = false;
  5457. const spot = {
  5458. top: MATCH_SCROLL_OFFSET_TOP,
  5459. left: selectedLeft + MATCH_SCROLL_OFFSET_LEFT
  5460. };
  5461. (0,ui_utils.scrollIntoView)(element, spot, true);
  5462. }
  5463. #reset() {
  5464. this._highlightMatches = false;
  5465. this._scrollMatches = false;
  5466. this._pdfDocument = null;
  5467. this._pageMatches = [];
  5468. this._pageMatchesLength = [];
  5469. this.#visitedPagesCount = 0;
  5470. this.#state = null;
  5471. this._selected = {
  5472. pageIdx: -1,
  5473. matchIdx: -1
  5474. };
  5475. this._offset = {
  5476. pageIdx: null,
  5477. matchIdx: null,
  5478. wrapped: false
  5479. };
  5480. this._extractTextPromises = [];
  5481. this._pageContents = [];
  5482. this._pageDiffs = [];
  5483. this._hasDiacritics = [];
  5484. this._matchesCountTotal = 0;
  5485. this._pagesToSearch = null;
  5486. this._pendingFindMatches = new Set();
  5487. this._resumePageIdx = null;
  5488. this._dirtyMatch = false;
  5489. clearTimeout(this._findTimeout);
  5490. this._findTimeout = null;
  5491. this._firstPageCapability = Promise.withResolvers();
  5492. }
  5493. get #query() {
  5494. const {
  5495. query
  5496. } = this.#state;
  5497. if (typeof query === "string") {
  5498. if (query !== this._rawQuery) {
  5499. this._rawQuery = query;
  5500. [this._normalizedQuery] = normalize(query);
  5501. }
  5502. return this._normalizedQuery;
  5503. }
  5504. return (query || []).filter(q => !!q).map(q => normalize(q)[0]);
  5505. }
  5506. #shouldDirtyMatch(state) {
  5507. const newQuery = state.query,
  5508. prevQuery = this.#state.query;
  5509. const newType = typeof newQuery,
  5510. prevType = typeof prevQuery;
  5511. if (newType !== prevType) {
  5512. return true;
  5513. }
  5514. if (newType === "string") {
  5515. if (newQuery !== prevQuery) {
  5516. return true;
  5517. }
  5518. } else if (JSON.stringify(newQuery) !== JSON.stringify(prevQuery)) {
  5519. return true;
  5520. }
  5521. switch (state.type) {
  5522. case "again":
  5523. const pageNumber = this._selected.pageIdx + 1;
  5524. const linkService = this._linkService;
  5525. return pageNumber >= 1 && pageNumber <= linkService.pagesCount && pageNumber !== linkService.page && !(this.onIsPageVisible?.(pageNumber) ?? true);
  5526. case "highlightallchange":
  5527. return false;
  5528. }
  5529. return true;
  5530. }
  5531. #isEntireWord(content, startIdx, length) {
  5532. let match = content.slice(0, startIdx).match(NOT_DIACRITIC_FROM_END_REG_EXP);
  5533. if (match) {
  5534. const first = content.charCodeAt(startIdx);
  5535. const limit = match[1].charCodeAt(0);
  5536. if (getCharacterType(first) === getCharacterType(limit)) {
  5537. return false;
  5538. }
  5539. }
  5540. match = content.slice(startIdx + length).match(NOT_DIACRITIC_FROM_START_REG_EXP);
  5541. if (match) {
  5542. const last = content.charCodeAt(startIdx + length - 1);
  5543. const limit = match[1].charCodeAt(0);
  5544. if (getCharacterType(last) === getCharacterType(limit)) {
  5545. return false;
  5546. }
  5547. }
  5548. return true;
  5549. }
  5550. #calculateRegExpMatch(query, entireWord, pageIndex, pageContent) {
  5551. const matches = this._pageMatches[pageIndex] = [];
  5552. const matchesLength = this._pageMatchesLength[pageIndex] = [];
  5553. if (!query) {
  5554. return;
  5555. }
  5556. const diffs = this._pageDiffs[pageIndex];
  5557. let match;
  5558. while ((match = query.exec(pageContent)) !== null) {
  5559. if (entireWord && !this.#isEntireWord(pageContent, match.index, match[0].length)) {
  5560. continue;
  5561. }
  5562. const [matchPos, matchLen] = getOriginalIndex(diffs, match.index, match[0].length);
  5563. if (matchLen) {
  5564. matches.push(matchPos);
  5565. matchesLength.push(matchLen);
  5566. }
  5567. }
  5568. }
  5569. #convertToRegExpString(query, hasDiacritics) {
  5570. const {
  5571. matchDiacritics
  5572. } = this.#state;
  5573. let isUnicode = false;
  5574. query = query.replaceAll(SPECIAL_CHARS_REG_EXP, (match, p1, p2, p3, p4, p5) => {
  5575. if (p1) {
  5576. return `[ ]*\\${p1}[ ]*`;
  5577. }
  5578. if (p2) {
  5579. return `[ ]*${p2}[ ]*`;
  5580. }
  5581. if (p3) {
  5582. return "[ ]+";
  5583. }
  5584. if (matchDiacritics) {
  5585. return p4 || p5;
  5586. }
  5587. if (p4) {
  5588. return DIACRITICS_EXCEPTION.has(p4.charCodeAt(0)) ? p4 : "";
  5589. }
  5590. if (hasDiacritics) {
  5591. isUnicode = true;
  5592. return `${p5}\\p{M}*`;
  5593. }
  5594. return p5;
  5595. });
  5596. const trailingSpaces = "[ ]*";
  5597. if (query.endsWith(trailingSpaces)) {
  5598. query = query.slice(0, query.length - trailingSpaces.length);
  5599. }
  5600. if (matchDiacritics) {
  5601. if (hasDiacritics) {
  5602. DIACRITICS_EXCEPTION_STR ||= String.fromCharCode(...DIACRITICS_EXCEPTION);
  5603. isUnicode = true;
  5604. query = `${query}(?=[${DIACRITICS_EXCEPTION_STR}]|[^\\p{M}]|$)`;
  5605. }
  5606. }
  5607. return [isUnicode, query];
  5608. }
  5609. #calculateMatch(pageIndex) {
  5610. let query = this.#query;
  5611. if (query.length === 0) {
  5612. return;
  5613. }
  5614. const {
  5615. caseSensitive,
  5616. entireWord
  5617. } = this.#state;
  5618. const pageContent = this._pageContents[pageIndex];
  5619. const hasDiacritics = this._hasDiacritics[pageIndex];
  5620. let isUnicode = false;
  5621. if (typeof query === "string") {
  5622. [isUnicode, query] = this.#convertToRegExpString(query, hasDiacritics);
  5623. } else {
  5624. query = query.sort().reverse().map(q => {
  5625. const [isUnicodePart, queryPart] = this.#convertToRegExpString(q, hasDiacritics);
  5626. isUnicode ||= isUnicodePart;
  5627. return `(${queryPart})`;
  5628. }).join("|");
  5629. }
  5630. const flags = `g${isUnicode ? "u" : ""}${caseSensitive ? "" : "i"}`;
  5631. query = query ? new RegExp(query, flags) : null;
  5632. this.#calculateRegExpMatch(query, entireWord, pageIndex, pageContent);
  5633. if (this.#state.highlightAll) {
  5634. this.#updatePage(pageIndex);
  5635. }
  5636. if (this._resumePageIdx === pageIndex) {
  5637. this._resumePageIdx = null;
  5638. this.#nextPageMatch();
  5639. }
  5640. const pageMatchesCount = this._pageMatches[pageIndex].length;
  5641. this._matchesCountTotal += pageMatchesCount;
  5642. if (this.#updateMatchesCountOnProgress) {
  5643. if (pageMatchesCount > 0) {
  5644. this.#updateUIResultsCount();
  5645. }
  5646. } else if (++this.#visitedPagesCount === this._linkService.pagesCount) {
  5647. this.#updateUIResultsCount();
  5648. }
  5649. }
  5650. #extractText() {
  5651. if (this._extractTextPromises.length > 0) {
  5652. return;
  5653. }
  5654. let deferred = Promise.resolve();
  5655. const textOptions = {
  5656. disableNormalization: true
  5657. };
  5658. for (let i = 0, ii = this._linkService.pagesCount; i < ii; i++) {
  5659. const {
  5660. promise,
  5661. resolve
  5662. } = Promise.withResolvers();
  5663. this._extractTextPromises[i] = promise;
  5664. deferred = deferred.then(() => {
  5665. return this._pdfDocument.getPage(i + 1).then(pdfPage => pdfPage.getTextContent(textOptions)).then(textContent => {
  5666. const strBuf = [];
  5667. for (const textItem of textContent.items) {
  5668. strBuf.push(textItem.str);
  5669. if (textItem.hasEOL) {
  5670. strBuf.push("\n");
  5671. }
  5672. }
  5673. [this._pageContents[i], this._pageDiffs[i], this._hasDiacritics[i]] = normalize(strBuf.join(""));
  5674. resolve();
  5675. }, reason => {
  5676. console.error(`Unable to get text content for page ${i + 1}`, reason);
  5677. this._pageContents[i] = "";
  5678. this._pageDiffs[i] = null;
  5679. this._hasDiacritics[i] = false;
  5680. resolve();
  5681. });
  5682. });
  5683. }
  5684. }
  5685. #updatePage(index) {
  5686. if (this._scrollMatches && this._selected.pageIdx === index) {
  5687. this._linkService.page = index + 1;
  5688. }
  5689. this._eventBus.dispatch("updatetextlayermatches", {
  5690. source: this,
  5691. pageIndex: index
  5692. });
  5693. }
  5694. #updateAllPages() {
  5695. this._eventBus.dispatch("updatetextlayermatches", {
  5696. source: this,
  5697. pageIndex: -1
  5698. });
  5699. }
  5700. #nextMatch() {
  5701. const previous = this.#state.findPrevious;
  5702. const currentPageIndex = this._linkService.page - 1;
  5703. const numPages = this._linkService.pagesCount;
  5704. this._highlightMatches = true;
  5705. if (this._dirtyMatch) {
  5706. this._dirtyMatch = false;
  5707. this._selected.pageIdx = this._selected.matchIdx = -1;
  5708. this._offset.pageIdx = currentPageIndex;
  5709. this._offset.matchIdx = null;
  5710. this._offset.wrapped = false;
  5711. this._resumePageIdx = null;
  5712. this._pageMatches.length = 0;
  5713. this._pageMatchesLength.length = 0;
  5714. this.#visitedPagesCount = 0;
  5715. this._matchesCountTotal = 0;
  5716. this.#updateAllPages();
  5717. for (let i = 0; i < numPages; i++) {
  5718. if (this._pendingFindMatches.has(i)) {
  5719. continue;
  5720. }
  5721. this._pendingFindMatches.add(i);
  5722. this._extractTextPromises[i].then(() => {
  5723. this._pendingFindMatches.delete(i);
  5724. this.#calculateMatch(i);
  5725. });
  5726. }
  5727. }
  5728. const query = this.#query;
  5729. if (query.length === 0) {
  5730. this.#updateUIState(FindState.FOUND);
  5731. return;
  5732. }
  5733. if (this._resumePageIdx) {
  5734. return;
  5735. }
  5736. const offset = this._offset;
  5737. this._pagesToSearch = numPages;
  5738. if (offset.matchIdx !== null) {
  5739. const numPageMatches = this._pageMatches[offset.pageIdx].length;
  5740. if (!previous && offset.matchIdx + 1 < numPageMatches || previous && offset.matchIdx > 0) {
  5741. offset.matchIdx = previous ? offset.matchIdx - 1 : offset.matchIdx + 1;
  5742. this.#updateMatch(true);
  5743. return;
  5744. }
  5745. this.#advanceOffsetPage(previous);
  5746. }
  5747. this.#nextPageMatch();
  5748. }
  5749. #matchesReady(matches) {
  5750. const offset = this._offset;
  5751. const numMatches = matches.length;
  5752. const previous = this.#state.findPrevious;
  5753. if (numMatches) {
  5754. offset.matchIdx = previous ? numMatches - 1 : 0;
  5755. this.#updateMatch(true);
  5756. return true;
  5757. }
  5758. this.#advanceOffsetPage(previous);
  5759. if (offset.wrapped) {
  5760. offset.matchIdx = null;
  5761. if (this._pagesToSearch < 0) {
  5762. this.#updateMatch(false);
  5763. return true;
  5764. }
  5765. }
  5766. return false;
  5767. }
  5768. #nextPageMatch() {
  5769. if (this._resumePageIdx !== null) {
  5770. console.error("There can only be one pending page.");
  5771. }
  5772. let matches = null;
  5773. do {
  5774. const pageIdx = this._offset.pageIdx;
  5775. matches = this._pageMatches[pageIdx];
  5776. if (!matches) {
  5777. this._resumePageIdx = pageIdx;
  5778. break;
  5779. }
  5780. } while (!this.#matchesReady(matches));
  5781. }
  5782. #advanceOffsetPage(previous) {
  5783. const offset = this._offset;
  5784. const numPages = this._linkService.pagesCount;
  5785. offset.pageIdx = previous ? offset.pageIdx - 1 : offset.pageIdx + 1;
  5786. offset.matchIdx = null;
  5787. this._pagesToSearch--;
  5788. if (offset.pageIdx >= numPages || offset.pageIdx < 0) {
  5789. offset.pageIdx = previous ? numPages - 1 : 0;
  5790. offset.wrapped = true;
  5791. }
  5792. }
  5793. #updateMatch(found = false) {
  5794. let state = FindState.NOT_FOUND;
  5795. const wrapped = this._offset.wrapped;
  5796. this._offset.wrapped = false;
  5797. if (found) {
  5798. const previousPage = this._selected.pageIdx;
  5799. this._selected.pageIdx = this._offset.pageIdx;
  5800. this._selected.matchIdx = this._offset.matchIdx;
  5801. state = wrapped ? FindState.WRAPPED : FindState.FOUND;
  5802. if (previousPage !== -1 && previousPage !== this._selected.pageIdx) {
  5803. this.#updatePage(previousPage);
  5804. }
  5805. }
  5806. this.#updateUIState(state, this.#state.findPrevious);
  5807. if (this._selected.pageIdx !== -1) {
  5808. this._scrollMatches = true;
  5809. this.#updatePage(this._selected.pageIdx);
  5810. }
  5811. }
  5812. #onFindBarClose(evt) {
  5813. const pdfDocument = this._pdfDocument;
  5814. this._firstPageCapability.promise.then(() => {
  5815. if (!this._pdfDocument || pdfDocument && this._pdfDocument !== pdfDocument) {
  5816. return;
  5817. }
  5818. if (this._findTimeout) {
  5819. clearTimeout(this._findTimeout);
  5820. this._findTimeout = null;
  5821. }
  5822. if (this._resumePageIdx) {
  5823. this._resumePageIdx = null;
  5824. this._dirtyMatch = true;
  5825. }
  5826. this.#updateUIState(FindState.FOUND);
  5827. this._highlightMatches = false;
  5828. this.#updateAllPages();
  5829. });
  5830. }
  5831. #requestMatchesCount() {
  5832. const {
  5833. pageIdx,
  5834. matchIdx
  5835. } = this._selected;
  5836. let current = 0,
  5837. total = this._matchesCountTotal;
  5838. if (matchIdx !== -1) {
  5839. for (let i = 0; i < pageIdx; i++) {
  5840. current += this._pageMatches[i]?.length || 0;
  5841. }
  5842. current += matchIdx + 1;
  5843. }
  5844. if (current < 1 || current > total) {
  5845. current = total = 0;
  5846. }
  5847. return {
  5848. current,
  5849. total
  5850. };
  5851. }
  5852. #updateUIResultsCount() {
  5853. this._eventBus.dispatch("updatefindmatchescount", {
  5854. source: this,
  5855. matchesCount: this.#requestMatchesCount()
  5856. });
  5857. }
  5858. #updateUIState(state, previous = false) {
  5859. if (!this.#updateMatchesCountOnProgress && (this.#visitedPagesCount !== this._linkService.pagesCount || state === FindState.PENDING)) {
  5860. return;
  5861. }
  5862. this._eventBus.dispatch("updatefindcontrolstate", {
  5863. source: this,
  5864. state,
  5865. previous,
  5866. matchesCount: this.#requestMatchesCount(),
  5867. rawQuery: this.#state?.query ?? null
  5868. });
  5869. }
  5870. }
  5871. /***/ }),
  5872. /***/ 8543:
  5873. /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
  5874. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  5875. /* harmony export */ PDFHistory: () => (/* binding */ PDFHistory)
  5876. /* harmony export */ });
  5877. /* unused harmony exports isDestArraysEqual, isDestHashesEqual */
  5878. /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7256);
  5879. /* harmony import */ var _event_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5656);
  5880. const HASH_CHANGE_TIMEOUT = 1000;
  5881. const POSITION_UPDATED_THRESHOLD = 50;
  5882. const UPDATE_VIEWAREA_TIMEOUT = 1000;
  5883. function getCurrentHash() {
  5884. return document.location.hash;
  5885. }
  5886. class PDFHistory {
  5887. #eventAbortController = null;
  5888. constructor({
  5889. linkService,
  5890. eventBus
  5891. }) {
  5892. this.linkService = linkService;
  5893. this.eventBus = eventBus;
  5894. this._initialized = false;
  5895. this._fingerprint = "";
  5896. this.reset();
  5897. this.eventBus._on("pagesinit", () => {
  5898. this._isPagesLoaded = false;
  5899. this.eventBus._on("pagesloaded", evt => {
  5900. this._isPagesLoaded = !!evt.pagesCount;
  5901. }, {
  5902. once: true
  5903. });
  5904. });
  5905. }
  5906. initialize({
  5907. fingerprint,
  5908. resetHistory = false,
  5909. updateUrl = false
  5910. }) {
  5911. if (!fingerprint || typeof fingerprint !== "string") {
  5912. console.error('PDFHistory.initialize: The "fingerprint" must be a non-empty string.');
  5913. return;
  5914. }
  5915. if (this._initialized) {
  5916. this.reset();
  5917. }
  5918. const reInitialized = this._fingerprint !== "" && this._fingerprint !== fingerprint;
  5919. this._fingerprint = fingerprint;
  5920. this._updateUrl = updateUrl === true;
  5921. this._initialized = true;
  5922. this.#bindEvents();
  5923. const state = window.history.state;
  5924. this._popStateInProgress = false;
  5925. this._blockHashChange = 0;
  5926. this._currentHash = getCurrentHash();
  5927. this._numPositionUpdates = 0;
  5928. this._uid = this._maxUid = 0;
  5929. this._destination = null;
  5930. this._position = null;
  5931. if (!this.#isValidState(state, true) || resetHistory) {
  5932. const {
  5933. hash,
  5934. page,
  5935. rotation
  5936. } = this.#parseCurrentHash(true);
  5937. if (!hash || reInitialized || resetHistory) {
  5938. this.#pushOrReplaceState(null, true);
  5939. return;
  5940. }
  5941. this.#pushOrReplaceState({
  5942. hash,
  5943. page,
  5944. rotation
  5945. }, true);
  5946. return;
  5947. }
  5948. const destination = state.destination;
  5949. this.#updateInternalState(destination, state.uid, true);
  5950. if (destination.rotation !== undefined) {
  5951. this._initialRotation = destination.rotation;
  5952. }
  5953. if (destination.dest) {
  5954. this._initialBookmark = JSON.stringify(destination.dest);
  5955. this._destination.page = null;
  5956. } else if (destination.hash) {
  5957. this._initialBookmark = destination.hash;
  5958. } else if (destination.page) {
  5959. this._initialBookmark = `page=${destination.page}`;
  5960. }
  5961. }
  5962. reset() {
  5963. if (this._initialized) {
  5964. this.#pageHide();
  5965. this._initialized = false;
  5966. this.#unbindEvents();
  5967. }
  5968. if (this._updateViewareaTimeout) {
  5969. clearTimeout(this._updateViewareaTimeout);
  5970. this._updateViewareaTimeout = null;
  5971. }
  5972. this._initialBookmark = null;
  5973. this._initialRotation = null;
  5974. }
  5975. push({
  5976. namedDest = null,
  5977. explicitDest,
  5978. pageNumber
  5979. }) {
  5980. if (!this._initialized) {
  5981. return;
  5982. }
  5983. if (namedDest && typeof namedDest !== "string") {
  5984. console.error("PDFHistory.push: " + `"${namedDest}" is not a valid namedDest parameter.`);
  5985. return;
  5986. } else if (!Array.isArray(explicitDest)) {
  5987. console.error("PDFHistory.push: " + `"${explicitDest}" is not a valid explicitDest parameter.`);
  5988. return;
  5989. } else if (!this.#isValidPage(pageNumber)) {
  5990. if (pageNumber !== null || this._destination) {
  5991. console.error("PDFHistory.push: " + `"${pageNumber}" is not a valid pageNumber parameter.`);
  5992. return;
  5993. }
  5994. }
  5995. const hash = namedDest || JSON.stringify(explicitDest);
  5996. if (!hash) {
  5997. return;
  5998. }
  5999. let forceReplace = false;
  6000. if (this._destination && (isDestHashesEqual(this._destination.hash, hash) || isDestArraysEqual(this._destination.dest, explicitDest))) {
  6001. if (this._destination.page) {
  6002. return;
  6003. }
  6004. forceReplace = true;
  6005. }
  6006. if (this._popStateInProgress && !forceReplace) {
  6007. return;
  6008. }
  6009. this.#pushOrReplaceState({
  6010. dest: explicitDest,
  6011. hash,
  6012. page: pageNumber,
  6013. rotation: this.linkService.rotation
  6014. }, forceReplace);
  6015. if (!this._popStateInProgress) {
  6016. this._popStateInProgress = true;
  6017. Promise.resolve().then(() => {
  6018. this._popStateInProgress = false;
  6019. });
  6020. }
  6021. }
  6022. pushPage(pageNumber) {
  6023. if (!this._initialized) {
  6024. return;
  6025. }
  6026. if (!this.#isValidPage(pageNumber)) {
  6027. console.error(`PDFHistory.pushPage: "${pageNumber}" is not a valid page number.`);
  6028. return;
  6029. }
  6030. if (this._destination?.page === pageNumber) {
  6031. return;
  6032. }
  6033. if (this._popStateInProgress) {
  6034. return;
  6035. }
  6036. this.#pushOrReplaceState({
  6037. dest: null,
  6038. hash: `page=${pageNumber}`,
  6039. page: pageNumber,
  6040. rotation: this.linkService.rotation
  6041. });
  6042. if (!this._popStateInProgress) {
  6043. this._popStateInProgress = true;
  6044. Promise.resolve().then(() => {
  6045. this._popStateInProgress = false;
  6046. });
  6047. }
  6048. }
  6049. pushCurrentPosition() {
  6050. if (!this._initialized || this._popStateInProgress) {
  6051. return;
  6052. }
  6053. this.#tryPushCurrentPosition();
  6054. }
  6055. back() {
  6056. if (!this._initialized || this._popStateInProgress) {
  6057. return;
  6058. }
  6059. const state = window.history.state;
  6060. if (this.#isValidState(state) && state.uid > 0) {
  6061. window.history.back();
  6062. }
  6063. }
  6064. forward() {
  6065. if (!this._initialized || this._popStateInProgress) {
  6066. return;
  6067. }
  6068. const state = window.history.state;
  6069. if (this.#isValidState(state) && state.uid < this._maxUid) {
  6070. window.history.forward();
  6071. }
  6072. }
  6073. get popStateInProgress() {
  6074. return this._initialized && (this._popStateInProgress || this._blockHashChange > 0);
  6075. }
  6076. get initialBookmark() {
  6077. return this._initialized ? this._initialBookmark : null;
  6078. }
  6079. get initialRotation() {
  6080. return this._initialized ? this._initialRotation : null;
  6081. }
  6082. #pushOrReplaceState(destination, forceReplace = false) {
  6083. const shouldReplace = forceReplace || !this._destination;
  6084. const newState = {
  6085. fingerprint: this._fingerprint,
  6086. uid: shouldReplace ? this._uid : this._uid + 1,
  6087. destination
  6088. };
  6089. this.#updateInternalState(destination, newState.uid);
  6090. let newUrl;
  6091. if (this._updateUrl && destination?.hash) {
  6092. const baseUrl = document.location.href.split("#", 1)[0];
  6093. if (!baseUrl.startsWith("file://")) {
  6094. newUrl = `${baseUrl}#${destination.hash}`;
  6095. }
  6096. }
  6097. if (shouldReplace) {
  6098. window.history.replaceState(newState, "", newUrl);
  6099. } else {
  6100. window.history.pushState(newState, "", newUrl);
  6101. }
  6102. }
  6103. #tryPushCurrentPosition(temporary = false) {
  6104. if (!this._position) {
  6105. return;
  6106. }
  6107. let position = this._position;
  6108. if (temporary) {
  6109. position = Object.assign(Object.create(null), this._position);
  6110. position.temporary = true;
  6111. }
  6112. if (!this._destination) {
  6113. this.#pushOrReplaceState(position);
  6114. return;
  6115. }
  6116. if (this._destination.temporary) {
  6117. this.#pushOrReplaceState(position, true);
  6118. return;
  6119. }
  6120. if (this._destination.hash === position.hash) {
  6121. return;
  6122. }
  6123. if (!this._destination.page && (POSITION_UPDATED_THRESHOLD <= 0 || this._numPositionUpdates <= POSITION_UPDATED_THRESHOLD)) {
  6124. return;
  6125. }
  6126. let forceReplace = false;
  6127. if (this._destination.page >= position.first && this._destination.page <= position.page) {
  6128. if (this._destination.dest !== undefined || !this._destination.first) {
  6129. return;
  6130. }
  6131. forceReplace = true;
  6132. }
  6133. this.#pushOrReplaceState(position, forceReplace);
  6134. }
  6135. #isValidPage(val) {
  6136. return Number.isInteger(val) && val > 0 && val <= this.linkService.pagesCount;
  6137. }
  6138. #isValidState(state, checkReload = false) {
  6139. if (!state) {
  6140. return false;
  6141. }
  6142. if (state.fingerprint !== this._fingerprint) {
  6143. if (checkReload) {
  6144. if (typeof state.fingerprint !== "string" || state.fingerprint.length !== this._fingerprint.length) {
  6145. return false;
  6146. }
  6147. const [perfEntry] = performance.getEntriesByType("navigation");
  6148. if (perfEntry?.type !== "reload") {
  6149. return false;
  6150. }
  6151. } else {
  6152. return false;
  6153. }
  6154. }
  6155. if (!Number.isInteger(state.uid) || state.uid < 0) {
  6156. return false;
  6157. }
  6158. if (state.destination === null || typeof state.destination !== "object") {
  6159. return false;
  6160. }
  6161. return true;
  6162. }
  6163. #updateInternalState(destination, uid, removeTemporary = false) {
  6164. if (this._updateViewareaTimeout) {
  6165. clearTimeout(this._updateViewareaTimeout);
  6166. this._updateViewareaTimeout = null;
  6167. }
  6168. if (removeTemporary && destination?.temporary) {
  6169. delete destination.temporary;
  6170. }
  6171. this._destination = destination;
  6172. this._uid = uid;
  6173. this._maxUid = Math.max(this._maxUid, uid);
  6174. this._numPositionUpdates = 0;
  6175. }
  6176. #parseCurrentHash(checkNameddest = false) {
  6177. const hash = unescape(getCurrentHash()).substring(1);
  6178. const params = (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.parseQueryString)(hash);
  6179. const nameddest = params.get("nameddest") || "";
  6180. let page = params.get("page") | 0;
  6181. if (!this.#isValidPage(page) || checkNameddest && nameddest.length > 0) {
  6182. page = null;
  6183. }
  6184. return {
  6185. hash,
  6186. page,
  6187. rotation: this.linkService.rotation
  6188. };
  6189. }
  6190. #updateViewarea({
  6191. location
  6192. }) {
  6193. if (this._updateViewareaTimeout) {
  6194. clearTimeout(this._updateViewareaTimeout);
  6195. this._updateViewareaTimeout = null;
  6196. }
  6197. this._position = {
  6198. hash: location.pdfOpenParams.substring(1),
  6199. page: this.linkService.page,
  6200. first: location.pageNumber,
  6201. rotation: location.rotation
  6202. };
  6203. if (this._popStateInProgress) {
  6204. return;
  6205. }
  6206. if (POSITION_UPDATED_THRESHOLD > 0 && this._isPagesLoaded && this._destination && !this._destination.page) {
  6207. this._numPositionUpdates++;
  6208. }
  6209. if (UPDATE_VIEWAREA_TIMEOUT > 0) {
  6210. this._updateViewareaTimeout = setTimeout(() => {
  6211. if (!this._popStateInProgress) {
  6212. this.#tryPushCurrentPosition(true);
  6213. }
  6214. this._updateViewareaTimeout = null;
  6215. }, UPDATE_VIEWAREA_TIMEOUT);
  6216. }
  6217. }
  6218. #popState({
  6219. state
  6220. }) {
  6221. const newHash = getCurrentHash(),
  6222. hashChanged = this._currentHash !== newHash;
  6223. this._currentHash = newHash;
  6224. if (!state) {
  6225. this._uid++;
  6226. const {
  6227. hash,
  6228. page,
  6229. rotation
  6230. } = this.#parseCurrentHash();
  6231. this.#pushOrReplaceState({
  6232. hash,
  6233. page,
  6234. rotation
  6235. }, true);
  6236. return;
  6237. }
  6238. if (!this.#isValidState(state)) {
  6239. return;
  6240. }
  6241. this._popStateInProgress = true;
  6242. if (hashChanged) {
  6243. this._blockHashChange++;
  6244. (0,_event_utils_js__WEBPACK_IMPORTED_MODULE_1__.waitOnEventOrTimeout)({
  6245. target: window,
  6246. name: "hashchange",
  6247. delay: HASH_CHANGE_TIMEOUT
  6248. }).then(() => {
  6249. this._blockHashChange--;
  6250. });
  6251. }
  6252. const destination = state.destination;
  6253. this.#updateInternalState(destination, state.uid, true);
  6254. if ((0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.isValidRotation)(destination.rotation)) {
  6255. this.linkService.rotation = destination.rotation;
  6256. }
  6257. if (destination.dest) {
  6258. this.linkService.goToDestination(destination.dest);
  6259. } else if (destination.hash) {
  6260. this.linkService.setHash(destination.hash);
  6261. } else if (destination.page) {
  6262. this.linkService.page = destination.page;
  6263. }
  6264. Promise.resolve().then(() => {
  6265. this._popStateInProgress = false;
  6266. });
  6267. }
  6268. #pageHide() {
  6269. if (!this._destination || this._destination.temporary) {
  6270. this.#tryPushCurrentPosition();
  6271. }
  6272. }
  6273. #bindEvents() {
  6274. if (this.#eventAbortController) {
  6275. return;
  6276. }
  6277. this.#eventAbortController = new AbortController();
  6278. const {
  6279. signal
  6280. } = this.#eventAbortController;
  6281. this.eventBus._on("updateviewarea", this.#updateViewarea.bind(this), {
  6282. signal
  6283. });
  6284. window.addEventListener("popstate", this.#popState.bind(this), {
  6285. signal
  6286. });
  6287. window.addEventListener("pagehide", this.#pageHide.bind(this), {
  6288. signal
  6289. });
  6290. }
  6291. #unbindEvents() {
  6292. this.#eventAbortController?.abort();
  6293. this.#eventAbortController = null;
  6294. }
  6295. }
  6296. function isDestHashesEqual(destHash, pushHash) {
  6297. if (typeof destHash !== "string" || typeof pushHash !== "string") {
  6298. return false;
  6299. }
  6300. if (destHash === pushHash) {
  6301. return true;
  6302. }
  6303. const nameddest = (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.parseQueryString)(destHash).get("nameddest");
  6304. if (nameddest === pushHash) {
  6305. return true;
  6306. }
  6307. return false;
  6308. }
  6309. function isDestArraysEqual(firstDest, secondDest) {
  6310. function isEntryEqual(first, second) {
  6311. if (typeof first !== typeof second) {
  6312. return false;
  6313. }
  6314. if (Array.isArray(first) || Array.isArray(second)) {
  6315. return false;
  6316. }
  6317. if (first !== null && typeof first === "object" && second !== null) {
  6318. if (Object.keys(first).length !== Object.keys(second).length) {
  6319. return false;
  6320. }
  6321. for (const key in first) {
  6322. if (!isEntryEqual(first[key], second[key])) {
  6323. return false;
  6324. }
  6325. }
  6326. return true;
  6327. }
  6328. return first === second || Number.isNaN(first) && Number.isNaN(second);
  6329. }
  6330. if (!(Array.isArray(firstDest) && Array.isArray(secondDest))) {
  6331. return false;
  6332. }
  6333. if (firstDest.length !== secondDest.length) {
  6334. return false;
  6335. }
  6336. for (let i = 0, ii = firstDest.length; i < ii; i++) {
  6337. if (!isEntryEqual(firstDest[i], secondDest[i])) {
  6338. return false;
  6339. }
  6340. }
  6341. return true;
  6342. }
  6343. /***/ }),
  6344. /***/ 787:
  6345. /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
  6346. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  6347. /* harmony export */ LinkTarget: () => (/* binding */ LinkTarget),
  6348. /* harmony export */ PDFLinkService: () => (/* binding */ PDFLinkService),
  6349. /* harmony export */ SimpleLinkService: () => (/* binding */ SimpleLinkService)
  6350. /* harmony export */ });
  6351. /* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4114);
  6352. /* harmony import */ var core_js_modules_esnext_json_parse_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8335);
  6353. /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7256);
  6354. const DEFAULT_LINK_REL = "noopener noreferrer nofollow";
  6355. const LinkTarget = {
  6356. NONE: 0,
  6357. SELF: 1,
  6358. BLANK: 2,
  6359. PARENT: 3,
  6360. TOP: 4
  6361. };
  6362. class PDFLinkService {
  6363. externalLinkEnabled = true;
  6364. constructor({
  6365. eventBus,
  6366. externalLinkTarget = null,
  6367. externalLinkRel = null,
  6368. ignoreDestinationZoom = false
  6369. } = {}) {
  6370. this.eventBus = eventBus;
  6371. this.externalLinkTarget = externalLinkTarget;
  6372. this.externalLinkRel = externalLinkRel;
  6373. this._ignoreDestinationZoom = ignoreDestinationZoom;
  6374. this.baseUrl = null;
  6375. this.pdfDocument = null;
  6376. this.pdfViewer = null;
  6377. this.pdfHistory = null;
  6378. }
  6379. setDocument(pdfDocument, baseUrl = null) {
  6380. this.baseUrl = baseUrl;
  6381. this.pdfDocument = pdfDocument;
  6382. }
  6383. setViewer(pdfViewer) {
  6384. this.pdfViewer = pdfViewer;
  6385. }
  6386. setHistory(pdfHistory) {
  6387. this.pdfHistory = pdfHistory;
  6388. }
  6389. get pagesCount() {
  6390. return this.pdfDocument ? this.pdfDocument.numPages : 0;
  6391. }
  6392. get page() {
  6393. return this.pdfDocument ? this.pdfViewer.currentPageNumber : 1;
  6394. }
  6395. set page(value) {
  6396. if (this.pdfDocument) {
  6397. this.pdfViewer.currentPageNumber = value;
  6398. }
  6399. }
  6400. get rotation() {
  6401. return this.pdfDocument ? this.pdfViewer.pagesRotation : 0;
  6402. }
  6403. set rotation(value) {
  6404. if (this.pdfDocument) {
  6405. this.pdfViewer.pagesRotation = value;
  6406. }
  6407. }
  6408. get isInPresentationMode() {
  6409. return this.pdfDocument ? this.pdfViewer.isInPresentationMode : false;
  6410. }
  6411. async goToDestination(dest) {
  6412. if (!this.pdfDocument) {
  6413. return;
  6414. }
  6415. let namedDest, explicitDest, pageNumber;
  6416. if (typeof dest === "string") {
  6417. namedDest = dest;
  6418. explicitDest = await this.pdfDocument.getDestination(dest);
  6419. } else {
  6420. namedDest = null;
  6421. explicitDest = await dest;
  6422. }
  6423. if (!Array.isArray(explicitDest)) {
  6424. console.error(`goToDestination: "${explicitDest}" is not a valid destination array, for dest="${dest}".`);
  6425. return;
  6426. }
  6427. const [destRef] = explicitDest;
  6428. if (destRef && typeof destRef === "object") {
  6429. pageNumber = this.pdfDocument.cachedPageNumber(destRef);
  6430. if (!pageNumber) {
  6431. try {
  6432. pageNumber = (await this.pdfDocument.getPageIndex(destRef)) + 1;
  6433. } catch {
  6434. console.error(`goToDestination: "${destRef}" is not a valid page reference, for dest="${dest}".`);
  6435. return;
  6436. }
  6437. }
  6438. } else if (Number.isInteger(destRef)) {
  6439. pageNumber = destRef + 1;
  6440. }
  6441. if (!pageNumber || pageNumber < 1 || pageNumber > this.pagesCount) {
  6442. console.error(`goToDestination: "${pageNumber}" is not a valid page number, for dest="${dest}".`);
  6443. return;
  6444. }
  6445. if (this.pdfHistory) {
  6446. this.pdfHistory.pushCurrentPosition();
  6447. this.pdfHistory.push({
  6448. namedDest,
  6449. explicitDest,
  6450. pageNumber
  6451. });
  6452. }
  6453. this.pdfViewer.scrollPageIntoView({
  6454. pageNumber,
  6455. destArray: explicitDest,
  6456. ignoreDestinationZoom: this._ignoreDestinationZoom
  6457. });
  6458. }
  6459. goToPage(val) {
  6460. if (!this.pdfDocument) {
  6461. return;
  6462. }
  6463. const pageNumber = typeof val === "string" && this.pdfViewer.pageLabelToPageNumber(val) || val | 0;
  6464. if (!(Number.isInteger(pageNumber) && pageNumber > 0 && pageNumber <= this.pagesCount)) {
  6465. console.error(`PDFLinkService.goToPage: "${val}" is not a valid page.`);
  6466. return;
  6467. }
  6468. if (this.pdfHistory) {
  6469. this.pdfHistory.pushCurrentPosition();
  6470. this.pdfHistory.pushPage(pageNumber);
  6471. }
  6472. this.pdfViewer.scrollPageIntoView({
  6473. pageNumber
  6474. });
  6475. }
  6476. addLinkAttributes(link, url, newWindow = false) {
  6477. if (!url || typeof url !== "string") {
  6478. throw new Error('A valid "url" parameter must provided.');
  6479. }
  6480. const target = newWindow ? LinkTarget.BLANK : this.externalLinkTarget,
  6481. rel = this.externalLinkRel;
  6482. if (this.externalLinkEnabled) {
  6483. link.href = link.title = url;
  6484. } else {
  6485. link.href = "";
  6486. link.title = `Disabled: ${url}`;
  6487. link.onclick = () => false;
  6488. }
  6489. let targetStr = "";
  6490. switch (target) {
  6491. case LinkTarget.NONE:
  6492. break;
  6493. case LinkTarget.SELF:
  6494. targetStr = "_self";
  6495. break;
  6496. case LinkTarget.BLANK:
  6497. targetStr = "_blank";
  6498. break;
  6499. case LinkTarget.PARENT:
  6500. targetStr = "_parent";
  6501. break;
  6502. case LinkTarget.TOP:
  6503. targetStr = "_top";
  6504. break;
  6505. }
  6506. link.target = targetStr;
  6507. link.rel = typeof rel === "string" ? rel : DEFAULT_LINK_REL;
  6508. }
  6509. getDestinationHash(dest) {
  6510. if (typeof dest === "string") {
  6511. if (dest.length > 0) {
  6512. return this.getAnchorUrl("#" + escape(dest));
  6513. }
  6514. } else if (Array.isArray(dest)) {
  6515. const str = JSON.stringify(dest);
  6516. if (str.length > 0) {
  6517. return this.getAnchorUrl("#" + escape(str));
  6518. }
  6519. }
  6520. return this.getAnchorUrl("");
  6521. }
  6522. getAnchorUrl(anchor) {
  6523. return this.baseUrl ? this.baseUrl + anchor : anchor;
  6524. }
  6525. setHash(hash) {
  6526. if (!this.pdfDocument) {
  6527. return;
  6528. }
  6529. let pageNumber, dest;
  6530. if (hash.includes("=")) {
  6531. const params = (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.parseQueryString)(hash);
  6532. if (params.has("search")) {
  6533. const query = params.get("search").replaceAll('"', ""),
  6534. phrase = params.get("phrase") === "true";
  6535. this.eventBus.dispatch("findfromurlhash", {
  6536. source: this,
  6537. query: phrase ? query : query.match(/\S+/g)
  6538. });
  6539. }
  6540. if (params.has("page")) {
  6541. pageNumber = params.get("page") | 0 || 1;
  6542. }
  6543. if (params.has("zoom")) {
  6544. const zoomArgs = params.get("zoom").split(",");
  6545. const zoomArg = zoomArgs[0];
  6546. const zoomArgNumber = parseFloat(zoomArg);
  6547. if (!zoomArg.includes("Fit")) {
  6548. dest = [null, {
  6549. name: "XYZ"
  6550. }, zoomArgs.length > 1 ? zoomArgs[1] | 0 : null, zoomArgs.length > 2 ? zoomArgs[2] | 0 : null, zoomArgNumber ? zoomArgNumber / 100 : zoomArg];
  6551. } else if (zoomArg === "Fit" || zoomArg === "FitB") {
  6552. dest = [null, {
  6553. name: zoomArg
  6554. }];
  6555. } else if (zoomArg === "FitH" || zoomArg === "FitBH" || zoomArg === "FitV" || zoomArg === "FitBV") {
  6556. dest = [null, {
  6557. name: zoomArg
  6558. }, zoomArgs.length > 1 ? zoomArgs[1] | 0 : null];
  6559. } else if (zoomArg === "FitR") {
  6560. if (zoomArgs.length !== 5) {
  6561. console.error('PDFLinkService.setHash: Not enough parameters for "FitR".');
  6562. } else {
  6563. dest = [null, {
  6564. name: zoomArg
  6565. }, zoomArgs[1] | 0, zoomArgs[2] | 0, zoomArgs[3] | 0, zoomArgs[4] | 0];
  6566. }
  6567. } else {
  6568. console.error(`PDFLinkService.setHash: "${zoomArg}" is not a valid zoom value.`);
  6569. }
  6570. }
  6571. if (dest) {
  6572. this.pdfViewer.scrollPageIntoView({
  6573. pageNumber: pageNumber || this.page,
  6574. destArray: dest,
  6575. allowNegativeOffset: true
  6576. });
  6577. } else if (pageNumber) {
  6578. this.page = pageNumber;
  6579. }
  6580. if (params.has("pagemode")) {
  6581. this.eventBus.dispatch("pagemode", {
  6582. source: this,
  6583. mode: params.get("pagemode")
  6584. });
  6585. }
  6586. if (params.has("nameddest")) {
  6587. this.goToDestination(params.get("nameddest"));
  6588. }
  6589. return;
  6590. }
  6591. dest = unescape(hash);
  6592. try {
  6593. dest = JSON.parse(dest);
  6594. if (!Array.isArray(dest)) {
  6595. dest = dest.toString();
  6596. }
  6597. } catch {}
  6598. if (typeof dest === "string" || PDFLinkService.#isValidExplicitDest(dest)) {
  6599. this.goToDestination(dest);
  6600. return;
  6601. }
  6602. console.error(`PDFLinkService.setHash: "${unescape(hash)}" is not a valid destination.`);
  6603. }
  6604. executeNamedAction(action) {
  6605. if (!this.pdfDocument) {
  6606. return;
  6607. }
  6608. switch (action) {
  6609. case "GoBack":
  6610. this.pdfHistory?.back();
  6611. break;
  6612. case "GoForward":
  6613. this.pdfHistory?.forward();
  6614. break;
  6615. case "NextPage":
  6616. this.pdfViewer.nextPage();
  6617. break;
  6618. case "PrevPage":
  6619. this.pdfViewer.previousPage();
  6620. break;
  6621. case "LastPage":
  6622. this.page = this.pagesCount;
  6623. break;
  6624. case "FirstPage":
  6625. this.page = 1;
  6626. break;
  6627. default:
  6628. break;
  6629. }
  6630. this.eventBus.dispatch("namedaction", {
  6631. source: this,
  6632. action
  6633. });
  6634. }
  6635. async executeSetOCGState(action) {
  6636. if (!this.pdfDocument) {
  6637. return;
  6638. }
  6639. const pdfDocument = this.pdfDocument,
  6640. optionalContentConfig = await this.pdfViewer.optionalContentConfigPromise;
  6641. if (pdfDocument !== this.pdfDocument) {
  6642. return;
  6643. }
  6644. optionalContentConfig.setOCGState(action);
  6645. this.pdfViewer.optionalContentConfigPromise = Promise.resolve(optionalContentConfig);
  6646. }
  6647. static #isValidExplicitDest(dest) {
  6648. if (!Array.isArray(dest) || dest.length < 2) {
  6649. return false;
  6650. }
  6651. const [page, zoom, ...args] = dest;
  6652. if (!(typeof page === "object" && Number.isInteger(page?.num) && Number.isInteger(page?.gen)) && !Number.isInteger(page)) {
  6653. return false;
  6654. }
  6655. if (!(typeof zoom === "object" && typeof zoom?.name === "string")) {
  6656. return false;
  6657. }
  6658. let allowNull = true;
  6659. switch (zoom.name) {
  6660. case "XYZ":
  6661. if (args.length !== 3) {
  6662. return false;
  6663. }
  6664. break;
  6665. case "Fit":
  6666. case "FitB":
  6667. return args.length === 0;
  6668. case "FitH":
  6669. case "FitBH":
  6670. case "FitV":
  6671. case "FitBV":
  6672. if (args.length !== 1) {
  6673. return false;
  6674. }
  6675. break;
  6676. case "FitR":
  6677. if (args.length !== 4) {
  6678. return false;
  6679. }
  6680. allowNull = false;
  6681. break;
  6682. default:
  6683. return false;
  6684. }
  6685. for (const arg of args) {
  6686. if (!(typeof arg === "number" || allowNull && arg === null)) {
  6687. return false;
  6688. }
  6689. }
  6690. return true;
  6691. }
  6692. }
  6693. class SimpleLinkService extends PDFLinkService {
  6694. setDocument(pdfDocument, baseUrl = null) {}
  6695. }
  6696. /***/ }),
  6697. /***/ 9966:
  6698. /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
  6699. __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
  6700. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  6701. /* harmony export */ PDFPageView: () => (/* binding */ PDFPageView)
  6702. /* harmony export */ });
  6703. /* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4114);
  6704. /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2603);
  6705. /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7256);
  6706. /* harmony import */ var _annotation_editor_layer_builder_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2664);
  6707. /* harmony import */ var _annotation_layer_builder_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2707);
  6708. /* harmony import */ var _app_options_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9840);
  6709. /* harmony import */ var _draw_layer_builder_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(3088);
  6710. /* harmony import */ var web_null_l10n__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(410);
  6711. /* harmony import */ var _pdf_link_service_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(787);
  6712. /* harmony import */ var _struct_tree_layer_builder_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(6698);
  6713. /* harmony import */ var _text_accessibility_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(5860);
  6714. /* harmony import */ var _text_highlighter_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(2027);
  6715. /* harmony import */ var _text_layer_builder_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(7765);
  6716. /* harmony import */ var _xfa_layer_builder_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(2973);
  6717. var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__, _annotation_editor_layer_builder_js__WEBPACK_IMPORTED_MODULE_3__, _annotation_layer_builder_js__WEBPACK_IMPORTED_MODULE_4__, _draw_layer_builder_js__WEBPACK_IMPORTED_MODULE_6__, web_null_l10n__WEBPACK_IMPORTED_MODULE_7__, _text_layer_builder_js__WEBPACK_IMPORTED_MODULE_12__, _xfa_layer_builder_js__WEBPACK_IMPORTED_MODULE_13__]);
  6718. ([pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__, _annotation_editor_layer_builder_js__WEBPACK_IMPORTED_MODULE_3__, _annotation_layer_builder_js__WEBPACK_IMPORTED_MODULE_4__, _draw_layer_builder_js__WEBPACK_IMPORTED_MODULE_6__, web_null_l10n__WEBPACK_IMPORTED_MODULE_7__, _text_layer_builder_js__WEBPACK_IMPORTED_MODULE_12__, _xfa_layer_builder_js__WEBPACK_IMPORTED_MODULE_13__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
  6719. const DEFAULT_LAYER_PROPERTIES = {
  6720. annotationEditorUIManager: null,
  6721. annotationStorage: null,
  6722. downloadManager: null,
  6723. enableScripting: false,
  6724. fieldObjectsPromise: null,
  6725. findController: null,
  6726. hasJSActionsPromise: null,
  6727. get linkService() {
  6728. return new _pdf_link_service_js__WEBPACK_IMPORTED_MODULE_8__.SimpleLinkService();
  6729. }
  6730. };
  6731. const LAYERS_ORDER = new Map([["canvasWrapper", 0], ["textLayer", 1], ["annotationLayer", 2], ["annotationEditorLayer", 3], ["xfaLayer", 3]]);
  6732. class PDFPageView {
  6733. #annotationMode = pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.AnnotationMode.ENABLE_FORMS;
  6734. #hasRestrictedScaling = false;
  6735. #layerProperties = null;
  6736. #loadingId = null;
  6737. #previousRotation = null;
  6738. #renderError = null;
  6739. #renderingState = _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.RenderingStates.INITIAL;
  6740. #textLayerMode = _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.TextLayerMode.ENABLE;
  6741. #useThumbnailCanvas = {
  6742. directDrawing: true,
  6743. initialOptionalContent: true,
  6744. regularAnnotations: true
  6745. };
  6746. #viewportMap = new WeakMap();
  6747. #layers = [null, null, null, null];
  6748. constructor(options) {
  6749. const container = options.container;
  6750. const defaultViewport = options.defaultViewport;
  6751. this.id = options.id;
  6752. this.renderingId = "page" + this.id;
  6753. this.#layerProperties = options.layerProperties || DEFAULT_LAYER_PROPERTIES;
  6754. this.pdfPage = null;
  6755. this.pageLabel = null;
  6756. this.rotation = 0;
  6757. this.scale = options.scale || _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_SCALE;
  6758. this.viewport = defaultViewport;
  6759. this.pdfPageRotate = defaultViewport.rotation;
  6760. this._optionalContentConfigPromise = options.optionalContentConfigPromise || null;
  6761. this.#textLayerMode = options.textLayerMode ?? _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.TextLayerMode.ENABLE;
  6762. this.#annotationMode = options.annotationMode ?? pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.AnnotationMode.ENABLE_FORMS;
  6763. this.imageResourcesPath = options.imageResourcesPath || "";
  6764. this.maxCanvasPixels = options.maxCanvasPixels ?? _app_options_js__WEBPACK_IMPORTED_MODULE_5__.AppOptions.get("maxCanvasPixels");
  6765. this.pageColors = options.pageColors || null;
  6766. this.eventBus = options.eventBus;
  6767. this.renderingQueue = options.renderingQueue;
  6768. this.l10n = options.l10n;
  6769. this.l10n ||= new web_null_l10n__WEBPACK_IMPORTED_MODULE_7__.GenericL10n();
  6770. this.renderTask = null;
  6771. this.resume = null;
  6772. this._isStandalone = !this.renderingQueue?.hasViewer();
  6773. this._container = container;
  6774. this._annotationCanvasMap = null;
  6775. this.annotationLayer = null;
  6776. this.annotationEditorLayer = null;
  6777. this.textLayer = null;
  6778. this.zoomLayer = null;
  6779. this.xfaLayer = null;
  6780. this.structTreeLayer = null;
  6781. this.drawLayer = null;
  6782. const div = document.createElement("div");
  6783. div.className = "page";
  6784. div.setAttribute("data-page-number", this.id);
  6785. div.setAttribute("role", "region");
  6786. div.setAttribute("data-l10n-id", "pdfjs-page-landmark");
  6787. div.setAttribute("data-l10n-args", JSON.stringify({
  6788. page: this.id
  6789. }));
  6790. this.div = div;
  6791. this.#setDimensions();
  6792. container?.append(div);
  6793. if (this._isStandalone) {
  6794. container?.style.setProperty("--scale-factor", this.scale * pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.PixelsPerInch.PDF_TO_CSS_UNITS);
  6795. const {
  6796. optionalContentConfigPromise
  6797. } = options;
  6798. if (optionalContentConfigPromise) {
  6799. optionalContentConfigPromise.then(optionalContentConfig => {
  6800. if (optionalContentConfigPromise !== this._optionalContentConfigPromise) {
  6801. return;
  6802. }
  6803. this.#useThumbnailCanvas.initialOptionalContent = optionalContentConfig.hasInitialVisibility;
  6804. });
  6805. }
  6806. if (!options.l10n) {
  6807. this.l10n.translate(this.div);
  6808. }
  6809. }
  6810. }
  6811. #addLayer(div, name) {
  6812. const pos = LAYERS_ORDER.get(name);
  6813. const oldDiv = this.#layers[pos];
  6814. this.#layers[pos] = div;
  6815. if (oldDiv) {
  6816. oldDiv.replaceWith(div);
  6817. return;
  6818. }
  6819. for (let i = pos - 1; i >= 0; i--) {
  6820. const layer = this.#layers[i];
  6821. if (layer) {
  6822. layer.after(div);
  6823. return;
  6824. }
  6825. }
  6826. this.div.prepend(div);
  6827. }
  6828. get renderingState() {
  6829. return this.#renderingState;
  6830. }
  6831. set renderingState(state) {
  6832. if (state === this.#renderingState) {
  6833. return;
  6834. }
  6835. this.#renderingState = state;
  6836. if (this.#loadingId) {
  6837. clearTimeout(this.#loadingId);
  6838. this.#loadingId = null;
  6839. }
  6840. switch (state) {
  6841. case _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.RenderingStates.PAUSED:
  6842. this.div.classList.remove("loading");
  6843. break;
  6844. case _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.RenderingStates.RUNNING:
  6845. this.div.classList.add("loadingIcon");
  6846. this.#loadingId = setTimeout(() => {
  6847. this.div.classList.add("loading");
  6848. this.#loadingId = null;
  6849. }, 0);
  6850. break;
  6851. case _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.RenderingStates.INITIAL:
  6852. case _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.RenderingStates.FINISHED:
  6853. this.div.classList.remove("loadingIcon", "loading");
  6854. break;
  6855. }
  6856. }
  6857. #setDimensions() {
  6858. const {
  6859. viewport
  6860. } = this;
  6861. if (this.pdfPage) {
  6862. if (this.#previousRotation === viewport.rotation) {
  6863. return;
  6864. }
  6865. this.#previousRotation = viewport.rotation;
  6866. }
  6867. (0,pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.setLayerDimensions)(this.div, viewport, true, false);
  6868. }
  6869. setPdfPage(pdfPage) {
  6870. if (this._isStandalone && (this.pageColors?.foreground === "CanvasText" || this.pageColors?.background === "Canvas")) {
  6871. this._container?.style.setProperty("--hcm-highlight-filter", pdfPage.filterFactory.addHighlightHCMFilter("highlight", "CanvasText", "Canvas", "HighlightText", "Highlight"));
  6872. this._container?.style.setProperty("--hcm-highlight-selected-filter", pdfPage.filterFactory.addHighlightHCMFilter("highlight_selected", "CanvasText", "Canvas", "HighlightText", "Highlight"));
  6873. }
  6874. this.pdfPage = pdfPage;
  6875. this.pdfPageRotate = pdfPage.rotate;
  6876. const totalRotation = (this.rotation + this.pdfPageRotate) % 360;
  6877. this.viewport = pdfPage.getViewport({
  6878. scale: this.scale * pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.PixelsPerInch.PDF_TO_CSS_UNITS,
  6879. rotation: totalRotation
  6880. });
  6881. this.#setDimensions();
  6882. this.reset();
  6883. }
  6884. destroy() {
  6885. this.reset();
  6886. this.pdfPage?.cleanup();
  6887. }
  6888. get _textHighlighter() {
  6889. return (0,pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.shadow)(this, "_textHighlighter", new _text_highlighter_js__WEBPACK_IMPORTED_MODULE_11__.TextHighlighter({
  6890. pageIndex: this.id - 1,
  6891. eventBus: this.eventBus,
  6892. findController: this.#layerProperties.findController
  6893. }));
  6894. }
  6895. async #renderAnnotationLayer() {
  6896. let error = null;
  6897. try {
  6898. await this.annotationLayer.render(this.viewport, "display");
  6899. } catch (ex) {
  6900. console.error(`#renderAnnotationLayer: "${ex}".`);
  6901. error = ex;
  6902. } finally {
  6903. this.eventBus.dispatch("annotationlayerrendered", {
  6904. source: this,
  6905. pageNumber: this.id,
  6906. error
  6907. });
  6908. }
  6909. }
  6910. async #renderAnnotationEditorLayer() {
  6911. let error = null;
  6912. try {
  6913. await this.annotationEditorLayer.render(this.viewport, "display");
  6914. } catch (ex) {
  6915. console.error(`#renderAnnotationEditorLayer: "${ex}".`);
  6916. error = ex;
  6917. } finally {
  6918. this.eventBus.dispatch("annotationeditorlayerrendered", {
  6919. source: this,
  6920. pageNumber: this.id,
  6921. error
  6922. });
  6923. }
  6924. }
  6925. async #renderDrawLayer() {
  6926. try {
  6927. await this.drawLayer.render("display");
  6928. } catch (ex) {
  6929. console.error(`#renderDrawLayer: "${ex}".`);
  6930. }
  6931. }
  6932. async #renderXfaLayer() {
  6933. let error = null;
  6934. try {
  6935. const result = await this.xfaLayer.render(this.viewport, "display");
  6936. if (result?.textDivs && this._textHighlighter) {
  6937. this.#buildXfaTextContentItems(result.textDivs);
  6938. }
  6939. } catch (ex) {
  6940. console.error(`#renderXfaLayer: "${ex}".`);
  6941. error = ex;
  6942. } finally {
  6943. if (this.xfaLayer?.div) {
  6944. this.l10n.pause();
  6945. this.#addLayer(this.xfaLayer.div, "xfaLayer");
  6946. this.l10n.resume();
  6947. }
  6948. this.eventBus.dispatch("xfalayerrendered", {
  6949. source: this,
  6950. pageNumber: this.id,
  6951. error
  6952. });
  6953. }
  6954. }
  6955. async #renderTextLayer() {
  6956. const {
  6957. pdfPage,
  6958. textLayer,
  6959. viewport
  6960. } = this;
  6961. if (!textLayer) {
  6962. return;
  6963. }
  6964. let error = null;
  6965. try {
  6966. if (!textLayer.renderingDone) {
  6967. const readableStream = pdfPage.streamTextContent({
  6968. includeMarkedContent: true,
  6969. disableNormalization: true
  6970. });
  6971. textLayer.setTextContentSource(readableStream);
  6972. }
  6973. await textLayer.render(viewport);
  6974. } catch (ex) {
  6975. if (ex instanceof pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.AbortException) {
  6976. return;
  6977. }
  6978. console.error(`#renderTextLayer: "${ex}".`);
  6979. error = ex;
  6980. }
  6981. this.eventBus.dispatch("textlayerrendered", {
  6982. source: this,
  6983. pageNumber: this.id,
  6984. numTextDivs: textLayer.numTextDivs,
  6985. error
  6986. });
  6987. this.#renderStructTreeLayer();
  6988. }
  6989. async #renderStructTreeLayer() {
  6990. if (!this.textLayer) {
  6991. return;
  6992. }
  6993. this.structTreeLayer ||= new _struct_tree_layer_builder_js__WEBPACK_IMPORTED_MODULE_9__.StructTreeLayerBuilder();
  6994. const tree = await (!this.structTreeLayer.renderingDone ? this.pdfPage.getStructTree() : null);
  6995. const treeDom = this.structTreeLayer?.render(tree);
  6996. if (treeDom) {
  6997. this.l10n.pause();
  6998. this.canvas?.append(treeDom);
  6999. this.l10n.resume();
  7000. }
  7001. this.structTreeLayer?.show();
  7002. }
  7003. async #buildXfaTextContentItems(textDivs) {
  7004. const text = await this.pdfPage.getTextContent();
  7005. const items = [];
  7006. for (const item of text.items) {
  7007. items.push(item.str);
  7008. }
  7009. this._textHighlighter.setTextMapping(textDivs, items);
  7010. this._textHighlighter.enable();
  7011. }
  7012. _resetZoomLayer(removeFromDOM = false) {
  7013. if (!this.zoomLayer) {
  7014. return;
  7015. }
  7016. const zoomLayerCanvas = this.zoomLayer.firstChild;
  7017. this.#viewportMap.delete(zoomLayerCanvas);
  7018. zoomLayerCanvas.width = 0;
  7019. zoomLayerCanvas.height = 0;
  7020. if (removeFromDOM) {
  7021. this.zoomLayer.remove();
  7022. }
  7023. this.zoomLayer = null;
  7024. }
  7025. reset({
  7026. keepZoomLayer = false,
  7027. keepAnnotationLayer = false,
  7028. keepAnnotationEditorLayer = false,
  7029. keepXfaLayer = false,
  7030. keepTextLayer = false
  7031. } = {}) {
  7032. this.cancelRendering({
  7033. keepAnnotationLayer,
  7034. keepAnnotationEditorLayer,
  7035. keepXfaLayer,
  7036. keepTextLayer
  7037. });
  7038. this.renderingState = _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.RenderingStates.INITIAL;
  7039. const div = this.div;
  7040. const childNodes = div.childNodes,
  7041. zoomLayerNode = keepZoomLayer && this.zoomLayer || null,
  7042. annotationLayerNode = keepAnnotationLayer && this.annotationLayer?.div || null,
  7043. annotationEditorLayerNode = keepAnnotationEditorLayer && this.annotationEditorLayer?.div || null,
  7044. xfaLayerNode = keepXfaLayer && this.xfaLayer?.div || null,
  7045. textLayerNode = keepTextLayer && this.textLayer?.div || null;
  7046. for (let i = childNodes.length - 1; i >= 0; i--) {
  7047. const node = childNodes[i];
  7048. switch (node) {
  7049. case zoomLayerNode:
  7050. case annotationLayerNode:
  7051. case annotationEditorLayerNode:
  7052. case xfaLayerNode:
  7053. case textLayerNode:
  7054. continue;
  7055. }
  7056. node.remove();
  7057. const layerIndex = this.#layers.indexOf(node);
  7058. if (layerIndex >= 0) {
  7059. this.#layers[layerIndex] = null;
  7060. }
  7061. }
  7062. div.removeAttribute("data-loaded");
  7063. if (annotationLayerNode) {
  7064. this.annotationLayer.hide();
  7065. }
  7066. if (annotationEditorLayerNode) {
  7067. this.annotationEditorLayer.hide();
  7068. }
  7069. if (xfaLayerNode) {
  7070. this.xfaLayer.hide();
  7071. }
  7072. if (textLayerNode) {
  7073. this.textLayer.hide();
  7074. }
  7075. this.structTreeLayer?.hide();
  7076. if (!zoomLayerNode) {
  7077. if (this.canvas) {
  7078. this.#viewportMap.delete(this.canvas);
  7079. this.canvas.width = 0;
  7080. this.canvas.height = 0;
  7081. delete this.canvas;
  7082. }
  7083. this._resetZoomLayer();
  7084. }
  7085. }
  7086. update({
  7087. scale = 0,
  7088. rotation = null,
  7089. optionalContentConfigPromise = null,
  7090. drawingDelay = -1
  7091. }) {
  7092. this.scale = scale || this.scale;
  7093. if (typeof rotation === "number") {
  7094. this.rotation = rotation;
  7095. }
  7096. if (optionalContentConfigPromise instanceof Promise) {
  7097. this._optionalContentConfigPromise = optionalContentConfigPromise;
  7098. optionalContentConfigPromise.then(optionalContentConfig => {
  7099. if (optionalContentConfigPromise !== this._optionalContentConfigPromise) {
  7100. return;
  7101. }
  7102. this.#useThumbnailCanvas.initialOptionalContent = optionalContentConfig.hasInitialVisibility;
  7103. });
  7104. }
  7105. this.#useThumbnailCanvas.directDrawing = true;
  7106. const totalRotation = (this.rotation + this.pdfPageRotate) % 360;
  7107. this.viewport = this.viewport.clone({
  7108. scale: this.scale * pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.PixelsPerInch.PDF_TO_CSS_UNITS,
  7109. rotation: totalRotation
  7110. });
  7111. this.#setDimensions();
  7112. if (this._isStandalone) {
  7113. this._container?.style.setProperty("--scale-factor", this.viewport.scale);
  7114. }
  7115. if (this.canvas) {
  7116. let onlyCssZoom = false;
  7117. if (this.#hasRestrictedScaling) {
  7118. if (this.maxCanvasPixels === 0) {
  7119. onlyCssZoom = true;
  7120. } else if (this.maxCanvasPixels > 0) {
  7121. const {
  7122. width,
  7123. height
  7124. } = this.viewport;
  7125. const {
  7126. sx,
  7127. sy
  7128. } = this.outputScale;
  7129. onlyCssZoom = (Math.floor(width) * sx | 0) * (Math.floor(height) * sy | 0) > this.maxCanvasPixels;
  7130. }
  7131. }
  7132. const postponeDrawing = !onlyCssZoom && drawingDelay >= 0 && drawingDelay < 1000;
  7133. if (postponeDrawing || onlyCssZoom) {
  7134. if (postponeDrawing && this.renderingState !== _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.RenderingStates.FINISHED) {
  7135. this.cancelRendering({
  7136. keepZoomLayer: true,
  7137. keepAnnotationLayer: true,
  7138. keepAnnotationEditorLayer: true,
  7139. keepXfaLayer: true,
  7140. keepTextLayer: true,
  7141. cancelExtraDelay: drawingDelay
  7142. });
  7143. this.renderingState = _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.RenderingStates.FINISHED;
  7144. this.#useThumbnailCanvas.directDrawing = false;
  7145. }
  7146. this.cssTransform({
  7147. target: this.canvas,
  7148. redrawAnnotationLayer: true,
  7149. redrawAnnotationEditorLayer: true,
  7150. redrawXfaLayer: true,
  7151. redrawTextLayer: !postponeDrawing,
  7152. hideTextLayer: postponeDrawing
  7153. });
  7154. if (postponeDrawing) {
  7155. return;
  7156. }
  7157. this.eventBus.dispatch("pagerendered", {
  7158. source: this,
  7159. pageNumber: this.id,
  7160. cssTransform: true,
  7161. timestamp: performance.now(),
  7162. error: this.#renderError
  7163. });
  7164. return;
  7165. }
  7166. if (!this.zoomLayer && !this.canvas.hidden) {
  7167. this.zoomLayer = this.canvas.parentNode;
  7168. this.zoomLayer.style.position = "absolute";
  7169. }
  7170. }
  7171. if (this.zoomLayer) {
  7172. this.cssTransform({
  7173. target: this.zoomLayer.firstChild
  7174. });
  7175. }
  7176. this.reset({
  7177. keepZoomLayer: true,
  7178. keepAnnotationLayer: true,
  7179. keepAnnotationEditorLayer: true,
  7180. keepXfaLayer: true,
  7181. keepTextLayer: true
  7182. });
  7183. }
  7184. cancelRendering({
  7185. keepAnnotationLayer = false,
  7186. keepAnnotationEditorLayer = false,
  7187. keepXfaLayer = false,
  7188. keepTextLayer = false,
  7189. cancelExtraDelay = 0
  7190. } = {}) {
  7191. if (this.renderTask) {
  7192. this.renderTask.cancel(cancelExtraDelay);
  7193. this.renderTask = null;
  7194. }
  7195. this.resume = null;
  7196. if (this.textLayer && (!keepTextLayer || !this.textLayer.div)) {
  7197. this.textLayer.cancel();
  7198. this.textLayer = null;
  7199. }
  7200. if (this.structTreeLayer && !this.textLayer) {
  7201. this.structTreeLayer = null;
  7202. }
  7203. if (this.annotationLayer && (!keepAnnotationLayer || !this.annotationLayer.div)) {
  7204. this.annotationLayer.cancel();
  7205. this.annotationLayer = null;
  7206. this._annotationCanvasMap = null;
  7207. }
  7208. if (this.annotationEditorLayer && (!keepAnnotationEditorLayer || !this.annotationEditorLayer.div)) {
  7209. if (this.drawLayer) {
  7210. this.drawLayer.cancel();
  7211. this.drawLayer = null;
  7212. }
  7213. this.annotationEditorLayer.cancel();
  7214. this.annotationEditorLayer = null;
  7215. }
  7216. if (this.xfaLayer && (!keepXfaLayer || !this.xfaLayer.div)) {
  7217. this.xfaLayer.cancel();
  7218. this.xfaLayer = null;
  7219. this._textHighlighter?.disable();
  7220. }
  7221. }
  7222. cssTransform({
  7223. target,
  7224. redrawAnnotationLayer = false,
  7225. redrawAnnotationEditorLayer = false,
  7226. redrawXfaLayer = false,
  7227. redrawTextLayer = false,
  7228. hideTextLayer = false
  7229. }) {
  7230. if (!target.hasAttribute("zooming")) {
  7231. target.setAttribute("zooming", true);
  7232. const {
  7233. style
  7234. } = target;
  7235. style.width = style.height = "";
  7236. }
  7237. const originalViewport = this.#viewportMap.get(target);
  7238. if (this.viewport !== originalViewport) {
  7239. const relativeRotation = this.viewport.rotation - originalViewport.rotation;
  7240. const absRotation = Math.abs(relativeRotation);
  7241. let scaleX = 1,
  7242. scaleY = 1;
  7243. if (absRotation === 90 || absRotation === 270) {
  7244. const {
  7245. width,
  7246. height
  7247. } = this.viewport;
  7248. scaleX = height / width;
  7249. scaleY = width / height;
  7250. }
  7251. target.style.transform = `rotate(${relativeRotation}deg) scale(${scaleX}, ${scaleY})`;
  7252. }
  7253. if (redrawAnnotationLayer && this.annotationLayer) {
  7254. this.#renderAnnotationLayer();
  7255. }
  7256. if (redrawAnnotationEditorLayer && this.annotationEditorLayer) {
  7257. if (this.drawLayer) {
  7258. this.#renderDrawLayer();
  7259. }
  7260. this.#renderAnnotationEditorLayer();
  7261. }
  7262. if (redrawXfaLayer && this.xfaLayer) {
  7263. this.#renderXfaLayer();
  7264. }
  7265. if (this.textLayer) {
  7266. if (hideTextLayer) {
  7267. this.textLayer.hide();
  7268. this.structTreeLayer?.hide();
  7269. } else if (redrawTextLayer) {
  7270. this.#renderTextLayer();
  7271. }
  7272. }
  7273. }
  7274. get width() {
  7275. return this.viewport.width;
  7276. }
  7277. get height() {
  7278. return this.viewport.height;
  7279. }
  7280. getPagePoint(x, y) {
  7281. return this.viewport.convertToPdfPoint(x, y);
  7282. }
  7283. async #finishRenderTask(renderTask, error = null) {
  7284. if (renderTask === this.renderTask) {
  7285. this.renderTask = null;
  7286. }
  7287. if (error instanceof pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.RenderingCancelledException) {
  7288. this.#renderError = null;
  7289. return;
  7290. }
  7291. this.#renderError = error;
  7292. this.renderingState = _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.RenderingStates.FINISHED;
  7293. this._resetZoomLayer(true);
  7294. this.#useThumbnailCanvas.regularAnnotations = !renderTask.separateAnnots;
  7295. this.eventBus.dispatch("pagerendered", {
  7296. source: this,
  7297. pageNumber: this.id,
  7298. cssTransform: false,
  7299. timestamp: performance.now(),
  7300. error: this.#renderError
  7301. });
  7302. if (error) {
  7303. throw error;
  7304. }
  7305. }
  7306. async draw() {
  7307. if (this.renderingState !== _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.RenderingStates.INITIAL) {
  7308. console.error("Must be in new state before drawing");
  7309. this.reset();
  7310. }
  7311. const {
  7312. div,
  7313. l10n,
  7314. pageColors,
  7315. pdfPage,
  7316. viewport
  7317. } = this;
  7318. if (!pdfPage) {
  7319. this.renderingState = _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.RenderingStates.FINISHED;
  7320. throw new Error("pdfPage is not loaded");
  7321. }
  7322. this.renderingState = _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.RenderingStates.RUNNING;
  7323. const canvasWrapper = document.createElement("div");
  7324. canvasWrapper.classList.add("canvasWrapper");
  7325. canvasWrapper.setAttribute("aria-hidden", true);
  7326. this.#addLayer(canvasWrapper, "canvasWrapper");
  7327. if (!this.textLayer && this.#textLayerMode !== _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.TextLayerMode.DISABLE && !pdfPage.isPureXfa) {
  7328. this._accessibilityManager ||= new _text_accessibility_js__WEBPACK_IMPORTED_MODULE_10__.TextAccessibilityManager();
  7329. this.textLayer = new _text_layer_builder_js__WEBPACK_IMPORTED_MODULE_12__.TextLayerBuilder({
  7330. highlighter: this._textHighlighter,
  7331. accessibilityManager: this._accessibilityManager,
  7332. enablePermissions: this.#textLayerMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.TextLayerMode.ENABLE_PERMISSIONS,
  7333. onAppend: textLayerDiv => {
  7334. this.l10n.pause();
  7335. this.#addLayer(textLayerDiv, "textLayer");
  7336. this.l10n.resume();
  7337. }
  7338. });
  7339. }
  7340. if (!this.annotationLayer && this.#annotationMode !== pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.AnnotationMode.DISABLE) {
  7341. const {
  7342. annotationStorage,
  7343. annotationEditorUIManager,
  7344. downloadManager,
  7345. enableScripting,
  7346. fieldObjectsPromise,
  7347. hasJSActionsPromise,
  7348. linkService
  7349. } = this.#layerProperties;
  7350. this._annotationCanvasMap ||= new Map();
  7351. this.annotationLayer = new _annotation_layer_builder_js__WEBPACK_IMPORTED_MODULE_4__.AnnotationLayerBuilder({
  7352. pdfPage,
  7353. annotationStorage,
  7354. imageResourcesPath: this.imageResourcesPath,
  7355. renderForms: this.#annotationMode === pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.AnnotationMode.ENABLE_FORMS,
  7356. linkService,
  7357. downloadManager,
  7358. enableScripting,
  7359. hasJSActionsPromise,
  7360. fieldObjectsPromise,
  7361. annotationCanvasMap: this._annotationCanvasMap,
  7362. accessibilityManager: this._accessibilityManager,
  7363. annotationEditorUIManager,
  7364. onAppend: annotationLayerDiv => {
  7365. this.#addLayer(annotationLayerDiv, "annotationLayer");
  7366. }
  7367. });
  7368. }
  7369. const renderContinueCallback = cont => {
  7370. showCanvas?.(false);
  7371. if (this.renderingQueue && !this.renderingQueue.isHighestPriority(this)) {
  7372. this.renderingState = _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.RenderingStates.PAUSED;
  7373. this.resume = () => {
  7374. this.renderingState = _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.RenderingStates.RUNNING;
  7375. cont();
  7376. };
  7377. return;
  7378. }
  7379. cont();
  7380. };
  7381. const {
  7382. width,
  7383. height
  7384. } = viewport;
  7385. const canvas = document.createElement("canvas");
  7386. canvas.setAttribute("role", "presentation");
  7387. canvas.hidden = true;
  7388. const hasHCM = !!(pageColors?.background && pageColors?.foreground);
  7389. let showCanvas = isLastShow => {
  7390. if (!hasHCM || isLastShow) {
  7391. canvas.hidden = false;
  7392. showCanvas = null;
  7393. }
  7394. };
  7395. canvasWrapper.append(canvas);
  7396. this.canvas = canvas;
  7397. const ctx = canvas.getContext("2d", {
  7398. alpha: false
  7399. });
  7400. const outputScale = this.outputScale = new _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.OutputScale();
  7401. if (this.maxCanvasPixels === 0) {
  7402. const invScale = 1 / this.scale;
  7403. outputScale.sx *= invScale;
  7404. outputScale.sy *= invScale;
  7405. this.#hasRestrictedScaling = true;
  7406. } else if (this.maxCanvasPixels > 0) {
  7407. const pixelsInViewport = width * height;
  7408. const maxScale = Math.sqrt(this.maxCanvasPixels / pixelsInViewport);
  7409. if (outputScale.sx > maxScale || outputScale.sy > maxScale) {
  7410. outputScale.sx = maxScale;
  7411. outputScale.sy = maxScale;
  7412. this.#hasRestrictedScaling = true;
  7413. } else {
  7414. this.#hasRestrictedScaling = false;
  7415. }
  7416. }
  7417. const sfx = (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.approximateFraction)(outputScale.sx);
  7418. const sfy = (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.approximateFraction)(outputScale.sy);
  7419. canvas.width = (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.roundToDivide)(width * outputScale.sx, sfx[0]);
  7420. canvas.height = (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.roundToDivide)(height * outputScale.sy, sfy[0]);
  7421. const {
  7422. style
  7423. } = canvas;
  7424. style.width = (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.roundToDivide)(width, sfx[1]) + "px";
  7425. style.height = (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.roundToDivide)(height, sfy[1]) + "px";
  7426. this.#viewportMap.set(canvas, viewport);
  7427. const transform = outputScale.scaled ? [outputScale.sx, 0, 0, outputScale.sy, 0, 0] : null;
  7428. const renderContext = {
  7429. canvasContext: ctx,
  7430. transform,
  7431. viewport,
  7432. annotationMode: this.#annotationMode,
  7433. optionalContentConfigPromise: this._optionalContentConfigPromise,
  7434. annotationCanvasMap: this._annotationCanvasMap,
  7435. pageColors
  7436. };
  7437. const renderTask = this.renderTask = this.pdfPage.render(renderContext);
  7438. renderTask.onContinue = renderContinueCallback;
  7439. const resultPromise = renderTask.promise.then(async () => {
  7440. showCanvas?.(true);
  7441. await this.#finishRenderTask(renderTask);
  7442. this.#renderTextLayer();
  7443. if (this.annotationLayer) {
  7444. await this.#renderAnnotationLayer();
  7445. }
  7446. const {
  7447. annotationEditorUIManager
  7448. } = this.#layerProperties;
  7449. if (!annotationEditorUIManager) {
  7450. return;
  7451. }
  7452. this.drawLayer ||= new _draw_layer_builder_js__WEBPACK_IMPORTED_MODULE_6__.DrawLayerBuilder({
  7453. pageIndex: this.id
  7454. });
  7455. await this.#renderDrawLayer();
  7456. this.drawLayer.setParent(canvasWrapper);
  7457. if (!this.annotationEditorLayer) {
  7458. this.annotationEditorLayer = new _annotation_editor_layer_builder_js__WEBPACK_IMPORTED_MODULE_3__.AnnotationEditorLayerBuilder({
  7459. uiManager: annotationEditorUIManager,
  7460. pdfPage,
  7461. l10n,
  7462. accessibilityManager: this._accessibilityManager,
  7463. annotationLayer: this.annotationLayer?.annotationLayer,
  7464. textLayer: this.textLayer,
  7465. drawLayer: this.drawLayer.getDrawLayer(),
  7466. onAppend: annotationEditorLayerDiv => {
  7467. this.#addLayer(annotationEditorLayerDiv, "annotationEditorLayer");
  7468. }
  7469. });
  7470. }
  7471. this.#renderAnnotationEditorLayer();
  7472. }, error => {
  7473. if (!(error instanceof pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.RenderingCancelledException)) {
  7474. showCanvas?.(true);
  7475. }
  7476. return this.#finishRenderTask(renderTask, error);
  7477. });
  7478. if (pdfPage.isPureXfa) {
  7479. if (!this.xfaLayer) {
  7480. const {
  7481. annotationStorage,
  7482. linkService
  7483. } = this.#layerProperties;
  7484. this.xfaLayer = new _xfa_layer_builder_js__WEBPACK_IMPORTED_MODULE_13__.XfaLayerBuilder({
  7485. pdfPage,
  7486. annotationStorage,
  7487. linkService
  7488. });
  7489. }
  7490. this.#renderXfaLayer();
  7491. }
  7492. div.setAttribute("data-loaded", true);
  7493. this.eventBus.dispatch("pagerender", {
  7494. source: this,
  7495. pageNumber: this.id
  7496. });
  7497. return resultPromise;
  7498. }
  7499. setPageLabel(label) {
  7500. this.pageLabel = typeof label === "string" ? label : null;
  7501. this.div.setAttribute("data-l10n-args", JSON.stringify({
  7502. page: this.pageLabel ?? this.id
  7503. }));
  7504. if (this.pageLabel !== null) {
  7505. this.div.setAttribute("data-page-label", this.pageLabel);
  7506. } else {
  7507. this.div.removeAttribute("data-page-label");
  7508. }
  7509. }
  7510. get thumbnailCanvas() {
  7511. const {
  7512. directDrawing,
  7513. initialOptionalContent,
  7514. regularAnnotations
  7515. } = this.#useThumbnailCanvas;
  7516. return directDrawing && initialOptionalContent && regularAnnotations ? this.canvas : null;
  7517. }
  7518. }
  7519. __webpack_async_result__();
  7520. } catch(e) { __webpack_async_result__(e); } });
  7521. /***/ }),
  7522. /***/ 6615:
  7523. /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
  7524. __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
  7525. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  7526. /* harmony export */ PDFRenderingQueue: () => (/* binding */ PDFRenderingQueue)
  7527. /* harmony export */ });
  7528. /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2603);
  7529. /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7256);
  7530. var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__]);
  7531. pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
  7532. const CLEANUP_TIMEOUT = 30000;
  7533. class PDFRenderingQueue {
  7534. constructor() {
  7535. this.pdfViewer = null;
  7536. this.pdfThumbnailViewer = null;
  7537. this.onIdle = null;
  7538. this.highestPriorityPage = null;
  7539. this.idleTimeout = null;
  7540. this.printing = false;
  7541. this.isThumbnailViewEnabled = false;
  7542. Object.defineProperty(this, "hasViewer", {
  7543. value: () => !!this.pdfViewer
  7544. });
  7545. }
  7546. setViewer(pdfViewer) {
  7547. this.pdfViewer = pdfViewer;
  7548. }
  7549. setThumbnailViewer(pdfThumbnailViewer) {
  7550. this.pdfThumbnailViewer = pdfThumbnailViewer;
  7551. }
  7552. isHighestPriority(view) {
  7553. return this.highestPriorityPage === view.renderingId;
  7554. }
  7555. renderHighestPriority(currentlyVisiblePages) {
  7556. if (this.idleTimeout) {
  7557. clearTimeout(this.idleTimeout);
  7558. this.idleTimeout = null;
  7559. }
  7560. if (this.pdfViewer.forceRendering(currentlyVisiblePages)) {
  7561. return;
  7562. }
  7563. if (this.isThumbnailViewEnabled && this.pdfThumbnailViewer?.forceRendering()) {
  7564. return;
  7565. }
  7566. if (this.printing) {
  7567. return;
  7568. }
  7569. if (this.onIdle) {
  7570. this.idleTimeout = setTimeout(this.onIdle.bind(this), CLEANUP_TIMEOUT);
  7571. }
  7572. }
  7573. getHighestPriority(visible, views, scrolledDown, preRenderExtra = false) {
  7574. const visibleViews = visible.views,
  7575. numVisible = visibleViews.length;
  7576. if (numVisible === 0) {
  7577. return null;
  7578. }
  7579. for (let i = 0; i < numVisible; i++) {
  7580. const view = visibleViews[i].view;
  7581. if (!this.isViewFinished(view)) {
  7582. return view;
  7583. }
  7584. }
  7585. const firstId = visible.first.id,
  7586. lastId = visible.last.id;
  7587. if (lastId - firstId + 1 > numVisible) {
  7588. const visibleIds = visible.ids;
  7589. for (let i = 1, ii = lastId - firstId; i < ii; i++) {
  7590. const holeId = scrolledDown ? firstId + i : lastId - i;
  7591. if (visibleIds.has(holeId)) {
  7592. continue;
  7593. }
  7594. const holeView = views[holeId - 1];
  7595. if (!this.isViewFinished(holeView)) {
  7596. return holeView;
  7597. }
  7598. }
  7599. }
  7600. let preRenderIndex = scrolledDown ? lastId : firstId - 2;
  7601. let preRenderView = views[preRenderIndex];
  7602. if (preRenderView && !this.isViewFinished(preRenderView)) {
  7603. return preRenderView;
  7604. }
  7605. if (preRenderExtra) {
  7606. preRenderIndex += scrolledDown ? 1 : -1;
  7607. preRenderView = views[preRenderIndex];
  7608. if (preRenderView && !this.isViewFinished(preRenderView)) {
  7609. return preRenderView;
  7610. }
  7611. }
  7612. return null;
  7613. }
  7614. isViewFinished(view) {
  7615. return view.renderingState === _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__.RenderingStates.FINISHED;
  7616. }
  7617. renderView(view) {
  7618. switch (view.renderingState) {
  7619. case _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__.RenderingStates.FINISHED:
  7620. return false;
  7621. case _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__.RenderingStates.PAUSED:
  7622. this.highestPriorityPage = view.renderingId;
  7623. view.resume();
  7624. break;
  7625. case _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__.RenderingStates.RUNNING:
  7626. this.highestPriorityPage = view.renderingId;
  7627. break;
  7628. case _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__.RenderingStates.INITIAL:
  7629. this.highestPriorityPage = view.renderingId;
  7630. view.draw().finally(() => {
  7631. this.renderHighestPriority();
  7632. }).catch(reason => {
  7633. if (reason instanceof pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.RenderingCancelledException) {
  7634. return;
  7635. }
  7636. console.error(`renderView: "${reason}"`);
  7637. });
  7638. break;
  7639. }
  7640. return true;
  7641. }
  7642. }
  7643. __webpack_async_result__();
  7644. } catch(e) { __webpack_async_result__(e); } });
  7645. /***/ }),
  7646. /***/ 2371:
  7647. /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
  7648. __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
  7649. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  7650. /* harmony export */ PDFScriptingManager: () => (/* binding */ PDFScriptingManagerComponents)
  7651. /* harmony export */ });
  7652. /* harmony import */ var _generic_scripting_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(289);
  7653. /* harmony import */ var _pdf_scripting_manager_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5942);
  7654. var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_generic_scripting_js__WEBPACK_IMPORTED_MODULE_0__, _pdf_scripting_manager_js__WEBPACK_IMPORTED_MODULE_1__]);
  7655. ([_generic_scripting_js__WEBPACK_IMPORTED_MODULE_0__, _pdf_scripting_manager_js__WEBPACK_IMPORTED_MODULE_1__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
  7656. class PDFScriptingManagerComponents extends _pdf_scripting_manager_js__WEBPACK_IMPORTED_MODULE_1__.PDFScriptingManager {
  7657. constructor(options) {
  7658. if (!options.externalServices) {
  7659. window.addEventListener("updatefromsandbox", event => {
  7660. options.eventBus.dispatch("updatefromsandbox", {
  7661. source: window,
  7662. detail: event.detail
  7663. });
  7664. });
  7665. }
  7666. options.externalServices ||= {
  7667. createScripting: () => new _generic_scripting_js__WEBPACK_IMPORTED_MODULE_0__.GenericScripting(options.sandboxBundleSrc)
  7668. };
  7669. options.docProperties ||= pdfDocument => (0,_generic_scripting_js__WEBPACK_IMPORTED_MODULE_0__.docProperties)(pdfDocument);
  7670. super(options);
  7671. }
  7672. }
  7673. __webpack_async_result__();
  7674. } catch(e) { __webpack_async_result__(e); } });
  7675. /***/ }),
  7676. /***/ 5942:
  7677. /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
  7678. __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
  7679. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  7680. /* harmony export */ PDFScriptingManager: () => (/* binding */ PDFScriptingManager)
  7681. /* harmony export */ });
  7682. /* harmony import */ var core_js_modules_es_promise_with_resolvers_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4628);
  7683. /* harmony import */ var core_js_modules_esnext_set_difference_v2_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3375);
  7684. /* harmony import */ var core_js_modules_esnext_set_intersection_v2_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9225);
  7685. /* harmony import */ var core_js_modules_esnext_set_is_disjoint_from_v2_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3972);
  7686. /* harmony import */ var core_js_modules_esnext_set_is_subset_of_v2_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9209);
  7687. /* harmony import */ var core_js_modules_esnext_set_is_superset_of_v2_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5714);
  7688. /* harmony import */ var core_js_modules_esnext_set_symmetric_difference_v2_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7561);
  7689. /* harmony import */ var core_js_modules_esnext_set_union_v2_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(6197);
  7690. /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(7256);
  7691. /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(2603);
  7692. var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_9__]);
  7693. pdfjs_lib__WEBPACK_IMPORTED_MODULE_9__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
  7694. class PDFScriptingManager {
  7695. #closeCapability = null;
  7696. #destroyCapability = null;
  7697. #docProperties = null;
  7698. #eventAbortController = null;
  7699. #eventBus = null;
  7700. #externalServices = null;
  7701. #pdfDocument = null;
  7702. #pdfViewer = null;
  7703. #ready = false;
  7704. #scripting = null;
  7705. #willPrintCapability = null;
  7706. constructor({
  7707. eventBus,
  7708. externalServices = null,
  7709. docProperties = null
  7710. }) {
  7711. this.#eventBus = eventBus;
  7712. this.#externalServices = externalServices;
  7713. this.#docProperties = docProperties;
  7714. }
  7715. setViewer(pdfViewer) {
  7716. this.#pdfViewer = pdfViewer;
  7717. }
  7718. async setDocument(pdfDocument) {
  7719. if (this.#pdfDocument) {
  7720. await this.#destroyScripting();
  7721. }
  7722. this.#pdfDocument = pdfDocument;
  7723. if (!pdfDocument) {
  7724. return;
  7725. }
  7726. const [objects, calculationOrder, docActions] = await Promise.all([pdfDocument.getFieldObjects(), pdfDocument.getCalculationOrderIds(), pdfDocument.getJSActions()]);
  7727. if (!objects && !docActions) {
  7728. await this.#destroyScripting();
  7729. return;
  7730. }
  7731. if (pdfDocument !== this.#pdfDocument) {
  7732. return;
  7733. }
  7734. try {
  7735. this.#scripting = this.#initScripting();
  7736. } catch (error) {
  7737. console.error(`setDocument: "${error.message}".`);
  7738. await this.#destroyScripting();
  7739. return;
  7740. }
  7741. const eventBus = this.#eventBus;
  7742. this.#eventAbortController = new AbortController();
  7743. const {
  7744. signal
  7745. } = this.#eventAbortController;
  7746. eventBus._on("updatefromsandbox", event => {
  7747. if (event?.source === window) {
  7748. this.#updateFromSandbox(event.detail);
  7749. }
  7750. }, {
  7751. signal
  7752. });
  7753. eventBus._on("dispatcheventinsandbox", event => {
  7754. this.#scripting?.dispatchEventInSandbox(event.detail);
  7755. }, {
  7756. signal
  7757. });
  7758. eventBus._on("pagechanging", ({
  7759. pageNumber,
  7760. previous
  7761. }) => {
  7762. if (pageNumber === previous) {
  7763. return;
  7764. }
  7765. this.#dispatchPageClose(previous);
  7766. this.#dispatchPageOpen(pageNumber);
  7767. }, {
  7768. signal
  7769. });
  7770. eventBus._on("pagerendered", ({
  7771. pageNumber
  7772. }) => {
  7773. if (!this._pageOpenPending.has(pageNumber)) {
  7774. return;
  7775. }
  7776. if (pageNumber !== this.#pdfViewer.currentPageNumber) {
  7777. return;
  7778. }
  7779. this.#dispatchPageOpen(pageNumber);
  7780. }, {
  7781. signal
  7782. });
  7783. eventBus._on("pagesdestroy", async () => {
  7784. await this.#dispatchPageClose(this.#pdfViewer.currentPageNumber);
  7785. await this.#scripting?.dispatchEventInSandbox({
  7786. id: "doc",
  7787. name: "WillClose"
  7788. });
  7789. this.#closeCapability?.resolve();
  7790. }, {
  7791. signal
  7792. });
  7793. try {
  7794. const docProperties = await this.#docProperties(pdfDocument);
  7795. if (pdfDocument !== this.#pdfDocument) {
  7796. return;
  7797. }
  7798. await this.#scripting.createSandbox({
  7799. objects,
  7800. calculationOrder,
  7801. appInfo: {
  7802. platform: navigator.platform,
  7803. language: navigator.language
  7804. },
  7805. docInfo: {
  7806. ...docProperties,
  7807. actions: docActions
  7808. }
  7809. });
  7810. eventBus.dispatch("sandboxcreated", {
  7811. source: this
  7812. });
  7813. } catch (error) {
  7814. console.error(`setDocument: "${error.message}".`);
  7815. await this.#destroyScripting();
  7816. return;
  7817. }
  7818. await this.#scripting?.dispatchEventInSandbox({
  7819. id: "doc",
  7820. name: "Open"
  7821. });
  7822. await this.#dispatchPageOpen(this.#pdfViewer.currentPageNumber, true);
  7823. Promise.resolve().then(() => {
  7824. if (pdfDocument === this.#pdfDocument) {
  7825. this.#ready = true;
  7826. }
  7827. });
  7828. }
  7829. async dispatchWillSave() {
  7830. return this.#scripting?.dispatchEventInSandbox({
  7831. id: "doc",
  7832. name: "WillSave"
  7833. });
  7834. }
  7835. async dispatchDidSave() {
  7836. return this.#scripting?.dispatchEventInSandbox({
  7837. id: "doc",
  7838. name: "DidSave"
  7839. });
  7840. }
  7841. async dispatchWillPrint() {
  7842. if (!this.#scripting) {
  7843. return;
  7844. }
  7845. await this.#willPrintCapability?.promise;
  7846. this.#willPrintCapability = Promise.withResolvers();
  7847. try {
  7848. await this.#scripting.dispatchEventInSandbox({
  7849. id: "doc",
  7850. name: "WillPrint"
  7851. });
  7852. } catch (ex) {
  7853. this.#willPrintCapability.resolve();
  7854. this.#willPrintCapability = null;
  7855. throw ex;
  7856. }
  7857. await this.#willPrintCapability.promise;
  7858. }
  7859. async dispatchDidPrint() {
  7860. return this.#scripting?.dispatchEventInSandbox({
  7861. id: "doc",
  7862. name: "DidPrint"
  7863. });
  7864. }
  7865. get destroyPromise() {
  7866. return this.#destroyCapability?.promise || null;
  7867. }
  7868. get ready() {
  7869. return this.#ready;
  7870. }
  7871. get _pageOpenPending() {
  7872. return (0,pdfjs_lib__WEBPACK_IMPORTED_MODULE_9__.shadow)(this, "_pageOpenPending", new Set());
  7873. }
  7874. get _visitedPages() {
  7875. return (0,pdfjs_lib__WEBPACK_IMPORTED_MODULE_9__.shadow)(this, "_visitedPages", new Map());
  7876. }
  7877. async #updateFromSandbox(detail) {
  7878. const pdfViewer = this.#pdfViewer;
  7879. const isInPresentationMode = pdfViewer.isInPresentationMode || pdfViewer.isChangingPresentationMode;
  7880. const {
  7881. id,
  7882. siblings,
  7883. command,
  7884. value
  7885. } = detail;
  7886. if (!id) {
  7887. switch (command) {
  7888. case "clear":
  7889. console.clear();
  7890. break;
  7891. case "error":
  7892. console.error(value);
  7893. break;
  7894. case "layout":
  7895. if (!isInPresentationMode) {
  7896. const modes = (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_8__.apiPageLayoutToViewerModes)(value);
  7897. pdfViewer.spreadMode = modes.spreadMode;
  7898. }
  7899. break;
  7900. case "page-num":
  7901. pdfViewer.currentPageNumber = value + 1;
  7902. break;
  7903. case "print":
  7904. await pdfViewer.pagesPromise;
  7905. this.#eventBus.dispatch("print", {
  7906. source: this
  7907. });
  7908. break;
  7909. case "println":
  7910. console.log(value);
  7911. break;
  7912. case "zoom":
  7913. if (!isInPresentationMode) {
  7914. pdfViewer.currentScaleValue = value;
  7915. }
  7916. break;
  7917. case "SaveAs":
  7918. this.#eventBus.dispatch("download", {
  7919. source: this
  7920. });
  7921. break;
  7922. case "FirstPage":
  7923. pdfViewer.currentPageNumber = 1;
  7924. break;
  7925. case "LastPage":
  7926. pdfViewer.currentPageNumber = pdfViewer.pagesCount;
  7927. break;
  7928. case "NextPage":
  7929. pdfViewer.nextPage();
  7930. break;
  7931. case "PrevPage":
  7932. pdfViewer.previousPage();
  7933. break;
  7934. case "ZoomViewIn":
  7935. if (!isInPresentationMode) {
  7936. pdfViewer.increaseScale();
  7937. }
  7938. break;
  7939. case "ZoomViewOut":
  7940. if (!isInPresentationMode) {
  7941. pdfViewer.decreaseScale();
  7942. }
  7943. break;
  7944. case "WillPrintFinished":
  7945. this.#willPrintCapability?.resolve();
  7946. this.#willPrintCapability = null;
  7947. break;
  7948. }
  7949. return;
  7950. }
  7951. if (isInPresentationMode && detail.focus) {
  7952. return;
  7953. }
  7954. delete detail.id;
  7955. delete detail.siblings;
  7956. const ids = siblings ? [id, ...siblings] : [id];
  7957. for (const elementId of ids) {
  7958. const element = document.querySelector(`[data-element-id="${elementId}"]`);
  7959. if (element) {
  7960. element.dispatchEvent(new CustomEvent("updatefromsandbox", {
  7961. detail
  7962. }));
  7963. } else {
  7964. this.#pdfDocument?.annotationStorage.setValue(elementId, detail);
  7965. }
  7966. }
  7967. }
  7968. async #dispatchPageOpen(pageNumber, initialize = false) {
  7969. const pdfDocument = this.#pdfDocument,
  7970. visitedPages = this._visitedPages;
  7971. if (initialize) {
  7972. this.#closeCapability = Promise.withResolvers();
  7973. }
  7974. if (!this.#closeCapability) {
  7975. return;
  7976. }
  7977. const pageView = this.#pdfViewer.getPageView(pageNumber - 1);
  7978. if (pageView?.renderingState !== _ui_utils_js__WEBPACK_IMPORTED_MODULE_8__.RenderingStates.FINISHED) {
  7979. this._pageOpenPending.add(pageNumber);
  7980. return;
  7981. }
  7982. this._pageOpenPending.delete(pageNumber);
  7983. const actionsPromise = (async () => {
  7984. const actions = await (!visitedPages.has(pageNumber) ? pageView.pdfPage?.getJSActions() : null);
  7985. if (pdfDocument !== this.#pdfDocument) {
  7986. return;
  7987. }
  7988. await this.#scripting?.dispatchEventInSandbox({
  7989. id: "page",
  7990. name: "PageOpen",
  7991. pageNumber,
  7992. actions
  7993. });
  7994. })();
  7995. visitedPages.set(pageNumber, actionsPromise);
  7996. }
  7997. async #dispatchPageClose(pageNumber) {
  7998. const pdfDocument = this.#pdfDocument,
  7999. visitedPages = this._visitedPages;
  8000. if (!this.#closeCapability) {
  8001. return;
  8002. }
  8003. if (this._pageOpenPending.has(pageNumber)) {
  8004. return;
  8005. }
  8006. const actionsPromise = visitedPages.get(pageNumber);
  8007. if (!actionsPromise) {
  8008. return;
  8009. }
  8010. visitedPages.set(pageNumber, null);
  8011. await actionsPromise;
  8012. if (pdfDocument !== this.#pdfDocument) {
  8013. return;
  8014. }
  8015. await this.#scripting?.dispatchEventInSandbox({
  8016. id: "page",
  8017. name: "PageClose",
  8018. pageNumber
  8019. });
  8020. }
  8021. #initScripting() {
  8022. this.#destroyCapability = Promise.withResolvers();
  8023. if (this.#scripting) {
  8024. throw new Error("#initScripting: Scripting already exists.");
  8025. }
  8026. return this.#externalServices.createScripting();
  8027. }
  8028. async #destroyScripting() {
  8029. if (!this.#scripting) {
  8030. this.#pdfDocument = null;
  8031. this.#destroyCapability?.resolve();
  8032. return;
  8033. }
  8034. if (this.#closeCapability) {
  8035. await Promise.race([this.#closeCapability.promise, new Promise(resolve => {
  8036. setTimeout(resolve, 1000);
  8037. })]).catch(() => {});
  8038. this.#closeCapability = null;
  8039. }
  8040. this.#pdfDocument = null;
  8041. try {
  8042. await this.#scripting.destroySandbox();
  8043. } catch {}
  8044. this.#willPrintCapability?.reject(new Error("Scripting destroyed."));
  8045. this.#willPrintCapability = null;
  8046. this.#eventAbortController?.abort();
  8047. this.#eventAbortController = null;
  8048. this._pageOpenPending.clear();
  8049. this._visitedPages.clear();
  8050. this.#scripting = null;
  8051. this.#ready = false;
  8052. this.#destroyCapability?.resolve();
  8053. }
  8054. }
  8055. __webpack_async_result__();
  8056. } catch(e) { __webpack_async_result__(e); } });
  8057. /***/ }),
  8058. /***/ 1838:
  8059. /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
  8060. __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
  8061. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  8062. /* harmony export */ PDFSinglePageViewer: () => (/* binding */ PDFSinglePageViewer)
  8063. /* harmony export */ });
  8064. /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7256);
  8065. /* harmony import */ var _pdf_viewer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6285);
  8066. var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_pdf_viewer_js__WEBPACK_IMPORTED_MODULE_1__]);
  8067. _pdf_viewer_js__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
  8068. class PDFSinglePageViewer extends _pdf_viewer_js__WEBPACK_IMPORTED_MODULE_1__.PDFViewer {
  8069. _resetView() {
  8070. super._resetView();
  8071. this._scrollMode = _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.ScrollMode.PAGE;
  8072. this._spreadMode = _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.SpreadMode.NONE;
  8073. }
  8074. set scrollMode(mode) {}
  8075. _updateScrollMode() {}
  8076. set spreadMode(mode) {}
  8077. _updateSpreadMode() {}
  8078. }
  8079. __webpack_async_result__();
  8080. } catch(e) { __webpack_async_result__(e); } });
  8081. /***/ }),
  8082. /***/ 624:
  8083. /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
  8084. __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
  8085. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  8086. /* harmony export */ AnnotationLayerBuilder: () => (/* reexport safe */ _annotation_layer_builder_js__WEBPACK_IMPORTED_MODULE_3__.AnnotationLayerBuilder),
  8087. /* harmony export */ DownloadManager: () => (/* reexport safe */ _download_manager_js__WEBPACK_IMPORTED_MODULE_4__.DownloadManager),
  8088. /* harmony export */ EventBus: () => (/* reexport safe */ _event_utils_js__WEBPACK_IMPORTED_MODULE_5__.EventBus),
  8089. /* harmony export */ FindState: () => (/* reexport safe */ _pdf_find_controller_js__WEBPACK_IMPORTED_MODULE_0__.FindState),
  8090. /* harmony export */ GenericL10n: () => (/* reexport safe */ _genericl10n_js__WEBPACK_IMPORTED_MODULE_6__.GenericL10n),
  8091. /* harmony export */ LinkTarget: () => (/* reexport safe */ _pdf_link_service_js__WEBPACK_IMPORTED_MODULE_1__.LinkTarget),
  8092. /* harmony export */ PDFFindController: () => (/* reexport safe */ _pdf_find_controller_js__WEBPACK_IMPORTED_MODULE_0__.PDFFindController),
  8093. /* harmony export */ PDFHistory: () => (/* reexport safe */ _pdf_history_js__WEBPACK_IMPORTED_MODULE_7__.PDFHistory),
  8094. /* harmony export */ PDFLinkService: () => (/* reexport safe */ _pdf_link_service_js__WEBPACK_IMPORTED_MODULE_1__.PDFLinkService),
  8095. /* harmony export */ PDFPageView: () => (/* reexport safe */ _pdf_page_view_js__WEBPACK_IMPORTED_MODULE_8__.PDFPageView),
  8096. /* harmony export */ PDFScriptingManager: () => (/* reexport safe */ _pdf_scripting_manager_component_js__WEBPACK_IMPORTED_MODULE_9__.PDFScriptingManager),
  8097. /* harmony export */ PDFSinglePageViewer: () => (/* reexport safe */ _pdf_single_page_viewer_js__WEBPACK_IMPORTED_MODULE_10__.PDFSinglePageViewer),
  8098. /* harmony export */ PDFViewer: () => (/* reexport safe */ _pdf_viewer_js__WEBPACK_IMPORTED_MODULE_11__.PDFViewer),
  8099. /* harmony export */ ProgressBar: () => (/* reexport safe */ _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.ProgressBar),
  8100. /* harmony export */ RenderingStates: () => (/* reexport safe */ _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.RenderingStates),
  8101. /* harmony export */ ScrollMode: () => (/* reexport safe */ _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.ScrollMode),
  8102. /* harmony export */ SimpleLinkService: () => (/* reexport safe */ _pdf_link_service_js__WEBPACK_IMPORTED_MODULE_1__.SimpleLinkService),
  8103. /* harmony export */ SpreadMode: () => (/* reexport safe */ _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.SpreadMode),
  8104. /* harmony export */ StructTreeLayerBuilder: () => (/* reexport safe */ _struct_tree_layer_builder_js__WEBPACK_IMPORTED_MODULE_12__.StructTreeLayerBuilder),
  8105. /* harmony export */ TextLayerBuilder: () => (/* reexport safe */ _text_layer_builder_js__WEBPACK_IMPORTED_MODULE_13__.TextLayerBuilder),
  8106. /* harmony export */ XfaLayerBuilder: () => (/* reexport safe */ _xfa_layer_builder_js__WEBPACK_IMPORTED_MODULE_14__.XfaLayerBuilder),
  8107. /* harmony export */ parseQueryString: () => (/* reexport safe */ _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.parseQueryString)
  8108. /* harmony export */ });
  8109. /* harmony import */ var _pdf_find_controller_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9814);
  8110. /* harmony import */ var _pdf_link_service_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(787);
  8111. /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7256);
  8112. /* harmony import */ var _annotation_layer_builder_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2707);
  8113. /* harmony import */ var _download_manager_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1544);
  8114. /* harmony import */ var _event_utils_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5656);
  8115. /* harmony import */ var _genericl10n_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(410);
  8116. /* harmony import */ var _pdf_history_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(8543);
  8117. /* harmony import */ var _pdf_page_view_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(9966);
  8118. /* harmony import */ var _pdf_scripting_manager_component_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(2371);
  8119. /* harmony import */ var _pdf_single_page_viewer_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(1838);
  8120. /* harmony import */ var _pdf_viewer_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(6285);
  8121. /* harmony import */ var _struct_tree_layer_builder_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(6698);
  8122. /* harmony import */ var _text_layer_builder_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(7765);
  8123. /* harmony import */ var _xfa_layer_builder_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(2973);
  8124. var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_annotation_layer_builder_js__WEBPACK_IMPORTED_MODULE_3__, _download_manager_js__WEBPACK_IMPORTED_MODULE_4__, _genericl10n_js__WEBPACK_IMPORTED_MODULE_6__, _pdf_page_view_js__WEBPACK_IMPORTED_MODULE_8__, _pdf_scripting_manager_component_js__WEBPACK_IMPORTED_MODULE_9__, _pdf_single_page_viewer_js__WEBPACK_IMPORTED_MODULE_10__, _pdf_viewer_js__WEBPACK_IMPORTED_MODULE_11__, _text_layer_builder_js__WEBPACK_IMPORTED_MODULE_13__, _xfa_layer_builder_js__WEBPACK_IMPORTED_MODULE_14__]);
  8125. ([_annotation_layer_builder_js__WEBPACK_IMPORTED_MODULE_3__, _download_manager_js__WEBPACK_IMPORTED_MODULE_4__, _genericl10n_js__WEBPACK_IMPORTED_MODULE_6__, _pdf_page_view_js__WEBPACK_IMPORTED_MODULE_8__, _pdf_scripting_manager_component_js__WEBPACK_IMPORTED_MODULE_9__, _pdf_single_page_viewer_js__WEBPACK_IMPORTED_MODULE_10__, _pdf_viewer_js__WEBPACK_IMPORTED_MODULE_11__, _text_layer_builder_js__WEBPACK_IMPORTED_MODULE_13__, _xfa_layer_builder_js__WEBPACK_IMPORTED_MODULE_14__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
  8126. const pdfjsVersion = "4.2.67";
  8127. const pdfjsBuild = "49b388101";
  8128. __webpack_async_result__();
  8129. } catch(e) { __webpack_async_result__(e); } });
  8130. /***/ }),
  8131. /***/ 6285:
  8132. /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
  8133. __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
  8134. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  8135. /* harmony export */ PDFViewer: () => (/* binding */ PDFViewer)
  8136. /* harmony export */ });
  8137. /* unused harmony exports PagesCountLimit, PDFPageViewBuffer */
  8138. /* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4114);
  8139. /* harmony import */ var core_js_modules_es_promise_with_resolvers_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4628);
  8140. /* harmony import */ var core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8992);
  8141. /* harmony import */ var core_js_modules_esnext_iterator_every_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3215);
  8142. /* harmony import */ var core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1454);
  8143. /* harmony import */ var core_js_modules_esnext_set_difference_v2_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(3375);
  8144. /* harmony import */ var core_js_modules_esnext_set_intersection_v2_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(9225);
  8145. /* harmony import */ var core_js_modules_esnext_set_is_disjoint_from_v2_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(3972);
  8146. /* harmony import */ var core_js_modules_esnext_set_is_subset_of_v2_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(9209);
  8147. /* harmony import */ var core_js_modules_esnext_set_is_superset_of_v2_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(5714);
  8148. /* harmony import */ var core_js_modules_esnext_set_symmetric_difference_v2_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(7561);
  8149. /* harmony import */ var core_js_modules_esnext_set_union_v2_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(6197);
  8150. /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(2603);
  8151. /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(7256);
  8152. /* harmony import */ var web_null_l10n__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(410);
  8153. /* harmony import */ var _pdf_page_view_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(9966);
  8154. /* harmony import */ var _pdf_rendering_queue_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(6615);
  8155. /* harmony import */ var _pdf_link_service_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(787);
  8156. var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__, web_null_l10n__WEBPACK_IMPORTED_MODULE_14__, _pdf_page_view_js__WEBPACK_IMPORTED_MODULE_15__, _pdf_rendering_queue_js__WEBPACK_IMPORTED_MODULE_16__]);
  8157. ([pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__, web_null_l10n__WEBPACK_IMPORTED_MODULE_14__, _pdf_page_view_js__WEBPACK_IMPORTED_MODULE_15__, _pdf_rendering_queue_js__WEBPACK_IMPORTED_MODULE_16__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
  8158. const DEFAULT_CACHE_SIZE = 10;
  8159. const PagesCountLimit = {
  8160. FORCE_SCROLL_MODE_PAGE: 15000,
  8161. FORCE_LAZY_PAGE_INIT: 7500,
  8162. PAUSE_EAGER_PAGE_INIT: 250
  8163. };
  8164. function isValidAnnotationEditorMode(mode) {
  8165. return Object.values(pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.AnnotationEditorType).includes(mode) && mode !== pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.AnnotationEditorType.DISABLE;
  8166. }
  8167. class PDFPageViewBuffer {
  8168. #buf = new Set();
  8169. #size = 0;
  8170. constructor(size) {
  8171. this.#size = size;
  8172. }
  8173. push(view) {
  8174. const buf = this.#buf;
  8175. if (buf.has(view)) {
  8176. buf.delete(view);
  8177. }
  8178. buf.add(view);
  8179. if (buf.size > this.#size) {
  8180. this.#destroyFirstView();
  8181. }
  8182. }
  8183. resize(newSize, idsToKeep = null) {
  8184. this.#size = newSize;
  8185. const buf = this.#buf;
  8186. if (idsToKeep) {
  8187. const ii = buf.size;
  8188. let i = 1;
  8189. for (const view of buf) {
  8190. if (idsToKeep.has(view.id)) {
  8191. buf.delete(view);
  8192. buf.add(view);
  8193. }
  8194. if (++i > ii) {
  8195. break;
  8196. }
  8197. }
  8198. }
  8199. while (buf.size > this.#size) {
  8200. this.#destroyFirstView();
  8201. }
  8202. }
  8203. has(view) {
  8204. return this.#buf.has(view);
  8205. }
  8206. [Symbol.iterator]() {
  8207. return this.#buf.keys();
  8208. }
  8209. #destroyFirstView() {
  8210. const firstView = this.#buf.keys().next().value;
  8211. firstView?.destroy();
  8212. this.#buf.delete(firstView);
  8213. }
  8214. }
  8215. class PDFViewer {
  8216. #buffer = null;
  8217. #altTextManager = null;
  8218. #annotationEditorHighlightColors = null;
  8219. #annotationEditorMode = pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.AnnotationEditorType.NONE;
  8220. #annotationEditorUIManager = null;
  8221. #annotationMode = pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.AnnotationMode.ENABLE_FORMS;
  8222. #containerTopLeft = null;
  8223. #copyCallbackBound = null;
  8224. #enableHighlightFloatingButton = false;
  8225. #enablePermissions = false;
  8226. #mlManager = null;
  8227. #getAllTextInProgress = false;
  8228. #hiddenCopyElement = null;
  8229. #interruptCopyCondition = false;
  8230. #previousContainerHeight = 0;
  8231. #resizeObserver = new ResizeObserver(this.#resizeObserverCallback.bind(this));
  8232. #scrollModePageState = null;
  8233. #onVisibilityChange = null;
  8234. #scaleTimeoutId = null;
  8235. #textLayerMode = _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.TextLayerMode.ENABLE;
  8236. constructor(options) {
  8237. const viewerVersion = "4.2.67";
  8238. if (pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.version !== viewerVersion) {
  8239. throw new Error(`The API version "${pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.version}" does not match the Viewer version "${viewerVersion}".`);
  8240. }
  8241. this.container = options.container;
  8242. this.viewer = options.viewer || options.container.firstElementChild;
  8243. if (this.container?.tagName !== "DIV" || this.viewer?.tagName !== "DIV") {
  8244. throw new Error("Invalid `container` and/or `viewer` option.");
  8245. }
  8246. if (this.container.offsetParent && getComputedStyle(this.container).position !== "absolute") {
  8247. throw new Error("The `container` must be absolutely positioned.");
  8248. }
  8249. this.#resizeObserver.observe(this.container);
  8250. this.eventBus = options.eventBus;
  8251. this.linkService = options.linkService || new _pdf_link_service_js__WEBPACK_IMPORTED_MODULE_17__.SimpleLinkService();
  8252. this.downloadManager = options.downloadManager || null;
  8253. this.findController = options.findController || null;
  8254. this.#altTextManager = options.altTextManager || null;
  8255. if (this.findController) {
  8256. this.findController.onIsPageVisible = pageNumber => this._getVisiblePages().ids.has(pageNumber);
  8257. }
  8258. this._scriptingManager = options.scriptingManager || null;
  8259. this.#textLayerMode = options.textLayerMode ?? _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.TextLayerMode.ENABLE;
  8260. this.#annotationMode = options.annotationMode ?? pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.AnnotationMode.ENABLE_FORMS;
  8261. this.#annotationEditorMode = options.annotationEditorMode ?? pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.AnnotationEditorType.NONE;
  8262. this.#annotationEditorHighlightColors = options.annotationEditorHighlightColors || null;
  8263. this.#enableHighlightFloatingButton = options.enableHighlightFloatingButton === true;
  8264. this.imageResourcesPath = options.imageResourcesPath || "";
  8265. this.enablePrintAutoRotate = options.enablePrintAutoRotate || false;
  8266. this.removePageBorders = options.removePageBorders || false;
  8267. this.maxCanvasPixels = options.maxCanvasPixels;
  8268. this.l10n = options.l10n;
  8269. this.l10n ||= new web_null_l10n__WEBPACK_IMPORTED_MODULE_14__.GenericL10n();
  8270. this.#enablePermissions = options.enablePermissions || false;
  8271. this.pageColors = options.pageColors || null;
  8272. this.#mlManager = options.mlManager || null;
  8273. this.defaultRenderingQueue = !options.renderingQueue;
  8274. if (this.defaultRenderingQueue) {
  8275. this.renderingQueue = new _pdf_rendering_queue_js__WEBPACK_IMPORTED_MODULE_16__.PDFRenderingQueue();
  8276. this.renderingQueue.setViewer(this);
  8277. } else {
  8278. this.renderingQueue = options.renderingQueue;
  8279. }
  8280. this.scroll = (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.watchScroll)(this.container, this._scrollUpdate.bind(this));
  8281. this.presentationModeState = _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.PresentationModeState.UNKNOWN;
  8282. this._onBeforeDraw = this._onAfterDraw = null;
  8283. this._resetView();
  8284. if (this.removePageBorders) {
  8285. this.viewer.classList.add("removePageBorders");
  8286. }
  8287. this.#updateContainerHeightCss();
  8288. this.eventBus._on("thumbnailrendered", ({
  8289. pageNumber,
  8290. pdfPage
  8291. }) => {
  8292. const pageView = this._pages[pageNumber - 1];
  8293. if (!this.#buffer.has(pageView)) {
  8294. pdfPage?.cleanup();
  8295. }
  8296. });
  8297. if (!options.l10n) {
  8298. this.l10n.translate(this.container);
  8299. }
  8300. }
  8301. get pagesCount() {
  8302. return this._pages.length;
  8303. }
  8304. getPageView(index) {
  8305. return this._pages[index];
  8306. }
  8307. getCachedPageViews() {
  8308. return new Set(this.#buffer);
  8309. }
  8310. get pageViewsReady() {
  8311. return this._pages.every(pageView => pageView?.pdfPage);
  8312. }
  8313. get renderForms() {
  8314. return this.#annotationMode === pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.AnnotationMode.ENABLE_FORMS;
  8315. }
  8316. get enableScripting() {
  8317. return !!this._scriptingManager;
  8318. }
  8319. get currentPageNumber() {
  8320. return this._currentPageNumber;
  8321. }
  8322. set currentPageNumber(val) {
  8323. if (!Number.isInteger(val)) {
  8324. throw new Error("Invalid page number.");
  8325. }
  8326. if (!this.pdfDocument) {
  8327. return;
  8328. }
  8329. if (!this._setCurrentPageNumber(val, true)) {
  8330. console.error(`currentPageNumber: "${val}" is not a valid page.`);
  8331. }
  8332. }
  8333. _setCurrentPageNumber(val, resetCurrentPageView = false) {
  8334. if (this._currentPageNumber === val) {
  8335. if (resetCurrentPageView) {
  8336. this.#resetCurrentPageView();
  8337. }
  8338. return true;
  8339. }
  8340. if (!(0 < val && val <= this.pagesCount)) {
  8341. return false;
  8342. }
  8343. const previous = this._currentPageNumber;
  8344. this._currentPageNumber = val;
  8345. this.eventBus.dispatch("pagechanging", {
  8346. source: this,
  8347. pageNumber: val,
  8348. pageLabel: this._pageLabels?.[val - 1] ?? null,
  8349. previous
  8350. });
  8351. if (resetCurrentPageView) {
  8352. this.#resetCurrentPageView();
  8353. }
  8354. return true;
  8355. }
  8356. get currentPageLabel() {
  8357. return this._pageLabels?.[this._currentPageNumber - 1] ?? null;
  8358. }
  8359. set currentPageLabel(val) {
  8360. if (!this.pdfDocument) {
  8361. return;
  8362. }
  8363. let page = val | 0;
  8364. if (this._pageLabels) {
  8365. const i = this._pageLabels.indexOf(val);
  8366. if (i >= 0) {
  8367. page = i + 1;
  8368. }
  8369. }
  8370. if (!this._setCurrentPageNumber(page, true)) {
  8371. console.error(`currentPageLabel: "${val}" is not a valid page.`);
  8372. }
  8373. }
  8374. get currentScale() {
  8375. return this._currentScale !== _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.UNKNOWN_SCALE ? this._currentScale : _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.DEFAULT_SCALE;
  8376. }
  8377. set currentScale(val) {
  8378. if (isNaN(val)) {
  8379. throw new Error("Invalid numeric scale.");
  8380. }
  8381. if (!this.pdfDocument) {
  8382. return;
  8383. }
  8384. this.#setScale(val, {
  8385. noScroll: false
  8386. });
  8387. }
  8388. get currentScaleValue() {
  8389. return this._currentScaleValue;
  8390. }
  8391. set currentScaleValue(val) {
  8392. if (!this.pdfDocument) {
  8393. return;
  8394. }
  8395. this.#setScale(val, {
  8396. noScroll: false
  8397. });
  8398. }
  8399. get pagesRotation() {
  8400. return this._pagesRotation;
  8401. }
  8402. set pagesRotation(rotation) {
  8403. if (!(0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.isValidRotation)(rotation)) {
  8404. throw new Error("Invalid pages rotation angle.");
  8405. }
  8406. if (!this.pdfDocument) {
  8407. return;
  8408. }
  8409. rotation %= 360;
  8410. if (rotation < 0) {
  8411. rotation += 360;
  8412. }
  8413. if (this._pagesRotation === rotation) {
  8414. return;
  8415. }
  8416. this._pagesRotation = rotation;
  8417. const pageNumber = this._currentPageNumber;
  8418. this.refresh(true, {
  8419. rotation
  8420. });
  8421. if (this._currentScaleValue) {
  8422. this.#setScale(this._currentScaleValue, {
  8423. noScroll: true
  8424. });
  8425. }
  8426. this.eventBus.dispatch("rotationchanging", {
  8427. source: this,
  8428. pagesRotation: rotation,
  8429. pageNumber
  8430. });
  8431. if (this.defaultRenderingQueue) {
  8432. this.update();
  8433. }
  8434. }
  8435. get firstPagePromise() {
  8436. return this.pdfDocument ? this._firstPageCapability.promise : null;
  8437. }
  8438. get onePageRendered() {
  8439. return this.pdfDocument ? this._onePageRenderedCapability.promise : null;
  8440. }
  8441. get pagesPromise() {
  8442. return this.pdfDocument ? this._pagesCapability.promise : null;
  8443. }
  8444. get _layerProperties() {
  8445. const self = this;
  8446. return (0,pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.shadow)(this, "_layerProperties", {
  8447. get annotationEditorUIManager() {
  8448. return self.#annotationEditorUIManager;
  8449. },
  8450. get annotationStorage() {
  8451. return self.pdfDocument?.annotationStorage;
  8452. },
  8453. get downloadManager() {
  8454. return self.downloadManager;
  8455. },
  8456. get enableScripting() {
  8457. return !!self._scriptingManager;
  8458. },
  8459. get fieldObjectsPromise() {
  8460. return self.pdfDocument?.getFieldObjects();
  8461. },
  8462. get findController() {
  8463. return self.findController;
  8464. },
  8465. get hasJSActionsPromise() {
  8466. return self.pdfDocument?.hasJSActions();
  8467. },
  8468. get linkService() {
  8469. return self.linkService;
  8470. }
  8471. });
  8472. }
  8473. #initializePermissions(permissions) {
  8474. const params = {
  8475. annotationEditorMode: this.#annotationEditorMode,
  8476. annotationMode: this.#annotationMode,
  8477. textLayerMode: this.#textLayerMode
  8478. };
  8479. if (!permissions) {
  8480. return params;
  8481. }
  8482. if (!permissions.includes(pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.PermissionFlag.COPY) && this.#textLayerMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.TextLayerMode.ENABLE) {
  8483. params.textLayerMode = _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.TextLayerMode.ENABLE_PERMISSIONS;
  8484. }
  8485. if (!permissions.includes(pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.PermissionFlag.MODIFY_CONTENTS)) {
  8486. params.annotationEditorMode = pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.AnnotationEditorType.DISABLE;
  8487. }
  8488. if (!permissions.includes(pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.PermissionFlag.MODIFY_ANNOTATIONS) && !permissions.includes(pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.PermissionFlag.FILL_INTERACTIVE_FORMS) && this.#annotationMode === pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.AnnotationMode.ENABLE_FORMS) {
  8489. params.annotationMode = pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.AnnotationMode.ENABLE;
  8490. }
  8491. return params;
  8492. }
  8493. async #onePageRenderedOrForceFetch() {
  8494. if (document.visibilityState === "hidden" || !this.container.offsetParent || this._getVisiblePages().views.length === 0) {
  8495. return;
  8496. }
  8497. const visibilityChangePromise = new Promise(resolve => {
  8498. this.#onVisibilityChange = () => {
  8499. if (document.visibilityState !== "hidden") {
  8500. return;
  8501. }
  8502. resolve();
  8503. };
  8504. document.addEventListener("visibilitychange", this.#onVisibilityChange);
  8505. });
  8506. await Promise.race([this._onePageRenderedCapability.promise, visibilityChangePromise]);
  8507. document.removeEventListener("visibilitychange", this.#onVisibilityChange);
  8508. this.#onVisibilityChange = null;
  8509. }
  8510. async getAllText() {
  8511. const texts = [];
  8512. const buffer = [];
  8513. for (let pageNum = 1, pagesCount = this.pdfDocument.numPages; pageNum <= pagesCount; ++pageNum) {
  8514. if (this.#interruptCopyCondition) {
  8515. return null;
  8516. }
  8517. buffer.length = 0;
  8518. const page = await this.pdfDocument.getPage(pageNum);
  8519. const {
  8520. items
  8521. } = await page.getTextContent();
  8522. for (const item of items) {
  8523. if (item.str) {
  8524. buffer.push(item.str);
  8525. }
  8526. if (item.hasEOL) {
  8527. buffer.push("\n");
  8528. }
  8529. }
  8530. texts.push((0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.removeNullCharacters)(buffer.join("")));
  8531. }
  8532. return texts.join("\n");
  8533. }
  8534. #copyCallback(textLayerMode, event) {
  8535. const selection = document.getSelection();
  8536. const {
  8537. focusNode,
  8538. anchorNode
  8539. } = selection;
  8540. if (anchorNode && focusNode && selection.containsNode(this.#hiddenCopyElement)) {
  8541. if (this.#getAllTextInProgress || textLayerMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.TextLayerMode.ENABLE_PERMISSIONS) {
  8542. event.preventDefault();
  8543. event.stopPropagation();
  8544. return;
  8545. }
  8546. this.#getAllTextInProgress = true;
  8547. const savedCursor = this.container.style.cursor;
  8548. this.container.style.cursor = "wait";
  8549. const interruptCopy = ev => this.#interruptCopyCondition = ev.key === "Escape";
  8550. window.addEventListener("keydown", interruptCopy);
  8551. this.getAllText().then(async text => {
  8552. if (text !== null) {
  8553. await navigator.clipboard.writeText(text);
  8554. }
  8555. }).catch(reason => {
  8556. console.warn(`Something goes wrong when extracting the text: ${reason.message}`);
  8557. }).finally(() => {
  8558. this.#getAllTextInProgress = false;
  8559. this.#interruptCopyCondition = false;
  8560. window.removeEventListener("keydown", interruptCopy);
  8561. this.container.style.cursor = savedCursor;
  8562. });
  8563. event.preventDefault();
  8564. event.stopPropagation();
  8565. }
  8566. }
  8567. setDocument(pdfDocument) {
  8568. if (this.pdfDocument) {
  8569. this.eventBus.dispatch("pagesdestroy", {
  8570. source: this
  8571. });
  8572. this._cancelRendering();
  8573. this._resetView();
  8574. this.findController?.setDocument(null);
  8575. this._scriptingManager?.setDocument(null);
  8576. if (this.#annotationEditorUIManager) {
  8577. this.#annotationEditorUIManager.destroy();
  8578. this.#annotationEditorUIManager = null;
  8579. }
  8580. }
  8581. this.pdfDocument = pdfDocument;
  8582. if (!pdfDocument) {
  8583. return;
  8584. }
  8585. const pagesCount = pdfDocument.numPages;
  8586. const firstPagePromise = pdfDocument.getPage(1);
  8587. const optionalContentConfigPromise = pdfDocument.getOptionalContentConfig({
  8588. intent: "display"
  8589. });
  8590. const permissionsPromise = this.#enablePermissions ? pdfDocument.getPermissions() : Promise.resolve();
  8591. if (pagesCount > PagesCountLimit.FORCE_SCROLL_MODE_PAGE) {
  8592. console.warn("Forcing PAGE-scrolling for performance reasons, given the length of the document.");
  8593. const mode = this._scrollMode = _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.PAGE;
  8594. this.eventBus.dispatch("scrollmodechanged", {
  8595. source: this,
  8596. mode
  8597. });
  8598. }
  8599. this._pagesCapability.promise.then(() => {
  8600. this.eventBus.dispatch("pagesloaded", {
  8601. source: this,
  8602. pagesCount
  8603. });
  8604. }, () => {});
  8605. this._onBeforeDraw = evt => {
  8606. const pageView = this._pages[evt.pageNumber - 1];
  8607. if (!pageView) {
  8608. return;
  8609. }
  8610. this.#buffer.push(pageView);
  8611. };
  8612. this.eventBus._on("pagerender", this._onBeforeDraw);
  8613. this._onAfterDraw = evt => {
  8614. if (evt.cssTransform) {
  8615. return;
  8616. }
  8617. this._onePageRenderedCapability.resolve({
  8618. timestamp: evt.timestamp
  8619. });
  8620. this.eventBus._off("pagerendered", this._onAfterDraw);
  8621. this._onAfterDraw = null;
  8622. };
  8623. this.eventBus._on("pagerendered", this._onAfterDraw);
  8624. Promise.all([firstPagePromise, permissionsPromise]).then(([firstPdfPage, permissions]) => {
  8625. if (pdfDocument !== this.pdfDocument) {
  8626. return;
  8627. }
  8628. this._firstPageCapability.resolve(firstPdfPage);
  8629. this._optionalContentConfigPromise = optionalContentConfigPromise;
  8630. const {
  8631. annotationEditorMode,
  8632. annotationMode,
  8633. textLayerMode
  8634. } = this.#initializePermissions(permissions);
  8635. if (textLayerMode !== _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.TextLayerMode.DISABLE) {
  8636. const element = this.#hiddenCopyElement = document.createElement("div");
  8637. element.id = "hiddenCopyElement";
  8638. this.viewer.before(element);
  8639. }
  8640. if (annotationEditorMode !== pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.AnnotationEditorType.DISABLE) {
  8641. const mode = annotationEditorMode;
  8642. if (pdfDocument.isPureXfa) {
  8643. console.warn("Warning: XFA-editing is not implemented.");
  8644. } else if (isValidAnnotationEditorMode(mode)) {
  8645. this.#annotationEditorUIManager = new pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.AnnotationEditorUIManager(this.container, this.viewer, this.#altTextManager, this.eventBus, pdfDocument, this.pageColors, this.#annotationEditorHighlightColors, this.#enableHighlightFloatingButton, this.#mlManager);
  8646. this.eventBus.dispatch("annotationeditoruimanager", {
  8647. source: this,
  8648. uiManager: this.#annotationEditorUIManager
  8649. });
  8650. if (mode !== pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.AnnotationEditorType.NONE) {
  8651. this.#annotationEditorUIManager.updateMode(mode);
  8652. }
  8653. } else {
  8654. console.error(`Invalid AnnotationEditor mode: ${mode}`);
  8655. }
  8656. }
  8657. const viewerElement = this._scrollMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.PAGE ? null : this.viewer;
  8658. const scale = this.currentScale;
  8659. const viewport = firstPdfPage.getViewport({
  8660. scale: scale * pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.PixelsPerInch.PDF_TO_CSS_UNITS
  8661. });
  8662. this.viewer.style.setProperty("--scale-factor", viewport.scale);
  8663. if (this.pageColors?.foreground === "CanvasText" || this.pageColors?.background === "Canvas") {
  8664. this.viewer.style.setProperty("--hcm-highlight-filter", pdfDocument.filterFactory.addHighlightHCMFilter("highlight", "CanvasText", "Canvas", "HighlightText", "Highlight"));
  8665. this.viewer.style.setProperty("--hcm-highlight-selected-filter", pdfDocument.filterFactory.addHighlightHCMFilter("highlight_selected", "CanvasText", "Canvas", "HighlightText", "ButtonText"));
  8666. }
  8667. for (let pageNum = 1; pageNum <= pagesCount; ++pageNum) {
  8668. const pageView = new _pdf_page_view_js__WEBPACK_IMPORTED_MODULE_15__.PDFPageView({
  8669. container: viewerElement,
  8670. eventBus: this.eventBus,
  8671. id: pageNum,
  8672. scale,
  8673. defaultViewport: viewport.clone(),
  8674. optionalContentConfigPromise,
  8675. renderingQueue: this.renderingQueue,
  8676. textLayerMode,
  8677. annotationMode,
  8678. imageResourcesPath: this.imageResourcesPath,
  8679. maxCanvasPixels: this.maxCanvasPixels,
  8680. pageColors: this.pageColors,
  8681. l10n: this.l10n,
  8682. layerProperties: this._layerProperties
  8683. });
  8684. this._pages.push(pageView);
  8685. }
  8686. this._pages[0]?.setPdfPage(firstPdfPage);
  8687. if (this._scrollMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.PAGE) {
  8688. this.#ensurePageViewVisible();
  8689. } else if (this._spreadMode !== _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.SpreadMode.NONE) {
  8690. this._updateSpreadMode();
  8691. }
  8692. this.#onePageRenderedOrForceFetch().then(async () => {
  8693. this.findController?.setDocument(pdfDocument);
  8694. this._scriptingManager?.setDocument(pdfDocument);
  8695. if (this.#hiddenCopyElement) {
  8696. this.#copyCallbackBound = this.#copyCallback.bind(this, textLayerMode);
  8697. document.addEventListener("copy", this.#copyCallbackBound);
  8698. }
  8699. if (this.#annotationEditorUIManager) {
  8700. this.eventBus.dispatch("annotationeditormodechanged", {
  8701. source: this,
  8702. mode: this.#annotationEditorMode
  8703. });
  8704. }
  8705. if (pdfDocument.loadingParams.disableAutoFetch || pagesCount > PagesCountLimit.FORCE_LAZY_PAGE_INIT) {
  8706. this._pagesCapability.resolve();
  8707. return;
  8708. }
  8709. let getPagesLeft = pagesCount - 1;
  8710. if (getPagesLeft <= 0) {
  8711. this._pagesCapability.resolve();
  8712. return;
  8713. }
  8714. for (let pageNum = 2; pageNum <= pagesCount; ++pageNum) {
  8715. const promise = pdfDocument.getPage(pageNum).then(pdfPage => {
  8716. const pageView = this._pages[pageNum - 1];
  8717. if (!pageView.pdfPage) {
  8718. pageView.setPdfPage(pdfPage);
  8719. }
  8720. if (--getPagesLeft === 0) {
  8721. this._pagesCapability.resolve();
  8722. }
  8723. }, reason => {
  8724. console.error(`Unable to get page ${pageNum} to initialize viewer`, reason);
  8725. if (--getPagesLeft === 0) {
  8726. this._pagesCapability.resolve();
  8727. }
  8728. });
  8729. if (pageNum % PagesCountLimit.PAUSE_EAGER_PAGE_INIT === 0) {
  8730. await promise;
  8731. }
  8732. }
  8733. });
  8734. this.eventBus.dispatch("pagesinit", {
  8735. source: this
  8736. });
  8737. pdfDocument.getMetadata().then(({
  8738. info
  8739. }) => {
  8740. if (pdfDocument !== this.pdfDocument) {
  8741. return;
  8742. }
  8743. if (info.Language) {
  8744. this.viewer.lang = info.Language;
  8745. }
  8746. });
  8747. if (this.defaultRenderingQueue) {
  8748. this.update();
  8749. }
  8750. }).catch(reason => {
  8751. console.error("Unable to initialize viewer", reason);
  8752. this._pagesCapability.reject(reason);
  8753. });
  8754. }
  8755. setPageLabels(labels) {
  8756. if (!this.pdfDocument) {
  8757. return;
  8758. }
  8759. if (!labels) {
  8760. this._pageLabels = null;
  8761. } else if (!(Array.isArray(labels) && this.pdfDocument.numPages === labels.length)) {
  8762. this._pageLabels = null;
  8763. console.error(`setPageLabels: Invalid page labels.`);
  8764. } else {
  8765. this._pageLabels = labels;
  8766. }
  8767. for (let i = 0, ii = this._pages.length; i < ii; i++) {
  8768. this._pages[i].setPageLabel(this._pageLabels?.[i] ?? null);
  8769. }
  8770. }
  8771. _resetView() {
  8772. this._pages = [];
  8773. this._currentPageNumber = 1;
  8774. this._currentScale = _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.UNKNOWN_SCALE;
  8775. this._currentScaleValue = null;
  8776. this._pageLabels = null;
  8777. this.#buffer = new PDFPageViewBuffer(DEFAULT_CACHE_SIZE);
  8778. this._location = null;
  8779. this._pagesRotation = 0;
  8780. this._optionalContentConfigPromise = null;
  8781. this._firstPageCapability = Promise.withResolvers();
  8782. this._onePageRenderedCapability = Promise.withResolvers();
  8783. this._pagesCapability = Promise.withResolvers();
  8784. this._scrollMode = _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.VERTICAL;
  8785. this._previousScrollMode = _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.UNKNOWN;
  8786. this._spreadMode = _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.SpreadMode.NONE;
  8787. this.#scrollModePageState = {
  8788. previousPageNumber: 1,
  8789. scrollDown: true,
  8790. pages: []
  8791. };
  8792. if (this._onBeforeDraw) {
  8793. this.eventBus._off("pagerender", this._onBeforeDraw);
  8794. this._onBeforeDraw = null;
  8795. }
  8796. if (this._onAfterDraw) {
  8797. this.eventBus._off("pagerendered", this._onAfterDraw);
  8798. this._onAfterDraw = null;
  8799. }
  8800. if (this.#onVisibilityChange) {
  8801. document.removeEventListener("visibilitychange", this.#onVisibilityChange);
  8802. this.#onVisibilityChange = null;
  8803. }
  8804. this.viewer.textContent = "";
  8805. this._updateScrollMode();
  8806. this.viewer.removeAttribute("lang");
  8807. if (this.#hiddenCopyElement) {
  8808. document.removeEventListener("copy", this.#copyCallbackBound);
  8809. this.#copyCallbackBound = null;
  8810. this.#hiddenCopyElement.remove();
  8811. this.#hiddenCopyElement = null;
  8812. }
  8813. }
  8814. #ensurePageViewVisible() {
  8815. if (this._scrollMode !== _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.PAGE) {
  8816. throw new Error("#ensurePageViewVisible: Invalid scrollMode value.");
  8817. }
  8818. const pageNumber = this._currentPageNumber,
  8819. state = this.#scrollModePageState,
  8820. viewer = this.viewer;
  8821. viewer.textContent = "";
  8822. state.pages.length = 0;
  8823. if (this._spreadMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.SpreadMode.NONE && !this.isInPresentationMode) {
  8824. const pageView = this._pages[pageNumber - 1];
  8825. viewer.append(pageView.div);
  8826. state.pages.push(pageView);
  8827. } else {
  8828. const pageIndexSet = new Set(),
  8829. parity = this._spreadMode - 1;
  8830. if (parity === -1) {
  8831. pageIndexSet.add(pageNumber - 1);
  8832. } else if (pageNumber % 2 !== parity) {
  8833. pageIndexSet.add(pageNumber - 1);
  8834. pageIndexSet.add(pageNumber);
  8835. } else {
  8836. pageIndexSet.add(pageNumber - 2);
  8837. pageIndexSet.add(pageNumber - 1);
  8838. }
  8839. const spread = document.createElement("div");
  8840. spread.className = "spread";
  8841. if (this.isInPresentationMode) {
  8842. const dummyPage = document.createElement("div");
  8843. dummyPage.className = "dummyPage";
  8844. spread.append(dummyPage);
  8845. }
  8846. for (const i of pageIndexSet) {
  8847. const pageView = this._pages[i];
  8848. if (!pageView) {
  8849. continue;
  8850. }
  8851. spread.append(pageView.div);
  8852. state.pages.push(pageView);
  8853. }
  8854. viewer.append(spread);
  8855. }
  8856. state.scrollDown = pageNumber >= state.previousPageNumber;
  8857. state.previousPageNumber = pageNumber;
  8858. }
  8859. _scrollUpdate() {
  8860. if (this.pagesCount === 0) {
  8861. return;
  8862. }
  8863. this.update();
  8864. }
  8865. #scrollIntoView(pageView, pageSpot = null) {
  8866. const {
  8867. div,
  8868. id
  8869. } = pageView;
  8870. if (this._currentPageNumber !== id) {
  8871. this._setCurrentPageNumber(id);
  8872. }
  8873. if (this._scrollMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.PAGE) {
  8874. this.#ensurePageViewVisible();
  8875. this.update();
  8876. }
  8877. if (!pageSpot && !this.isInPresentationMode) {
  8878. const left = div.offsetLeft + div.clientLeft,
  8879. right = left + div.clientWidth;
  8880. const {
  8881. scrollLeft,
  8882. clientWidth
  8883. } = this.container;
  8884. if (this._scrollMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.HORIZONTAL || left < scrollLeft || right > scrollLeft + clientWidth) {
  8885. pageSpot = {
  8886. left: 0,
  8887. top: 0
  8888. };
  8889. }
  8890. }
  8891. (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.scrollIntoView)(div, pageSpot);
  8892. if (!this._currentScaleValue && this._location) {
  8893. this._location = null;
  8894. }
  8895. }
  8896. #isSameScale(newScale) {
  8897. return newScale === this._currentScale || Math.abs(newScale - this._currentScale) < 1e-15;
  8898. }
  8899. #setScaleUpdatePages(newScale, newValue, {
  8900. noScroll = false,
  8901. preset = false,
  8902. drawingDelay = -1
  8903. }) {
  8904. this._currentScaleValue = newValue.toString();
  8905. if (this.#isSameScale(newScale)) {
  8906. if (preset) {
  8907. this.eventBus.dispatch("scalechanging", {
  8908. source: this,
  8909. scale: newScale,
  8910. presetValue: newValue
  8911. });
  8912. }
  8913. return;
  8914. }
  8915. this.viewer.style.setProperty("--scale-factor", newScale * pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.PixelsPerInch.PDF_TO_CSS_UNITS);
  8916. const postponeDrawing = drawingDelay >= 0 && drawingDelay < 1000;
  8917. this.refresh(true, {
  8918. scale: newScale,
  8919. drawingDelay: postponeDrawing ? drawingDelay : -1
  8920. });
  8921. if (postponeDrawing) {
  8922. this.#scaleTimeoutId = setTimeout(() => {
  8923. this.#scaleTimeoutId = null;
  8924. this.refresh();
  8925. }, drawingDelay);
  8926. }
  8927. this._currentScale = newScale;
  8928. if (!noScroll) {
  8929. let page = this._currentPageNumber,
  8930. dest;
  8931. if (this._location && !(this.isInPresentationMode || this.isChangingPresentationMode)) {
  8932. page = this._location.pageNumber;
  8933. dest = [null, {
  8934. name: "XYZ"
  8935. }, this._location.left, this._location.top, null];
  8936. }
  8937. this.scrollPageIntoView({
  8938. pageNumber: page,
  8939. destArray: dest,
  8940. allowNegativeOffset: true
  8941. });
  8942. }
  8943. this.eventBus.dispatch("scalechanging", {
  8944. source: this,
  8945. scale: newScale,
  8946. presetValue: preset ? newValue : undefined
  8947. });
  8948. if (this.defaultRenderingQueue) {
  8949. this.update();
  8950. }
  8951. }
  8952. get #pageWidthScaleFactor() {
  8953. if (this._spreadMode !== _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.SpreadMode.NONE && this._scrollMode !== _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.HORIZONTAL) {
  8954. return 2;
  8955. }
  8956. return 1;
  8957. }
  8958. #setScale(value, options) {
  8959. let scale = parseFloat(value);
  8960. if (scale > 0) {
  8961. options.preset = false;
  8962. this.#setScaleUpdatePages(scale, value, options);
  8963. } else {
  8964. const currentPage = this._pages[this._currentPageNumber - 1];
  8965. if (!currentPage) {
  8966. return;
  8967. }
  8968. let hPadding = _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.SCROLLBAR_PADDING,
  8969. vPadding = _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.VERTICAL_PADDING;
  8970. if (this.isInPresentationMode) {
  8971. hPadding = vPadding = 4;
  8972. if (this._spreadMode !== _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.SpreadMode.NONE) {
  8973. hPadding *= 2;
  8974. }
  8975. } else if (this.removePageBorders) {
  8976. hPadding = vPadding = 0;
  8977. } else if (this._scrollMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.HORIZONTAL) {
  8978. [hPadding, vPadding] = [vPadding, hPadding];
  8979. }
  8980. const pageWidthScale = (this.container.clientWidth - hPadding) / currentPage.width * currentPage.scale / this.#pageWidthScaleFactor;
  8981. const pageHeightScale = (this.container.clientHeight - vPadding) / currentPage.height * currentPage.scale;
  8982. switch (value) {
  8983. case "page-actual":
  8984. scale = 1;
  8985. break;
  8986. case "page-width":
  8987. scale = pageWidthScale;
  8988. break;
  8989. case "page-height":
  8990. scale = pageHeightScale;
  8991. break;
  8992. case "page-fit":
  8993. scale = Math.min(pageWidthScale, pageHeightScale);
  8994. break;
  8995. case "auto":
  8996. const horizontalScale = (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.isPortraitOrientation)(currentPage) ? pageWidthScale : Math.min(pageHeightScale, pageWidthScale);
  8997. scale = Math.min(_ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.MAX_AUTO_SCALE, horizontalScale);
  8998. break;
  8999. default:
  9000. console.error(`#setScale: "${value}" is an unknown zoom value.`);
  9001. return;
  9002. }
  9003. options.preset = true;
  9004. this.#setScaleUpdatePages(scale, value, options);
  9005. }
  9006. }
  9007. #resetCurrentPageView() {
  9008. const pageView = this._pages[this._currentPageNumber - 1];
  9009. if (this.isInPresentationMode) {
  9010. this.#setScale(this._currentScaleValue, {
  9011. noScroll: true
  9012. });
  9013. }
  9014. this.#scrollIntoView(pageView);
  9015. }
  9016. pageLabelToPageNumber(label) {
  9017. if (!this._pageLabels) {
  9018. return null;
  9019. }
  9020. const i = this._pageLabels.indexOf(label);
  9021. if (i < 0) {
  9022. return null;
  9023. }
  9024. return i + 1;
  9025. }
  9026. scrollPageIntoView({
  9027. pageNumber,
  9028. destArray = null,
  9029. allowNegativeOffset = false,
  9030. ignoreDestinationZoom = false
  9031. }) {
  9032. if (!this.pdfDocument) {
  9033. return;
  9034. }
  9035. const pageView = Number.isInteger(pageNumber) && this._pages[pageNumber - 1];
  9036. if (!pageView) {
  9037. console.error(`scrollPageIntoView: "${pageNumber}" is not a valid pageNumber parameter.`);
  9038. return;
  9039. }
  9040. if (this.isInPresentationMode || !destArray) {
  9041. this._setCurrentPageNumber(pageNumber, true);
  9042. return;
  9043. }
  9044. let x = 0,
  9045. y = 0;
  9046. let width = 0,
  9047. height = 0,
  9048. widthScale,
  9049. heightScale;
  9050. const changeOrientation = pageView.rotation % 180 !== 0;
  9051. const pageWidth = (changeOrientation ? pageView.height : pageView.width) / pageView.scale / pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.PixelsPerInch.PDF_TO_CSS_UNITS;
  9052. const pageHeight = (changeOrientation ? pageView.width : pageView.height) / pageView.scale / pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.PixelsPerInch.PDF_TO_CSS_UNITS;
  9053. let scale = 0;
  9054. switch (destArray[1].name) {
  9055. case "XYZ":
  9056. x = destArray[2];
  9057. y = destArray[3];
  9058. scale = destArray[4];
  9059. x = x !== null ? x : 0;
  9060. y = y !== null ? y : pageHeight;
  9061. break;
  9062. case "Fit":
  9063. case "FitB":
  9064. scale = "page-fit";
  9065. break;
  9066. case "FitH":
  9067. case "FitBH":
  9068. y = destArray[2];
  9069. scale = "page-width";
  9070. if (y === null && this._location) {
  9071. x = this._location.left;
  9072. y = this._location.top;
  9073. } else if (typeof y !== "number" || y < 0) {
  9074. y = pageHeight;
  9075. }
  9076. break;
  9077. case "FitV":
  9078. case "FitBV":
  9079. x = destArray[2];
  9080. width = pageWidth;
  9081. height = pageHeight;
  9082. scale = "page-height";
  9083. break;
  9084. case "FitR":
  9085. x = destArray[2];
  9086. y = destArray[3];
  9087. width = destArray[4] - x;
  9088. height = destArray[5] - y;
  9089. let hPadding = _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.SCROLLBAR_PADDING,
  9090. vPadding = _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.VERTICAL_PADDING;
  9091. if (this.removePageBorders) {
  9092. hPadding = vPadding = 0;
  9093. }
  9094. widthScale = (this.container.clientWidth - hPadding) / width / pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.PixelsPerInch.PDF_TO_CSS_UNITS;
  9095. heightScale = (this.container.clientHeight - vPadding) / height / pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.PixelsPerInch.PDF_TO_CSS_UNITS;
  9096. scale = Math.min(Math.abs(widthScale), Math.abs(heightScale));
  9097. break;
  9098. default:
  9099. console.error(`scrollPageIntoView: "${destArray[1].name}" is not a valid destination type.`);
  9100. return;
  9101. }
  9102. if (!ignoreDestinationZoom) {
  9103. if (scale && scale !== this._currentScale) {
  9104. this.currentScaleValue = scale;
  9105. } else if (this._currentScale === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.UNKNOWN_SCALE) {
  9106. this.currentScaleValue = _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.DEFAULT_SCALE_VALUE;
  9107. }
  9108. }
  9109. if (scale === "page-fit" && !destArray[4]) {
  9110. this.#scrollIntoView(pageView);
  9111. return;
  9112. }
  9113. const boundingRect = [pageView.viewport.convertToViewportPoint(x, y), pageView.viewport.convertToViewportPoint(x + width, y + height)];
  9114. let left = Math.min(boundingRect[0][0], boundingRect[1][0]);
  9115. let top = Math.min(boundingRect[0][1], boundingRect[1][1]);
  9116. if (!allowNegativeOffset) {
  9117. left = Math.max(left, 0);
  9118. top = Math.max(top, 0);
  9119. }
  9120. this.#scrollIntoView(pageView, {
  9121. left,
  9122. top
  9123. });
  9124. }
  9125. _updateLocation(firstPage) {
  9126. const currentScale = this._currentScale;
  9127. const currentScaleValue = this._currentScaleValue;
  9128. const normalizedScaleValue = parseFloat(currentScaleValue) === currentScale ? Math.round(currentScale * 10000) / 100 : currentScaleValue;
  9129. const pageNumber = firstPage.id;
  9130. const currentPageView = this._pages[pageNumber - 1];
  9131. const container = this.container;
  9132. const topLeft = currentPageView.getPagePoint(container.scrollLeft - firstPage.x, container.scrollTop - firstPage.y);
  9133. const intLeft = Math.round(topLeft[0]);
  9134. const intTop = Math.round(topLeft[1]);
  9135. let pdfOpenParams = `#page=${pageNumber}`;
  9136. if (!this.isInPresentationMode) {
  9137. pdfOpenParams += `&zoom=${normalizedScaleValue},${intLeft},${intTop}`;
  9138. }
  9139. this._location = {
  9140. pageNumber,
  9141. scale: normalizedScaleValue,
  9142. top: intTop,
  9143. left: intLeft,
  9144. rotation: this._pagesRotation,
  9145. pdfOpenParams
  9146. };
  9147. }
  9148. update() {
  9149. const visible = this._getVisiblePages();
  9150. const visiblePages = visible.views,
  9151. numVisiblePages = visiblePages.length;
  9152. if (numVisiblePages === 0) {
  9153. return;
  9154. }
  9155. const newCacheSize = Math.max(DEFAULT_CACHE_SIZE, 2 * numVisiblePages + 1);
  9156. this.#buffer.resize(newCacheSize, visible.ids);
  9157. this.renderingQueue.renderHighestPriority(visible);
  9158. const isSimpleLayout = this._spreadMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.SpreadMode.NONE && (this._scrollMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.PAGE || this._scrollMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.VERTICAL);
  9159. const currentId = this._currentPageNumber;
  9160. let stillFullyVisible = false;
  9161. for (const page of visiblePages) {
  9162. if (page.percent < 100) {
  9163. break;
  9164. }
  9165. if (page.id === currentId && isSimpleLayout) {
  9166. stillFullyVisible = true;
  9167. break;
  9168. }
  9169. }
  9170. this._setCurrentPageNumber(stillFullyVisible ? currentId : visiblePages[0].id);
  9171. this._updateLocation(visible.first);
  9172. this.eventBus.dispatch("updateviewarea", {
  9173. source: this,
  9174. location: this._location
  9175. });
  9176. }
  9177. containsElement(element) {
  9178. return this.container.contains(element);
  9179. }
  9180. focus() {
  9181. this.container.focus();
  9182. }
  9183. get _isContainerRtl() {
  9184. return getComputedStyle(this.container).direction === "rtl";
  9185. }
  9186. get isInPresentationMode() {
  9187. return this.presentationModeState === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.PresentationModeState.FULLSCREEN;
  9188. }
  9189. get isChangingPresentationMode() {
  9190. return this.presentationModeState === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.PresentationModeState.CHANGING;
  9191. }
  9192. get isHorizontalScrollbarEnabled() {
  9193. return this.isInPresentationMode ? false : this.container.scrollWidth > this.container.clientWidth;
  9194. }
  9195. get isVerticalScrollbarEnabled() {
  9196. return this.isInPresentationMode ? false : this.container.scrollHeight > this.container.clientHeight;
  9197. }
  9198. _getVisiblePages() {
  9199. const views = this._scrollMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.PAGE ? this.#scrollModePageState.pages : this._pages,
  9200. horizontal = this._scrollMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.HORIZONTAL,
  9201. rtl = horizontal && this._isContainerRtl;
  9202. return (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.getVisibleElements)({
  9203. scrollEl: this.container,
  9204. views,
  9205. sortByVisibility: true,
  9206. horizontal,
  9207. rtl
  9208. });
  9209. }
  9210. cleanup() {
  9211. for (const pageView of this._pages) {
  9212. if (pageView.renderingState !== _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.RenderingStates.FINISHED) {
  9213. pageView.reset();
  9214. }
  9215. }
  9216. }
  9217. _cancelRendering() {
  9218. for (const pageView of this._pages) {
  9219. pageView.cancelRendering();
  9220. }
  9221. }
  9222. async #ensurePdfPageLoaded(pageView) {
  9223. if (pageView.pdfPage) {
  9224. return pageView.pdfPage;
  9225. }
  9226. try {
  9227. const pdfPage = await this.pdfDocument.getPage(pageView.id);
  9228. if (!pageView.pdfPage) {
  9229. pageView.setPdfPage(pdfPage);
  9230. }
  9231. return pdfPage;
  9232. } catch (reason) {
  9233. console.error("Unable to get page for page view", reason);
  9234. return null;
  9235. }
  9236. }
  9237. #getScrollAhead(visible) {
  9238. if (visible.first?.id === 1) {
  9239. return true;
  9240. } else if (visible.last?.id === this.pagesCount) {
  9241. return false;
  9242. }
  9243. switch (this._scrollMode) {
  9244. case _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.PAGE:
  9245. return this.#scrollModePageState.scrollDown;
  9246. case _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.HORIZONTAL:
  9247. return this.scroll.right;
  9248. }
  9249. return this.scroll.down;
  9250. }
  9251. forceRendering(currentlyVisiblePages) {
  9252. const visiblePages = currentlyVisiblePages || this._getVisiblePages();
  9253. const scrollAhead = this.#getScrollAhead(visiblePages);
  9254. const preRenderExtra = this._spreadMode !== _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.SpreadMode.NONE && this._scrollMode !== _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.HORIZONTAL;
  9255. const pageView = this.renderingQueue.getHighestPriority(visiblePages, this._pages, scrollAhead, preRenderExtra);
  9256. if (pageView) {
  9257. this.#ensurePdfPageLoaded(pageView).then(() => {
  9258. this.renderingQueue.renderView(pageView);
  9259. });
  9260. return true;
  9261. }
  9262. return false;
  9263. }
  9264. get hasEqualPageSizes() {
  9265. const firstPageView = this._pages[0];
  9266. for (let i = 1, ii = this._pages.length; i < ii; ++i) {
  9267. const pageView = this._pages[i];
  9268. if (pageView.width !== firstPageView.width || pageView.height !== firstPageView.height) {
  9269. return false;
  9270. }
  9271. }
  9272. return true;
  9273. }
  9274. getPagesOverview() {
  9275. let initialOrientation;
  9276. return this._pages.map(pageView => {
  9277. const viewport = pageView.pdfPage.getViewport({
  9278. scale: 1
  9279. });
  9280. const orientation = (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.isPortraitOrientation)(viewport);
  9281. if (initialOrientation === undefined) {
  9282. initialOrientation = orientation;
  9283. } else if (this.enablePrintAutoRotate && orientation !== initialOrientation) {
  9284. return {
  9285. width: viewport.height,
  9286. height: viewport.width,
  9287. rotation: (viewport.rotation - 90) % 360
  9288. };
  9289. }
  9290. return {
  9291. width: viewport.width,
  9292. height: viewport.height,
  9293. rotation: viewport.rotation
  9294. };
  9295. });
  9296. }
  9297. get optionalContentConfigPromise() {
  9298. if (!this.pdfDocument) {
  9299. return Promise.resolve(null);
  9300. }
  9301. if (!this._optionalContentConfigPromise) {
  9302. console.error("optionalContentConfigPromise: Not initialized yet.");
  9303. return this.pdfDocument.getOptionalContentConfig({
  9304. intent: "display"
  9305. });
  9306. }
  9307. return this._optionalContentConfigPromise;
  9308. }
  9309. set optionalContentConfigPromise(promise) {
  9310. if (!(promise instanceof Promise)) {
  9311. throw new Error(`Invalid optionalContentConfigPromise: ${promise}`);
  9312. }
  9313. if (!this.pdfDocument) {
  9314. return;
  9315. }
  9316. if (!this._optionalContentConfigPromise) {
  9317. return;
  9318. }
  9319. this._optionalContentConfigPromise = promise;
  9320. this.refresh(false, {
  9321. optionalContentConfigPromise: promise
  9322. });
  9323. this.eventBus.dispatch("optionalcontentconfigchanged", {
  9324. source: this,
  9325. promise
  9326. });
  9327. }
  9328. get scrollMode() {
  9329. return this._scrollMode;
  9330. }
  9331. set scrollMode(mode) {
  9332. if (this._scrollMode === mode) {
  9333. return;
  9334. }
  9335. if (!(0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.isValidScrollMode)(mode)) {
  9336. throw new Error(`Invalid scroll mode: ${mode}`);
  9337. }
  9338. if (this.pagesCount > PagesCountLimit.FORCE_SCROLL_MODE_PAGE) {
  9339. return;
  9340. }
  9341. this._previousScrollMode = this._scrollMode;
  9342. this._scrollMode = mode;
  9343. this.eventBus.dispatch("scrollmodechanged", {
  9344. source: this,
  9345. mode
  9346. });
  9347. this._updateScrollMode(this._currentPageNumber);
  9348. }
  9349. _updateScrollMode(pageNumber = null) {
  9350. const scrollMode = this._scrollMode,
  9351. viewer = this.viewer;
  9352. viewer.classList.toggle("scrollHorizontal", scrollMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.HORIZONTAL);
  9353. viewer.classList.toggle("scrollWrapped", scrollMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.WRAPPED);
  9354. if (!this.pdfDocument || !pageNumber) {
  9355. return;
  9356. }
  9357. if (scrollMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.PAGE) {
  9358. this.#ensurePageViewVisible();
  9359. } else if (this._previousScrollMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.PAGE) {
  9360. this._updateSpreadMode();
  9361. }
  9362. if (this._currentScaleValue && isNaN(this._currentScaleValue)) {
  9363. this.#setScale(this._currentScaleValue, {
  9364. noScroll: true
  9365. });
  9366. }
  9367. this._setCurrentPageNumber(pageNumber, true);
  9368. this.update();
  9369. }
  9370. get spreadMode() {
  9371. return this._spreadMode;
  9372. }
  9373. set spreadMode(mode) {
  9374. if (this._spreadMode === mode) {
  9375. return;
  9376. }
  9377. if (!(0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.isValidSpreadMode)(mode)) {
  9378. throw new Error(`Invalid spread mode: ${mode}`);
  9379. }
  9380. this._spreadMode = mode;
  9381. this.eventBus.dispatch("spreadmodechanged", {
  9382. source: this,
  9383. mode
  9384. });
  9385. this._updateSpreadMode(this._currentPageNumber);
  9386. }
  9387. _updateSpreadMode(pageNumber = null) {
  9388. if (!this.pdfDocument) {
  9389. return;
  9390. }
  9391. const viewer = this.viewer,
  9392. pages = this._pages;
  9393. if (this._scrollMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.PAGE) {
  9394. this.#ensurePageViewVisible();
  9395. } else {
  9396. viewer.textContent = "";
  9397. if (this._spreadMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.SpreadMode.NONE) {
  9398. for (const pageView of this._pages) {
  9399. viewer.append(pageView.div);
  9400. }
  9401. } else {
  9402. const parity = this._spreadMode - 1;
  9403. let spread = null;
  9404. for (let i = 0, ii = pages.length; i < ii; ++i) {
  9405. if (spread === null) {
  9406. spread = document.createElement("div");
  9407. spread.className = "spread";
  9408. viewer.append(spread);
  9409. } else if (i % 2 === parity) {
  9410. spread = spread.cloneNode(false);
  9411. viewer.append(spread);
  9412. }
  9413. spread.append(pages[i].div);
  9414. }
  9415. }
  9416. }
  9417. if (!pageNumber) {
  9418. return;
  9419. }
  9420. if (this._currentScaleValue && isNaN(this._currentScaleValue)) {
  9421. this.#setScale(this._currentScaleValue, {
  9422. noScroll: true
  9423. });
  9424. }
  9425. this._setCurrentPageNumber(pageNumber, true);
  9426. this.update();
  9427. }
  9428. _getPageAdvance(currentPageNumber, previous = false) {
  9429. switch (this._scrollMode) {
  9430. case _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.WRAPPED:
  9431. {
  9432. const {
  9433. views
  9434. } = this._getVisiblePages(),
  9435. pageLayout = new Map();
  9436. for (const {
  9437. id,
  9438. y,
  9439. percent,
  9440. widthPercent
  9441. } of views) {
  9442. if (percent === 0 || widthPercent < 100) {
  9443. continue;
  9444. }
  9445. let yArray = pageLayout.get(y);
  9446. if (!yArray) {
  9447. pageLayout.set(y, yArray ||= []);
  9448. }
  9449. yArray.push(id);
  9450. }
  9451. for (const yArray of pageLayout.values()) {
  9452. const currentIndex = yArray.indexOf(currentPageNumber);
  9453. if (currentIndex === -1) {
  9454. continue;
  9455. }
  9456. const numPages = yArray.length;
  9457. if (numPages === 1) {
  9458. break;
  9459. }
  9460. if (previous) {
  9461. for (let i = currentIndex - 1, ii = 0; i >= ii; i--) {
  9462. const currentId = yArray[i],
  9463. expectedId = yArray[i + 1] - 1;
  9464. if (currentId < expectedId) {
  9465. return currentPageNumber - expectedId;
  9466. }
  9467. }
  9468. } else {
  9469. for (let i = currentIndex + 1, ii = numPages; i < ii; i++) {
  9470. const currentId = yArray[i],
  9471. expectedId = yArray[i - 1] + 1;
  9472. if (currentId > expectedId) {
  9473. return expectedId - currentPageNumber;
  9474. }
  9475. }
  9476. }
  9477. if (previous) {
  9478. const firstId = yArray[0];
  9479. if (firstId < currentPageNumber) {
  9480. return currentPageNumber - firstId + 1;
  9481. }
  9482. } else {
  9483. const lastId = yArray[numPages - 1];
  9484. if (lastId > currentPageNumber) {
  9485. return lastId - currentPageNumber + 1;
  9486. }
  9487. }
  9488. break;
  9489. }
  9490. break;
  9491. }
  9492. case _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.HORIZONTAL:
  9493. {
  9494. break;
  9495. }
  9496. case _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.PAGE:
  9497. case _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.VERTICAL:
  9498. {
  9499. if (this._spreadMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.SpreadMode.NONE) {
  9500. break;
  9501. }
  9502. const parity = this._spreadMode - 1;
  9503. if (previous && currentPageNumber % 2 !== parity) {
  9504. break;
  9505. } else if (!previous && currentPageNumber % 2 === parity) {
  9506. break;
  9507. }
  9508. const {
  9509. views
  9510. } = this._getVisiblePages(),
  9511. expectedId = previous ? currentPageNumber - 1 : currentPageNumber + 1;
  9512. for (const {
  9513. id,
  9514. percent,
  9515. widthPercent
  9516. } of views) {
  9517. if (id !== expectedId) {
  9518. continue;
  9519. }
  9520. if (percent > 0 && widthPercent === 100) {
  9521. return 2;
  9522. }
  9523. break;
  9524. }
  9525. break;
  9526. }
  9527. }
  9528. return 1;
  9529. }
  9530. nextPage() {
  9531. const currentPageNumber = this._currentPageNumber,
  9532. pagesCount = this.pagesCount;
  9533. if (currentPageNumber >= pagesCount) {
  9534. return false;
  9535. }
  9536. const advance = this._getPageAdvance(currentPageNumber, false) || 1;
  9537. this.currentPageNumber = Math.min(currentPageNumber + advance, pagesCount);
  9538. return true;
  9539. }
  9540. previousPage() {
  9541. const currentPageNumber = this._currentPageNumber;
  9542. if (currentPageNumber <= 1) {
  9543. return false;
  9544. }
  9545. const advance = this._getPageAdvance(currentPageNumber, true) || 1;
  9546. this.currentPageNumber = Math.max(currentPageNumber - advance, 1);
  9547. return true;
  9548. }
  9549. increaseScale({
  9550. drawingDelay,
  9551. scaleFactor,
  9552. steps
  9553. } = {}) {
  9554. if (!this.pdfDocument) {
  9555. return;
  9556. }
  9557. let newScale = this._currentScale;
  9558. if (scaleFactor > 1) {
  9559. newScale = Math.round(newScale * scaleFactor * 100) / 100;
  9560. } else {
  9561. steps ??= 1;
  9562. do {
  9563. newScale = Math.ceil((newScale * _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.DEFAULT_SCALE_DELTA).toFixed(2) * 10) / 10;
  9564. } while (--steps > 0 && newScale < _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.MAX_SCALE);
  9565. }
  9566. this.#setScale(Math.min(_ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.MAX_SCALE, newScale), {
  9567. noScroll: false,
  9568. drawingDelay
  9569. });
  9570. }
  9571. decreaseScale({
  9572. drawingDelay,
  9573. scaleFactor,
  9574. steps
  9575. } = {}) {
  9576. if (!this.pdfDocument) {
  9577. return;
  9578. }
  9579. let newScale = this._currentScale;
  9580. if (scaleFactor > 0 && scaleFactor < 1) {
  9581. newScale = Math.round(newScale * scaleFactor * 100) / 100;
  9582. } else {
  9583. steps ??= 1;
  9584. do {
  9585. newScale = Math.floor((newScale / _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.DEFAULT_SCALE_DELTA).toFixed(2) * 10) / 10;
  9586. } while (--steps > 0 && newScale > _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.MIN_SCALE);
  9587. }
  9588. this.#setScale(Math.max(_ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.MIN_SCALE, newScale), {
  9589. noScroll: false,
  9590. drawingDelay
  9591. });
  9592. }
  9593. #updateContainerHeightCss(height = this.container.clientHeight) {
  9594. if (height !== this.#previousContainerHeight) {
  9595. this.#previousContainerHeight = height;
  9596. _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.docStyle.setProperty("--viewer-container-height", `${height}px`);
  9597. }
  9598. }
  9599. #resizeObserverCallback(entries) {
  9600. for (const entry of entries) {
  9601. if (entry.target === this.container) {
  9602. this.#updateContainerHeightCss(Math.floor(entry.borderBoxSize[0].blockSize));
  9603. this.#containerTopLeft = null;
  9604. break;
  9605. }
  9606. }
  9607. }
  9608. get containerTopLeft() {
  9609. return this.#containerTopLeft ||= [this.container.offsetTop, this.container.offsetLeft];
  9610. }
  9611. get annotationEditorMode() {
  9612. return this.#annotationEditorUIManager ? this.#annotationEditorMode : pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.AnnotationEditorType.DISABLE;
  9613. }
  9614. set annotationEditorMode({
  9615. mode,
  9616. editId = null,
  9617. isFromKeyboard = false
  9618. }) {
  9619. if (!this.#annotationEditorUIManager) {
  9620. throw new Error(`The AnnotationEditor is not enabled.`);
  9621. }
  9622. if (this.#annotationEditorMode === mode) {
  9623. return;
  9624. }
  9625. if (!isValidAnnotationEditorMode(mode)) {
  9626. throw new Error(`Invalid AnnotationEditor mode: ${mode}`);
  9627. }
  9628. if (!this.pdfDocument) {
  9629. return;
  9630. }
  9631. this.#annotationEditorMode = mode;
  9632. this.eventBus.dispatch("annotationeditormodechanged", {
  9633. source: this,
  9634. mode
  9635. });
  9636. this.#annotationEditorUIManager.updateMode(mode, editId, isFromKeyboard);
  9637. }
  9638. set annotationEditorParams({
  9639. type,
  9640. value
  9641. }) {
  9642. if (!this.#annotationEditorUIManager) {
  9643. throw new Error(`The AnnotationEditor is not enabled.`);
  9644. }
  9645. this.#annotationEditorUIManager.updateParams(type, value);
  9646. }
  9647. refresh(noUpdate = false, updateArgs = Object.create(null)) {
  9648. if (!this.pdfDocument) {
  9649. return;
  9650. }
  9651. for (const pageView of this._pages) {
  9652. pageView.update(updateArgs);
  9653. }
  9654. if (this.#scaleTimeoutId !== null) {
  9655. clearTimeout(this.#scaleTimeoutId);
  9656. this.#scaleTimeoutId = null;
  9657. }
  9658. if (!noUpdate) {
  9659. this.update();
  9660. }
  9661. }
  9662. }
  9663. __webpack_async_result__();
  9664. } catch(e) { __webpack_async_result__(e); } });
  9665. /***/ }),
  9666. /***/ 2603:
  9667. /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
  9668. __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
  9669. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  9670. /* harmony export */ AbortException: () => (/* binding */ AbortException),
  9671. /* harmony export */ AnnotationEditorLayer: () => (/* binding */ AnnotationEditorLayer),
  9672. /* harmony export */ AnnotationEditorType: () => (/* binding */ AnnotationEditorType),
  9673. /* harmony export */ AnnotationEditorUIManager: () => (/* binding */ AnnotationEditorUIManager),
  9674. /* harmony export */ AnnotationLayer: () => (/* binding */ AnnotationLayer),
  9675. /* harmony export */ AnnotationMode: () => (/* binding */ AnnotationMode),
  9676. /* harmony export */ DrawLayer: () => (/* binding */ DrawLayer),
  9677. /* harmony export */ PermissionFlag: () => (/* binding */ PermissionFlag),
  9678. /* harmony export */ PixelsPerInch: () => (/* binding */ PixelsPerInch),
  9679. /* harmony export */ RenderingCancelledException: () => (/* binding */ RenderingCancelledException),
  9680. /* harmony export */ XfaLayer: () => (/* binding */ XfaLayer),
  9681. /* harmony export */ createValidAbsoluteUrl: () => (/* binding */ createValidAbsoluteUrl),
  9682. /* harmony export */ fetchData: () => (/* binding */ fetchData),
  9683. /* harmony export */ getPdfFilenameFromUrl: () => (/* binding */ getPdfFilenameFromUrl),
  9684. /* harmony export */ isPdfFile: () => (/* binding */ isPdfFile),
  9685. /* harmony export */ normalizeUnicode: () => (/* binding */ normalizeUnicode),
  9686. /* harmony export */ renderTextLayer: () => (/* binding */ renderTextLayer),
  9687. /* harmony export */ setLayerDimensions: () => (/* binding */ setLayerDimensions),
  9688. /* harmony export */ shadow: () => (/* binding */ shadow),
  9689. /* harmony export */ updateTextLayer: () => (/* binding */ updateTextLayer),
  9690. /* harmony export */ version: () => (/* binding */ version)
  9691. /* harmony export */ });
  9692. /* unused harmony exports AnnotationEditorParamsType, build, CMapCompressionType, ColorPicker, DOMSVGFactory, FeatureTest, getDocument, getFilenameFromUrl, getXfaPageViewport, GlobalWorkerOptions, ImageKind, InvalidPDFException, isDataScheme, MissingPDFException, noContextMenu, OPS, Outliner, PasswordResponses, PDFDataRangeTransport, PDFDateString, PDFWorker, UnexpectedResponseException, Util, VerbosityLevel */
  9693. if (!globalThis.pdfjsLib) {
  9694. await globalThis.pdfjsLibPromise;
  9695. }
  9696. const {
  9697. AbortException,
  9698. AnnotationEditorLayer,
  9699. AnnotationEditorParamsType,
  9700. AnnotationEditorType,
  9701. AnnotationEditorUIManager,
  9702. AnnotationLayer,
  9703. AnnotationMode,
  9704. build,
  9705. CMapCompressionType,
  9706. ColorPicker,
  9707. createValidAbsoluteUrl,
  9708. DOMSVGFactory,
  9709. DrawLayer,
  9710. FeatureTest,
  9711. fetchData,
  9712. getDocument,
  9713. getFilenameFromUrl,
  9714. getPdfFilenameFromUrl,
  9715. getXfaPageViewport,
  9716. GlobalWorkerOptions,
  9717. ImageKind,
  9718. InvalidPDFException,
  9719. isDataScheme,
  9720. isPdfFile,
  9721. MissingPDFException,
  9722. noContextMenu,
  9723. normalizeUnicode,
  9724. OPS,
  9725. Outliner,
  9726. PasswordResponses,
  9727. PDFDataRangeTransport,
  9728. PDFDateString,
  9729. PDFWorker,
  9730. PermissionFlag,
  9731. PixelsPerInch,
  9732. RenderingCancelledException,
  9733. renderTextLayer,
  9734. setLayerDimensions,
  9735. shadow,
  9736. UnexpectedResponseException,
  9737. updateTextLayer,
  9738. Util,
  9739. VerbosityLevel,
  9740. version,
  9741. XfaLayer
  9742. } = globalThis.pdfjsLib;
  9743. __webpack_async_result__();
  9744. } catch(e) { __webpack_async_result__(e); } }, 1);
  9745. /***/ }),
  9746. /***/ 6698:
  9747. /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
  9748. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  9749. /* harmony export */ StructTreeLayerBuilder: () => (/* binding */ StructTreeLayerBuilder)
  9750. /* harmony export */ });
  9751. /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7256);
  9752. const PDF_ROLE_TO_HTML_ROLE = {
  9753. Document: null,
  9754. DocumentFragment: null,
  9755. Part: "group",
  9756. Sect: "group",
  9757. Div: "group",
  9758. Aside: "note",
  9759. NonStruct: "none",
  9760. P: null,
  9761. H: "heading",
  9762. Title: null,
  9763. FENote: "note",
  9764. Sub: "group",
  9765. Lbl: null,
  9766. Span: null,
  9767. Em: null,
  9768. Strong: null,
  9769. Link: "link",
  9770. Annot: "note",
  9771. Form: "form",
  9772. Ruby: null,
  9773. RB: null,
  9774. RT: null,
  9775. RP: null,
  9776. Warichu: null,
  9777. WT: null,
  9778. WP: null,
  9779. L: "list",
  9780. LI: "listitem",
  9781. LBody: null,
  9782. Table: "table",
  9783. TR: "row",
  9784. TH: "columnheader",
  9785. TD: "cell",
  9786. THead: "columnheader",
  9787. TBody: null,
  9788. TFoot: null,
  9789. Caption: null,
  9790. Figure: "figure",
  9791. Formula: null,
  9792. Artifact: null
  9793. };
  9794. const HEADING_PATTERN = /^H(\d+)$/;
  9795. class StructTreeLayerBuilder {
  9796. #treeDom = undefined;
  9797. get renderingDone() {
  9798. return this.#treeDom !== undefined;
  9799. }
  9800. render(structTree) {
  9801. if (this.#treeDom !== undefined) {
  9802. return this.#treeDom;
  9803. }
  9804. const treeDom = this.#walk(structTree);
  9805. treeDom?.classList.add("structTree");
  9806. return this.#treeDom = treeDom;
  9807. }
  9808. hide() {
  9809. if (this.#treeDom && !this.#treeDom.hidden) {
  9810. this.#treeDom.hidden = true;
  9811. }
  9812. }
  9813. show() {
  9814. if (this.#treeDom?.hidden) {
  9815. this.#treeDom.hidden = false;
  9816. }
  9817. }
  9818. #setAttributes(structElement, htmlElement) {
  9819. const {
  9820. alt,
  9821. id,
  9822. lang
  9823. } = structElement;
  9824. if (alt !== undefined) {
  9825. htmlElement.setAttribute("aria-label", (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.removeNullCharacters)(alt));
  9826. }
  9827. if (id !== undefined) {
  9828. htmlElement.setAttribute("aria-owns", id);
  9829. }
  9830. if (lang !== undefined) {
  9831. htmlElement.setAttribute("lang", (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.removeNullCharacters)(lang, true));
  9832. }
  9833. }
  9834. #walk(node) {
  9835. if (!node) {
  9836. return null;
  9837. }
  9838. const element = document.createElement("span");
  9839. if ("role" in node) {
  9840. const {
  9841. role
  9842. } = node;
  9843. const match = role.match(HEADING_PATTERN);
  9844. if (match) {
  9845. element.setAttribute("role", "heading");
  9846. element.setAttribute("aria-level", match[1]);
  9847. } else if (PDF_ROLE_TO_HTML_ROLE[role]) {
  9848. element.setAttribute("role", PDF_ROLE_TO_HTML_ROLE[role]);
  9849. }
  9850. }
  9851. this.#setAttributes(node, element);
  9852. if (node.children) {
  9853. if (node.children.length === 1 && "id" in node.children[0]) {
  9854. this.#setAttributes(node.children[0], element);
  9855. } else {
  9856. for (const kid of node.children) {
  9857. element.append(this.#walk(kid));
  9858. }
  9859. }
  9860. }
  9861. return element;
  9862. }
  9863. }
  9864. /***/ }),
  9865. /***/ 5860:
  9866. /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
  9867. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  9868. /* harmony export */ TextAccessibilityManager: () => (/* binding */ TextAccessibilityManager)
  9869. /* harmony export */ });
  9870. /* harmony import */ var core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8992);
  9871. /* harmony import */ var core_js_modules_esnext_iterator_filter_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4520);
  9872. /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7256);
  9873. class TextAccessibilityManager {
  9874. #enabled = false;
  9875. #textChildren = null;
  9876. #textNodes = new Map();
  9877. #waitingElements = new Map();
  9878. setTextMapping(textDivs) {
  9879. this.#textChildren = textDivs;
  9880. }
  9881. static #compareElementPositions(e1, e2) {
  9882. const rect1 = e1.getBoundingClientRect();
  9883. const rect2 = e2.getBoundingClientRect();
  9884. if (rect1.width === 0 && rect1.height === 0) {
  9885. return +1;
  9886. }
  9887. if (rect2.width === 0 && rect2.height === 0) {
  9888. return -1;
  9889. }
  9890. const top1 = rect1.y;
  9891. const bot1 = rect1.y + rect1.height;
  9892. const mid1 = rect1.y + rect1.height / 2;
  9893. const top2 = rect2.y;
  9894. const bot2 = rect2.y + rect2.height;
  9895. const mid2 = rect2.y + rect2.height / 2;
  9896. if (mid1 <= top2 && mid2 >= bot1) {
  9897. return -1;
  9898. }
  9899. if (mid2 <= top1 && mid1 >= bot2) {
  9900. return +1;
  9901. }
  9902. const centerX1 = rect1.x + rect1.width / 2;
  9903. const centerX2 = rect2.x + rect2.width / 2;
  9904. return centerX1 - centerX2;
  9905. }
  9906. enable() {
  9907. if (this.#enabled) {
  9908. throw new Error("TextAccessibilityManager is already enabled.");
  9909. }
  9910. if (!this.#textChildren) {
  9911. throw new Error("Text divs and strings have not been set.");
  9912. }
  9913. this.#enabled = true;
  9914. this.#textChildren = this.#textChildren.slice();
  9915. this.#textChildren.sort(TextAccessibilityManager.#compareElementPositions);
  9916. if (this.#textNodes.size > 0) {
  9917. const textChildren = this.#textChildren;
  9918. for (const [id, nodeIndex] of this.#textNodes) {
  9919. const element = document.getElementById(id);
  9920. if (!element) {
  9921. this.#textNodes.delete(id);
  9922. continue;
  9923. }
  9924. this.#addIdToAriaOwns(id, textChildren[nodeIndex]);
  9925. }
  9926. }
  9927. for (const [element, isRemovable] of this.#waitingElements) {
  9928. this.addPointerInTextLayer(element, isRemovable);
  9929. }
  9930. this.#waitingElements.clear();
  9931. }
  9932. disable() {
  9933. if (!this.#enabled) {
  9934. return;
  9935. }
  9936. this.#waitingElements.clear();
  9937. this.#textChildren = null;
  9938. this.#enabled = false;
  9939. }
  9940. removePointerInTextLayer(element) {
  9941. if (!this.#enabled) {
  9942. this.#waitingElements.delete(element);
  9943. return;
  9944. }
  9945. const children = this.#textChildren;
  9946. if (!children || children.length === 0) {
  9947. return;
  9948. }
  9949. const {
  9950. id
  9951. } = element;
  9952. const nodeIndex = this.#textNodes.get(id);
  9953. if (nodeIndex === undefined) {
  9954. return;
  9955. }
  9956. const node = children[nodeIndex];
  9957. this.#textNodes.delete(id);
  9958. let owns = node.getAttribute("aria-owns");
  9959. if (owns?.includes(id)) {
  9960. owns = owns.split(" ").filter(x => x !== id).join(" ");
  9961. if (owns) {
  9962. node.setAttribute("aria-owns", owns);
  9963. } else {
  9964. node.removeAttribute("aria-owns");
  9965. node.setAttribute("role", "presentation");
  9966. }
  9967. }
  9968. }
  9969. #addIdToAriaOwns(id, node) {
  9970. const owns = node.getAttribute("aria-owns");
  9971. if (!owns?.includes(id)) {
  9972. node.setAttribute("aria-owns", owns ? `${owns} ${id}` : id);
  9973. }
  9974. node.removeAttribute("role");
  9975. }
  9976. addPointerInTextLayer(element, isRemovable) {
  9977. const {
  9978. id
  9979. } = element;
  9980. if (!id) {
  9981. return null;
  9982. }
  9983. if (!this.#enabled) {
  9984. this.#waitingElements.set(element, isRemovable);
  9985. return null;
  9986. }
  9987. if (isRemovable) {
  9988. this.removePointerInTextLayer(element);
  9989. }
  9990. const children = this.#textChildren;
  9991. if (!children || children.length === 0) {
  9992. return null;
  9993. }
  9994. const index = (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.binarySearchFirstItem)(children, node => TextAccessibilityManager.#compareElementPositions(element, node) < 0);
  9995. const nodeIndex = Math.max(0, index - 1);
  9996. const child = children[nodeIndex];
  9997. this.#addIdToAriaOwns(id, child);
  9998. this.#textNodes.set(id, nodeIndex);
  9999. const parent = child.parentNode;
  10000. return parent?.classList.contains("markedContent") ? parent.id : null;
  10001. }
  10002. moveElementInDOM(container, element, contentElement, isRemovable) {
  10003. const id = this.addPointerInTextLayer(contentElement, isRemovable);
  10004. if (!container.hasChildNodes()) {
  10005. container.append(element);
  10006. return id;
  10007. }
  10008. const children = Array.from(container.childNodes).filter(node => node !== element);
  10009. if (children.length === 0) {
  10010. return id;
  10011. }
  10012. const elementToCompare = contentElement || element;
  10013. const index = (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.binarySearchFirstItem)(children, node => TextAccessibilityManager.#compareElementPositions(elementToCompare, node) < 0);
  10014. if (index === 0) {
  10015. children[0].before(element);
  10016. } else {
  10017. children[index - 1].after(element);
  10018. }
  10019. return id;
  10020. }
  10021. }
  10022. /***/ }),
  10023. /***/ 2027:
  10024. /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
  10025. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  10026. /* harmony export */ TextHighlighter: () => (/* binding */ TextHighlighter)
  10027. /* harmony export */ });
  10028. /* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4114);
  10029. class TextHighlighter {
  10030. #eventAbortController = null;
  10031. constructor({
  10032. findController,
  10033. eventBus,
  10034. pageIndex
  10035. }) {
  10036. this.findController = findController;
  10037. this.matches = [];
  10038. this.eventBus = eventBus;
  10039. this.pageIdx = pageIndex;
  10040. this.textDivs = null;
  10041. this.textContentItemsStr = null;
  10042. this.enabled = false;
  10043. }
  10044. setTextMapping(divs, texts) {
  10045. this.textDivs = divs;
  10046. this.textContentItemsStr = texts;
  10047. }
  10048. enable() {
  10049. if (!this.textDivs || !this.textContentItemsStr) {
  10050. throw new Error("Text divs and strings have not been set.");
  10051. }
  10052. if (this.enabled) {
  10053. throw new Error("TextHighlighter is already enabled.");
  10054. }
  10055. this.enabled = true;
  10056. if (!this.#eventAbortController) {
  10057. this.#eventAbortController = new AbortController();
  10058. this.eventBus._on("updatetextlayermatches", evt => {
  10059. if (evt.pageIndex === this.pageIdx || evt.pageIndex === -1) {
  10060. this._updateMatches();
  10061. }
  10062. }, {
  10063. signal: this.#eventAbortController.signal
  10064. });
  10065. }
  10066. this._updateMatches();
  10067. }
  10068. disable() {
  10069. if (!this.enabled) {
  10070. return;
  10071. }
  10072. this.enabled = false;
  10073. this.#eventAbortController?.abort();
  10074. this.#eventAbortController = null;
  10075. this._updateMatches(true);
  10076. }
  10077. _convertMatches(matches, matchesLength) {
  10078. if (!matches) {
  10079. return [];
  10080. }
  10081. const {
  10082. textContentItemsStr
  10083. } = this;
  10084. let i = 0,
  10085. iIndex = 0;
  10086. const end = textContentItemsStr.length - 1;
  10087. const result = [];
  10088. for (let m = 0, mm = matches.length; m < mm; m++) {
  10089. let matchIdx = matches[m];
  10090. while (i !== end && matchIdx >= iIndex + textContentItemsStr[i].length) {
  10091. iIndex += textContentItemsStr[i].length;
  10092. i++;
  10093. }
  10094. if (i === textContentItemsStr.length) {
  10095. console.error("Could not find a matching mapping");
  10096. }
  10097. const match = {
  10098. begin: {
  10099. divIdx: i,
  10100. offset: matchIdx - iIndex
  10101. }
  10102. };
  10103. matchIdx += matchesLength[m];
  10104. while (i !== end && matchIdx > iIndex + textContentItemsStr[i].length) {
  10105. iIndex += textContentItemsStr[i].length;
  10106. i++;
  10107. }
  10108. match.end = {
  10109. divIdx: i,
  10110. offset: matchIdx - iIndex
  10111. };
  10112. result.push(match);
  10113. }
  10114. return result;
  10115. }
  10116. _renderMatches(matches) {
  10117. if (matches.length === 0) {
  10118. return;
  10119. }
  10120. const {
  10121. findController,
  10122. pageIdx
  10123. } = this;
  10124. const {
  10125. textContentItemsStr,
  10126. textDivs
  10127. } = this;
  10128. const isSelectedPage = pageIdx === findController.selected.pageIdx;
  10129. const selectedMatchIdx = findController.selected.matchIdx;
  10130. const highlightAll = findController.state.highlightAll;
  10131. let prevEnd = null;
  10132. const infinity = {
  10133. divIdx: -1,
  10134. offset: undefined
  10135. };
  10136. function beginText(begin, className) {
  10137. const divIdx = begin.divIdx;
  10138. textDivs[divIdx].textContent = "";
  10139. return appendTextToDiv(divIdx, 0, begin.offset, className);
  10140. }
  10141. function appendTextToDiv(divIdx, fromOffset, toOffset, className) {
  10142. let div = textDivs[divIdx];
  10143. if (div.nodeType === Node.TEXT_NODE) {
  10144. const span = document.createElement("span");
  10145. div.before(span);
  10146. span.append(div);
  10147. textDivs[divIdx] = span;
  10148. div = span;
  10149. }
  10150. const content = textContentItemsStr[divIdx].substring(fromOffset, toOffset);
  10151. const node = document.createTextNode(content);
  10152. if (className) {
  10153. const span = document.createElement("span");
  10154. span.className = `${className} appended`;
  10155. span.append(node);
  10156. div.append(span);
  10157. return className.includes("selected") ? span.offsetLeft : 0;
  10158. }
  10159. div.append(node);
  10160. return 0;
  10161. }
  10162. let i0 = selectedMatchIdx,
  10163. i1 = i0 + 1;
  10164. if (highlightAll) {
  10165. i0 = 0;
  10166. i1 = matches.length;
  10167. } else if (!isSelectedPage) {
  10168. return;
  10169. }
  10170. let lastDivIdx = -1;
  10171. let lastOffset = -1;
  10172. for (let i = i0; i < i1; i++) {
  10173. const match = matches[i];
  10174. const begin = match.begin;
  10175. if (begin.divIdx === lastDivIdx && begin.offset === lastOffset) {
  10176. continue;
  10177. }
  10178. lastDivIdx = begin.divIdx;
  10179. lastOffset = begin.offset;
  10180. const end = match.end;
  10181. const isSelected = isSelectedPage && i === selectedMatchIdx;
  10182. const highlightSuffix = isSelected ? " selected" : "";
  10183. let selectedLeft = 0;
  10184. if (!prevEnd || begin.divIdx !== prevEnd.divIdx) {
  10185. if (prevEnd !== null) {
  10186. appendTextToDiv(prevEnd.divIdx, prevEnd.offset, infinity.offset);
  10187. }
  10188. beginText(begin);
  10189. } else {
  10190. appendTextToDiv(prevEnd.divIdx, prevEnd.offset, begin.offset);
  10191. }
  10192. if (begin.divIdx === end.divIdx) {
  10193. selectedLeft = appendTextToDiv(begin.divIdx, begin.offset, end.offset, "highlight" + highlightSuffix);
  10194. } else {
  10195. selectedLeft = appendTextToDiv(begin.divIdx, begin.offset, infinity.offset, "highlight begin" + highlightSuffix);
  10196. for (let n0 = begin.divIdx + 1, n1 = end.divIdx; n0 < n1; n0++) {
  10197. textDivs[n0].className = "highlight middle" + highlightSuffix;
  10198. }
  10199. beginText(end, "highlight end" + highlightSuffix);
  10200. }
  10201. prevEnd = end;
  10202. if (isSelected) {
  10203. findController.scrollMatchIntoView({
  10204. element: textDivs[begin.divIdx],
  10205. selectedLeft,
  10206. pageIndex: pageIdx,
  10207. matchIndex: selectedMatchIdx
  10208. });
  10209. }
  10210. }
  10211. if (prevEnd) {
  10212. appendTextToDiv(prevEnd.divIdx, prevEnd.offset, infinity.offset);
  10213. }
  10214. }
  10215. _updateMatches(reset = false) {
  10216. if (!this.enabled && !reset) {
  10217. return;
  10218. }
  10219. const {
  10220. findController,
  10221. matches,
  10222. pageIdx
  10223. } = this;
  10224. const {
  10225. textContentItemsStr,
  10226. textDivs
  10227. } = this;
  10228. let clearedUntilDivIdx = -1;
  10229. for (const match of matches) {
  10230. const begin = Math.max(clearedUntilDivIdx, match.begin.divIdx);
  10231. for (let n = begin, end = match.end.divIdx; n <= end; n++) {
  10232. const div = textDivs[n];
  10233. div.textContent = textContentItemsStr[n];
  10234. div.className = "";
  10235. }
  10236. clearedUntilDivIdx = match.end.divIdx + 1;
  10237. }
  10238. if (!findController?.highlightMatches || reset) {
  10239. return;
  10240. }
  10241. const pageMatches = findController.pageMatches[pageIdx] || null;
  10242. const pageMatchesLength = findController.pageMatchesLength[pageIdx] || null;
  10243. this.matches = this._convertMatches(pageMatches, pageMatchesLength);
  10244. this._renderMatches(this.matches);
  10245. }
  10246. }
  10247. /***/ }),
  10248. /***/ 7765:
  10249. /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
  10250. __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
  10251. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  10252. /* harmony export */ TextLayerBuilder: () => (/* binding */ TextLayerBuilder)
  10253. /* harmony export */ });
  10254. /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2603);
  10255. /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7256);
  10256. var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__]);
  10257. pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
  10258. class TextLayerBuilder {
  10259. #enablePermissions = false;
  10260. #onAppend = null;
  10261. #rotation = 0;
  10262. #scale = 0;
  10263. #textContentSource = null;
  10264. constructor({
  10265. highlighter = null,
  10266. accessibilityManager = null,
  10267. enablePermissions = false,
  10268. onAppend = null
  10269. }) {
  10270. this.textContentItemsStr = [];
  10271. this.renderingDone = false;
  10272. this.textDivs = [];
  10273. this.textDivProperties = new WeakMap();
  10274. this.textLayerRenderTask = null;
  10275. this.highlighter = highlighter;
  10276. this.accessibilityManager = accessibilityManager;
  10277. this.#enablePermissions = enablePermissions === true;
  10278. this.#onAppend = onAppend;
  10279. this.div = document.createElement("div");
  10280. this.div.tabIndex = 0;
  10281. this.div.className = "textLayer";
  10282. }
  10283. #finishRendering() {
  10284. this.renderingDone = true;
  10285. const endOfContent = document.createElement("div");
  10286. endOfContent.className = "endOfContent";
  10287. this.div.append(endOfContent);
  10288. this.#bindMouse();
  10289. }
  10290. get numTextDivs() {
  10291. return this.textDivs.length;
  10292. }
  10293. async render(viewport) {
  10294. if (!this.#textContentSource) {
  10295. throw new Error('No "textContentSource" parameter specified.');
  10296. }
  10297. const scale = viewport.scale * (globalThis.devicePixelRatio || 1);
  10298. const {
  10299. rotation
  10300. } = viewport;
  10301. if (this.renderingDone) {
  10302. const mustRotate = rotation !== this.#rotation;
  10303. const mustRescale = scale !== this.#scale;
  10304. if (mustRotate || mustRescale) {
  10305. this.hide();
  10306. (0,pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.updateTextLayer)({
  10307. container: this.div,
  10308. viewport,
  10309. textDivs: this.textDivs,
  10310. textDivProperties: this.textDivProperties,
  10311. mustRescale,
  10312. mustRotate
  10313. });
  10314. this.#scale = scale;
  10315. this.#rotation = rotation;
  10316. }
  10317. this.show();
  10318. return;
  10319. }
  10320. this.cancel();
  10321. this.highlighter?.setTextMapping(this.textDivs, this.textContentItemsStr);
  10322. this.accessibilityManager?.setTextMapping(this.textDivs);
  10323. this.textLayerRenderTask = (0,pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.renderTextLayer)({
  10324. textContentSource: this.#textContentSource,
  10325. container: this.div,
  10326. viewport,
  10327. textDivs: this.textDivs,
  10328. textDivProperties: this.textDivProperties,
  10329. textContentItemsStr: this.textContentItemsStr
  10330. });
  10331. await this.textLayerRenderTask.promise;
  10332. this.#finishRendering();
  10333. this.#scale = scale;
  10334. this.#rotation = rotation;
  10335. this.#onAppend?.(this.div);
  10336. this.highlighter?.enable();
  10337. this.accessibilityManager?.enable();
  10338. }
  10339. hide() {
  10340. if (!this.div.hidden && this.renderingDone) {
  10341. this.highlighter?.disable();
  10342. this.div.hidden = true;
  10343. }
  10344. }
  10345. show() {
  10346. if (this.div.hidden && this.renderingDone) {
  10347. this.div.hidden = false;
  10348. this.highlighter?.enable();
  10349. }
  10350. }
  10351. cancel() {
  10352. if (this.textLayerRenderTask) {
  10353. this.textLayerRenderTask.cancel();
  10354. this.textLayerRenderTask = null;
  10355. }
  10356. this.highlighter?.disable();
  10357. this.accessibilityManager?.disable();
  10358. this.textContentItemsStr.length = 0;
  10359. this.textDivs.length = 0;
  10360. this.textDivProperties = new WeakMap();
  10361. }
  10362. setTextContentSource(source) {
  10363. this.cancel();
  10364. this.#textContentSource = source;
  10365. }
  10366. #bindMouse() {
  10367. const {
  10368. div
  10369. } = this;
  10370. div.addEventListener("mousedown", evt => {
  10371. const end = div.querySelector(".endOfContent");
  10372. if (!end) {
  10373. return;
  10374. }
  10375. let adjustTop = evt.target !== div;
  10376. adjustTop &&= getComputedStyle(end).getPropertyValue("-moz-user-select") !== "none";
  10377. if (adjustTop) {
  10378. const divBounds = div.getBoundingClientRect();
  10379. const r = Math.max(0, (evt.pageY - divBounds.top) / divBounds.height);
  10380. end.style.top = (r * 100).toFixed(2) + "%";
  10381. }
  10382. end.classList.add("active");
  10383. });
  10384. div.addEventListener("mouseup", () => {
  10385. const end = div.querySelector(".endOfContent");
  10386. if (!end) {
  10387. return;
  10388. }
  10389. end.style.top = "";
  10390. end.classList.remove("active");
  10391. });
  10392. div.addEventListener("copy", event => {
  10393. if (!this.#enablePermissions) {
  10394. const selection = document.getSelection();
  10395. event.clipboardData.setData("text/plain", (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_1__.removeNullCharacters)((0,pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.normalizeUnicode)(selection.toString())));
  10396. }
  10397. event.preventDefault();
  10398. event.stopPropagation();
  10399. });
  10400. }
  10401. }
  10402. __webpack_async_result__();
  10403. } catch(e) { __webpack_async_result__(e); } });
  10404. /***/ }),
  10405. /***/ 7256:
  10406. /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
  10407. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  10408. /* harmony export */ DEFAULT_SCALE: () => (/* binding */ DEFAULT_SCALE),
  10409. /* harmony export */ DEFAULT_SCALE_DELTA: () => (/* binding */ DEFAULT_SCALE_DELTA),
  10410. /* harmony export */ DEFAULT_SCALE_VALUE: () => (/* binding */ DEFAULT_SCALE_VALUE),
  10411. /* harmony export */ MAX_AUTO_SCALE: () => (/* binding */ MAX_AUTO_SCALE),
  10412. /* harmony export */ MAX_SCALE: () => (/* binding */ MAX_SCALE),
  10413. /* harmony export */ MIN_SCALE: () => (/* binding */ MIN_SCALE),
  10414. /* harmony export */ OutputScale: () => (/* binding */ OutputScale),
  10415. /* harmony export */ PresentationModeState: () => (/* binding */ PresentationModeState),
  10416. /* harmony export */ ProgressBar: () => (/* binding */ ProgressBar),
  10417. /* harmony export */ RenderingStates: () => (/* binding */ RenderingStates),
  10418. /* harmony export */ SCROLLBAR_PADDING: () => (/* binding */ SCROLLBAR_PADDING),
  10419. /* harmony export */ ScrollMode: () => (/* binding */ ScrollMode),
  10420. /* harmony export */ SpreadMode: () => (/* binding */ SpreadMode),
  10421. /* harmony export */ TextLayerMode: () => (/* binding */ TextLayerMode),
  10422. /* harmony export */ UNKNOWN_SCALE: () => (/* binding */ UNKNOWN_SCALE),
  10423. /* harmony export */ VERTICAL_PADDING: () => (/* binding */ VERTICAL_PADDING),
  10424. /* harmony export */ apiPageLayoutToViewerModes: () => (/* binding */ apiPageLayoutToViewerModes),
  10425. /* harmony export */ approximateFraction: () => (/* binding */ approximateFraction),
  10426. /* harmony export */ binarySearchFirstItem: () => (/* binding */ binarySearchFirstItem),
  10427. /* harmony export */ docStyle: () => (/* binding */ docStyle),
  10428. /* harmony export */ getVisibleElements: () => (/* binding */ getVisibleElements),
  10429. /* harmony export */ isPortraitOrientation: () => (/* binding */ isPortraitOrientation),
  10430. /* harmony export */ isValidRotation: () => (/* binding */ isValidRotation),
  10431. /* harmony export */ isValidScrollMode: () => (/* binding */ isValidScrollMode),
  10432. /* harmony export */ isValidSpreadMode: () => (/* binding */ isValidSpreadMode),
  10433. /* harmony export */ parseQueryString: () => (/* binding */ parseQueryString),
  10434. /* harmony export */ removeNullCharacters: () => (/* binding */ removeNullCharacters),
  10435. /* harmony export */ roundToDivide: () => (/* binding */ roundToDivide),
  10436. /* harmony export */ scrollIntoView: () => (/* binding */ scrollIntoView),
  10437. /* harmony export */ watchScroll: () => (/* binding */ watchScroll)
  10438. /* harmony export */ });
  10439. /* unused harmony exports animationStarted, apiPageModeToSidebarView, AutoPrintRegExp, backtrackBeforeAllVisibleElements, CursorTool, getActiveOrFocusedElement, getPageSizeInches, normalizeWheelEventDelta, normalizeWheelEventDirection, SidebarView, toggleCheckedBtn, toggleExpandedBtn */
  10440. /* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4114);
  10441. /* harmony import */ var core_js_modules_esnext_set_difference_v2_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3375);
  10442. /* harmony import */ var core_js_modules_esnext_set_intersection_v2_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9225);
  10443. /* harmony import */ var core_js_modules_esnext_set_is_disjoint_from_v2_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3972);
  10444. /* harmony import */ var core_js_modules_esnext_set_is_subset_of_v2_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9209);
  10445. /* harmony import */ var core_js_modules_esnext_set_is_superset_of_v2_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5714);
  10446. /* harmony import */ var core_js_modules_esnext_set_symmetric_difference_v2_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7561);
  10447. /* harmony import */ var core_js_modules_esnext_set_union_v2_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(6197);
  10448. /* harmony import */ var core_js_modules_web_url_search_params_delete_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4603);
  10449. /* harmony import */ var core_js_modules_web_url_search_params_has_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(7566);
  10450. /* harmony import */ var core_js_modules_web_url_search_params_size_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(8721);
  10451. const DEFAULT_SCALE_VALUE = "auto";
  10452. const DEFAULT_SCALE = 1.0;
  10453. const DEFAULT_SCALE_DELTA = 1.1;
  10454. const MIN_SCALE = 0.1;
  10455. const MAX_SCALE = 10.0;
  10456. const UNKNOWN_SCALE = 0;
  10457. const MAX_AUTO_SCALE = 1.25;
  10458. const SCROLLBAR_PADDING = 40;
  10459. const VERTICAL_PADDING = 5;
  10460. const RenderingStates = {
  10461. INITIAL: 0,
  10462. RUNNING: 1,
  10463. PAUSED: 2,
  10464. FINISHED: 3
  10465. };
  10466. const PresentationModeState = {
  10467. UNKNOWN: 0,
  10468. NORMAL: 1,
  10469. CHANGING: 2,
  10470. FULLSCREEN: 3
  10471. };
  10472. const SidebarView = {
  10473. UNKNOWN: -1,
  10474. NONE: 0,
  10475. THUMBS: 1,
  10476. OUTLINE: 2,
  10477. ATTACHMENTS: 3,
  10478. LAYERS: 4
  10479. };
  10480. const TextLayerMode = {
  10481. DISABLE: 0,
  10482. ENABLE: 1,
  10483. ENABLE_PERMISSIONS: 2
  10484. };
  10485. const ScrollMode = {
  10486. UNKNOWN: -1,
  10487. VERTICAL: 0,
  10488. HORIZONTAL: 1,
  10489. WRAPPED: 2,
  10490. PAGE: 3
  10491. };
  10492. const SpreadMode = {
  10493. UNKNOWN: -1,
  10494. NONE: 0,
  10495. ODD: 1,
  10496. EVEN: 2
  10497. };
  10498. const CursorTool = {
  10499. SELECT: 0,
  10500. HAND: 1,
  10501. ZOOM: 2
  10502. };
  10503. const AutoPrintRegExp = /\bprint\s*\(/;
  10504. class OutputScale {
  10505. constructor() {
  10506. const pixelRatio = window.devicePixelRatio || 1;
  10507. this.sx = pixelRatio;
  10508. this.sy = pixelRatio;
  10509. }
  10510. get scaled() {
  10511. return this.sx !== 1 || this.sy !== 1;
  10512. }
  10513. }
  10514. function scrollIntoView(element, spot, scrollMatches = false) {
  10515. let parent = element.offsetParent;
  10516. if (!parent) {
  10517. console.error("offsetParent is not set -- cannot scroll");
  10518. return;
  10519. }
  10520. let offsetY = element.offsetTop + element.clientTop;
  10521. let offsetX = element.offsetLeft + element.clientLeft;
  10522. while (parent.clientHeight === parent.scrollHeight && parent.clientWidth === parent.scrollWidth || scrollMatches && (parent.classList.contains("markedContent") || getComputedStyle(parent).overflow === "hidden")) {
  10523. offsetY += parent.offsetTop;
  10524. offsetX += parent.offsetLeft;
  10525. parent = parent.offsetParent;
  10526. if (!parent) {
  10527. return;
  10528. }
  10529. }
  10530. if (spot) {
  10531. if (spot.top !== undefined) {
  10532. offsetY += spot.top;
  10533. }
  10534. if (spot.left !== undefined) {
  10535. offsetX += spot.left;
  10536. parent.scrollLeft = offsetX;
  10537. }
  10538. }
  10539. parent.scrollTop = offsetY;
  10540. }
  10541. function watchScroll(viewAreaElement, callback) {
  10542. const debounceScroll = function (evt) {
  10543. if (rAF) {
  10544. return;
  10545. }
  10546. rAF = window.requestAnimationFrame(function viewAreaElementScrolled() {
  10547. rAF = null;
  10548. const currentX = viewAreaElement.scrollLeft;
  10549. const lastX = state.lastX;
  10550. if (currentX !== lastX) {
  10551. state.right = currentX > lastX;
  10552. }
  10553. state.lastX = currentX;
  10554. const currentY = viewAreaElement.scrollTop;
  10555. const lastY = state.lastY;
  10556. if (currentY !== lastY) {
  10557. state.down = currentY > lastY;
  10558. }
  10559. state.lastY = currentY;
  10560. callback(state);
  10561. });
  10562. };
  10563. const state = {
  10564. right: true,
  10565. down: true,
  10566. lastX: viewAreaElement.scrollLeft,
  10567. lastY: viewAreaElement.scrollTop,
  10568. _eventHandler: debounceScroll
  10569. };
  10570. let rAF = null;
  10571. viewAreaElement.addEventListener("scroll", debounceScroll, true);
  10572. return state;
  10573. }
  10574. function parseQueryString(query) {
  10575. const params = new Map();
  10576. for (const [key, value] of new URLSearchParams(query)) {
  10577. params.set(key.toLowerCase(), value);
  10578. }
  10579. return params;
  10580. }
  10581. const InvisibleCharsRegExp = /[\x00-\x1F]/g;
  10582. function removeNullCharacters(str, replaceInvisible = false) {
  10583. if (!InvisibleCharsRegExp.test(str)) {
  10584. return str;
  10585. }
  10586. if (replaceInvisible) {
  10587. return str.replaceAll(InvisibleCharsRegExp, m => m === "\x00" ? "" : " ");
  10588. }
  10589. return str.replaceAll("\x00", "");
  10590. }
  10591. function binarySearchFirstItem(items, condition, start = 0) {
  10592. let minIndex = start;
  10593. let maxIndex = items.length - 1;
  10594. if (maxIndex < 0 || !condition(items[maxIndex])) {
  10595. return items.length;
  10596. }
  10597. if (condition(items[minIndex])) {
  10598. return minIndex;
  10599. }
  10600. while (minIndex < maxIndex) {
  10601. const currentIndex = minIndex + maxIndex >> 1;
  10602. const currentItem = items[currentIndex];
  10603. if (condition(currentItem)) {
  10604. maxIndex = currentIndex;
  10605. } else {
  10606. minIndex = currentIndex + 1;
  10607. }
  10608. }
  10609. return minIndex;
  10610. }
  10611. function approximateFraction(x) {
  10612. if (Math.floor(x) === x) {
  10613. return [x, 1];
  10614. }
  10615. const xinv = 1 / x;
  10616. const limit = 8;
  10617. if (xinv > limit) {
  10618. return [1, limit];
  10619. } else if (Math.floor(xinv) === xinv) {
  10620. return [1, xinv];
  10621. }
  10622. const x_ = x > 1 ? xinv : x;
  10623. let a = 0,
  10624. b = 1,
  10625. c = 1,
  10626. d = 1;
  10627. while (true) {
  10628. const p = a + c,
  10629. q = b + d;
  10630. if (q > limit) {
  10631. break;
  10632. }
  10633. if (x_ <= p / q) {
  10634. c = p;
  10635. d = q;
  10636. } else {
  10637. a = p;
  10638. b = q;
  10639. }
  10640. }
  10641. let result;
  10642. if (x_ - a / b < c / d - x_) {
  10643. result = x_ === x ? [a, b] : [b, a];
  10644. } else {
  10645. result = x_ === x ? [c, d] : [d, c];
  10646. }
  10647. return result;
  10648. }
  10649. function roundToDivide(x, div) {
  10650. const r = x % div;
  10651. return r === 0 ? x : Math.round(x - r + div);
  10652. }
  10653. function getPageSizeInches({
  10654. view,
  10655. userUnit,
  10656. rotate
  10657. }) {
  10658. const [x1, y1, x2, y2] = view;
  10659. const changeOrientation = rotate % 180 !== 0;
  10660. const width = (x2 - x1) / 72 * userUnit;
  10661. const height = (y2 - y1) / 72 * userUnit;
  10662. return {
  10663. width: changeOrientation ? height : width,
  10664. height: changeOrientation ? width : height
  10665. };
  10666. }
  10667. function backtrackBeforeAllVisibleElements(index, views, top) {
  10668. if (index < 2) {
  10669. return index;
  10670. }
  10671. let elt = views[index].div;
  10672. let pageTop = elt.offsetTop + elt.clientTop;
  10673. if (pageTop >= top) {
  10674. elt = views[index - 1].div;
  10675. pageTop = elt.offsetTop + elt.clientTop;
  10676. }
  10677. for (let i = index - 2; i >= 0; --i) {
  10678. elt = views[i].div;
  10679. if (elt.offsetTop + elt.clientTop + elt.clientHeight <= pageTop) {
  10680. break;
  10681. }
  10682. index = i;
  10683. }
  10684. return index;
  10685. }
  10686. function getVisibleElements({
  10687. scrollEl,
  10688. views,
  10689. sortByVisibility = false,
  10690. horizontal = false,
  10691. rtl = false
  10692. }) {
  10693. const top = scrollEl.scrollTop,
  10694. bottom = top + scrollEl.clientHeight;
  10695. const left = scrollEl.scrollLeft,
  10696. right = left + scrollEl.clientWidth;
  10697. function isElementBottomAfterViewTop(view) {
  10698. const element = view.div;
  10699. const elementBottom = element.offsetTop + element.clientTop + element.clientHeight;
  10700. return elementBottom > top;
  10701. }
  10702. function isElementNextAfterViewHorizontally(view) {
  10703. const element = view.div;
  10704. const elementLeft = element.offsetLeft + element.clientLeft;
  10705. const elementRight = elementLeft + element.clientWidth;
  10706. return rtl ? elementLeft < right : elementRight > left;
  10707. }
  10708. const visible = [],
  10709. ids = new Set(),
  10710. numViews = views.length;
  10711. let firstVisibleElementInd = binarySearchFirstItem(views, horizontal ? isElementNextAfterViewHorizontally : isElementBottomAfterViewTop);
  10712. if (firstVisibleElementInd > 0 && firstVisibleElementInd < numViews && !horizontal) {
  10713. firstVisibleElementInd = backtrackBeforeAllVisibleElements(firstVisibleElementInd, views, top);
  10714. }
  10715. let lastEdge = horizontal ? right : -1;
  10716. for (let i = firstVisibleElementInd; i < numViews; i++) {
  10717. const view = views[i],
  10718. element = view.div;
  10719. const currentWidth = element.offsetLeft + element.clientLeft;
  10720. const currentHeight = element.offsetTop + element.clientTop;
  10721. const viewWidth = element.clientWidth,
  10722. viewHeight = element.clientHeight;
  10723. const viewRight = currentWidth + viewWidth;
  10724. const viewBottom = currentHeight + viewHeight;
  10725. if (lastEdge === -1) {
  10726. if (viewBottom >= bottom) {
  10727. lastEdge = viewBottom;
  10728. }
  10729. } else if ((horizontal ? currentWidth : currentHeight) > lastEdge) {
  10730. break;
  10731. }
  10732. if (viewBottom <= top || currentHeight >= bottom || viewRight <= left || currentWidth >= right) {
  10733. continue;
  10734. }
  10735. const hiddenHeight = Math.max(0, top - currentHeight) + Math.max(0, viewBottom - bottom);
  10736. const hiddenWidth = Math.max(0, left - currentWidth) + Math.max(0, viewRight - right);
  10737. const fractionHeight = (viewHeight - hiddenHeight) / viewHeight,
  10738. fractionWidth = (viewWidth - hiddenWidth) / viewWidth;
  10739. const percent = fractionHeight * fractionWidth * 100 | 0;
  10740. visible.push({
  10741. id: view.id,
  10742. x: currentWidth,
  10743. y: currentHeight,
  10744. view,
  10745. percent,
  10746. widthPercent: fractionWidth * 100 | 0
  10747. });
  10748. ids.add(view.id);
  10749. }
  10750. const first = visible[0],
  10751. last = visible.at(-1);
  10752. if (sortByVisibility) {
  10753. visible.sort(function (a, b) {
  10754. const pc = a.percent - b.percent;
  10755. if (Math.abs(pc) > 0.001) {
  10756. return -pc;
  10757. }
  10758. return a.id - b.id;
  10759. });
  10760. }
  10761. return {
  10762. first,
  10763. last,
  10764. views: visible,
  10765. ids
  10766. };
  10767. }
  10768. function normalizeWheelEventDirection(evt) {
  10769. let delta = Math.hypot(evt.deltaX, evt.deltaY);
  10770. const angle = Math.atan2(evt.deltaY, evt.deltaX);
  10771. if (-0.25 * Math.PI < angle && angle < 0.75 * Math.PI) {
  10772. delta = -delta;
  10773. }
  10774. return delta;
  10775. }
  10776. function normalizeWheelEventDelta(evt) {
  10777. const deltaMode = evt.deltaMode;
  10778. let delta = normalizeWheelEventDirection(evt);
  10779. const MOUSE_PIXELS_PER_LINE = 30;
  10780. const MOUSE_LINES_PER_PAGE = 30;
  10781. if (deltaMode === WheelEvent.DOM_DELTA_PIXEL) {
  10782. delta /= MOUSE_PIXELS_PER_LINE * MOUSE_LINES_PER_PAGE;
  10783. } else if (deltaMode === WheelEvent.DOM_DELTA_LINE) {
  10784. delta /= MOUSE_LINES_PER_PAGE;
  10785. }
  10786. return delta;
  10787. }
  10788. function isValidRotation(angle) {
  10789. return Number.isInteger(angle) && angle % 90 === 0;
  10790. }
  10791. function isValidScrollMode(mode) {
  10792. return Number.isInteger(mode) && Object.values(ScrollMode).includes(mode) && mode !== ScrollMode.UNKNOWN;
  10793. }
  10794. function isValidSpreadMode(mode) {
  10795. return Number.isInteger(mode) && Object.values(SpreadMode).includes(mode) && mode !== SpreadMode.UNKNOWN;
  10796. }
  10797. function isPortraitOrientation(size) {
  10798. return size.width <= size.height;
  10799. }
  10800. const animationStarted = new Promise(function (resolve) {
  10801. window.requestAnimationFrame(resolve);
  10802. });
  10803. const docStyle = document.documentElement.style;
  10804. function clamp(v, min, max) {
  10805. return Math.min(Math.max(v, min), max);
  10806. }
  10807. class ProgressBar {
  10808. #classList = null;
  10809. #disableAutoFetchTimeout = null;
  10810. #percent = 0;
  10811. #style = null;
  10812. #visible = true;
  10813. constructor(bar) {
  10814. this.#classList = bar.classList;
  10815. this.#style = bar.style;
  10816. }
  10817. get percent() {
  10818. return this.#percent;
  10819. }
  10820. set percent(val) {
  10821. this.#percent = clamp(val, 0, 100);
  10822. if (isNaN(val)) {
  10823. this.#classList.add("indeterminate");
  10824. return;
  10825. }
  10826. this.#classList.remove("indeterminate");
  10827. this.#style.setProperty("--progressBar-percent", `${this.#percent}%`);
  10828. }
  10829. setWidth(viewer) {
  10830. if (!viewer) {
  10831. return;
  10832. }
  10833. const container = viewer.parentNode;
  10834. const scrollbarWidth = container.offsetWidth - viewer.offsetWidth;
  10835. if (scrollbarWidth > 0) {
  10836. this.#style.setProperty("--progressBar-end-offset", `${scrollbarWidth}px`);
  10837. }
  10838. }
  10839. setDisableAutoFetch(delay = 5000) {
  10840. if (isNaN(this.#percent)) {
  10841. return;
  10842. }
  10843. if (this.#disableAutoFetchTimeout) {
  10844. clearTimeout(this.#disableAutoFetchTimeout);
  10845. }
  10846. this.show();
  10847. this.#disableAutoFetchTimeout = setTimeout(() => {
  10848. this.#disableAutoFetchTimeout = null;
  10849. this.hide();
  10850. }, delay);
  10851. }
  10852. hide() {
  10853. if (!this.#visible) {
  10854. return;
  10855. }
  10856. this.#visible = false;
  10857. this.#classList.add("hidden");
  10858. }
  10859. show() {
  10860. if (this.#visible) {
  10861. return;
  10862. }
  10863. this.#visible = true;
  10864. this.#classList.remove("hidden");
  10865. }
  10866. }
  10867. function getActiveOrFocusedElement() {
  10868. let curRoot = document;
  10869. let curActiveOrFocused = curRoot.activeElement || curRoot.querySelector(":focus");
  10870. while (curActiveOrFocused?.shadowRoot) {
  10871. curRoot = curActiveOrFocused.shadowRoot;
  10872. curActiveOrFocused = curRoot.activeElement || curRoot.querySelector(":focus");
  10873. }
  10874. return curActiveOrFocused;
  10875. }
  10876. function apiPageLayoutToViewerModes(layout) {
  10877. let scrollMode = ScrollMode.VERTICAL,
  10878. spreadMode = SpreadMode.NONE;
  10879. switch (layout) {
  10880. case "SinglePage":
  10881. scrollMode = ScrollMode.PAGE;
  10882. break;
  10883. case "OneColumn":
  10884. break;
  10885. case "TwoPageLeft":
  10886. scrollMode = ScrollMode.PAGE;
  10887. case "TwoColumnLeft":
  10888. spreadMode = SpreadMode.ODD;
  10889. break;
  10890. case "TwoPageRight":
  10891. scrollMode = ScrollMode.PAGE;
  10892. case "TwoColumnRight":
  10893. spreadMode = SpreadMode.EVEN;
  10894. break;
  10895. }
  10896. return {
  10897. scrollMode,
  10898. spreadMode
  10899. };
  10900. }
  10901. function apiPageModeToSidebarView(mode) {
  10902. switch (mode) {
  10903. case "UseNone":
  10904. return SidebarView.NONE;
  10905. case "UseThumbs":
  10906. return SidebarView.THUMBS;
  10907. case "UseOutlines":
  10908. return SidebarView.OUTLINE;
  10909. case "UseAttachments":
  10910. return SidebarView.ATTACHMENTS;
  10911. case "UseOC":
  10912. return SidebarView.LAYERS;
  10913. }
  10914. return SidebarView.NONE;
  10915. }
  10916. function toggleCheckedBtn(button, toggle, view = null) {
  10917. button.classList.toggle("toggled", toggle);
  10918. button.setAttribute("aria-checked", toggle);
  10919. view?.classList.toggle("hidden", !toggle);
  10920. }
  10921. function toggleExpandedBtn(button, toggle, view = null) {
  10922. button.classList.toggle("toggled", toggle);
  10923. button.setAttribute("aria-expanded", toggle);
  10924. view?.classList.toggle("hidden", !toggle);
  10925. }
  10926. /***/ }),
  10927. /***/ 2973:
  10928. /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
  10929. __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
  10930. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  10931. /* harmony export */ XfaLayerBuilder: () => (/* binding */ XfaLayerBuilder)
  10932. /* harmony export */ });
  10933. /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2603);
  10934. var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__]);
  10935. pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
  10936. class XfaLayerBuilder {
  10937. constructor({
  10938. pdfPage,
  10939. annotationStorage = null,
  10940. linkService,
  10941. xfaHtml = null
  10942. }) {
  10943. this.pdfPage = pdfPage;
  10944. this.annotationStorage = annotationStorage;
  10945. this.linkService = linkService;
  10946. this.xfaHtml = xfaHtml;
  10947. this.div = null;
  10948. this._cancelled = false;
  10949. }
  10950. async render(viewport, intent = "display") {
  10951. if (intent === "print") {
  10952. const parameters = {
  10953. viewport: viewport.clone({
  10954. dontFlip: true
  10955. }),
  10956. div: this.div,
  10957. xfaHtml: this.xfaHtml,
  10958. annotationStorage: this.annotationStorage,
  10959. linkService: this.linkService,
  10960. intent
  10961. };
  10962. this.div = document.createElement("div");
  10963. parameters.div = this.div;
  10964. return pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.XfaLayer.render(parameters);
  10965. }
  10966. const xfaHtml = await this.pdfPage.getXfa();
  10967. if (this._cancelled || !xfaHtml) {
  10968. return {
  10969. textDivs: []
  10970. };
  10971. }
  10972. const parameters = {
  10973. viewport: viewport.clone({
  10974. dontFlip: true
  10975. }),
  10976. div: this.div,
  10977. xfaHtml,
  10978. annotationStorage: this.annotationStorage,
  10979. linkService: this.linkService,
  10980. intent
  10981. };
  10982. if (this.div) {
  10983. return pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.XfaLayer.update(parameters);
  10984. }
  10985. this.div = document.createElement("div");
  10986. parameters.div = this.div;
  10987. return pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.XfaLayer.render(parameters);
  10988. }
  10989. cancel() {
  10990. this._cancelled = true;
  10991. }
  10992. hide() {
  10993. if (!this.div) {
  10994. return;
  10995. }
  10996. this.div.hidden = true;
  10997. }
  10998. }
  10999. __webpack_async_result__();
  11000. } catch(e) { __webpack_async_result__(e); } });
  11001. /***/ })
  11002. /******/ });
  11003. /************************************************************************/
  11004. /******/ // The module cache
  11005. /******/ var __webpack_module_cache__ = {};
  11006. /******/
  11007. /******/ // The require function
  11008. /******/ function __webpack_require__(moduleId) {
  11009. /******/ // Check if module is in cache
  11010. /******/ var cachedModule = __webpack_module_cache__[moduleId];
  11011. /******/ if (cachedModule !== undefined) {
  11012. /******/ return cachedModule.exports;
  11013. /******/ }
  11014. /******/ // Create a new module (and put it into the cache)
  11015. /******/ var module = __webpack_module_cache__[moduleId] = {
  11016. /******/ // no module.id needed
  11017. /******/ // no module.loaded needed
  11018. /******/ exports: {}
  11019. /******/ };
  11020. /******/
  11021. /******/ // Execute the module function
  11022. /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  11023. /******/
  11024. /******/ // Return the exports of the module
  11025. /******/ return module.exports;
  11026. /******/ }
  11027. /******/
  11028. /************************************************************************/
  11029. /******/ /* webpack/runtime/async module */
  11030. /******/ (() => {
  11031. /******/ var webpackQueues = typeof Symbol === "function" ? Symbol("webpack queues") : "__webpack_queues__";
  11032. /******/ var webpackExports = typeof Symbol === "function" ? Symbol("webpack exports") : "__webpack_exports__";
  11033. /******/ var webpackError = typeof Symbol === "function" ? Symbol("webpack error") : "__webpack_error__";
  11034. /******/ var resolveQueue = (queue) => {
  11035. /******/ if(queue && queue.d < 1) {
  11036. /******/ queue.d = 1;
  11037. /******/ queue.forEach((fn) => (fn.r--));
  11038. /******/ queue.forEach((fn) => (fn.r-- ? fn.r++ : fn()));
  11039. /******/ }
  11040. /******/ }
  11041. /******/ var wrapDeps = (deps) => (deps.map((dep) => {
  11042. /******/ if(dep !== null && typeof dep === "object") {
  11043. /******/ if(dep[webpackQueues]) return dep;
  11044. /******/ if(dep.then) {
  11045. /******/ var queue = [];
  11046. /******/ queue.d = 0;
  11047. /******/ dep.then((r) => {
  11048. /******/ obj[webpackExports] = r;
  11049. /******/ resolveQueue(queue);
  11050. /******/ }, (e) => {
  11051. /******/ obj[webpackError] = e;
  11052. /******/ resolveQueue(queue);
  11053. /******/ });
  11054. /******/ var obj = {};
  11055. /******/ obj[webpackQueues] = (fn) => (fn(queue));
  11056. /******/ return obj;
  11057. /******/ }
  11058. /******/ }
  11059. /******/ var ret = {};
  11060. /******/ ret[webpackQueues] = x => {};
  11061. /******/ ret[webpackExports] = dep;
  11062. /******/ return ret;
  11063. /******/ }));
  11064. /******/ __webpack_require__.a = (module, body, hasAwait) => {
  11065. /******/ var queue;
  11066. /******/ hasAwait && ((queue = []).d = -1);
  11067. /******/ var depQueues = new Set();
  11068. /******/ var exports = module.exports;
  11069. /******/ var currentDeps;
  11070. /******/ var outerResolve;
  11071. /******/ var reject;
  11072. /******/ var promise = new Promise((resolve, rej) => {
  11073. /******/ reject = rej;
  11074. /******/ outerResolve = resolve;
  11075. /******/ });
  11076. /******/ promise[webpackExports] = exports;
  11077. /******/ promise[webpackQueues] = (fn) => (queue && fn(queue), depQueues.forEach(fn), promise["catch"](x => {}));
  11078. /******/ module.exports = promise;
  11079. /******/ body((deps) => {
  11080. /******/ currentDeps = wrapDeps(deps);
  11081. /******/ var fn;
  11082. /******/ var getResult = () => (currentDeps.map((d) => {
  11083. /******/ if(d[webpackError]) throw d[webpackError];
  11084. /******/ return d[webpackExports];
  11085. /******/ }))
  11086. /******/ var promise = new Promise((resolve) => {
  11087. /******/ fn = () => (resolve(getResult));
  11088. /******/ fn.r = 0;
  11089. /******/ var fnQueue = (q) => (q !== queue && !depQueues.has(q) && (depQueues.add(q), q && !q.d && (fn.r++, q.push(fn))));
  11090. /******/ currentDeps.map((dep) => (dep[webpackQueues](fnQueue)));
  11091. /******/ });
  11092. /******/ return fn.r ? promise : getResult();
  11093. /******/ }, (err) => ((err ? reject(promise[webpackError] = err) : outerResolve(exports)), resolveQueue(queue)));
  11094. /******/ queue && queue.d < 0 && (queue.d = 0);
  11095. /******/ };
  11096. /******/ })();
  11097. /******/
  11098. /******/ /* webpack/runtime/define property getters */
  11099. /******/ (() => {
  11100. /******/ // define getter functions for harmony exports
  11101. /******/ __webpack_require__.d = (exports, definition) => {
  11102. /******/ for(var key in definition) {
  11103. /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  11104. /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
  11105. /******/ }
  11106. /******/ }
  11107. /******/ };
  11108. /******/ })();
  11109. /******/
  11110. /******/ /* webpack/runtime/hasOwnProperty shorthand */
  11111. /******/ (() => {
  11112. /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
  11113. /******/ })();
  11114. /******/
  11115. /************************************************************************/
  11116. /******/
  11117. /******/ // startup
  11118. /******/ // Load entry module and return exports
  11119. /******/ // This entry module used 'module' so it can't be inlined
  11120. /******/ var __webpack_exports__ = __webpack_require__(624);
  11121. /******/ __webpack_exports__ = globalThis.pdfjsViewer = await (globalThis.pdfjsViewerPromise = __webpack_exports__);
  11122. /******/ var __webpack_exports__AnnotationLayerBuilder = __webpack_exports__.AnnotationLayerBuilder;
  11123. /******/ var __webpack_exports__DownloadManager = __webpack_exports__.DownloadManager;
  11124. /******/ var __webpack_exports__EventBus = __webpack_exports__.EventBus;
  11125. /******/ var __webpack_exports__FindState = __webpack_exports__.FindState;
  11126. /******/ var __webpack_exports__GenericL10n = __webpack_exports__.GenericL10n;
  11127. /******/ var __webpack_exports__LinkTarget = __webpack_exports__.LinkTarget;
  11128. /******/ var __webpack_exports__PDFFindController = __webpack_exports__.PDFFindController;
  11129. /******/ var __webpack_exports__PDFHistory = __webpack_exports__.PDFHistory;
  11130. /******/ var __webpack_exports__PDFLinkService = __webpack_exports__.PDFLinkService;
  11131. /******/ var __webpack_exports__PDFPageView = __webpack_exports__.PDFPageView;
  11132. /******/ var __webpack_exports__PDFScriptingManager = __webpack_exports__.PDFScriptingManager;
  11133. /******/ var __webpack_exports__PDFSinglePageViewer = __webpack_exports__.PDFSinglePageViewer;
  11134. /******/ var __webpack_exports__PDFViewer = __webpack_exports__.PDFViewer;
  11135. /******/ var __webpack_exports__ProgressBar = __webpack_exports__.ProgressBar;
  11136. /******/ var __webpack_exports__RenderingStates = __webpack_exports__.RenderingStates;
  11137. /******/ var __webpack_exports__ScrollMode = __webpack_exports__.ScrollMode;
  11138. /******/ var __webpack_exports__SimpleLinkService = __webpack_exports__.SimpleLinkService;
  11139. /******/ var __webpack_exports__SpreadMode = __webpack_exports__.SpreadMode;
  11140. /******/ var __webpack_exports__StructTreeLayerBuilder = __webpack_exports__.StructTreeLayerBuilder;
  11141. /******/ var __webpack_exports__TextLayerBuilder = __webpack_exports__.TextLayerBuilder;
  11142. /******/ var __webpack_exports__XfaLayerBuilder = __webpack_exports__.XfaLayerBuilder;
  11143. /******/ var __webpack_exports__parseQueryString = __webpack_exports__.parseQueryString;
  11144. /******/ export { __webpack_exports__AnnotationLayerBuilder as AnnotationLayerBuilder, __webpack_exports__DownloadManager as DownloadManager, __webpack_exports__EventBus as EventBus, __webpack_exports__FindState as FindState, __webpack_exports__GenericL10n as GenericL10n, __webpack_exports__LinkTarget as LinkTarget, __webpack_exports__PDFFindController as PDFFindController, __webpack_exports__PDFHistory as PDFHistory, __webpack_exports__PDFLinkService as PDFLinkService, __webpack_exports__PDFPageView as PDFPageView, __webpack_exports__PDFScriptingManager as PDFScriptingManager, __webpack_exports__PDFSinglePageViewer as PDFSinglePageViewer, __webpack_exports__PDFViewer as PDFViewer, __webpack_exports__ProgressBar as ProgressBar, __webpack_exports__RenderingStates as RenderingStates, __webpack_exports__ScrollMode as ScrollMode, __webpack_exports__SimpleLinkService as SimpleLinkService, __webpack_exports__SpreadMode as SpreadMode, __webpack_exports__StructTreeLayerBuilder as StructTreeLayerBuilder, __webpack_exports__TextLayerBuilder as TextLayerBuilder, __webpack_exports__XfaLayerBuilder as XfaLayerBuilder, __webpack_exports__parseQueryString as parseQueryString };
  11145. /******/
  11146. // The workerSrc property shall be specified.
  11147. ;;pdfjsLib.GlobalWorkerOptions.workerSrc = './pdf.worker.mjs';