cheerio.min.js 498 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546
  1. var e, t = function() {
  2. return t = Object.assign || function(e) {
  3. for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in t = arguments[n]) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
  4. return e
  5. }, t.apply(this, arguments)
  6. }, n = {
  7. xml: !1,
  8. decodeEntities: !0
  9. }, r = {
  10. _useHtmlParser2: !0,
  11. xmlMode: !0
  12. };
  13. function i(e) {
  14. return (null == e ? void 0 : e.xml) ? "boolean" == typeof e.xml ? r : t(t({}, r), e.xml) : null != e ? e : void 0
  15. }! function(e) {
  16. e.Root = "root", e.Text = "text", e.Directive = "directive", e.Comment = "comment", e.Script = "script", e.Style = "style", e.Tag = "tag", e.CDATA = "cdata", e.Doctype = "doctype"
  17. }(e || (e = {}));
  18. const s = e.Root, a = e.Text, o = e.Directive, c = e.Comment, l = e.Script, h = e.Style, u = e.Tag, p = e.CDATA, f = e.Doctype;
  19. class d {
  20. constructor() {
  21. this.parent = null, this.prev = null, this.next = null, this.startIndex = null, this.endIndex = null
  22. }
  23. get parentNode() {
  24. return this.parent
  25. }
  26. set parentNode(e) {
  27. this.parent = e
  28. }
  29. get previousSibling() {
  30. return this.prev
  31. }
  32. set previousSibling(e) {
  33. this.prev = e
  34. }
  35. get nextSibling() {
  36. return this.next
  37. }
  38. set nextSibling(e) {
  39. this.next = e
  40. }
  41. cloneNode(e = !1) {
  42. return v(this, e)
  43. }
  44. }
  45. class E extends d {
  46. constructor(e) {
  47. super(), this.data = e
  48. }
  49. get nodeValue() {
  50. return this.data
  51. }
  52. set nodeValue(e) {
  53. this.data = e
  54. }
  55. }
  56. class m extends E {
  57. constructor() {
  58. super(...arguments), this.type = e.Text
  59. }
  60. get nodeType() {
  61. return 3
  62. }
  63. }
  64. class T extends E {
  65. constructor() {
  66. super(...arguments), this.type = e.Comment
  67. }
  68. get nodeType() {
  69. return 8
  70. }
  71. }
  72. class _ extends E {
  73. constructor(t, n) {
  74. super(n), this.name = t, this.type = e.Directive
  75. }
  76. get nodeType() {
  77. return 1
  78. }
  79. }
  80. class A extends d {
  81. constructor(e) {
  82. super(), this.children = e
  83. }
  84. get firstChild() {
  85. var e;
  86. return null !== (e = this.children[0]) && void 0 !== e ? e : null
  87. }
  88. get lastChild() {
  89. return this.children.length > 0 ? this.children[this.children.length - 1] : null
  90. }
  91. get childNodes() {
  92. return this.children
  93. }
  94. set childNodes(e) {
  95. this.children = e
  96. }
  97. }
  98. class g extends A {
  99. constructor() {
  100. super(...arguments), this.type = e.CDATA
  101. }
  102. get nodeType() {
  103. return 4
  104. }
  105. }
  106. class N extends A {
  107. constructor() {
  108. super(...arguments), this.type = e.Root
  109. }
  110. get nodeType() {
  111. return 9
  112. }
  113. }
  114. class C extends A {
  115. constructor(t, n, r = [], i = ("script" === t ? e.Script : "style" === t ? e.Style : e.Tag)) {
  116. super(r), this.name = t, this.attribs = n, this.type = i
  117. }
  118. get nodeType() {
  119. return 1
  120. }
  121. get tagName() {
  122. return this.name
  123. }
  124. set tagName(e) {
  125. this.name = e
  126. }
  127. get attributes() {
  128. return Object.keys(this.attribs).map((e => {
  129. var t, n;
  130. return {
  131. name: e,
  132. value: this.attribs[e],
  133. namespace: null === (t = this["x-attribsNamespace"]) || void 0 === t ? void 0 : t[e],
  134. prefix: null === (n = this["x-attribsPrefix"]) || void 0 === n ? void 0 : n[e]
  135. }
  136. }))
  137. }
  138. }
  139. function I(t) {
  140. return (n = t).type === e.Tag || n.type === e.Script || n.type === e.Style;
  141. var n
  142. }
  143. function S(t) {
  144. return t.type === e.CDATA
  145. }
  146. function b(t) {
  147. return t.type === e.Text
  148. }
  149. function O(t) {
  150. return t.type === e.Comment
  151. }
  152. function y(t) {
  153. return t.type === e.Directive
  154. }
  155. function L(t) {
  156. return t.type === e.Root
  157. }
  158. function k(e) {
  159. return Object.prototype.hasOwnProperty.call(e, "children")
  160. }
  161. function v(e, t = !1) {
  162. let n;
  163. if (b(e)) n = new m(e.data);
  164. else if (O(e)) n = new T(e.data);
  165. else if (I(e)) {
  166. const r = t ? D(e.children) : [], i = new C(e.name, {...e.attribs
  167. }, r);
  168. r.forEach((e => e.parent = i)), null != e.namespace && (i.namespace = e.namespace), e["x-attribsNamespace"] && (i["x-attribsNamespace"] = {...e["x-attribsNamespace"]
  169. }), e["x-attribsPrefix"] && (i["x-attribsPrefix"] = {...e["x-attribsPrefix"]
  170. }), n = i
  171. } else if (S(e)) {
  172. const r = t ? D(e.children) : [], i = new g(r);
  173. r.forEach((e => e.parent = i)), n = i
  174. } else if (L(e)) {
  175. const r = t ? D(e.children) : [], i = new N(r);
  176. r.forEach((e => e.parent = i)), e["x-mode"] && (i["x-mode"] = e["x-mode"]), n = i
  177. } else {
  178. if (!y(e)) throw new Error(`Not implemented yet: ${e.type}`); {
  179. const t = new _(e.name, e.data);
  180. null != e["x-name"] && (t["x-name"] = e["x-name"], t["x-publicId"] = e["x-publicId"], t["x-systemId"] = e["x-systemId"]), n = t
  181. }
  182. }
  183. return n.startIndex = e.startIndex, n.endIndex = e.endIndex, null != e.sourceCodeLocation && (n.sourceCodeLocation = e.sourceCodeLocation), n
  184. }
  185. function D(e) {
  186. const t = e.map((e => v(e, !0)));
  187. for (let e = 1; e < t.length; e++) t[e].prev = t[e - 1], t[e - 1].next = t[e];
  188. return t
  189. }
  190. const R = {
  191. withStartIndices: !1,
  192. withEndIndices: !1,
  193. xmlMode: !1
  194. };
  195. class M {
  196. constructor(e, t, n) {
  197. this.dom = [], this.root = new N(this.dom), this.done = !1, this.tagStack = [this.root], this.lastNode = null, this.parser = null, "function" == typeof t && (n = t, t = R), "object" == typeof e && (t = e, e = void 0), this.callback = null != e ? e : null, this.options = null != t ? t : R, this.elementCB = null != n ? n : null
  198. }
  199. onparserinit(e) {
  200. this.parser = e
  201. }
  202. onreset() {
  203. this.dom = [], this.root = new N(this.dom), this.done = !1, this.tagStack = [this.root], this.lastNode = null, this.parser = null
  204. }
  205. onend() {
  206. this.done || (this.done = !0, this.parser = null, this.handleCallback(null))
  207. }
  208. onerror(e) {
  209. this.handleCallback(e)
  210. }
  211. onclosetag() {
  212. this.lastNode = null;
  213. const e = this.tagStack.pop();
  214. this.options.withEndIndices && (e.endIndex = this.parser.endIndex), this.elementCB && this.elementCB(e)
  215. }
  216. onopentag(t, n) {
  217. const r = this.options.xmlMode ? e.Tag : void 0, i = new C(t, n, void 0, r);
  218. this.addNode(i), this.tagStack.push(i)
  219. }
  220. ontext(t) {
  221. const {
  222. lastNode: n
  223. } = this;
  224. if (n && n.type === e.Text) n.data += t, this.options.withEndIndices && (n.endIndex = this.parser.endIndex);
  225. else {
  226. const e = new m(t);
  227. this.addNode(e), this.lastNode = e
  228. }
  229. }
  230. oncomment(t) {
  231. if (this.lastNode && this.lastNode.type === e.Comment) return void(this.lastNode.data += t);
  232. const n = new T(t);
  233. this.addNode(n), this.lastNode = n
  234. }
  235. oncommentend() {
  236. this.lastNode = null
  237. }
  238. oncdatastart() {
  239. const e = new m(""), t = new g([e]);
  240. this.addNode(t), e.parent = t, this.lastNode = e
  241. }
  242. oncdataend() {
  243. this.lastNode = null
  244. }
  245. onprocessinginstruction(e, t) {
  246. const n = new _(e, t);
  247. this.addNode(n)
  248. }
  249. handleCallback(e) {
  250. if ("function" == typeof this.callback) this.callback(e, this.dom);
  251. else if (e) throw e
  252. }
  253. addNode(e) {
  254. const t = this.tagStack[this.tagStack.length - 1], n = t.children[t.children.length - 1];
  255. this.options.withStartIndices && (e.startIndex = this.parser.startIndex), this.options.withEndIndices && (e.endIndex = this.parser.endIndex), t.children.push(e), n && (e.prev = n, n.next = e), e.parent = t, this.lastNode = null
  256. }
  257. }
  258. const P = /["&'<>$\x80-\uFFFF]/g, x = new Map([
  259. [34, "&quot;"],
  260. [38, "&amp;"],
  261. [39, "&apos;"],
  262. [60, "&lt;"],
  263. [62, "&gt;"]
  264. ]), w = null != String.prototype.codePointAt ? (e, t) => e.codePointAt(t) : (e, t) => 55296 == (64512 & e.charCodeAt(t)) ? 1024 * (e.charCodeAt(t) - 55296) + e.charCodeAt(t + 1) - 56320 + 65536 : e.charCodeAt(t);
  265. function B(e) {
  266. let t, n = "", r = 0;
  267. for (; null !== (t = P.exec(e));) {
  268. const i = t.index, s = e.charCodeAt(i), a = x.get(s);
  269. void 0 !== a ? (n += e.substring(r, i) + a, r = i + 1) : (n += `${e.substring(r,i)}&#x${w(e,i).toString(16)};`, r = P.lastIndex += Number(55296 == (64512 & s)))
  270. }
  271. return n + e.substr(r)
  272. }
  273. function F(e, t) {
  274. return function(n) {
  275. let r, i = 0, s = "";
  276. for (; r = e.exec(n);) i !== r.index && (s += n.substring(i, r.index)), s += t.get(r[0].charCodeAt(0)), i = r.index + 1;
  277. return s + n.substring(i)
  278. }
  279. }
  280. const U = F(/["&\u00A0]/g, new Map([
  281. [34, "&quot;"],
  282. [38, "&amp;"],
  283. [160, "&nbsp;"]
  284. ])), H = F(/[&<>\u00A0]/g, new Map([
  285. [38, "&amp;"],
  286. [60, "&lt;"],
  287. [62, "&gt;"],
  288. [160, "&nbsp;"]
  289. ])), G = new Map(["altGlyph", "altGlyphDef", "altGlyphItem", "animateColor", "animateMotion", "animateTransform", "clipPath", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "foreignObject", "glyphRef", "linearGradient", "radialGradient", "textPath"].map((e => [e.toLowerCase(), e]))), Y = new Map(["definitionURL", "attributeName", "attributeType", "baseFrequency", "baseProfile", "calcMode", "clipPathUnits", "diffuseConstant", "edgeMode", "filterUnits", "glyphRef", "gradientTransform", "gradientUnits", "kernelMatrix", "kernelUnitLength", "keyPoints", "keySplines", "keyTimes", "lengthAdjust", "limitingConeAngle", "markerHeight", "markerUnits", "markerWidth", "maskContentUnits", "maskUnits", "numOctaves", "pathLength", "patternContentUnits", "patternTransform", "patternUnits", "pointsAtX", "pointsAtY", "pointsAtZ", "preserveAlpha", "preserveAspectRatio", "primitiveUnits", "refX", "refY", "repeatCount", "repeatDur", "requiredExtensions", "requiredFeatures", "specularConstant", "specularExponent", "spreadMethod", "startOffset", "stdDeviation", "stitchTiles", "surfaceScale", "systemLanguage", "tableValues", "targetX", "targetY", "textLength", "viewBox", "viewTarget", "xChannelSelector", "yChannelSelector", "zoomAndPan"].map((e => [e.toLowerCase(), e]))), q = new Set(["style", "script", "xmp", "iframe", "noembed", "noframes", "plaintext", "noscript"]);
  290. function K(e) {
  291. return e.replace(/"/g, "&quot;")
  292. }
  293. const j = new Set(["area", "base", "basefont", "br", "col", "command", "embed", "frame", "hr", "img", "input", "isindex", "keygen", "link", "meta", "param", "source", "track", "wbr"]);
  294. function V(e, t = {}) {
  295. const n = "length" in e ? e : [e];
  296. let r = "";
  297. for (let e = 0; e < n.length; e++) r += W(n[e], t);
  298. return r
  299. }
  300. function W(e, t) {
  301. switch (e.type) {
  302. case s:
  303. return V(e.children, t);
  304. case f:
  305. case o:
  306. return `<${e.data}>`;
  307. case c:
  308. return function(e) {
  309. return `\x3c!--${e.data}--\x3e`
  310. }(e);
  311. case p:
  312. return function(e) {
  313. return `<![CDATA[${e.children[0].data}]]>`
  314. }(e);
  315. case l:
  316. case h:
  317. case u:
  318. return function(e, t) {
  319. var n;
  320. "foreign" === t.xmlMode && (e.name = null !== (n = G.get(e.name)) && void 0 !== n ? n : e.name, e.parent && Q.has(e.parent.name) && (t = {...t, xmlMode: !1
  321. }));
  322. !t.xmlMode && X.has(e.name) && (t = {...t, xmlMode: "foreign"
  323. });
  324. let r = `<${e.name}`;
  325. const i = function(e, t) {
  326. var n;
  327. if (!e) return;
  328. const r = !1 === (null !== (n = t.encodeEntities) && void 0 !== n ? n : t.decodeEntities) ? K : t.xmlMode || "utf8" !== t.encodeEntities ? B : U;
  329. return Object.keys(e).map((n => {
  330. var i, s;
  331. const a = null !== (i = e[n]) && void 0 !== i ? i : "";
  332. return "foreign" === t.xmlMode && (n = null !== (s = Y.get(n)) && void 0 !== s ? s : n), t.emptyAttrs || t.xmlMode || "" !== a ? `${n}="${r(a)}"` : n
  333. })).join(" ")
  334. }(e.attribs, t);
  335. i && (r += ` ${i}`);
  336. 0 === e.children.length && (t.xmlMode ? !1 !== t.selfClosingTags : t.selfClosingTags && j.has(e.name)) ? (t.xmlMode || (r += " "), r += "/>") : (r += ">", e.children.length > 0 && (r += V(e.children, t)), !t.xmlMode && j.has(e.name) || (r += `</${e.name}>`));
  337. return r
  338. }(e, t);
  339. case a:
  340. return function(e, t) {
  341. var n;
  342. let r = e.data || "";
  343. !1 === (null !== (n = t.encodeEntities) && void 0 !== n ? n : t.decodeEntities) || !t.xmlMode && e.parent && q.has(e.parent.name) || (r = t.xmlMode || "utf8" !== t.encodeEntities ? B(r) : H(r));
  344. return r
  345. }(e, t)
  346. }
  347. }
  348. const Q = new Set(["mi", "mo", "mn", "ms", "mtext", "annotation-xml", "foreignObject", "desc", "title"]), X = new Set(["svg", "math"]);
  349. function $(e, t) {
  350. return V(e, t)
  351. }
  352. function z(e) {
  353. return Array.isArray(e) ? e.map(z).join("") : k(e) && !O(e) ? z(e.children) : b(e) ? e.data : ""
  354. }
  355. function J(t) {
  356. return Array.isArray(t) ? t.map(J).join("") : k(t) && (t.type === e.Tag || S(t)) ? J(t.children) : b(t) ? t.data : ""
  357. }
  358. function Z(e) {
  359. return k(e) ? e.children : []
  360. }
  361. function ee(e) {
  362. return e.parent || null
  363. }
  364. function te(e) {
  365. const t = ee(e);
  366. if (null != t) return Z(t);
  367. const n = [e];
  368. let {
  369. prev: r,
  370. next: i
  371. } = e;
  372. for (; null != r;) n.unshift(r), ({
  373. prev: r
  374. } = r);
  375. for (; null != i;) n.push(i), ({
  376. next: i
  377. } = i);
  378. return n
  379. }
  380. function ne(e) {
  381. let {
  382. next: t
  383. } = e;
  384. for (; null !== t && !I(t);)({
  385. next: t
  386. } = t);
  387. return t
  388. }
  389. function re(e) {
  390. let {
  391. prev: t
  392. } = e;
  393. for (; null !== t && !I(t);)({
  394. prev: t
  395. } = t);
  396. return t
  397. }
  398. function ie(e) {
  399. if (e.prev && (e.prev.next = e.next), e.next && (e.next.prev = e.prev), e.parent) {
  400. const t = e.parent.children;
  401. t.splice(t.lastIndexOf(e), 1)
  402. }
  403. }
  404. function se(e, t, n = !0, r = 1 / 0) {
  405. return Array.isArray(t) || (t = [t]), ae(e, t, n, r)
  406. }
  407. function ae(e, t, n, r) {
  408. const i = [];
  409. for (const s of t) {
  410. if (e(s) && (i.push(s), --r <= 0)) break;
  411. if (n && k(s) && s.children.length > 0) {
  412. const t = ae(e, s.children, n, r);
  413. if (i.push(...t), r -= t.length, r <= 0) break
  414. }
  415. }
  416. return i
  417. }
  418. function oe(e, t, n = !0) {
  419. let r = null;
  420. for (let i = 0; i < t.length && !r; i++) {
  421. const s = t[i];
  422. I(s) && (e(s) ? r = s : n && s.children.length > 0 && (r = oe(e, s.children, !0)))
  423. }
  424. return r
  425. }
  426. const ce = {
  427. tag_name: e => "function" == typeof e ? t => I(t) && e(t.name) : "*" === e ? I : t => I(t) && t.name === e,
  428. tag_type: e => "function" == typeof e ? t => e(t.type) : t => t.type === e,
  429. tag_contains: e => "function" == typeof e ? t => b(t) && e(t.data) : t => b(t) && t.data === e
  430. };
  431. function le(e, t) {
  432. return "function" == typeof t ? n => I(n) && t(n.attribs[e]) : n => I(n) && n.attribs[e] === t
  433. }
  434. function he(e, t) {
  435. return n => e(n) || t(n)
  436. }
  437. function ue(e) {
  438. const t = Object.keys(e).map((t => {
  439. const n = e[t];
  440. return Object.prototype.hasOwnProperty.call(ce, t) ? ce[t](n) : le(t, n)
  441. }));
  442. return 0 === t.length ? null : t.reduce(he)
  443. }
  444. function pe(e, t, n = !0, r = 1 / 0) {
  445. return se(ce.tag_name(e), t, n, r)
  446. }
  447. var fe;
  448. function de(e, t) {
  449. const n = [], r = [];
  450. if (e === t) return 0;
  451. let i = k(e) ? e : e.parent;
  452. for (; i;) n.unshift(i), i = i.parent;
  453. for (i = k(t) ? t : t.parent; i;) r.unshift(i), i = i.parent;
  454. const s = Math.min(n.length, r.length);
  455. let a = 0;
  456. for (; a < s && n[a] === r[a];) a++;
  457. if (0 === a) return fe.DISCONNECTED;
  458. const o = n[a - 1], c = o.children, l = n[a], h = r[a];
  459. return c.indexOf(l) > c.indexOf(h) ? o === t ? fe.FOLLOWING | fe.CONTAINED_BY : fe.FOLLOWING : o === e ? fe.PRECEDING | fe.CONTAINS : fe.PRECEDING
  460. }
  461. function Ee(e) {
  462. return (e = e.filter(((e, t, n) => !n.includes(e, t + 1)))).sort(((e, t) => {
  463. const n = de(e, t);
  464. return n & fe.PRECEDING ? -1 : n & fe.FOLLOWING ? 1 : 0
  465. })), e
  466. }! function(e) {
  467. e[e.DISCONNECTED = 1] = "DISCONNECTED", e[e.PRECEDING = 2] = "PRECEDING", e[e.FOLLOWING = 4] = "FOLLOWING", e[e.CONTAINS = 8] = "CONTAINS", e[e.CONTAINED_BY = 16] = "CONTAINED_BY"
  468. }(fe || (fe = {}));
  469. const me = ["url", "type", "lang"], Te = ["fileSize", "bitrate", "framerate", "samplingrate", "channels", "duration", "height", "width"];
  470. function _e(e) {
  471. return pe("media:content", e).map((e => {
  472. const {
  473. attribs: t
  474. } = e, n = {
  475. medium: t.medium,
  476. isDefault: !! t.isDefault
  477. };
  478. for (const e of me) t[e] && (n[e] = t[e]);
  479. for (const e of Te) t[e] && (n[e] = parseInt(t[e], 10));
  480. return t.expression && (n.expression = t.expression), n
  481. }))
  482. }
  483. function Ae(e, t) {
  484. return pe(e, t, !0, 1)[0]
  485. }
  486. function ge(e, t, n = !1) {
  487. return z(pe(e, t, n, 1)).trim()
  488. }
  489. function Ne(e, t, n, r, i = !1) {
  490. const s = ge(n, r, i);
  491. s && (e[t] = s)
  492. }
  493. function Ce(e) {
  494. return "rss" === e || "feed" === e || "rdf:RDF" === e
  495. }
  496. var Ie, Se = Object.freeze({
  497. __proto__: null,
  498. isTag: I,
  499. isCDATA: S,
  500. isText: b,
  501. isComment: O,
  502. isDocument: L,
  503. hasChildren: k,
  504. getOuterHTML: $,
  505. getInnerHTML: function(e, t) {
  506. return k(e) ? e.children.map((e => $(e, t))).join("") : ""
  507. },
  508. getText: function e(t) {
  509. return Array.isArray(t) ? t.map(e).join("") : I(t) ? "br" === t.name ? "\n" : e(t.children) : S(t) ? e(t.children) : b(t) ? t.data : ""
  510. },
  511. textContent: z,
  512. innerText: J,
  513. getChildren: Z,
  514. getParent: ee,
  515. getSiblings: te,
  516. getAttributeValue: function(e, t) {
  517. var n;
  518. return null === (n = e.attribs) || void 0 === n ? void 0 : n[t]
  519. },
  520. hasAttrib: function(e, t) {
  521. return null != e.attribs && Object.prototype.hasOwnProperty.call(e.attribs, t) && null != e.attribs[t]
  522. },
  523. getName: function(e) {
  524. return e.name
  525. },
  526. nextElementSibling: ne,
  527. prevElementSibling: re,
  528. removeElement: ie,
  529. replaceElement: function(e, t) {
  530. const n = t.prev = e.prev;
  531. n && (n.next = t);
  532. const r = t.next = e.next;
  533. r && (r.prev = t);
  534. const i = t.parent = e.parent;
  535. if (i) {
  536. const n = i.children;
  537. n[n.lastIndexOf(e)] = t, e.parent = null
  538. }
  539. },
  540. appendChild: function(e, t) {
  541. if (ie(t), t.next = null, t.parent = e, e.children.push(t) > 1) {
  542. const n = e.children[e.children.length - 2];
  543. n.next = t, t.prev = n
  544. } else t.prev = null
  545. },
  546. append: function(e, t) {
  547. ie(t);
  548. const {
  549. parent: n
  550. } = e, r = e.next;
  551. if (t.next = r, t.prev = e, e.next = t, t.parent = n, r) {
  552. if (r.prev = t, n) {
  553. const e = n.children;
  554. e.splice(e.lastIndexOf(r), 0, t)
  555. }
  556. } else n && n.children.push(t)
  557. },
  558. prependChild: function(e, t) {
  559. if (ie(t), t.parent = e, t.prev = null, 1 !== e.children.unshift(t)) {
  560. const n = e.children[1];
  561. n.prev = t, t.next = n
  562. } else t.next = null
  563. },
  564. prepend: function(e, t) {
  565. ie(t);
  566. const {
  567. parent: n
  568. } = e;
  569. if (n) {
  570. const r = n.children;
  571. r.splice(r.indexOf(e), 0, t)
  572. }
  573. e.prev && (e.prev.next = t), t.parent = n, t.prev = e.prev, t.next = e, e.prev = t
  574. },
  575. filter: se,
  576. find: ae,
  577. findOneChild: function(e, t) {
  578. return t.find(e)
  579. },
  580. findOne: oe,
  581. existsOne: function e(t, n) {
  582. return n.some((n => I(n) && (t(n) || n.children.length > 0 && e(t, n.children))))
  583. },
  584. findAll: function(e, t) {
  585. var n;
  586. const r = [], i = t.filter(I);
  587. let s;
  588. for (; s = i.shift();) {
  589. const t = null === (n = s.children) || void 0 === n ? void 0 : n.filter(I);
  590. t && t.length > 0 && i.unshift(...t), e(s) && r.push(s)
  591. }
  592. return r
  593. },
  594. testElement: function(e, t) {
  595. const n = ue(e);
  596. return !n || n(t)
  597. },
  598. getElements: function(e, t, n, r = 1 / 0) {
  599. const i = ue(e);
  600. return i ? se(i, t, n, r) : []
  601. },
  602. getElementById: function(e, t, n = !0) {
  603. return Array.isArray(t) || (t = [t]), oe(le("id", e), t, n)
  604. },
  605. getElementsByTagName: pe,
  606. getElementsByTagType: function(e, t, n = !0, r = 1 / 0) {
  607. return se(ce.tag_type(e), t, n, r)
  608. },
  609. removeSubsets: function(e) {
  610. let t = e.length;
  611. for (; --t >= 0;) {
  612. const n = e[t];
  613. if (t > 0 && e.lastIndexOf(n, t - 1) >= 0) e.splice(t, 1);
  614. else for (let r = n.parent; r; r = r.parent) if (e.includes(r)) {
  615. e.splice(t, 1);
  616. break
  617. }
  618. }
  619. return e
  620. },
  621. get DocumentPosition() {
  622. return fe
  623. },
  624. compareDocumentPosition: de,
  625. uniqueSort: Ee,
  626. getFeed: function(e) {
  627. const t = Ae(Ce, e);
  628. return t ? "feed" === t.name ? function(e) {
  629. var t;
  630. const n = e.children, r = {
  631. type: "atom",
  632. items: pe("entry", n).map((e => {
  633. var t;
  634. const {
  635. children: n
  636. } = e, r = {
  637. media: _e(n)
  638. };
  639. Ne(r, "id", "id", n), Ne(r, "title", "title", n);
  640. const i = null === (t = Ae("link", n)) || void 0 === t ? void 0 : t.attribs.href;
  641. i && (r.link = i);
  642. const s = ge("summary", n) || ge("content", n);
  643. s && (r.description = s);
  644. const a = ge("updated", n);
  645. return a && (r.pubDate = new Date(a)), r
  646. }))
  647. };
  648. Ne(r, "id", "id", n), Ne(r, "title", "title", n);
  649. const i = null === (t = Ae("link", n)) || void 0 === t ? void 0 : t.attribs.href;
  650. i && (r.link = i);
  651. Ne(r, "description", "subtitle", n);
  652. const s = ge("updated", n);
  653. s && (r.updated = new Date(s));
  654. return Ne(r, "author", "email", n, !0), r
  655. }(t) : function(e) {
  656. var t, n;
  657. const r = null !== (n = null === (t = Ae("channel", e.children)) || void 0 === t ? void 0 : t.children) && void 0 !== n ? n : [], i = {
  658. type: e.name.substr(0, 3),
  659. id: "",
  660. items: pe("item", e.children).map((e => {
  661. const {
  662. children: t
  663. } = e, n = {
  664. media: _e(t)
  665. };
  666. Ne(n, "id", "guid", t), Ne(n, "title", "title", t), Ne(n, "link", "link", t), Ne(n, "description", "description", t);
  667. const r = ge("pubDate", t);
  668. return r && (n.pubDate = new Date(r)), n
  669. }))
  670. };
  671. Ne(i, "title", "title", r), Ne(i, "link", "link", r), Ne(i, "description", "description", r);
  672. const s = ge("lastBuildDate", r);
  673. s && (i.updated = new Date(s));
  674. return Ne(i, "author", "managingEditor", r, !0), i
  675. }(t) : null
  676. }
  677. }),
  678. be = "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {};
  679. function Oe(e) {
  680. if (Object.keys) return Object.keys(e);
  681. var t = [];
  682. for (var n in e) t.push(n);
  683. return t
  684. }
  685. function ye(e, t) {
  686. if (e.forEach) return e.forEach(t);
  687. for (var n = 0; n < e.length; n++) t(e[n], n, e)
  688. }
  689. function Le() {
  690. try {
  691. return Object.defineProperty({}, "_", {}),
  692. function(e, t, n) {
  693. Object.defineProperty(e, t, {
  694. writable: !0,
  695. enumerable: !1,
  696. configurable: !0,
  697. value: n
  698. })
  699. }
  700. } catch (e) {
  701. return function(e, t, n) {
  702. e[t] = n
  703. }
  704. }
  705. }
  706. var ke = ["Array", "Boolean", "Date", "Error", "EvalError", "Function", "Infinity", "JSON", "Math", "NaN", "Number", "Object", "RangeError", "ReferenceError", "RegExp", "String", "SyntaxError", "TypeError", "URIError", "decodeURI", "decodeURIComponent", "encodeURI", "encodeURIComponent", "escape", "eval", "isFinite", "isNaN", "parseFloat", "parseInt", "undefined", "unescape"];
  707. function ve() {}
  708. function De(e) {
  709. if (!(this instanceof De)) return new De(e);
  710. this.code = e
  711. }
  712. function Re(e) {
  713. if (Me(e)) return e;
  714. var t = new ve;
  715. return "object" == typeof e && ye(Oe(e), (function(n) {
  716. t[n] = e[n]
  717. })), t
  718. }
  719. function Me(e) {
  720. return e instanceof ve
  721. }
  722. ve.prototype = {}, De.prototype.runInContext = function(e) {
  723. if (!(e instanceof ve)) throw new TypeError("needs a 'context' argument.");
  724. if (be.document) {
  725. var t = be.document.createElement("iframe");
  726. t.style || (t.style = {}), t.style.display = "none", be.document.body.appendChild(t);
  727. var n = t.contentWindow,
  728. r = n.eval,
  729. i = n.execScript;
  730. !r && i && (i.call(n, "null"), r = n.eval), ye(Oe(e), (function(t) {
  731. n[t] = e[t]
  732. })), ye(ke, (function(t) {
  733. e[t] && (n[t] = e[t])
  734. }));
  735. var s = Oe(n),
  736. a = r.call(n, this.code);
  737. return ye(Oe(n), (function(t) {
  738. (t in e || -1 === function(e, t) {
  739. if (xe) return e.indexOf(t);
  740. for (var n = 0; n < e.length; ++n) if (e[n] === t) return n;
  741. return -1
  742. }(s, t)) && (e[t] = n[t])
  743. })), ye(ke, (function(t) {
  744. var r, i, s;
  745. t in e || (r = e, i = t, s = n[t], "function" != typeof Ie && (Ie = Le), Ie(r, i, s))
  746. })), be.document.body.removeChild(t), a
  747. }
  748. return function(e, t) {
  749. var n = Oe(be);
  750. return n.push("with (this.__ctx__){return eval(this.__code__)}"), Function.apply(null, n).apply({
  751. __code__: e,
  752. __ctx__: t
  753. })
  754. }(this.code, e)
  755. }, De.prototype.runInThisContext = function() {
  756. return new Function("code", "return eval(code);").call(be, this.code)
  757. }, De.prototype.runInNewContext = function(e) {
  758. var t = Re(e),
  759. n = this.runInContext(t);
  760. return e && ye(Oe(t), (function(n) {
  761. e[n] = t[n]
  762. })), n
  763. };
  764. var Pe = {
  765. runInContext: function(e, t, n) {
  766. return new De(e).runInContext(t, n)
  767. },
  768. isContext: Me,
  769. createContext: Re,
  770. createScript: function(e) {
  771. return new De(e)
  772. },
  773. Script: De,
  774. runInThisContext: function(e, t) {
  775. return new De(e).runInThisContext(t)
  776. },
  777. runInNewContext: function(e, t, n) {
  778. return new De(e).runInNewContext(t, n)
  779. }
  780. }, xe = [].indexOf;
  781. const {
  782. hasOwnProperty: we
  783. } = Object.prototype;
  784. function Be(e, t) {
  785. return (e = e.slice()).push(t), e
  786. }
  787. function Fe(e, t) {
  788. return (t = t.slice()).unshift(e), t
  789. }
  790. class Ue extends Error {
  791. constructor(e) {
  792. super('JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'), this.avoidNew = !0, this.value = e, this.name = "NewError"
  793. }
  794. }
  795. function He(e, t, n, r, i) {
  796. if (!(this instanceof He)) try {
  797. return new He(e, t, n, r, i)
  798. } catch (e) {
  799. if (!e.avoidNew) throw e;
  800. return e.value
  801. }
  802. "string" == typeof e && (i = r, r = n, n = t, t = e, e = null);
  803. const s = e && "object" == typeof e;
  804. if (e = e || {}, this.json = e.json || n, this.path = e.path || t, this.resultType = e.resultType || "value", this.flatten = e.flatten || !1, this.wrap = !we.call(e, "wrap") || e.wrap, this.sandbox = e.sandbox || {}, this.preventEval = e.preventEval || !1, this.parent = e.parent || null, this.parentProperty = e.parentProperty || null, this.callback = e.callback || r || null, this.otherTypeCallback = e.otherTypeCallback || i || function() {
  805. throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")
  806. }, !1 !== e.autostart) {
  807. const r = {
  808. path: s ? e.path : t
  809. };
  810. s ? "json" in e && (r.json = e.json) : r.json = n;
  811. const i = this.evaluate(r);
  812. if (!i || "object" != typeof i) throw new Ue(i);
  813. return i
  814. }
  815. }
  816. He.prototype.evaluate = function(e, t, n, r) {
  817. let i = this.parent, s = this.parentProperty, {
  818. flatten: a,
  819. wrap: o
  820. } = this;
  821. if (this.currResultType = this.resultType, this.currPreventEval = this.preventEval, this.currSandbox = this.sandbox, n = n || this.callback, this.currOtherTypeCallback = r || this.otherTypeCallback, t = t || this.json, (e = e || this.path) && "object" == typeof e && !Array.isArray(e)) {
  822. if (!e.path && "" !== e.path) throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');
  823. if (!we.call(e, "json")) throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');
  824. ({
  825. json: t
  826. } = e), a = we.call(e, "flatten") ? e.flatten : a, this.currResultType = we.call(e, "resultType") ? e.resultType : this.currResultType, this.currSandbox = we.call(e, "sandbox") ? e.sandbox : this.currSandbox, o = we.call(e, "wrap") ? e.wrap : o, this.currPreventEval = we.call(e, "preventEval") ? e.preventEval : this.currPreventEval, n = we.call(e, "callback") ? e.callback : n, this.currOtherTypeCallback = we.call(e, "otherTypeCallback") ? e.otherTypeCallback : this.currOtherTypeCallback, i = we.call(e, "parent") ? e.parent : i, s = we.call(e, "parentProperty") ? e.parentProperty : s, e = e.path
  827. }
  828. if (i = i || null, s = s || null, Array.isArray(e) && (e = He.toPathString(e)), !e && "" !== e || !t) return;
  829. const c = He.toPathArray(e);
  830. "$" === c[0] && c.length > 1 && c.shift(), this._hasParentSelector = null;
  831. const l = this._trace(c, t, ["$"], i, s, n).filter((function(e) {
  832. return e && !e.isParentSelector
  833. }));
  834. return l.length ? o || 1 !== l.length || l[0].hasArrExpr ? l.reduce(((e, t) => {
  835. const n = this._getPreferredOutput(t);
  836. return a && Array.isArray(n) ? e = e.concat(n) : e.push(n), e
  837. }), []) : this._getPreferredOutput(l[0]) : o ? [] : void 0
  838. }, He.prototype._getPreferredOutput = function(e) {
  839. const t = this.currResultType;
  840. switch (t) {
  841. case "all":
  842. {
  843. const t = Array.isArray(e.path) ? e.path : He.toPathArray(e.path);
  844. return e.pointer = He.toPointer(t), e.path = "string" == typeof e.path ? e.path : He.toPathString(e.path), e
  845. }
  846. case "value":
  847. case "parent":
  848. case "parentProperty":
  849. return e[t];
  850. case "path":
  851. return He.toPathString(e[t]);
  852. case "pointer":
  853. return He.toPointer(e.path);
  854. default:
  855. throw new TypeError("Unknown result type")
  856. }
  857. }, He.prototype._handleCallback = function(e, t, n) {
  858. if (t) {
  859. const r = this._getPreferredOutput(e);
  860. e.path = "string" == typeof e.path ? e.path : He.toPathString(e.path), t(r, n, e)
  861. }
  862. }, He.prototype._trace = function(e, t, n, r, i, s, a, o) {
  863. let c;
  864. if (!e.length) return c = {
  865. path: n,
  866. value: t,
  867. parent: r,
  868. parentProperty: i,
  869. hasArrExpr: a
  870. }, this._handleCallback(c, s, "value"), c;
  871. const l = e[0], h = e.slice(1), u = [];
  872. function p(e) {
  873. Array.isArray(e) ? e.forEach((e => {
  874. u.push(e)
  875. })) : u.push(e)
  876. }
  877. if (("string" != typeof l || o) && t && we.call(t, l)) p(this._trace(h, t[l], Be(n, l), t, l, s, a));
  878. else if ("*" === l) this._walk(t, (e => {
  879. p(this._trace(h, t[e], Be(n, e), t, e, s, !0, !0))
  880. }));
  881. else if (".." === l) p(this._trace(h, t, n, r, i, s, a)), this._walk(t, (r => {
  882. "object" == typeof t[r] && p(this._trace(e.slice(), t[r], Be(n, r), t, r, s, !0))
  883. }));
  884. else {
  885. if ("^" === l) return this._hasParentSelector = !0, {
  886. path: n.slice(0, -1),
  887. expr: h,
  888. isParentSelector: !0
  889. };
  890. if ("~" === l) return c = {
  891. path: Be(n, l),
  892. value: i,
  893. parent: r,
  894. parentProperty: null
  895. }, this._handleCallback(c, s, "property"), c;
  896. if ("$" === l) p(this._trace(h, t, n, null, null, s, a));
  897. else if (/^(-?\d*):(-?\d*):?(\d*)$/u.test(l)) p(this._slice(l, h, t, n, r, i, s));
  898. else if (0 === l.indexOf("?(")) {
  899. if (this.currPreventEval) throw new Error("Eval [?(expr)] prevented in JSONPath expression.");
  900. const e = l.replace(/^\?\((.*?)\)$/u, "$1");
  901. this._walk(t, (a => {
  902. this._eval(e, t[a], a, n, r, i) && p(this._trace(h, t[a], Be(n, a), t, a, s, !0))
  903. }))
  904. } else if ("(" === l[0]) {
  905. if (this.currPreventEval) throw new Error("Eval [(expr)] prevented in JSONPath expression.");
  906. p(this._trace(Fe(this._eval(l, t, n[n.length - 1], n.slice(0, -1), r, i), h), t, n, r, i, s, a))
  907. } else if ("@" === l[0]) {
  908. let e = !1;
  909. const a = l.slice(1, -2);
  910. switch (a) {
  911. case "scalar":
  912. t && ["object", "function"].includes(typeof t) || (e = !0);
  913. break;
  914. case "boolean":
  915. case "string":
  916. case "undefined":
  917. case "function":
  918. typeof t === a && (e = !0);
  919. break;
  920. case "integer":
  921. !Number.isFinite(t) || t % 1 || (e = !0);
  922. break;
  923. case "number":
  924. Number.isFinite(t) && (e = !0);
  925. break;
  926. case "nonFinite":
  927. "number" != typeof t || Number.isFinite(t) || (e = !0);
  928. break;
  929. case "object":
  930. t && typeof t === a && (e = !0);
  931. break;
  932. case "array":
  933. Array.isArray(t) && (e = !0);
  934. break;
  935. case "other":
  936. e = this.currOtherTypeCallback(t, n, r, i);
  937. break;
  938. case "null":
  939. null === t && (e = !0);
  940. break;
  941. default:
  942. throw new TypeError("Unknown value type " + a)
  943. }
  944. if (e) return c = {
  945. path: n,
  946. value: t,
  947. parent: r,
  948. parentProperty: i
  949. }, this._handleCallback(c, s, "value"), c
  950. } else if ("`" === l[0] && t && we.call(t, l.slice(1))) {
  951. const e = l.slice(1);
  952. p(this._trace(h, t[e], Be(n, e), t, e, s, a, !0))
  953. } else if (l.includes(",")) {
  954. const e = l.split(",");
  955. for (const a of e) p(this._trace(Fe(a, h), t, n, r, i, s, !0))
  956. } else !o && t && we.call(t, l) && p(this._trace(h, t[l], Be(n, l), t, l, s, a, !0))
  957. }
  958. if (this._hasParentSelector) for (let e = 0; e < u.length; e++) {
  959. const n = u[e];
  960. if (n && n.isParentSelector) {
  961. const o = this._trace(n.expr, t, n.path, r, i, s, a);
  962. if (Array.isArray(o)) {
  963. u[e] = o[0];
  964. const t = o.length;
  965. for (let n = 1; n < t; n++) e++, u.splice(e, 0, o[n])
  966. } else u[e] = o
  967. }
  968. }
  969. return u
  970. }, He.prototype._walk = function(e, t) {
  971. if (Array.isArray(e)) {
  972. const n = e.length;
  973. for (let e = 0; e < n; e++) t(e)
  974. } else e && "object" == typeof e && Object.keys(e).forEach((e => {
  975. t(e)
  976. }))
  977. }, He.prototype._slice = function(e, t, n, r, i, s, a) {
  978. if (!Array.isArray(n)) return;
  979. const o = n.length, c = e.split(":"), l = c[2] && Number.parseInt(c[2]) || 1;
  980. let h = c[0] && Number.parseInt(c[0]) || 0, u = c[1] && Number.parseInt(c[1]) || o;
  981. h = h < 0 ? Math.max(0, h + o) : Math.min(o, h), u = u < 0 ? Math.max(0, u + o) : Math.min(o, u);
  982. const p = [];
  983. for (let e = h; e < u; e += l) {
  984. this._trace(Fe(e, t), n, r, i, s, a, !0).forEach((e => {
  985. p.push(e)
  986. }))
  987. }
  988. return p
  989. }, He.prototype._eval = function(e, t, n, r, i, s) {
  990. this.currSandbox._$_parentProperty = s, this.currSandbox._$_parent = i, this.currSandbox._$_property = n, this.currSandbox._$_root = this.json, this.currSandbox._$_v = t;
  991. const a = e.includes("@path");
  992. a && (this.currSandbox._$_path = He.toPathString(r.concat([n])));
  993. const o = "script:" + e;
  994. if (!He.cache[o]) {
  995. let t = e.replace(/@parentProperty/gu, "_$_parentProperty").replace(/@parent/gu, "_$_parent").replace(/@property/gu, "_$_property").replace(/@root/gu, "_$_root").replace(/@([.\s)[])/gu, "_$_v$1");
  996. a && (t = t.replace(/@path/gu, "_$_path")), He.cache[o] = new this.vm.Script(t)
  997. }
  998. try {
  999. return He.cache[o].runInNewContext(this.currSandbox)
  1000. } catch (t) {
  1001. throw new Error("jsonPath: " + t.message + ": " + e)
  1002. }
  1003. }, He.cache = {}, He.toPathString = function(e) {
  1004. const t = e, n = t.length;
  1005. let r = "$";
  1006. for (let e = 1; e < n; e++) /^(~|\^|@.*?\(\))$/u.test(t[e]) || (r += /^[0-9*]+$/u.test(t[e]) ? "[" + t[e] + "]" : "['" + t[e] + "']");
  1007. return r
  1008. }, He.toPointer = function(e) {
  1009. const t = e, n = t.length;
  1010. let r = "";
  1011. for (let e = 1; e < n; e++) /^(~|\^|@.*?\(\))$/u.test(t[e]) || (r += "/" + t[e].toString().replace(/~/gu, "~0").replace(/\//gu, "~1"));
  1012. return r
  1013. }, He.toPathArray = function(e) {
  1014. const {
  1015. cache: t
  1016. } = He;
  1017. if (t[e]) return t[e].concat();
  1018. const n = [], r = e.replace(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/gu, ";$&;").replace(/[['](\??\(.*?\))[\]']/gu, (function(e, t) {
  1019. return "[#" + (n.push(t) - 1) + "]"
  1020. })).replace(/\[['"]([^'\]]*)['"]\]/gu, (function(e, t) {
  1021. return "['" + t.replace(/\./gu, "%@%").replace(/~/gu, "%%@@%%") + "']"
  1022. })).replace(/~/gu, ";~;").replace(/['"]?\.['"]?(?![^[]*\])|\[['"]?/gu, ";").replace(/%@%/gu, ".").replace(/%%@@%%/gu, "~").replace(/(?:;)?(\^+)(?:;)?/gu, (function(e, t) {
  1023. return ";" + t.split("").join(";") + ";"
  1024. })).replace(/;;;|;;/gu, ";..;").replace(/;$|'?\]|'$/gu, ""), i = r.split(";").map((function(e) {
  1025. const t = e.match(/#(\d+)/u);
  1026. return t && t[1] ? n[t[1]] : e
  1027. }));
  1028. return t[e] = i, t[e].concat()
  1029. }, He.prototype.vm = Pe;
  1030. var Ge = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {};
  1031. function Ye() {
  1032. throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")
  1033. }
  1034. function qe(e) {
  1035. return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.
  1036. default : e
  1037. }
  1038. function Ke(e, t) {
  1039. return e(t = {
  1040. exports: {}
  1041. }, t.exports), t.exports
  1042. }
  1043. var je = Ke((function(e) {
  1044. var t = Array.prototype,
  1045. n = Object.prototype,
  1046. r = {
  1047. "&": "&amp;",
  1048. '"': "&quot;",
  1049. "'": "&#39;",
  1050. "<": "&lt;",
  1051. ">": "&gt;"
  1052. }, i = /[&"'<>]/g,
  1053. s = e.exports = {};
  1054. function a(e, t) {
  1055. return n.hasOwnProperty.call(e, t)
  1056. }
  1057. function o(e) {
  1058. return r[e]
  1059. }
  1060. function c(e, t, n) {
  1061. var r, i, s;
  1062. if (e instanceof Error && (e = (i = e).name + ": " + i.message), Object.setPrototypeOf ? (r = new Error(e), Object.setPrototypeOf(r, c.prototype)) : (r = this, Object.defineProperty(r, "message", {
  1063. enumerable: !1,
  1064. writable: !0,
  1065. value: e
  1066. })), Object.defineProperty(r, "name", {
  1067. value: "Template render error"
  1068. }), Error.captureStackTrace && Error.captureStackTrace(r, this.constructor), i) {
  1069. var a = Object.getOwnPropertyDescriptor(i, "stack");
  1070. (s = a && (a.get || function() {
  1071. return a.value
  1072. })) || (s = function() {
  1073. return i.stack
  1074. })
  1075. } else {
  1076. var o = new Error(e).stack;
  1077. s = function() {
  1078. return o
  1079. }
  1080. }
  1081. return Object.defineProperty(r, "stack", {
  1082. get: function() {
  1083. return s.call(r)
  1084. }
  1085. }), Object.defineProperty(r, "cause", {
  1086. value: i
  1087. }), r.lineno = t, r.colno = n, r.firstUpdate = !0, r.Update = function(e) {
  1088. var t = "(" + (e || "unknown path") + ")";
  1089. return this.firstUpdate && (this.lineno && this.colno ? t += " [Line " + this.lineno + ", Column " + this.colno + "]" : this.lineno && (t += " [Line " + this.lineno + "]")), t += "\n ", this.firstUpdate && (t += " "), this.message = t + (this.message || ""), this.firstUpdate = !1, this
  1090. }, r
  1091. }
  1092. function l(e) {
  1093. return "[object Function]" === n.toString.call(e)
  1094. }
  1095. function h(e) {
  1096. return "[object Array]" === n.toString.call(e)
  1097. }
  1098. function u(e) {
  1099. return "[object String]" === n.toString.call(e)
  1100. }
  1101. function p(e) {
  1102. return "[object Object]" === n.toString.call(e)
  1103. }
  1104. function f(e) {
  1105. var t = function(e) {
  1106. return e ? "string" == typeof e ? e.split(".") : [e] : []
  1107. }(e);
  1108. return function(e) {
  1109. for (var n = e, r = 0; r < t.length; r++) {
  1110. var i = t[r];
  1111. if (!a(n, i)) return;
  1112. n = n[i]
  1113. }
  1114. return n
  1115. }
  1116. }
  1117. function d(e) {
  1118. return Array.prototype.slice.call(e)
  1119. }
  1120. function E(e, t, n) {
  1121. return Array.prototype.indexOf.call(e || [], t, n)
  1122. }
  1123. function m(e) {
  1124. var t = [];
  1125. for (var n in e) a(e, n) && t.push(n);
  1126. return t
  1127. }
  1128. s.hasOwnProp = a, s._prettifyError = function(e, t, n) {
  1129. if (n.Update || (n = new s.TemplateError(n)), n.Update(e), !t) {
  1130. var r = n;
  1131. (n = new Error(r.message)).name = r.name
  1132. }
  1133. return n
  1134. }, Object.setPrototypeOf ? Object.setPrototypeOf(c.prototype, Error.prototype) : c.prototype = Object.create(Error.prototype, {
  1135. constructor: {
  1136. value: c
  1137. }
  1138. }), s.TemplateError = c, s.escape = function(e) {
  1139. return e.replace(i, o)
  1140. }, s.isFunction = l, s.isArray = h, s.isString = u, s.isObject = p, s.getAttrGetter = f, s.groupBy = function(e, t, n) {
  1141. for (var r = {}, i = l(t) ? t : f(t), s = 0; s < e.length; s++) {
  1142. var a = e[s],
  1143. o = i(a, s);
  1144. if (void 0 === o && !0 === n) throw new TypeError('groupby: attribute "' + t + '" resolved to undefined');
  1145. (r[o] || (r[o] = [])).push(a)
  1146. }
  1147. return r
  1148. }, s.toArray = d, s.without = function(e) {
  1149. var t = [];
  1150. if (!e) return t;
  1151. for (var n = e.length, r = d(arguments).slice(1), i = -1; ++i < n;) - 1 === E(r, e[i]) && t.push(e[i]);
  1152. return t
  1153. }, s.repeat = function(e, t) {
  1154. for (var n = "", r = 0; r < t; r++) n += e;
  1155. return n
  1156. }, s.each = function(e, n, r) {
  1157. if (null != e) if (t.forEach && e.forEach === t.forEach) e.forEach(n, r);
  1158. else if (e.length === +e.length) for (var i = 0, s = e.length; i < s; i++) n.call(r, e[i], i, e)
  1159. }, s.map = function(e, n) {
  1160. var r = [];
  1161. if (null == e) return r;
  1162. if (t.map && e.map === t.map) return e.map(n);
  1163. for (var i = 0; i < e.length; i++) r[r.length] = n(e[i], i);
  1164. return e.length === +e.length && (r.length = e.length), r
  1165. }, s.asyncIter = function(e, t, n) {
  1166. var r = -1;
  1167. ! function i() {
  1168. ++r < e.length ? t(e[r], r, i, n) : n()
  1169. }()
  1170. }, s.asyncFor = function(e, t, n) {
  1171. var r = m(e || {}),
  1172. i = r.length,
  1173. s = -1;
  1174. ! function a() {
  1175. s++;
  1176. var o = r[s];
  1177. s < i ? t(o, e[o], s, i, a) : n()
  1178. }()
  1179. }, s.indexOf = E, s.keys = m, s._entries = function(e) {
  1180. return m(e).map((function(t) {
  1181. return [t, e[t]]
  1182. }))
  1183. }, s._values = function(e) {
  1184. return m(e).map((function(t) {
  1185. return e[t]
  1186. }))
  1187. }, s._assign = s.extend = function(e, t) {
  1188. return e = e || {}, m(t).forEach((function(n) {
  1189. e[n] = t[n]
  1190. })), e
  1191. }, s.inOperator = function(e, t) {
  1192. if (h(t) || u(t)) return -1 !== t.indexOf(e);
  1193. if (p(t)) return e in t;
  1194. throw new Error('Cannot use "in" operator to search for "' + e + '" in unexpected types.')
  1195. }
  1196. }));
  1197. function Ve() {
  1198. throw new Error("setTimeout has not been defined")
  1199. }
  1200. function We() {
  1201. throw new Error("clearTimeout has not been defined")
  1202. }
  1203. var Qe = Ve,
  1204. Xe = We;
  1205. function $e(e) {
  1206. if (Qe === setTimeout) return setTimeout(e, 0);
  1207. if ((Qe === Ve || !Qe) && setTimeout) return Qe = setTimeout, setTimeout(e, 0);
  1208. try {
  1209. return Qe(e, 0)
  1210. } catch (t) {
  1211. try {
  1212. return Qe.call(null, e, 0)
  1213. } catch (t) {
  1214. return Qe.call(this, e, 0)
  1215. }
  1216. }
  1217. }
  1218. "function" == typeof be.setTimeout && (Qe = setTimeout), "function" == typeof be.clearTimeout && (Xe = clearTimeout);
  1219. var ze, Je = [],
  1220. Ze = !1,
  1221. et = -1;
  1222. function tt() {
  1223. Ze && ze && (Ze = !1, ze.length ? Je = ze.concat(Je) : et = -1, Je.length && nt())
  1224. }
  1225. function nt() {
  1226. if (!Ze) {
  1227. var e = $e(tt);
  1228. Ze = !0;
  1229. for (var t = Je.length; t;) {
  1230. for (ze = Je, Je = []; ++et < t;) ze && ze[et].run();
  1231. et = -1, t = Je.length
  1232. }
  1233. ze = null, Ze = !1,
  1234. function(e) {
  1235. if (Xe === clearTimeout) return clearTimeout(e);
  1236. if ((Xe === We || !Xe) && clearTimeout) return Xe = clearTimeout, clearTimeout(e);
  1237. try {
  1238. Xe(e)
  1239. } catch (t) {
  1240. try {
  1241. return Xe.call(null, e)
  1242. } catch (t) {
  1243. return Xe.call(this, e)
  1244. }
  1245. }
  1246. }(e)
  1247. }
  1248. }
  1249. function rt(e, t) {
  1250. this.fun = e, this.array = t
  1251. }
  1252. rt.prototype.run = function() {
  1253. this.fun.apply(null, this.array)
  1254. };
  1255. function it() {}
  1256. var st = it,
  1257. at = it,
  1258. ot = it,
  1259. ct = it,
  1260. lt = it,
  1261. ht = it,
  1262. ut = it;
  1263. var pt = be.performance || {}, ft = pt.now || pt.mozNow || pt.msNow || pt.oNow || pt.webkitNow || function() {
  1264. return (new Date).getTime()
  1265. };
  1266. var dt = new Date;
  1267. var Et = {
  1268. nextTick: function(e) {
  1269. var t = new Array(arguments.length - 1);
  1270. if (arguments.length > 1) for (var n = 1; n < arguments.length; n++) t[n - 1] = arguments[n];
  1271. Je.push(new rt(e, t)), 1 !== Je.length || Ze || $e(nt)
  1272. },
  1273. title: "browser",
  1274. browser: !0,
  1275. env: {},
  1276. argv: [],
  1277. version: "",
  1278. versions: {},
  1279. on: st,
  1280. addListener: at,
  1281. once: ot,
  1282. off: ct,
  1283. removeListener: lt,
  1284. removeAllListeners: ht,
  1285. emit: ut,
  1286. binding: function(e) {
  1287. throw new Error("process.binding is not supported")
  1288. },
  1289. cwd: function() {
  1290. return "/"
  1291. },
  1292. chdir: function(e) {
  1293. throw new Error("process.chdir is not supported")
  1294. },
  1295. umask: function() {
  1296. return 0
  1297. },
  1298. hrtime: function(e) {
  1299. var t = .001 * ft.call(pt),
  1300. n = Math.floor(t),
  1301. r = Math.floor(t % 1 * 1e9);
  1302. return e && (n -= e[0], (r -= e[1]) < 0 && (n--, r += 1e9)), [n, r]
  1303. },
  1304. platform: "browser",
  1305. release: {},
  1306. config: {},
  1307. uptime: function() {
  1308. return (new Date - dt) / 1e3
  1309. }
  1310. };
  1311. function mt() {}
  1312. function Tt() {
  1313. Tt.init.call(this)
  1314. }
  1315. function _t(e) {
  1316. return void 0 === e._maxListeners ? Tt.defaultMaxListeners : e._maxListeners
  1317. }
  1318. function At(e, t, n) {
  1319. if (t) e.call(n);
  1320. else for (var r = e.length, i = yt(e, r), s = 0; s < r; ++s) i[s].call(n)
  1321. }
  1322. function gt(e, t, n, r) {
  1323. if (t) e.call(n, r);
  1324. else for (var i = e.length, s = yt(e, i), a = 0; a < i; ++a) s[a].call(n, r)
  1325. }
  1326. function Nt(e, t, n, r, i) {
  1327. if (t) e.call(n, r, i);
  1328. else for (var s = e.length, a = yt(e, s), o = 0; o < s; ++o) a[o].call(n, r, i)
  1329. }
  1330. function Ct(e, t, n, r, i, s) {
  1331. if (t) e.call(n, r, i, s);
  1332. else for (var a = e.length, o = yt(e, a), c = 0; c < a; ++c) o[c].call(n, r, i, s)
  1333. }
  1334. function It(e, t, n, r) {
  1335. if (t) e.apply(n, r);
  1336. else for (var i = e.length, s = yt(e, i), a = 0; a < i; ++a) s[a].apply(n, r)
  1337. }
  1338. function St(e, t, n, r) {
  1339. var i, s, a;
  1340. if ("function" != typeof n) throw new TypeError('"listener" argument must be a function');
  1341. if ((s = e._events) ? (s.newListener && (e.emit("newListener", t, n.listener ? n.listener : n), s = e._events), a = s[t]) : (s = e._events = new mt, e._eventsCount = 0), a) {
  1342. if ("function" == typeof a ? a = s[t] = r ? [n, a] : [a, n] : r ? a.unshift(n) : a.push(n), !a.warned && (i = _t(e)) && i > 0 && a.length > i) {
  1343. a.warned = !0;
  1344. var o = new Error("Possible EventEmitter memory leak detected. " + a.length + " " + t + " listeners added. Use emitter.setMaxListeners() to increase limit");
  1345. o.name = "MaxListenersExceededWarning", o.emitter = e, o.type = t, o.count = a.length,
  1346. function(e) {
  1347. "function" == typeof console.warn ? console.warn(e) : console.log(e)
  1348. }(o)
  1349. }
  1350. } else a = s[t] = n, ++e._eventsCount;
  1351. return e
  1352. }
  1353. function bt(e, t, n) {
  1354. var r = !1;
  1355. function i() {
  1356. e.removeListener(t, i), r || (r = !0, n.apply(e, arguments))
  1357. }
  1358. return i.listener = n, i
  1359. }
  1360. function Ot(e) {
  1361. var t = this._events;
  1362. if (t) {
  1363. var n = t[e];
  1364. if ("function" == typeof n) return 1;
  1365. if (n) return n.length
  1366. }
  1367. return 0
  1368. }
  1369. function yt(e, t) {
  1370. for (var n = new Array(t); t--;) n[t] = e[t];
  1371. return n
  1372. }
  1373. function Lt() {
  1374. var e;
  1375. Tt.call(this), this.__emitError = (e = this, function(t) {
  1376. e.emit("error", t)
  1377. })
  1378. }
  1379. function kt() {
  1380. return new Lt
  1381. }
  1382. mt.prototype = Object.create(null), Tt.EventEmitter = Tt, Tt.usingDomains = !1, Tt.prototype.domain = void 0, Tt.prototype._events = void 0, Tt.prototype._maxListeners = void 0, Tt.defaultMaxListeners = 10, Tt.init = function() {
  1383. this.domain = null, Tt.usingDomains && undefined.active, this._events && this._events !== Object.getPrototypeOf(this)._events || (this._events = new mt, this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0
  1384. }, Tt.prototype.setMaxListeners = function(e) {
  1385. if ("number" != typeof e || e < 0 || isNaN(e)) throw new TypeError('"n" argument must be a positive number');
  1386. return this._maxListeners = e, this
  1387. }, Tt.prototype.getMaxListeners = function() {
  1388. return _t(this)
  1389. }, Tt.prototype.emit = function(e) {
  1390. var t, n, r, i, s, a, o, c = "error" === e;
  1391. if (a = this._events) c = c && null == a.error;
  1392. else if (!c) return !1;
  1393. if (o = this.domain, c) {
  1394. if (t = arguments[1], !o) {
  1395. if (t instanceof Error) throw t;
  1396. var l = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  1397. throw l.context = t, l
  1398. }
  1399. return t || (t = new Error('Uncaught, unspecified "error" event')), t.domainEmitter = this, t.domain = o, t.domainThrown = !1, o.emit("error", t), !1
  1400. }
  1401. if (!(n = a[e])) return !1;
  1402. var h = "function" == typeof n;
  1403. switch (r = arguments.length) {
  1404. case 1:
  1405. At(n, h, this);
  1406. break;
  1407. case 2:
  1408. gt(n, h, this, arguments[1]);
  1409. break;
  1410. case 3:
  1411. Nt(n, h, this, arguments[1], arguments[2]);
  1412. break;
  1413. case 4:
  1414. Ct(n, h, this, arguments[1], arguments[2], arguments[3]);
  1415. break;
  1416. default:
  1417. for (i = new Array(r - 1), s = 1; s < r; s++) i[s - 1] = arguments[s];
  1418. It(n, h, this, i)
  1419. }
  1420. return !0
  1421. }, Tt.prototype.addListener = function(e, t) {
  1422. return St(this, e, t, !1)
  1423. }, Tt.prototype.on = Tt.prototype.addListener, Tt.prototype.prependListener = function(e, t) {
  1424. return St(this, e, t, !0)
  1425. }, Tt.prototype.once = function(e, t) {
  1426. if ("function" != typeof t) throw new TypeError('"listener" argument must be a function');
  1427. return this.on(e, bt(this, e, t)), this
  1428. }, Tt.prototype.prependOnceListener = function(e, t) {
  1429. if ("function" != typeof t) throw new TypeError('"listener" argument must be a function');
  1430. return this.prependListener(e, bt(this, e, t)), this
  1431. }, Tt.prototype.removeListener = function(e, t) {
  1432. var n, r, i, s, a;
  1433. if ("function" != typeof t) throw new TypeError('"listener" argument must be a function');
  1434. if (!(r = this._events)) return this;
  1435. if (!(n = r[e])) return this;
  1436. if (n === t || n.listener && n.listener === t) 0 == --this._eventsCount ? this._events = new mt : (delete r[e], r.removeListener && this.emit("removeListener", e, n.listener || t));
  1437. else if ("function" != typeof n) {
  1438. for (i = -1, s = n.length; s-- > 0;) if (n[s] === t || n[s].listener && n[s].listener === t) {
  1439. a = n[s].listener, i = s;
  1440. break
  1441. }
  1442. if (i < 0) return this;
  1443. if (1 === n.length) {
  1444. if (n[0] = void 0, 0 == --this._eventsCount) return this._events = new mt, this;
  1445. delete r[e]
  1446. } else ! function(e, t) {
  1447. for (var n = t, r = n + 1, i = e.length; r < i; n += 1, r += 1) e[n] = e[r];
  1448. e.pop()
  1449. }(n, i);
  1450. r.removeListener && this.emit("removeListener", e, a || t)
  1451. }
  1452. return this
  1453. }, Tt.prototype.removeAllListeners = function(e) {
  1454. var t, n;
  1455. if (!(n = this._events)) return this;
  1456. if (!n.removeListener) return 0 === arguments.length ? (this._events = new mt, this._eventsCount = 0) : n[e] && (0 == --this._eventsCount ? this._events = new mt : delete n[e]), this;
  1457. if (0 === arguments.length) {
  1458. for (var r, i = Object.keys(n), s = 0; s < i.length; ++s) "removeListener" !== (r = i[s]) && this.removeAllListeners(r);
  1459. return this.removeAllListeners("removeListener"), this._events = new mt, this._eventsCount = 0, this
  1460. }
  1461. if ("function" == typeof(t = n[e])) this.removeListener(e, t);
  1462. else if (t) do {
  1463. this.removeListener(e, t[t.length - 1])
  1464. } while (t[0]);
  1465. return this
  1466. }, Tt.prototype.listeners = function(e) {
  1467. var t, n = this._events;
  1468. return n && (t = n[e]) ? "function" == typeof t ? [t.listener || t] : function(e) {
  1469. for (var t = new Array(e.length), n = 0; n < t.length; ++n) t[n] = e[n].listener || e[n];
  1470. return t
  1471. }(t) : []
  1472. }, Tt.listenerCount = function(e, t) {
  1473. return "function" == typeof e.listenerCount ? e.listenerCount(t) : Ot.call(e, t)
  1474. }, Tt.prototype.listenerCount = Ot, Tt.prototype.eventNames = function() {
  1475. return this._eventsCount > 0 ? Reflect.ownKeys(this._events) : []
  1476. }, ("function" == typeof Object.create ? function(e, t) {
  1477. e.super_ = t, e.prototype = Object.create(t.prototype, {
  1478. constructor: {
  1479. value: e,
  1480. enumerable: !1,
  1481. writable: !0,
  1482. configurable: !0
  1483. }
  1484. })
  1485. } : function(e, t) {
  1486. e.super_ = t;
  1487. var n = function() {};
  1488. n.prototype = t.prototype, e.prototype = new n, e.prototype.constructor = e
  1489. })(Lt, Tt), Lt.prototype.add = function(e) {
  1490. e.on("error", this.__emitError)
  1491. }, Lt.prototype.remove = function(e) {
  1492. e.removeListener("error", this.__emitError)
  1493. }, Lt.prototype.bind = function(e) {
  1494. var t = this.__emitError;
  1495. return function() {
  1496. var n = Array.prototype.slice.call(arguments);
  1497. try {
  1498. e.apply(null, n)
  1499. } catch (e) {
  1500. t(e)
  1501. }
  1502. }
  1503. }, Lt.prototype.intercept = function(e) {
  1504. var t = this.__emitError;
  1505. return function(n) {
  1506. if (n) t(n);
  1507. else {
  1508. var r = Array.prototype.slice.call(arguments, 1);
  1509. try {
  1510. e.apply(null, r)
  1511. } catch (n) {
  1512. t(n)
  1513. }
  1514. }
  1515. }
  1516. }, Lt.prototype.run = function(e) {
  1517. var t = this.__emitError;
  1518. try {
  1519. e()
  1520. } catch (e) {
  1521. t(e)
  1522. }
  1523. return this
  1524. }, Lt.prototype.dispose = function() {
  1525. return this.removeAllListeners(), this
  1526. }, Lt.prototype.enter = Lt.prototype.exit = function() {
  1527. return this
  1528. };
  1529. var vt, Dt = {
  1530. Domain: Lt,
  1531. createDomain: kt,
  1532. create: kt
  1533. }, Rt = "function" == typeof setImmediate,
  1534. Mt = Pt;
  1535. function Pt(e) {
  1536. xt.length || (Ut(), wt = !0), xt[xt.length] = e
  1537. }
  1538. var xt = [],
  1539. wt = !1,
  1540. Bt = 0;
  1541. function Ft() {
  1542. for (; Bt < xt.length;) {
  1543. var e = Bt;
  1544. if (Bt += 1, xt[e].call(), Bt > 1024) {
  1545. for (var t = 0, n = xt.length - Bt; t < n; t++) xt[t] = xt[t + Bt];
  1546. xt.length -= Bt, Bt = 0
  1547. }
  1548. }
  1549. xt.length = 0, Bt = 0, wt = !1
  1550. }
  1551. function Ut() {
  1552. var e = Et.domain;
  1553. e && (vt || (vt = Dt), vt.active = Et.domain = null), wt && Rt ? setImmediate(Ft) : Et.nextTick(Ft), e && (vt.active = Et.domain = e)
  1554. }
  1555. Pt.requestFlush = Ut;
  1556. var Ht = [],
  1557. Gt = function(e) {
  1558. var t;
  1559. t = Ht.length ? Ht.pop() : new Yt;
  1560. t.task = e, t.domain = Et.domain, Mt(t)
  1561. };
  1562. function Yt() {
  1563. this.task = null, this.domain = null
  1564. }
  1565. Yt.prototype.call = function() {
  1566. this.domain && this.domain.enter();
  1567. var e = !0;
  1568. try {
  1569. this.task.call(), e = !1, this.domain && this.domain.exit()
  1570. } finally {
  1571. e && Mt.requestFlush(), this.task = null, this.domain = null, Ht.push(this)
  1572. }
  1573. };
  1574. var qt = Ke((function(e) {
  1575. ! function(t) {
  1576. var n = function() {
  1577. var e = Array.prototype.slice.call(arguments);
  1578. "function" == typeof e[0] && e[0].apply(null, e.splice(1))
  1579. }, r = function(e) {
  1580. "function" == typeof setImmediate ? setImmediate(e) : void 0 !== Et && Et.nextTick ? Et.nextTick(e) : setTimeout(e, 0)
  1581. }, i = Array.isArray || function(e) {
  1582. return "[object Array]" === Object.prototype.toString.call(e)
  1583. }, s = function(e, t, s) {
  1584. var a = s ? r : n;
  1585. if (t = t || function() {}, !i(e)) {
  1586. var o = new Error("First argument to waterfall must be an array of functions");
  1587. return t(o)
  1588. }
  1589. if (!e.length) return t();
  1590. var c = function(e) {
  1591. return function(n) {
  1592. if (n) t.apply(null, arguments), t = function() {};
  1593. else {
  1594. var r = Array.prototype.slice.call(arguments, 1),
  1595. i = e.next();
  1596. i ? r.push(c(i)) : r.push(t), a((function() {
  1597. e.apply(null, r)
  1598. }))
  1599. }
  1600. }
  1601. };
  1602. c(function(e) {
  1603. var t = function(n) {
  1604. var r = function() {
  1605. return e.length && e[n].apply(null, arguments), r.next()
  1606. };
  1607. return r.next = function() {
  1608. return n < e.length - 1 ? t(n + 1) : null
  1609. }, r
  1610. };
  1611. return t(0)
  1612. }(e))()
  1613. };
  1614. e.exports ? e.exports = s : t.waterfall = s
  1615. }(Ge)
  1616. }));
  1617. function Kt(e, t, n, r) {
  1618. return {
  1619. type: e,
  1620. value: t,
  1621. lineno: n,
  1622. colno: r
  1623. }
  1624. }
  1625. var jt = function() {
  1626. function e(e, t) {
  1627. this.str = e, this.index = 0, this.len = e.length, this.lineno = 0, this.colno = 0, this.in_code = !1;
  1628. var n = (t = t || {}).tags || {};
  1629. this.tags = {
  1630. BLOCK_START: n.blockStart || "{%",
  1631. BLOCK_END: n.blockEnd || "%}",
  1632. VARIABLE_START: n.variableStart || "{{",
  1633. VARIABLE_END: n.variableEnd || "}}",
  1634. COMMENT_START: n.commentStart || "{#",
  1635. COMMENT_END: n.commentEnd || "#}"
  1636. }, this.trimBlocks = !! t.trimBlocks, this.lstripBlocks = !! t.lstripBlocks
  1637. }
  1638. var t = e.prototype;
  1639. return t.nextToken = function() {
  1640. var e, t = this.lineno,
  1641. n = this.colno;
  1642. if (this.in_code) {
  1643. var r = this.current();
  1644. if (this.isFinished()) return null;
  1645. if ('"' === r || "'" === r) return Kt("string", this._parseString(r), t, n);
  1646. if (e = this._extract(" \n\t\r ")) return Kt("whitespace", e, t, n);
  1647. if ((e = this._extractString(this.tags.BLOCK_END)) || (e = this._extractString("-" + this.tags.BLOCK_END))) return this.in_code = !1, this.trimBlocks && ("\n" === (r = this.current()) ? this.forward() : "\r" === r && (this.forward(), "\n" === (r = this.current()) ? this.forward() : this.back())), Kt("block-end", e, t, n);
  1648. if ((e = this._extractString(this.tags.VARIABLE_END)) || (e = this._extractString("-" + this.tags.VARIABLE_END))) return this.in_code = !1, Kt("variable-end", e, t, n);
  1649. if ("r" === r && "/" === this.str.charAt(this.index + 1)) {
  1650. this.forwardN(2);
  1651. for (var i = ""; !this.isFinished();) {
  1652. if ("/" === this.current() && "\\" !== this.previous()) {
  1653. this.forward();
  1654. break
  1655. }
  1656. i += this.current(), this.forward()
  1657. }
  1658. for (var s = ["g", "i", "m", "y"], a = ""; !this.isFinished();) {
  1659. if (!(-1 !== s.indexOf(this.current()))) break;
  1660. a += this.current(), this.forward()
  1661. }
  1662. return Kt("regex", {
  1663. body: i,
  1664. flags: a
  1665. }, t, n)
  1666. }
  1667. if (-1 !== "()[]{}%*-+~/#,:|.<>=!".indexOf(r)) {
  1668. this.forward();
  1669. var o, c = ["==", "===", "!=", "!==", "<=", ">=", "//", "**"],
  1670. l = r + this.current();
  1671. switch (-1 !== je.indexOf(c, l) && (this.forward(), r = l, -1 !== je.indexOf(c, l + this.current()) && (r = l + this.current(), this.forward())), r) {
  1672. case "(":
  1673. o = "left-paren";
  1674. break;
  1675. case ")":
  1676. o = "right-paren";
  1677. break;
  1678. case "[":
  1679. o = "left-bracket";
  1680. break;
  1681. case "]":
  1682. o = "right-bracket";
  1683. break;
  1684. case "{":
  1685. o = "left-curly";
  1686. break;
  1687. case "}":
  1688. o = "right-curly";
  1689. break;
  1690. case ",":
  1691. o = "comma";
  1692. break;
  1693. case ":":
  1694. o = "colon";
  1695. break;
  1696. case "~":
  1697. o = "tilde";
  1698. break;
  1699. case "|":
  1700. o = "pipe";
  1701. break;
  1702. default:
  1703. o = "operator"
  1704. }
  1705. return Kt(o, r, t, n)
  1706. }
  1707. if ((e = this._extractUntil(" \n\t\r ()[]{}%*-+~/#,:|.<>=!")).match(/^[-+]?[0-9]+$/)) return "." === this.current() ? (this.forward(), Kt("float", e + "." + this._extract("0123456789"), t, n)) : Kt("int", e, t, n);
  1708. if (e.match(/^(true|false)$/)) return Kt("boolean", e, t, n);
  1709. if ("none" === e) return Kt("none", e, t, n);
  1710. if ("null" === e) return Kt("none", e, t, n);
  1711. if (e) return Kt("symbol", e, t, n);
  1712. throw new Error("Unexpected value while parsing: " + e)
  1713. }
  1714. var h, u = this.tags.BLOCK_START.charAt(0) + this.tags.VARIABLE_START.charAt(0) + this.tags.COMMENT_START.charAt(0) + this.tags.COMMENT_END.charAt(0);
  1715. if (this.isFinished()) return null;
  1716. if ((e = this._extractString(this.tags.BLOCK_START + "-")) || (e = this._extractString(this.tags.BLOCK_START))) return this.in_code = !0, Kt("block-start", e, t, n);
  1717. if ((e = this._extractString(this.tags.VARIABLE_START + "-")) || (e = this._extractString(this.tags.VARIABLE_START))) return this.in_code = !0, Kt("variable-start", e, t, n);
  1718. e = "";
  1719. var p = !1;
  1720. for (this._matches(this.tags.COMMENT_START) && (p = !0, e = this._extractString(this.tags.COMMENT_START)); null !== (h = this._extractUntil(u));) {
  1721. if (e += h, (this._matches(this.tags.BLOCK_START) || this._matches(this.tags.VARIABLE_START) || this._matches(this.tags.COMMENT_START)) && !p) {
  1722. if (this.lstripBlocks && this._matches(this.tags.BLOCK_START) && this.colno > 0 && this.colno <= e.length) {
  1723. var f = e.slice(-this.colno);
  1724. if (/^\s+$/.test(f) && !(e = e.slice(0, -this.colno)).length) return this.nextToken()
  1725. }
  1726. break
  1727. }
  1728. if (this._matches(this.tags.COMMENT_END)) {
  1729. if (!p) throw new Error("unexpected end of comment");
  1730. e += this._extractString(this.tags.COMMENT_END);
  1731. break
  1732. }
  1733. e += this.current(), this.forward()
  1734. }
  1735. if (null === h && p) throw new Error("expected end of comment, got end of file");
  1736. return Kt(p ? "comment" : "data", e, t, n)
  1737. }, t._parseString = function(e) {
  1738. this.forward();
  1739. for (var t = ""; !this.isFinished() && this.current() !== e;) {
  1740. var n = this.current();
  1741. if ("\\" === n) {
  1742. switch (this.forward(), this.current()) {
  1743. case "n":
  1744. t += "\n";
  1745. break;
  1746. case "t":
  1747. t += "\t";
  1748. break;
  1749. case "r":
  1750. t += "\r";
  1751. break;
  1752. default:
  1753. t += this.current()
  1754. }
  1755. this.forward()
  1756. } else t += n, this.forward()
  1757. }
  1758. return this.forward(), t
  1759. }, t._matches = function(e) {
  1760. return this.index + e.length > this.len ? null : this.str.slice(this.index, this.index + e.length) === e
  1761. }, t._extractString = function(e) {
  1762. return this._matches(e) ? (this.forwardN(e.length), e) : null
  1763. }, t._extractUntil = function(e) {
  1764. return this._extractMatching(!0, e || "")
  1765. }, t._extract = function(e) {
  1766. return this._extractMatching(!1, e)
  1767. }, t._extractMatching = function(e, t) {
  1768. if (this.isFinished()) return null;
  1769. var n = t.indexOf(this.current());
  1770. if (e && -1 === n || !e && -1 !== n) {
  1771. var r = this.current();
  1772. this.forward();
  1773. for (var i = t.indexOf(this.current());
  1774. (e && -1 === i || !e && -1 !== i) && !this.isFinished();) r += this.current(), this.forward(), i = t.indexOf(this.current());
  1775. return r
  1776. }
  1777. return ""
  1778. }, t._extractRegex = function(e) {
  1779. var t = this.currentStr().match(e);
  1780. return t ? (this.forwardN(t[0].length), t) : null
  1781. }, t.isFinished = function() {
  1782. return this.index >= this.len
  1783. }, t.forwardN = function(e) {
  1784. for (var t = 0; t < e; t++) this.forward()
  1785. }, t.forward = function() {
  1786. this.index++, "\n" === this.previous() ? (this.lineno++, this.colno = 0) : this.colno++
  1787. }, t.backN = function(e) {
  1788. for (var t = 0; t < e; t++) this.back()
  1789. }, t.back = function() {
  1790. if (this.index--, "\n" === this.current()) {
  1791. this.lineno--;
  1792. var e = this.src.lastIndexOf("\n", this.index - 1);
  1793. this.colno = -1 === e ? this.index : this.index - e
  1794. } else this.colno--
  1795. }, t.current = function() {
  1796. return this.isFinished() ? "" : this.str.charAt(this.index)
  1797. }, t.currentStr = function() {
  1798. return this.isFinished() ? "" : this.str.substr(this.index)
  1799. }, t.previous = function() {
  1800. return this.str.charAt(this.index - 1)
  1801. }, e
  1802. }(),
  1803. Vt = {
  1804. lex: function(e, t) {
  1805. return new jt(e, t)
  1806. },
  1807. TOKEN_STRING: "string",
  1808. TOKEN_WHITESPACE: "whitespace",
  1809. TOKEN_DATA: "data",
  1810. TOKEN_BLOCK_START: "block-start",
  1811. TOKEN_BLOCK_END: "block-end",
  1812. TOKEN_VARIABLE_START: "variable-start",
  1813. TOKEN_VARIABLE_END: "variable-end",
  1814. TOKEN_COMMENT: "comment",
  1815. TOKEN_LEFT_PAREN: "left-paren",
  1816. TOKEN_RIGHT_PAREN: "right-paren",
  1817. TOKEN_LEFT_BRACKET: "left-bracket",
  1818. TOKEN_RIGHT_BRACKET: "right-bracket",
  1819. TOKEN_LEFT_CURLY: "left-curly",
  1820. TOKEN_RIGHT_CURLY: "right-curly",
  1821. TOKEN_OPERATOR: "operator",
  1822. TOKEN_COMMA: "comma",
  1823. TOKEN_COLON: "colon",
  1824. TOKEN_TILDE: "tilde",
  1825. TOKEN_PIPE: "pipe",
  1826. TOKEN_INT: "int",
  1827. TOKEN_FLOAT: "float",
  1828. TOKEN_BOOLEAN: "boolean",
  1829. TOKEN_NONE: "none",
  1830. TOKEN_SYMBOL: "symbol",
  1831. TOKEN_SPECIAL: "special",
  1832. TOKEN_REGEX: "regex"
  1833. };
  1834. function Wt(e, t) {
  1835. for (var n = 0; n < t.length; n++) {
  1836. var r = t[n];
  1837. r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
  1838. }
  1839. }
  1840. function Qt(e, t, n) {
  1841. return t && Wt(e.prototype, t), n && Wt(e, n), e
  1842. }
  1843. function Xt(e, t) {
  1844. e.prototype = Object.create(t.prototype), e.prototype.constructor = e, $t(e, t)
  1845. }
  1846. function $t(e, t) {
  1847. return $t = Object.setPrototypeOf || function(e, t) {
  1848. return e.__proto__ = t, e
  1849. }, $t(e, t)
  1850. }
  1851. function zt(e, t, n) {
  1852. n = n || {}, je.keys(n).forEach((function(t) {
  1853. n[t] = function(e, t) {
  1854. return "function" != typeof e || "function" != typeof t ? t : function() {
  1855. var n = this.parent;
  1856. this.parent = e;
  1857. var r = t.apply(this, arguments);
  1858. return this.parent = n, r
  1859. }
  1860. }(e.prototype[t], n[t])
  1861. }));
  1862. var r = function(e) {
  1863. function n() {
  1864. return e.apply(this, arguments) || this
  1865. }
  1866. return Xt(n, e), Qt(n, [{
  1867. key: "typename",
  1868. get: function() {
  1869. return t
  1870. }
  1871. }]), n
  1872. }(e);
  1873. return je._assign(r.prototype, n), r
  1874. }
  1875. var Jt = function() {
  1876. function e() {
  1877. this.init.apply(this, arguments)
  1878. }
  1879. return e.prototype.init = function() {}, e.extend = function(e, t) {
  1880. return "object" == typeof e && (t = e, e = "anonymous"), zt(this, e, t)
  1881. }, Qt(e, [{
  1882. key: "typename",
  1883. get: function() {
  1884. return this.constructor.name
  1885. }
  1886. }]), e
  1887. }(),
  1888. Zt = function(e) {
  1889. function t() {
  1890. var t, n;
  1891. return (t = n = e.call(this) || this).init.apply(t, arguments), n
  1892. }
  1893. return Xt(t, e), t.prototype.init = function() {}, t.extend = function(e, t) {
  1894. return "object" == typeof e && (t = e, e = "anonymous"), zt(this, e, t)
  1895. }, Qt(t, [{
  1896. key: "typename",
  1897. get: function() {
  1898. return this.constructor.name
  1899. }
  1900. }]), t
  1901. }(Tt),
  1902. en = {
  1903. Obj: Jt,
  1904. EmitterObj: Zt
  1905. };
  1906. function tn(e, t) {
  1907. for (var n = 0; n < t.length; n++) {
  1908. var r = t[n];
  1909. r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
  1910. }
  1911. }
  1912. function nn(e, t, n) {
  1913. return t && tn(e.prototype, t), n && tn(e, n), e
  1914. }
  1915. function rn(e, t) {
  1916. e.prototype = Object.create(t.prototype), e.prototype.constructor = e, sn(e, t)
  1917. }
  1918. function sn(e, t) {
  1919. return sn = Object.setPrototypeOf || function(e, t) {
  1920. return e.__proto__ = t, e
  1921. }, sn(e, t)
  1922. }
  1923. function an(e, t, n) {
  1924. e instanceof t && n.push(e), e instanceof on && e.findAll(t, n)
  1925. }
  1926. var on = function(e) {
  1927. function t() {
  1928. return e.apply(this, arguments) || this
  1929. }
  1930. rn(t, e);
  1931. var n = t.prototype;
  1932. return n.init = function(e, t) {
  1933. for (var n = arguments, r = this, i = arguments.length, s = new Array(i > 2 ? i - 2 : 0), a = 2; a < i; a++) s[a - 2] = arguments[a];
  1934. this.lineno = e, this.colno = t, this.fields.forEach((function(e, t) {
  1935. var i = n[t + 2];
  1936. void 0 === i && (i = null), r[e] = i
  1937. }))
  1938. }, n.findAll = function(e, t) {
  1939. var n = this;
  1940. return t = t || [], this instanceof ln ? this.children.forEach((function(n) {
  1941. return an(n, e, t)
  1942. })) : this.fields.forEach((function(r) {
  1943. return an(n[r], e, t)
  1944. })), t
  1945. }, n.iterFields = function(e) {
  1946. var t = this;
  1947. this.fields.forEach((function(n) {
  1948. e(t[n], n)
  1949. }))
  1950. }, t
  1951. }(en.Obj),
  1952. cn = function(e) {
  1953. function t() {
  1954. return e.apply(this, arguments) || this
  1955. }
  1956. return rn(t, e), nn(t, [{
  1957. key: "typename",
  1958. get: function() {
  1959. return "Value"
  1960. }
  1961. }, {
  1962. key: "fields",
  1963. get: function() {
  1964. return ["value"]
  1965. }
  1966. }]), t
  1967. }(on),
  1968. ln = function(e) {
  1969. function t() {
  1970. return e.apply(this, arguments) || this
  1971. }
  1972. rn(t, e);
  1973. var n = t.prototype;
  1974. return n.init = function(t, n, r) {
  1975. e.prototype.init.call(this, t, n, r || [])
  1976. }, n.addChild = function(e) {
  1977. this.children.push(e)
  1978. }, nn(t, [{
  1979. key: "typename",
  1980. get: function() {
  1981. return "NodeList"
  1982. }
  1983. }, {
  1984. key: "fields",
  1985. get: function() {
  1986. return ["children"]
  1987. }
  1988. }]), t
  1989. }(on),
  1990. hn = ln.extend("Root"),
  1991. un = cn.extend("Literal"),
  1992. pn = cn.extend("Symbol"),
  1993. fn = ln.extend("Group"),
  1994. dn = ln.extend("Array"),
  1995. En = on.extend("Pair", {
  1996. fields: ["key", "value"]
  1997. }),
  1998. mn = ln.extend("Dict"),
  1999. Tn = on.extend("LookupVal", {
  2000. fields: ["target", "val"]
  2001. }),
  2002. _n = on.extend("If", {
  2003. fields: ["cond", "body", "else_"]
  2004. }),
  2005. An = _n.extend("IfAsync"),
  2006. gn = on.extend("InlineIf", {
  2007. fields: ["cond", "body", "else_"]
  2008. }),
  2009. Nn = on.extend("For", {
  2010. fields: ["arr", "name", "body", "else_"]
  2011. }),
  2012. Cn = Nn.extend("AsyncEach"),
  2013. In = Nn.extend("AsyncAll"),
  2014. Sn = on.extend("Macro", {
  2015. fields: ["name", "args", "body"]
  2016. }),
  2017. bn = Sn.extend("Caller"),
  2018. On = on.extend("Import", {
  2019. fields: ["template", "target", "withContext"]
  2020. }),
  2021. yn = function(e) {
  2022. function t() {
  2023. return e.apply(this, arguments) || this
  2024. }
  2025. return rn(t, e), t.prototype.init = function(t, n, r, i, s) {
  2026. e.prototype.init.call(this, t, n, r, i || new ln, s)
  2027. }, nn(t, [{
  2028. key: "typename",
  2029. get: function() {
  2030. return "FromImport"
  2031. }
  2032. }, {
  2033. key: "fields",
  2034. get: function() {
  2035. return ["template", "names", "withContext"]
  2036. }
  2037. }]), t
  2038. }(on),
  2039. Ln = on.extend("FunCall", {
  2040. fields: ["name", "args"]
  2041. }),
  2042. kn = Ln.extend("Filter"),
  2043. vn = kn.extend("FilterAsync", {
  2044. fields: ["name", "args", "symbol"]
  2045. }),
  2046. Dn = mn.extend("KeywordArgs"),
  2047. Rn = on.extend("Block", {
  2048. fields: ["name", "body"]
  2049. }),
  2050. Mn = on.extend("Super", {
  2051. fields: ["blockName", "symbol"]
  2052. }),
  2053. Pn = on.extend("TemplateRef", {
  2054. fields: ["template"]
  2055. }).extend("Extends"),
  2056. xn = on.extend("Include", {
  2057. fields: ["template", "ignoreMissing"]
  2058. }),
  2059. wn = on.extend("Set", {
  2060. fields: ["targets", "value"]
  2061. }),
  2062. Bn = on.extend("Switch", {
  2063. fields: ["expr", "cases", "default"]
  2064. }),
  2065. Fn = on.extend("Case", {
  2066. fields: ["cond", "body"]
  2067. }),
  2068. Un = ln.extend("Output"),
  2069. Hn = on.extend("Capture", {
  2070. fields: ["body"]
  2071. }),
  2072. Gn = un.extend("TemplateData"),
  2073. Yn = on.extend("UnaryOp", {
  2074. fields: ["target"]
  2075. }),
  2076. qn = on.extend("BinOp", {
  2077. fields: ["left", "right"]
  2078. }),
  2079. Kn = qn.extend("In"),
  2080. jn = qn.extend("Is"),
  2081. Vn = qn.extend("Or"),
  2082. Wn = qn.extend("And"),
  2083. Qn = Yn.extend("Not"),
  2084. Xn = qn.extend("Add"),
  2085. $n = qn.extend("Concat"),
  2086. zn = qn.extend("Sub"),
  2087. Jn = qn.extend("Mul"),
  2088. Zn = qn.extend("Div"),
  2089. er = qn.extend("FloorDiv"),
  2090. tr = qn.extend("Mod"),
  2091. nr = qn.extend("Pow"),
  2092. rr = Yn.extend("Neg"),
  2093. ir = Yn.extend("Pos"),
  2094. sr = on.extend("Compare", {
  2095. fields: ["expr", "ops"]
  2096. }),
  2097. ar = on.extend("CompareOperand", {
  2098. fields: ["expr", "type"]
  2099. }),
  2100. or = on.extend("CallExtension", {
  2101. init: function(e, t, n, r) {
  2102. this.parent(), this.extName = e.__name || e, this.prop = t, this.args = n || new ln, this.contentArgs = r || [], this.autoescape = e.autoescape
  2103. },
  2104. fields: ["extName", "prop", "args", "contentArgs"]
  2105. }),
  2106. cr = or.extend("CallExtensionAsync");
  2107. function lr(e, t, n) {
  2108. var r = e.split("\n");
  2109. r.forEach((function(e, i) {
  2110. e && (n && i > 0 || !n) && Et.stdout.write(" ".repeat(t));
  2111. var s = i === r.length - 1 ? "" : "\n";
  2112. Et.stdout.write("" + e + s)
  2113. }))
  2114. }
  2115. var hr = {
  2116. Node: on,
  2117. Root: hn,
  2118. NodeList: ln,
  2119. Value: cn,
  2120. Literal: un,
  2121. Symbol: pn,
  2122. Group: fn,
  2123. Array: dn,
  2124. Pair: En,
  2125. Dict: mn,
  2126. Output: Un,
  2127. Capture: Hn,
  2128. TemplateData: Gn,
  2129. If: _n,
  2130. IfAsync: An,
  2131. InlineIf: gn,
  2132. For: Nn,
  2133. AsyncEach: Cn,
  2134. AsyncAll: In,
  2135. Macro: Sn,
  2136. Caller: bn,
  2137. Import: On,
  2138. FromImport: yn,
  2139. FunCall: Ln,
  2140. Filter: kn,
  2141. FilterAsync: vn,
  2142. KeywordArgs: Dn,
  2143. Block: Rn,
  2144. Super: Mn,
  2145. Extends: Pn,
  2146. Include: xn,
  2147. Set: wn,
  2148. Switch: Bn,
  2149. Case: Fn,
  2150. LookupVal: Tn,
  2151. BinOp: qn,
  2152. In: Kn,
  2153. Is: jn,
  2154. Or: Vn,
  2155. And: Wn,
  2156. Not: Qn,
  2157. Add: Xn,
  2158. Concat: $n,
  2159. Sub: zn,
  2160. Mul: Jn,
  2161. Div: Zn,
  2162. FloorDiv: er,
  2163. Mod: tr,
  2164. Pow: nr,
  2165. Neg: rr,
  2166. Pos: ir,
  2167. Compare: sr,
  2168. CompareOperand: ar,
  2169. CallExtension: or,
  2170. CallExtensionAsync: cr,
  2171. printNodes: function e(t, n) {
  2172. if (n = n || 0, lr(t.typename + ": ", n), t instanceof ln) lr("\n"), t.children.forEach((function(t) {
  2173. e(t, n + 2)
  2174. }));
  2175. else if (t instanceof or) lr(t.extName + "." + t.prop + "\n"), t.args && e(t.args, n + 2), t.contentArgs && t.contentArgs.forEach((function(t) {
  2176. e(t, n + 2)
  2177. }));
  2178. else {
  2179. var r = [],
  2180. i = null;
  2181. t.iterFields((function(e, t) {
  2182. e instanceof on ? r.push([t, e]) : (i = i || {})[t] = e
  2183. })), i ? lr(JSON.stringify(i, null, 2) + "\n", null, !0) : lr("\n"), r.forEach((function(t) {
  2184. var r = t[0],
  2185. i = t[1];
  2186. lr("[" + r + "] =>", n + 2), e(i, n + 4)
  2187. }))
  2188. }
  2189. }
  2190. };
  2191. function ur(e, t) {
  2192. return ur = Object.setPrototypeOf || function(e, t) {
  2193. return e.__proto__ = t, e
  2194. }, ur(e, t)
  2195. }
  2196. hr.Node, hr.Root, hr.NodeList, hr.Value, hr.Literal, hr.Group, hr.Pair, hr.Dict, hr.Output, hr.Capture, hr.TemplateData, hr.If, hr.IfAsync, hr.InlineIf, hr.For, hr.AsyncEach, hr.AsyncAll, hr.Macro, hr.Caller, hr.Import, hr.FromImport, hr.FunCall, hr.Filter, hr.FilterAsync, hr.KeywordArgs, hr.Block, hr.Super, hr.Extends, hr.Include, hr.Switch, hr.Case, hr.LookupVal, hr.BinOp, hr.In, hr.Is, hr.Or, hr.And, hr.Not, hr.Add, hr.Concat, hr.Sub, hr.Mul, hr.Div, hr.FloorDiv, hr.Mod, hr.Pow, hr.Neg, hr.Pos, hr.Compare, hr.CompareOperand, hr.CallExtension, hr.CallExtensionAsync, hr.printNodes;
  2197. var pr = function(e) {
  2198. var t, n;
  2199. function r() {
  2200. return e.apply(this, arguments) || this
  2201. }
  2202. n = e, (t = r).prototype = Object.create(n.prototype), t.prototype.constructor = t, ur(t, n);
  2203. var i = r.prototype;
  2204. return i.init = function(e) {
  2205. this.tokens = e, this.peeked = null, this.breakOnBlocks = null, this.dropLeadingWhitespace = !1, this.extensions = []
  2206. }, i.nextToken = function(e) {
  2207. var t;
  2208. if (this.peeked) {
  2209. if (e || this.peeked.type !== Vt.TOKEN_WHITESPACE) return t = this.peeked, this.peeked = null, t;
  2210. this.peeked = null
  2211. }
  2212. if (t = this.tokens.nextToken(), !e) for (; t && t.type === Vt.TOKEN_WHITESPACE;) t = this.tokens.nextToken();
  2213. return t
  2214. }, i.peekToken = function() {
  2215. return this.peeked = this.peeked || this.nextToken(), this.peeked
  2216. }, i.pushToken = function(e) {
  2217. if (this.peeked) throw new Error("pushToken: can only push one token on between reads");
  2218. this.peeked = e
  2219. }, i.error = function(e, t, n) {
  2220. if (void 0 === t || void 0 === n) {
  2221. var r = this.peekToken() || {};
  2222. t = r.lineno, n = r.colno
  2223. }
  2224. return void 0 !== t && (t += 1), void 0 !== n && (n += 1), new je.TemplateError(e, t, n)
  2225. }, i.fail = function(e, t, n) {
  2226. throw this.error(e, t, n)
  2227. }, i.skip = function(e) {
  2228. var t = this.nextToken();
  2229. return !(!t || t.type !== e) || (this.pushToken(t), !1)
  2230. }, i.expect = function(e) {
  2231. var t = this.nextToken();
  2232. return t.type !== e && this.fail("expected " + e + ", got " + t.type, t.lineno, t.colno), t
  2233. }, i.skipValue = function(e, t) {
  2234. var n = this.nextToken();
  2235. return !(!n || n.type !== e || n.value !== t) || (this.pushToken(n), !1)
  2236. }, i.skipSymbol = function(e) {
  2237. return this.skipValue(Vt.TOKEN_SYMBOL, e)
  2238. }, i.advanceAfterBlockEnd = function(e) {
  2239. var t;
  2240. return e || ((t = this.peekToken()) || this.fail("unexpected end of file"), t.type !== Vt.TOKEN_SYMBOL && this.fail("advanceAfterBlockEnd: expected symbol token or explicit name to be passed"), e = this.nextToken().value), (t = this.nextToken()) && t.type === Vt.TOKEN_BLOCK_END ? "-" === t.value.charAt(0) && (this.dropLeadingWhitespace = !0) : this.fail("expected block end in " + e + " statement"), t
  2241. }, i.advanceAfterVariableEnd = function() {
  2242. var e = this.nextToken();
  2243. e && e.type === Vt.TOKEN_VARIABLE_END ? this.dropLeadingWhitespace = "-" === e.value.charAt(e.value.length - this.tokens.tags.VARIABLE_END.length - 1) : (this.pushToken(e), this.fail("expected variable end"))
  2244. }, i.parseFor = function() {
  2245. var e, t, n = this.peekToken();
  2246. if (this.skipSymbol("for") ? (e = new hr.For(n.lineno, n.colno), t = "endfor") : this.skipSymbol("asyncEach") ? (e = new hr.AsyncEach(n.lineno, n.colno), t = "endeach") : this.skipSymbol("asyncAll") ? (e = new hr.AsyncAll(n.lineno, n.colno), t = "endall") : this.fail("parseFor: expected for{Async}", n.lineno, n.colno), e.name = this.parsePrimary(), e.name instanceof hr.Symbol || this.fail("parseFor: variable name expected for loop"), this.peekToken().type === Vt.TOKEN_COMMA) {
  2247. var r = e.name;
  2248. for (e.name = new hr.Array(r.lineno, r.colno), e.name.addChild(r); this.skip(Vt.TOKEN_COMMA);) {
  2249. var i = this.parsePrimary();
  2250. e.name.addChild(i)
  2251. }
  2252. }
  2253. return this.skipSymbol("in") || this.fail('parseFor: expected "in" keyword for loop', n.lineno, n.colno), e.arr = this.parseExpression(), this.advanceAfterBlockEnd(n.value), e.body = this.parseUntilBlocks(t, "else"), this.skipSymbol("else") && (this.advanceAfterBlockEnd("else"), e.else_ = this.parseUntilBlocks(t)), this.advanceAfterBlockEnd(), e
  2254. }, i.parseMacro = function() {
  2255. var e = this.peekToken();
  2256. this.skipSymbol("macro") || this.fail("expected macro");
  2257. var t = this.parsePrimary(!0),
  2258. n = this.parseSignature(),
  2259. r = new hr.Macro(e.lineno, e.colno, t, n);
  2260. return this.advanceAfterBlockEnd(e.value), r.body = this.parseUntilBlocks("endmacro"), this.advanceAfterBlockEnd(), r
  2261. }, i.parseCall = function() {
  2262. var e = this.peekToken();
  2263. this.skipSymbol("call") || this.fail("expected call");
  2264. var t = this.parseSignature(!0) || new hr.NodeList,
  2265. n = this.parsePrimary();
  2266. this.advanceAfterBlockEnd(e.value);
  2267. var r = this.parseUntilBlocks("endcall");
  2268. this.advanceAfterBlockEnd();
  2269. var i = new hr.Symbol(e.lineno, e.colno, "caller"),
  2270. s = new hr.Caller(e.lineno, e.colno, i, t, r),
  2271. a = n.args.children;
  2272. return a[a.length - 1] instanceof hr.KeywordArgs || a.push(new hr.KeywordArgs), a[a.length - 1].addChild(new hr.Pair(e.lineno, e.colno, i, s)), new hr.Output(e.lineno, e.colno, [n])
  2273. }, i.parseWithContext = function() {
  2274. var e = this.peekToken(),
  2275. t = null;
  2276. return this.skipSymbol("with") ? t = !0 : this.skipSymbol("without") && (t = !1), null !== t && (this.skipSymbol("context") || this.fail("parseFrom: expected context after with/without", e.lineno, e.colno)), t
  2277. }, i.parseImport = function() {
  2278. var e = this.peekToken();
  2279. this.skipSymbol("import") || this.fail("parseImport: expected import", e.lineno, e.colno);
  2280. var t = this.parseExpression();
  2281. this.skipSymbol("as") || this.fail('parseImport: expected "as" keyword', e.lineno, e.colno);
  2282. var n = this.parseExpression(),
  2283. r = this.parseWithContext(),
  2284. i = new hr.Import(e.lineno, e.colno, t, n, r);
  2285. return this.advanceAfterBlockEnd(e.value), i
  2286. }, i.parseFrom = function() {
  2287. var e = this.peekToken();
  2288. this.skipSymbol("from") || this.fail("parseFrom: expected from");
  2289. var t = this.parseExpression();
  2290. this.skipSymbol("import") || this.fail("parseFrom: expected import", e.lineno, e.colno);
  2291. for (var n, r = new hr.NodeList;;) {
  2292. var i = this.peekToken();
  2293. if (i.type === Vt.TOKEN_BLOCK_END) {
  2294. r.children.length || this.fail("parseFrom: Expected at least one import name", e.lineno, e.colno), "-" === i.value.charAt(0) && (this.dropLeadingWhitespace = !0), this.nextToken();
  2295. break
  2296. }
  2297. r.children.length > 0 && !this.skip(Vt.TOKEN_COMMA) && this.fail("parseFrom: expected comma", e.lineno, e.colno);
  2298. var s = this.parsePrimary();
  2299. if ("_" === s.value.charAt(0) && this.fail("parseFrom: names starting with an underscore cannot be imported", s.lineno, s.colno), this.skipSymbol("as")) {
  2300. var a = this.parsePrimary();
  2301. r.addChild(new hr.Pair(s.lineno, s.colno, s, a))
  2302. } else r.addChild(s);
  2303. n = this.parseWithContext()
  2304. }
  2305. return new hr.FromImport(e.lineno, e.colno, t, r, n)
  2306. }, i.parseBlock = function() {
  2307. var e = this.peekToken();
  2308. this.skipSymbol("block") || this.fail("parseBlock: expected block", e.lineno, e.colno);
  2309. var t = new hr.Block(e.lineno, e.colno);
  2310. t.name = this.parsePrimary(), t.name instanceof hr.Symbol || this.fail("parseBlock: variable name expected", e.lineno, e.colno), this.advanceAfterBlockEnd(e.value), t.body = this.parseUntilBlocks("endblock"), this.skipSymbol("endblock"), this.skipSymbol(t.name.value);
  2311. var n = this.peekToken();
  2312. return n || this.fail("parseBlock: expected endblock, got end of file"), this.advanceAfterBlockEnd(n.value), t
  2313. }, i.parseExtends = function() {
  2314. var e = "extends",
  2315. t = this.peekToken();
  2316. this.skipSymbol(e) || this.fail("parseTemplateRef: expected extends");
  2317. var n = new hr.Extends(t.lineno, t.colno);
  2318. return n.template = this.parseExpression(), this.advanceAfterBlockEnd(t.value), n
  2319. }, i.parseInclude = function() {
  2320. var e = "include",
  2321. t = this.peekToken();
  2322. this.skipSymbol(e) || this.fail("parseInclude: expected include");
  2323. var n = new hr.Include(t.lineno, t.colno);
  2324. return n.template = this.parseExpression(), this.skipSymbol("ignore") && this.skipSymbol("missing") && (n.ignoreMissing = !0), this.advanceAfterBlockEnd(t.value), n
  2325. }, i.parseIf = function() {
  2326. var e, t = this.peekToken();
  2327. this.skipSymbol("if") || this.skipSymbol("elif") || this.skipSymbol("elseif") ? e = new hr.If(t.lineno, t.colno) : this.skipSymbol("ifAsync") ? e = new hr.IfAsync(t.lineno, t.colno) : this.fail("parseIf: expected if, elif, or elseif", t.lineno, t.colno), e.cond = this.parseExpression(), this.advanceAfterBlockEnd(t.value), e.body = this.parseUntilBlocks("elif", "elseif", "else", "endif");
  2328. var n = this.peekToken();
  2329. switch (n && n.value) {
  2330. case "elseif":
  2331. case "elif":
  2332. e.else_ = this.parseIf();
  2333. break;
  2334. case "else":
  2335. this.advanceAfterBlockEnd(), e.else_ = this.parseUntilBlocks("endif"), this.advanceAfterBlockEnd();
  2336. break;
  2337. case "endif":
  2338. e.else_ = null, this.advanceAfterBlockEnd();
  2339. break;
  2340. default:
  2341. this.fail("parseIf: expected elif, else, or endif, got end of file")
  2342. }
  2343. return e
  2344. }, i.parseSet = function() {
  2345. var e = this.peekToken();
  2346. this.skipSymbol("set") || this.fail("parseSet: expected set", e.lineno, e.colno);
  2347. for (var t, n = new hr.Set(e.lineno, e.colno, []);
  2348. (t = this.parsePrimary()) && (n.targets.push(t), this.skip(Vt.TOKEN_COMMA)););
  2349. return this.skipValue(Vt.TOKEN_OPERATOR, "=") ? (n.value = this.parseExpression(), this.advanceAfterBlockEnd(e.value)) : this.skip(Vt.TOKEN_BLOCK_END) ? (n.body = new hr.Capture(e.lineno, e.colno, this.parseUntilBlocks("endset")), n.value = null, this.advanceAfterBlockEnd()) : this.fail("parseSet: expected = or block end in set tag", e.lineno, e.colno), n
  2350. }, i.parseSwitch = function() {
  2351. var e = "switch",
  2352. t = "endswitch",
  2353. n = "case",
  2354. r = "default",
  2355. i = this.peekToken();
  2356. this.skipSymbol(e) || this.skipSymbol(n) || this.skipSymbol(r) || this.fail('parseSwitch: expected "switch," "case" or "default"', i.lineno, i.colno);
  2357. var s = this.parseExpression();
  2358. this.advanceAfterBlockEnd(e), this.parseUntilBlocks(n, r, t);
  2359. var a, o = this.peekToken(),
  2360. c = [];
  2361. do {
  2362. this.skipSymbol(n);
  2363. var l = this.parseExpression();
  2364. this.advanceAfterBlockEnd(e);
  2365. var h = this.parseUntilBlocks(n, r, t);
  2366. c.push(new hr.Case(o.line, o.col, l, h)), o = this.peekToken()
  2367. } while (o && o.value === n);
  2368. switch (o.value) {
  2369. case r:
  2370. this.advanceAfterBlockEnd(), a = this.parseUntilBlocks(t), this.advanceAfterBlockEnd();
  2371. break;
  2372. case t:
  2373. this.advanceAfterBlockEnd();
  2374. break;
  2375. default:
  2376. this.fail('parseSwitch: expected "case," "default" or "endswitch," got EOF.')
  2377. }
  2378. return new hr.Switch(i.lineno, i.colno, s, c, a)
  2379. }, i.parseStatement = function() {
  2380. var e = this.peekToken();
  2381. if (e.type !== Vt.TOKEN_SYMBOL && this.fail("tag name expected", e.lineno, e.colno), this.breakOnBlocks && -1 !== je.indexOf(this.breakOnBlocks, e.value)) return null;
  2382. switch (e.value) {
  2383. case "raw":
  2384. return this.parseRaw();
  2385. case "verbatim":
  2386. return this.parseRaw("verbatim");
  2387. case "if":
  2388. case "ifAsync":
  2389. return this.parseIf();
  2390. case "for":
  2391. case "asyncEach":
  2392. case "asyncAll":
  2393. return this.parseFor();
  2394. case "block":
  2395. return this.parseBlock();
  2396. case "extends":
  2397. return this.parseExtends();
  2398. case "include":
  2399. return this.parseInclude();
  2400. case "set":
  2401. return this.parseSet();
  2402. case "macro":
  2403. return this.parseMacro();
  2404. case "call":
  2405. return this.parseCall();
  2406. case "import":
  2407. return this.parseImport();
  2408. case "from":
  2409. return this.parseFrom();
  2410. case "filter":
  2411. return this.parseFilterStatement();
  2412. case "switch":
  2413. return this.parseSwitch();
  2414. default:
  2415. if (this.extensions.length) for (var t = 0; t < this.extensions.length; t++) {
  2416. var n = this.extensions[t];
  2417. if (-1 !== je.indexOf(n.tags || [], e.value)) return n.parse(this, hr, Vt)
  2418. }
  2419. this.fail("unknown block tag: " + e.value, e.lineno, e.colno)
  2420. }
  2421. }, i.parseRaw = function(e) {
  2422. for (var t = "end" + (e = e || "raw"), n = new RegExp("([\\s\\S]*?){%\\s*(" + e + "|" + t + ")\\s*(?=%})%}"), r = 1, i = "", s = null, a = this.advanceAfterBlockEnd();
  2423. (s = this.tokens._extractRegex(n)) && r > 0;) {
  2424. var o = s[0],
  2425. c = s[1],
  2426. l = s[2];
  2427. l === e ? r += 1 : l === t && (r -= 1), 0 === r ? (i += c, this.tokens.backN(o.length - c.length)) : i += o
  2428. }
  2429. return new hr.Output(a.lineno, a.colno, [new hr.TemplateData(a.lineno, a.colno, i)])
  2430. }, i.parsePostfix = function(e) {
  2431. for (var t, n = this.peekToken(); n;) {
  2432. if (n.type === Vt.TOKEN_LEFT_PAREN) e = new hr.FunCall(n.lineno, n.colno, e, this.parseSignature());
  2433. else if (n.type === Vt.TOKEN_LEFT_BRACKET)(t = this.parseAggregate()).children.length > 1 && this.fail("invalid index"), e = new hr.LookupVal(n.lineno, n.colno, e, t.children[0]);
  2434. else {
  2435. if (n.type !== Vt.TOKEN_OPERATOR || "." !== n.value) break;
  2436. this.nextToken();
  2437. var r = this.nextToken();
  2438. r.type !== Vt.TOKEN_SYMBOL && this.fail("expected name as lookup value, got " + r.value, r.lineno, r.colno), t = new hr.Literal(r.lineno, r.colno, r.value), e = new hr.LookupVal(n.lineno, n.colno, e, t)
  2439. }
  2440. n = this.peekToken()
  2441. }
  2442. return e
  2443. }, i.parseExpression = function() {
  2444. return this.parseInlineIf()
  2445. }, i.parseInlineIf = function() {
  2446. var e = this.parseOr();
  2447. if (this.skipSymbol("if")) {
  2448. var t = this.parseOr(),
  2449. n = e;
  2450. (e = new hr.InlineIf(e.lineno, e.colno)).body = n, e.cond = t, this.skipSymbol("else") ? e.else_ = this.parseOr() : e.else_ = null
  2451. }
  2452. return e
  2453. }, i.parseOr = function() {
  2454. for (var e = this.parseAnd(); this.skipSymbol("or");) {
  2455. var t = this.parseAnd();
  2456. e = new hr.Or(e.lineno, e.colno, e, t)
  2457. }
  2458. return e
  2459. }, i.parseAnd = function() {
  2460. for (var e = this.parseNot(); this.skipSymbol("and");) {
  2461. var t = this.parseNot();
  2462. e = new hr.And(e.lineno, e.colno, e, t)
  2463. }
  2464. return e
  2465. }, i.parseNot = function() {
  2466. var e = this.peekToken();
  2467. return this.skipSymbol("not") ? new hr.Not(e.lineno, e.colno, this.parseNot()) : this.parseIn()
  2468. }, i.parseIn = function() {
  2469. for (var e = this.parseIs();;) {
  2470. var t = this.nextToken();
  2471. if (!t) break;
  2472. var n = t.type === Vt.TOKEN_SYMBOL && "not" === t.value;
  2473. if (n || this.pushToken(t), !this.skipSymbol("in")) {
  2474. n && this.pushToken(t);
  2475. break
  2476. }
  2477. var r = this.parseIs();
  2478. e = new hr.In(e.lineno, e.colno, e, r), n && (e = new hr.Not(e.lineno, e.colno, e))
  2479. }
  2480. return e
  2481. }, i.parseIs = function() {
  2482. var e = this.parseCompare();
  2483. if (this.skipSymbol("is")) {
  2484. var t = this.skipSymbol("not"),
  2485. n = this.parseCompare();
  2486. e = new hr.Is(e.lineno, e.colno, e, n), t && (e = new hr.Not(e.lineno, e.colno, e))
  2487. }
  2488. return e
  2489. }, i.parseCompare = function() {
  2490. for (var e = ["==", "===", "!=", "!==", "<", ">", "<=", ">="], t = this.parseConcat(), n = [];;) {
  2491. var r = this.nextToken();
  2492. if (!r) break;
  2493. if (-1 === e.indexOf(r.value)) {
  2494. this.pushToken(r);
  2495. break
  2496. }
  2497. n.push(new hr.CompareOperand(r.lineno, r.colno, this.parseConcat(), r.value))
  2498. }
  2499. return n.length ? new hr.Compare(n[0].lineno, n[0].colno, t, n) : t
  2500. }, i.parseConcat = function() {
  2501. for (var e = this.parseAdd(); this.skipValue(Vt.TOKEN_TILDE, "~");) {
  2502. var t = this.parseAdd();
  2503. e = new hr.Concat(e.lineno, e.colno, e, t)
  2504. }
  2505. return e
  2506. }, i.parseAdd = function() {
  2507. for (var e = this.parseSub(); this.skipValue(Vt.TOKEN_OPERATOR, "+");) {
  2508. var t = this.parseSub();
  2509. e = new hr.Add(e.lineno, e.colno, e, t)
  2510. }
  2511. return e
  2512. }, i.parseSub = function() {
  2513. for (var e = this.parseMul(); this.skipValue(Vt.TOKEN_OPERATOR, "-");) {
  2514. var t = this.parseMul();
  2515. e = new hr.Sub(e.lineno, e.colno, e, t)
  2516. }
  2517. return e
  2518. }, i.parseMul = function() {
  2519. for (var e = this.parseDiv(); this.skipValue(Vt.TOKEN_OPERATOR, "*");) {
  2520. var t = this.parseDiv();
  2521. e = new hr.Mul(e.lineno, e.colno, e, t)
  2522. }
  2523. return e
  2524. }, i.parseDiv = function() {
  2525. for (var e = this.parseFloorDiv(); this.skipValue(Vt.TOKEN_OPERATOR, "/");) {
  2526. var t = this.parseFloorDiv();
  2527. e = new hr.Div(e.lineno, e.colno, e, t)
  2528. }
  2529. return e
  2530. }, i.parseFloorDiv = function() {
  2531. for (var e = this.parseMod(); this.skipValue(Vt.TOKEN_OPERATOR, "//");) {
  2532. var t = this.parseMod();
  2533. e = new hr.FloorDiv(e.lineno, e.colno, e, t)
  2534. }
  2535. return e
  2536. }, i.parseMod = function() {
  2537. for (var e = this.parsePow(); this.skipValue(Vt.TOKEN_OPERATOR, "%");) {
  2538. var t = this.parsePow();
  2539. e = new hr.Mod(e.lineno, e.colno, e, t)
  2540. }
  2541. return e
  2542. }, i.parsePow = function() {
  2543. for (var e = this.parseUnary(); this.skipValue(Vt.TOKEN_OPERATOR, "**");) {
  2544. var t = this.parseUnary();
  2545. e = new hr.Pow(e.lineno, e.colno, e, t)
  2546. }
  2547. return e
  2548. }, i.parseUnary = function(e) {
  2549. var t, n = this.peekToken();
  2550. return t = this.skipValue(Vt.TOKEN_OPERATOR, "-") ? new hr.Neg(n.lineno, n.colno, this.parseUnary(!0)) : this.skipValue(Vt.TOKEN_OPERATOR, "+") ? new hr.Pos(n.lineno, n.colno, this.parseUnary(!0)) : this.parsePrimary(), e || (t = this.parseFilter(t)), t
  2551. }, i.parsePrimary = function(e) {
  2552. var t, n = this.nextToken(),
  2553. r = null;
  2554. if (n ? n.type === Vt.TOKEN_STRING ? t = n.value : n.type === Vt.TOKEN_INT ? t = parseInt(n.value, 10) : n.type === Vt.TOKEN_FLOAT ? t = parseFloat(n.value) : n.type === Vt.TOKEN_BOOLEAN ? "true" === n.value ? t = !0 : "false" === n.value ? t = !1 : this.fail("invalid boolean: " + n.value, n.lineno, n.colno) : n.type === Vt.TOKEN_NONE ? t = null : n.type === Vt.TOKEN_REGEX && (t = new RegExp(n.value.body, n.value.flags)) : this.fail("expected expression, got end of file"), void 0 !== t ? r = new hr.Literal(n.lineno, n.colno, t) : n.type === Vt.TOKEN_SYMBOL ? r = new hr.Symbol(n.lineno, n.colno, n.value) : (this.pushToken(n), r = this.parseAggregate()), e || (r = this.parsePostfix(r)), r) return r;
  2555. throw this.error("unexpected token: " + n.value, n.lineno, n.colno)
  2556. }, i.parseFilterName = function() {
  2557. for (var e = this.expect(Vt.TOKEN_SYMBOL), t = e.value; this.skipValue(Vt.TOKEN_OPERATOR, ".");) t += "." + this.expect(Vt.TOKEN_SYMBOL).value;
  2558. return new hr.Symbol(e.lineno, e.colno, t)
  2559. }, i.parseFilterArgs = function(e) {
  2560. return this.peekToken().type === Vt.TOKEN_LEFT_PAREN ? this.parsePostfix(e).args.children : []
  2561. }, i.parseFilter = function(e) {
  2562. for (; this.skip(Vt.TOKEN_PIPE);) {
  2563. var t = this.parseFilterName();
  2564. e = new hr.Filter(t.lineno, t.colno, t, new hr.NodeList(t.lineno, t.colno, [e].concat(this.parseFilterArgs(e))))
  2565. }
  2566. return e
  2567. }, i.parseFilterStatement = function() {
  2568. var e = this.peekToken();
  2569. this.skipSymbol("filter") || this.fail("parseFilterStatement: expected filter");
  2570. var t = this.parseFilterName(),
  2571. n = this.parseFilterArgs(t);
  2572. this.advanceAfterBlockEnd(e.value);
  2573. var r = new hr.Capture(t.lineno, t.colno, this.parseUntilBlocks("endfilter"));
  2574. this.advanceAfterBlockEnd();
  2575. var i = new hr.Filter(t.lineno, t.colno, t, new hr.NodeList(t.lineno, t.colno, [r].concat(n)));
  2576. return new hr.Output(t.lineno, t.colno, [i])
  2577. }, i.parseAggregate = function() {
  2578. var e, t = this.nextToken();
  2579. switch (t.type) {
  2580. case Vt.TOKEN_LEFT_PAREN:
  2581. e = new hr.Group(t.lineno, t.colno);
  2582. break;
  2583. case Vt.TOKEN_LEFT_BRACKET:
  2584. e = new hr.Array(t.lineno, t.colno);
  2585. break;
  2586. case Vt.TOKEN_LEFT_CURLY:
  2587. e = new hr.Dict(t.lineno, t.colno);
  2588. break;
  2589. default:
  2590. return null
  2591. }
  2592. for (;;) {
  2593. var n = this.peekToken().type;
  2594. if (n === Vt.TOKEN_RIGHT_PAREN || n === Vt.TOKEN_RIGHT_BRACKET || n === Vt.TOKEN_RIGHT_CURLY) {
  2595. this.nextToken();
  2596. break
  2597. }
  2598. if (e.children.length > 0 && (this.skip(Vt.TOKEN_COMMA) || this.fail("parseAggregate: expected comma after expression", t.lineno, t.colno)), e instanceof hr.Dict) {
  2599. var r = this.parsePrimary();
  2600. this.skip(Vt.TOKEN_COLON) || this.fail("parseAggregate: expected colon after dict key", t.lineno, t.colno);
  2601. var i = this.parseExpression();
  2602. e.addChild(new hr.Pair(r.lineno, r.colno, r, i))
  2603. } else {
  2604. var s = this.parseExpression();
  2605. e.addChild(s)
  2606. }
  2607. }
  2608. return e
  2609. }, i.parseSignature = function(e, t) {
  2610. var n = this.peekToken();
  2611. if (!t && n.type !== Vt.TOKEN_LEFT_PAREN) {
  2612. if (e) return null;
  2613. this.fail("expected arguments", n.lineno, n.colno)
  2614. }
  2615. n.type === Vt.TOKEN_LEFT_PAREN && (n = this.nextToken());
  2616. for (var r = new hr.NodeList(n.lineno, n.colno), i = new hr.KeywordArgs(n.lineno, n.colno), s = !1;;) {
  2617. if (n = this.peekToken(), !t && n.type === Vt.TOKEN_RIGHT_PAREN) {
  2618. this.nextToken();
  2619. break
  2620. }
  2621. if (t && n.type === Vt.TOKEN_BLOCK_END) break;
  2622. if (s && !this.skip(Vt.TOKEN_COMMA)) this.fail("parseSignature: expected comma after expression", n.lineno, n.colno);
  2623. else {
  2624. var a = this.parseExpression();
  2625. this.skipValue(Vt.TOKEN_OPERATOR, "=") ? i.addChild(new hr.Pair(a.lineno, a.colno, a, this.parseExpression())) : r.addChild(a)
  2626. }
  2627. s = !0
  2628. }
  2629. return i.children.length && r.addChild(i), r
  2630. }, i.parseUntilBlocks = function() {
  2631. for (var e = this.breakOnBlocks, t = arguments.length, n = new Array(t), r = 0; r < t; r++) n[r] = arguments[r];
  2632. this.breakOnBlocks = n;
  2633. var i = this.parse();
  2634. return this.breakOnBlocks = e, i
  2635. }, i.parseNodes = function() {
  2636. for (var e, t = []; e = this.nextToken();) if (e.type === Vt.TOKEN_DATA) {
  2637. var n = e.value,
  2638. r = this.peekToken(),
  2639. i = r && r.value;
  2640. this.dropLeadingWhitespace && (n = n.replace(/^\s*/, ""), this.dropLeadingWhitespace = !1), r && (r.type === Vt.TOKEN_BLOCK_START && "-" === i.charAt(i.length - 1) || r.type === Vt.TOKEN_VARIABLE_START && "-" === i.charAt(this.tokens.tags.VARIABLE_START.length) || r.type === Vt.TOKEN_COMMENT && "-" === i.charAt(this.tokens.tags.COMMENT_START.length)) && (n = n.replace(/\s*$/, "")), t.push(new hr.Output(e.lineno, e.colno, [new hr.TemplateData(e.lineno, e.colno, n)]))
  2641. } else if (e.type === Vt.TOKEN_BLOCK_START) {
  2642. this.dropLeadingWhitespace = !1;
  2643. var s = this.parseStatement();
  2644. if (!s) break;
  2645. t.push(s)
  2646. } else if (e.type === Vt.TOKEN_VARIABLE_START) {
  2647. var a = this.parseExpression();
  2648. this.dropLeadingWhitespace = !1, this.advanceAfterVariableEnd(), t.push(new hr.Output(e.lineno, e.colno, [a]))
  2649. } else e.type === Vt.TOKEN_COMMENT ? this.dropLeadingWhitespace = "-" === e.value.charAt(e.value.length - this.tokens.tags.COMMENT_END.length - 1) : this.fail("Unexpected token at top-level: " + e.type, e.lineno, e.colno);
  2650. return t
  2651. }, i.parse = function() {
  2652. return new hr.NodeList(0, 0, this.parseNodes())
  2653. }, i.parseAsRoot = function() {
  2654. return new hr.Root(0, 0, this.parseNodes())
  2655. }, r
  2656. }(en.Obj),
  2657. fr = {
  2658. parse: function(e, t, n) {
  2659. var r = new pr(Vt.lex(e, n));
  2660. return void 0 !== t && (r.extensions = t), r.parseAsRoot()
  2661. },
  2662. Parser: pr
  2663. }, dr = 0;
  2664. function Er() {
  2665. return "hole_" + dr++
  2666. }
  2667. function mr(e, t) {
  2668. for (var n = null, r = 0; r < e.length; r++) {
  2669. var i = t(e[r]);
  2670. i !== e[r] && (n || (n = e.slice()), n[r] = i)
  2671. }
  2672. return n || e
  2673. }
  2674. function Tr(e, t, n) {
  2675. if (!(e instanceof hr.Node)) return e;
  2676. if (!n) {
  2677. var r = t(e);
  2678. if (r && r !== e) return r
  2679. }
  2680. if (e instanceof hr.NodeList) {
  2681. var i = mr(e.children, (function(e) {
  2682. return Tr(e, t, n)
  2683. }));
  2684. i !== e.children && (e = new hr[e.typename](e.lineno, e.colno, i))
  2685. } else if (e instanceof hr.CallExtension) {
  2686. var s = Tr(e.args, t, n),
  2687. a = mr(e.contentArgs, (function(e) {
  2688. return Tr(e, t, n)
  2689. }));
  2690. s === e.args && a === e.contentArgs || (e = new hr[e.typename](e.extName, e.prop, s, a))
  2691. } else {
  2692. var o = e.fields.map((function(t) {
  2693. return e[t]
  2694. })),
  2695. c = mr(o, (function(e) {
  2696. return Tr(e, t, n)
  2697. }));
  2698. c !== o && (e = new hr[e.typename](e.lineno, e.colno), c.forEach((function(t, n) {
  2699. e[e.fields[n]] = t
  2700. })))
  2701. }
  2702. return n && t(e) || e
  2703. }
  2704. function _r(e, t) {
  2705. return Tr(e, t, !0)
  2706. }
  2707. function Ar(e, t, n) {
  2708. var r = [],
  2709. i = _r(n ? e[n] : e, (function(e) {
  2710. var n;
  2711. return e instanceof hr.Block ? e : ((e instanceof hr.Filter && -1 !== je.indexOf(t, e.name.value) || e instanceof hr.CallExtensionAsync) && (n = new hr.Symbol(e.lineno, e.colno, Er()), r.push(new hr.FilterAsync(e.lineno, e.colno, e.name, e.args, n))), n)
  2712. }));
  2713. return n ? e[n] = i : e = i, r.length ? (r.push(e), new hr.NodeList(e.lineno, e.colno, r)) : e
  2714. }
  2715. function gr(e, t) {
  2716. return function(e) {
  2717. return _r(e, (function(e) {
  2718. if (e instanceof hr.If || e instanceof hr.For) {
  2719. var t = !1;
  2720. if (Tr(e, (function(e) {
  2721. if (e instanceof hr.FilterAsync || e instanceof hr.IfAsync || e instanceof hr.AsyncEach || e instanceof hr.AsyncAll || e instanceof hr.CallExtensionAsync) return t = !0, e
  2722. })), t) {
  2723. if (e instanceof hr.If) return new hr.IfAsync(e.lineno, e.colno, e.cond, e.body, e.else_);
  2724. if (e instanceof hr.For && !(e instanceof hr.AsyncAll)) return new hr.AsyncEach(e.lineno, e.colno, e.arr, e.name, e.body, e.else_)
  2725. }
  2726. }
  2727. }))
  2728. }(function(e) {
  2729. return Tr(e, (function(e) {
  2730. if (e instanceof hr.Block) {
  2731. var t = !1,
  2732. n = Er();
  2733. e.body = Tr(e.body, (function(e) {
  2734. if (e instanceof hr.FunCall && "super" === e.name.value) return t = !0, new hr.Symbol(e.lineno, e.colno, n)
  2735. })), t && e.body.children.unshift(new hr.Super(0, 0, e.name, new hr.Symbol(0, 0, n)))
  2736. }
  2737. }))
  2738. }(function(e, t) {
  2739. return _r(e, (function(e) {
  2740. return e instanceof hr.Output ? Ar(e, t) : e instanceof hr.Set ? Ar(e, t, "value") : e instanceof hr.For ? Ar(e, t, "arr") : e instanceof hr.If ? Ar(e, t, "cond") : e instanceof hr.CallExtension ? Ar(e, t, "args") : void 0
  2741. }))
  2742. }(e, t)))
  2743. }
  2744. var Nr = {
  2745. transform: function(e, t) {
  2746. return gr(e, t || [])
  2747. }
  2748. }, Cr = Array.from,
  2749. Ir = "function" == typeof Symbol && Symbol.iterator && "function" == typeof Cr,
  2750. Sr = function() {
  2751. function e(e, t) {
  2752. this.variables = Object.create(null), this.parent = e, this.topLevel = !1, this.isolateWrites = t
  2753. }
  2754. var t = e.prototype;
  2755. return t.set = function(e, t, n) {
  2756. var r = e.split("."),
  2757. i = this.variables,
  2758. s = this;
  2759. if (n && (s = this.resolve(r[0], !0))) s.set(e, t);
  2760. else {
  2761. for (var a = 0; a < r.length - 1; a++) {
  2762. var o = r[a];
  2763. i[o] || (i[o] = {}), i = i[o]
  2764. }
  2765. i[r[r.length - 1]] = t
  2766. }
  2767. }, t.get = function(e) {
  2768. var t = this.variables[e];
  2769. return void 0 !== t ? t : null
  2770. }, t.lookup = function(e) {
  2771. var t = this.parent,
  2772. n = this.variables[e];
  2773. return void 0 !== n ? n : t && t.lookup(e)
  2774. }, t.resolve = function(e, t) {
  2775. var n = t && this.isolateWrites ? void 0 : this.parent;
  2776. return void 0 !== this.variables[e] ? this : n && n.resolve(e)
  2777. }, t.push = function(t) {
  2778. return new e(this, t)
  2779. }, t.pop = function() {
  2780. return this.parent
  2781. }, e
  2782. }();
  2783. function br(e) {
  2784. return e && Object.prototype.hasOwnProperty.call(e, "__keywords")
  2785. }
  2786. function Or(e) {
  2787. var t = e.length;
  2788. if (t) {
  2789. var n = e[t - 1];
  2790. if (br(n)) return n
  2791. }
  2792. return {}
  2793. }
  2794. function yr(e) {
  2795. var t = e.length;
  2796. return 0 === t ? 0 : br(e[t - 1]) ? t - 1 : t
  2797. }
  2798. function Lr(e) {
  2799. if ("string" != typeof e) return e;
  2800. this.val = e, Object.defineProperty(this, "length", {
  2801. writable: !0,
  2802. configurable: !0,
  2803. value: e.length
  2804. })
  2805. }
  2806. Lr.prototype = Object.create(String.prototype, {
  2807. length: {
  2808. writable: !0,
  2809. configurable: !0,
  2810. value: 0
  2811. }
  2812. }), Lr.prototype.valueOf = function() {
  2813. return this.val
  2814. }, Lr.prototype.toString = function() {
  2815. return this.val
  2816. };
  2817. var kr = {
  2818. Frame: Sr,
  2819. makeMacro: function(e, t, n) {
  2820. return function() {
  2821. for (var r = arguments.length, i = new Array(r), s = 0; s < r; s++) i[s] = arguments[s];
  2822. var a, o = yr(i),
  2823. c = Or(i);
  2824. if (o > e.length) a = i.slice(0, e.length), i.slice(a.length, o).forEach((function(e, n) {
  2825. n < t.length && (c[t[n]] = e)
  2826. })), a.push(c);
  2827. else if (o < e.length) {
  2828. a = i.slice(0, o);
  2829. for (var l = o; l < e.length; l++) {
  2830. var h = e[l];
  2831. a.push(c[h]), delete c[h]
  2832. }
  2833. a.push(c)
  2834. } else a = i;
  2835. return n.apply(this, a)
  2836. }
  2837. },
  2838. makeKeywordArgs: function(e) {
  2839. return e.__keywords = !0, e
  2840. },
  2841. numArgs: yr,
  2842. suppressValue: function(e, t) {
  2843. return "object" == typeof(e = null != e ? e : "") ? new Lr(JSON.stringify(e).toString()) : (!t || e instanceof Lr || (e = je.escape(e.toString())), e)
  2844. },
  2845. ensureDefined: function(e, t, n) {
  2846. if (null == e) throw new je.TemplateError("attempted to output null or undefined value", t + 1, n + 1);
  2847. return e
  2848. },
  2849. memberLookup: function(e, t) {
  2850. if (null != e) return "function" == typeof e[t] ? function() {
  2851. for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++) r[i] = arguments[i];
  2852. return e[t].apply(e, r)
  2853. } : e[t]
  2854. },
  2855. contextOrFrameLookup: function(e, t, n) {
  2856. var r = t.lookup(n);
  2857. return void 0 !== r ? r : e.lookup(n)
  2858. },
  2859. callWrap: function(e, t, n, r) {
  2860. if (!e) throw new Error("Unable to call `" + t + "`, which is undefined or falsey");
  2861. if ("function" != typeof e) throw new Error("Unable to call `" + t + "`, which is not a function");
  2862. return e.apply(n, r)
  2863. },
  2864. handleError: function(e, t, n) {
  2865. return e.lineno ? e : new je.TemplateError(e, t, n)
  2866. },
  2867. isArray: je.isArray,
  2868. keys: je.keys,
  2869. SafeString: Lr,
  2870. copySafeness: function(e, t) {
  2871. return e instanceof Lr ? new Lr(t) : t.toString()
  2872. },
  2873. markSafe: function(e) {
  2874. var t = typeof e;
  2875. return "string" === t ? new Lr(e) : "function" !== t ? e : function(t) {
  2876. var n = e.apply(this, arguments);
  2877. return "string" == typeof n ? new Lr(n) : n
  2878. }
  2879. },
  2880. asyncEach: function(e, t, n, r) {
  2881. if (je.isArray(e)) {
  2882. var i = e.length;
  2883. je.asyncIter(e, (function(e, r, s) {
  2884. switch (t) {
  2885. case 1:
  2886. n(e, r, i, s);
  2887. break;
  2888. case 2:
  2889. n(e[0], e[1], r, i, s);
  2890. break;
  2891. case 3:
  2892. n(e[0], e[1], e[2], r, i, s);
  2893. break;
  2894. default:
  2895. e.push(r, i, s), n.apply(this, e)
  2896. }
  2897. }), r)
  2898. } else je.asyncFor(e, (function(e, t, r, i, s) {
  2899. n(e, t, r, i, s)
  2900. }), r)
  2901. },
  2902. asyncAll: function(e, t, n, r) {
  2903. var i, s, a = 0;
  2904. function o(e, t) {
  2905. a++, s[e] = t, a === i && r(null, s.join(""))
  2906. }
  2907. if (je.isArray(e)) if (i = e.length, s = new Array(i), 0 === i) r(null, "");
  2908. else for (var c = 0; c < e.length; c++) {
  2909. var l = e[c];
  2910. switch (t) {
  2911. case 1:
  2912. n(l, c, i, o);
  2913. break;
  2914. case 2:
  2915. n(l[0], l[1], c, i, o);
  2916. break;
  2917. case 3:
  2918. n(l[0], l[1], l[2], c, i, o);
  2919. break;
  2920. default:
  2921. l.push(c, i, o), n.apply(this, l)
  2922. }
  2923. } else {
  2924. var h = je.keys(e || {});
  2925. if (i = h.length, s = new Array(i), 0 === i) r(null, "");
  2926. else for (var u = 0; u < h.length; u++) {
  2927. var p = h[u];
  2928. n(p, e[p], u, i, o)
  2929. }
  2930. }
  2931. },
  2932. inOperator: je.inOperator,
  2933. fromIterator: function(e) {
  2934. return "object" != typeof e || null === e || je.isArray(e) ? e : Ir && Symbol.iterator in e ? Cr(e) : e
  2935. }
  2936. };
  2937. function vr(e, t) {
  2938. return vr = Object.setPrototypeOf || function(e, t) {
  2939. return e.__proto__ = t, e
  2940. }, vr(e, t)
  2941. }
  2942. kr.Frame, kr.makeMacro, kr.makeKeywordArgs, kr.numArgs, kr.suppressValue, kr.ensureDefined, kr.memberLookup, kr.contextOrFrameLookup, kr.callWrap, kr.handleError, kr.isArray, kr.keys, kr.SafeString, kr.copySafeness, kr.markSafe, kr.asyncEach, kr.asyncAll, kr.inOperator, kr.fromIterator;
  2943. var Dr = je.TemplateError,
  2944. Rr = kr.Frame,
  2945. Mr = {
  2946. "==": "==",
  2947. "===": "===",
  2948. "!=": "!=",
  2949. "!==": "!==",
  2950. "<": "<",
  2951. ">": ">",
  2952. "<=": "<=",
  2953. ">=": ">="
  2954. }, Pr = function(e) {
  2955. var t, n;
  2956. function r() {
  2957. return e.apply(this, arguments) || this
  2958. }
  2959. n = e, (t = r).prototype = Object.create(n.prototype), t.prototype.constructor = t, vr(t, n);
  2960. var i = r.prototype;
  2961. return i.init = function(e, t) {
  2962. this.templateName = e, this.codebuf = [], this.lastId = 0, this.buffer = null, this.bufferStack = [], this._scopeClosers = "", this.inBlock = !1, this.throwOnUndefined = t
  2963. }, i.fail = function(e, t, n) {
  2964. throw void 0 !== t && (t += 1), void 0 !== n && (n += 1), new Dr(e, t, n)
  2965. }, i._pushBuffer = function() {
  2966. var e = this._tmpid();
  2967. return this.bufferStack.push(this.buffer), this.buffer = e, this._emit("var " + this.buffer + ' = "";'), e
  2968. }, i._popBuffer = function() {
  2969. this.buffer = this.bufferStack.pop()
  2970. }, i._emit = function(e) {
  2971. this.codebuf.push(e)
  2972. }, i._emitLine = function(e) {
  2973. this._emit(e + "\n")
  2974. }, i._emitLines = function() {
  2975. for (var e = this, t = arguments.length, n = new Array(t), r = 0; r < t; r++) n[r] = arguments[r];
  2976. n.forEach((function(t) {
  2977. return e._emitLine(t)
  2978. }))
  2979. }, i._emitFuncBegin = function(e, t) {
  2980. this.buffer = "output", this._scopeClosers = "", this._emitLine("function " + t + "(env, context, frame, runtime, cb) {"), this._emitLine("var lineno = " + e.lineno + ";"), this._emitLine("var colno = " + e.colno + ";"), this._emitLine("var " + this.buffer + ' = "";'), this._emitLine("try {")
  2981. }, i._emitFuncEnd = function(e) {
  2982. e || this._emitLine("cb(null, " + this.buffer + ");"), this._closeScopeLevels(), this._emitLine("} catch (e) {"), this._emitLine(" cb(runtime.handleError(e, lineno, colno));"), this._emitLine("}"), this._emitLine("}"), this.buffer = null
  2983. }, i._addScopeLevel = function() {
  2984. this._scopeClosers += "})"
  2985. }, i._closeScopeLevels = function() {
  2986. this._emitLine(this._scopeClosers + ";"), this._scopeClosers = ""
  2987. }, i._withScopedSyntax = function(e) {
  2988. var t = this._scopeClosers;
  2989. this._scopeClosers = "", e.call(this), this._closeScopeLevels(), this._scopeClosers = t
  2990. }, i._makeCallback = function(e) {
  2991. var t = this._tmpid();
  2992. return "function(" + t + (e ? "," + e : "") + ") {\nif(" + t + ") { cb(" + t + "); return; }"
  2993. }, i._tmpid = function() {
  2994. return this.lastId++, "t_" + this.lastId
  2995. }, i._templateName = function() {
  2996. return null == this.templateName ? "undefined" : JSON.stringify(this.templateName)
  2997. }, i._compileChildren = function(e, t) {
  2998. var n = this;
  2999. e.children.forEach((function(e) {
  3000. n.compile(e, t)
  3001. }))
  3002. }, i._compileAggregate = function(e, t, n, r) {
  3003. var i = this;
  3004. n && this._emit(n), e.children.forEach((function(e, n) {
  3005. n > 0 && i._emit(","), i.compile(e, t)
  3006. })), r && this._emit(r)
  3007. }, i._compileExpression = function(e, t) {
  3008. this.assertType(e, hr.Literal, hr.Symbol, hr.Group, hr.Array, hr.Dict, hr.FunCall, hr.Caller, hr.Filter, hr.LookupVal, hr.Compare, hr.InlineIf, hr.In, hr.Is, hr.And, hr.Or, hr.Not, hr.Add, hr.Concat, hr.Sub, hr.Mul, hr.Div, hr.FloorDiv, hr.Mod, hr.Pow, hr.Neg, hr.Pos, hr.Compare, hr.NodeList), this.compile(e, t)
  3009. }, i.assertType = function(e) {
  3010. for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), r = 1; r < t; r++) n[r - 1] = arguments[r];
  3011. n.some((function(t) {
  3012. return e instanceof t
  3013. })) || this.fail("assertType: invalid type: " + e.typename, e.lineno, e.colno)
  3014. }, i.compileCallExtension = function(e, t, n) {
  3015. var r = this,
  3016. i = e.args,
  3017. s = e.contentArgs,
  3018. a = "boolean" != typeof e.autoescape || e.autoescape;
  3019. if (n || this._emit(this.buffer + " += runtime.suppressValue("), this._emit('env.getExtension("' + e.extName + '")["' + e.prop + '"]('), this._emit("context"), (i || s) && this._emit(","), i && (i instanceof hr.NodeList || this.fail("compileCallExtension: arguments must be a NodeList, use `parser.parseSignature`"), i.children.forEach((function(e, n) {
  3020. r._compileExpression(e, t), (n !== i.children.length - 1 || s.length) && r._emit(",")
  3021. }))), s.length && s.forEach((function(e, n) {
  3022. if (n > 0 && r._emit(","), e) {
  3023. r._emitLine("function(cb) {"), r._emitLine("if(!cb) { cb = function(err) { if(err) { throw err; }}}");
  3024. var i = r._pushBuffer();
  3025. r._withScopedSyntax((function() {
  3026. r.compile(e, t), r._emitLine("cb(null, " + i + ");")
  3027. })), r._popBuffer(), r._emitLine("return " + i + ";"), r._emitLine("}")
  3028. } else r._emit("null")
  3029. })), n) {
  3030. var o = this._tmpid();
  3031. this._emitLine(", " + this._makeCallback(o)), this._emitLine(this.buffer + " += runtime.suppressValue(" + o + ", " + a + " && env.opts.autoescape);"), this._addScopeLevel()
  3032. } else this._emit(")"), this._emit(", " + a + " && env.opts.autoescape);\n")
  3033. }, i.compileCallExtensionAsync = function(e, t) {
  3034. this.compileCallExtension(e, t, !0)
  3035. }, i.compileNodeList = function(e, t) {
  3036. this._compileChildren(e, t)
  3037. }, i.compileLiteral = function(e) {
  3038. if ("string" == typeof e.value) {
  3039. var t = e.value.replace(/\\/g, "\\\\");
  3040. t = (t = (t = (t = (t = t.replace(/"/g, '\\"')).replace(/\n/g, "\\n")).replace(/\r/g, "\\r")).replace(/\t/g, "\\t")).replace(/\u2028/g, "\\u2028"), this._emit('"' + t + '"')
  3041. } else null === e.value ? this._emit("null") : this._emit(e.value.toString())
  3042. }, i.compileSymbol = function(e, t) {
  3043. var n = e.value,
  3044. r = t.lookup(n);
  3045. r ? this._emit(r) : this._emit('runtime.contextOrFrameLookup(context, frame, "' + n + '")')
  3046. }, i.compileGroup = function(e, t) {
  3047. this._compileAggregate(e, t, "(", ")")
  3048. }, i.compileArray = function(e, t) {
  3049. this._compileAggregate(e, t, "[", "]")
  3050. }, i.compileDict = function(e, t) {
  3051. this._compileAggregate(e, t, "{", "}")
  3052. }, i.compilePair = function(e, t) {
  3053. var n = e.key,
  3054. r = e.value;
  3055. n instanceof hr.Symbol ? n = new hr.Literal(n.lineno, n.colno, n.value) : n instanceof hr.Literal && "string" == typeof n.value || this.fail("compilePair: Dict keys must be strings or names", n.lineno, n.colno), this.compile(n, t), this._emit(": "), this._compileExpression(r, t)
  3056. }, i.compileInlineIf = function(e, t) {
  3057. this._emit("("), this.compile(e.cond, t), this._emit("?"), this.compile(e.body, t), this._emit(":"), null !== e.else_ ? this.compile(e.else_, t) : this._emit('""'), this._emit(")")
  3058. }, i.compileIn = function(e, t) {
  3059. this._emit("runtime.inOperator("), this.compile(e.left, t), this._emit(","), this.compile(e.right, t), this._emit(")")
  3060. }, i.compileIs = function(e, t) {
  3061. var n = e.right.name ? e.right.name.value : e.right.value;
  3062. this._emit('env.getTest("' + n + '").call(context, '), this.compile(e.left, t), e.right.args && (this._emit(","), this.compile(e.right.args, t)), this._emit(") === true")
  3063. }, i._binOpEmitter = function(e, t, n) {
  3064. this.compile(e.left, t), this._emit(n), this.compile(e.right, t)
  3065. }, i.compileOr = function(e, t) {
  3066. return this._binOpEmitter(e, t, " || ")
  3067. }, i.compileAnd = function(e, t) {
  3068. return this._binOpEmitter(e, t, " && ")
  3069. }, i.compileAdd = function(e, t) {
  3070. return this._binOpEmitter(e, t, " + ")
  3071. }, i.compileConcat = function(e, t) {
  3072. return this._binOpEmitter(e, t, ' + "" + ')
  3073. }, i.compileSub = function(e, t) {
  3074. return this._binOpEmitter(e, t, " - ")
  3075. }, i.compileMul = function(e, t) {
  3076. return this._binOpEmitter(e, t, " * ")
  3077. }, i.compileDiv = function(e, t) {
  3078. return this._binOpEmitter(e, t, " / ")
  3079. }, i.compileMod = function(e, t) {
  3080. return this._binOpEmitter(e, t, " % ")
  3081. }, i.compileNot = function(e, t) {
  3082. this._emit("!"), this.compile(e.target, t)
  3083. }, i.compileFloorDiv = function(e, t) {
  3084. this._emit("Math.floor("), this.compile(e.left, t), this._emit(" / "), this.compile(e.right, t), this._emit(")")
  3085. }, i.compilePow = function(e, t) {
  3086. this._emit("Math.pow("), this.compile(e.left, t), this._emit(", "), this.compile(e.right, t), this._emit(")")
  3087. }, i.compileNeg = function(e, t) {
  3088. this._emit("-"), this.compile(e.target, t)
  3089. }, i.compilePos = function(e, t) {
  3090. this._emit("+"), this.compile(e.target, t)
  3091. }, i.compileCompare = function(e, t) {
  3092. var n = this;
  3093. this.compile(e.expr, t), e.ops.forEach((function(e) {
  3094. n._emit(" " + Mr[e.type] + " "), n.compile(e.expr, t)
  3095. }))
  3096. }, i.compileLookupVal = function(e, t) {
  3097. this._emit("runtime.memberLookup(("), this._compileExpression(e.target, t), this._emit("),"), this._compileExpression(e.val, t), this._emit(")")
  3098. }, i._getNodeName = function(e) {
  3099. switch (e.typename) {
  3100. case "Symbol":
  3101. return e.value;
  3102. case "FunCall":
  3103. return "the return value of (" + this._getNodeName(e.name) + ")";
  3104. case "LookupVal":
  3105. return this._getNodeName(e.target) + '["' + this._getNodeName(e.val) + '"]';
  3106. case "Literal":
  3107. return e.value.toString();
  3108. default:
  3109. return "--expression--"
  3110. }
  3111. }, i.compileFunCall = function(e, t) {
  3112. this._emit("(lineno = " + e.lineno + ", colno = " + e.colno + ", "), this._emit("runtime.callWrap("), this._compileExpression(e.name, t), this._emit(', "' + this._getNodeName(e.name).replace(/"/g, '\\"') + '", context, '), this._compileAggregate(e.args, t, "[", "])"), this._emit(")")
  3113. }, i.compileFilter = function(e, t) {
  3114. var n = e.name;
  3115. this.assertType(n, hr.Symbol), this._emit('env.getFilter("' + n.value + '").call(context, '), this._compileAggregate(e.args, t), this._emit(")")
  3116. }, i.compileFilterAsync = function(e, t) {
  3117. var n = e.name,
  3118. r = e.symbol.value;
  3119. this.assertType(n, hr.Symbol), t.set(r, r), this._emit('env.getFilter("' + n.value + '").call(context, '), this._compileAggregate(e.args, t), this._emitLine(", " + this._makeCallback(r)), this._addScopeLevel()
  3120. }, i.compileKeywordArgs = function(e, t) {
  3121. this._emit("runtime.makeKeywordArgs("), this.compileDict(e, t), this._emit(")")
  3122. }, i.compileSet = function(e, t) {
  3123. var n = this,
  3124. r = [];
  3125. e.targets.forEach((function(e) {
  3126. var i = e.value,
  3127. s = t.lookup(i);
  3128. null == s && (s = n._tmpid(), n._emitLine("var " + s + ";")), r.push(s)
  3129. })), e.value ? (this._emit(r.join(" = ") + " = "), this._compileExpression(e.value, t), this._emitLine(";")) : (this._emit(r.join(" = ") + " = "), this.compile(e.body, t), this._emitLine(";")), e.targets.forEach((function(e, t) {
  3130. var i = r[t],
  3131. s = e.value;
  3132. n._emitLine('frame.set("' + s + '", ' + i + ", true);"), n._emitLine("if(frame.topLevel) {"), n._emitLine('context.setVariable("' + s + '", ' + i + ");"), n._emitLine("}"), "_" !== s.charAt(0) && (n._emitLine("if(frame.topLevel) {"), n._emitLine('context.addExport("' + s + '", ' + i + ");"), n._emitLine("}"))
  3133. }))
  3134. }, i.compileSwitch = function(e, t) {
  3135. var n = this;
  3136. this._emit("switch ("), this.compile(e.expr, t), this._emit(") {"), e.cases.forEach((function(e, r) {
  3137. n._emit("case "), n.compile(e.cond, t), n._emit(": "), n.compile(e.body, t), e.body.children.length && n._emitLine("break;")
  3138. })), e.
  3139. default && (this._emit("default:"), this.compile(e.
  3140. default, t)), this._emit("}")
  3141. }, i.compileIf = function(e, t, n) {
  3142. var r = this;
  3143. this._emit("if("), this._compileExpression(e.cond, t), this._emitLine(") {"), this._withScopedSyntax((function() {
  3144. r.compile(e.body, t), n && r._emit("cb()")
  3145. })), e.else_ ? (this._emitLine("}\nelse {"), this._withScopedSyntax((function() {
  3146. r.compile(e.else_, t), n && r._emit("cb()")
  3147. }))) : n && (this._emitLine("}\nelse {"), this._emit("cb()")), this._emitLine("}")
  3148. }, i.compileIfAsync = function(e, t) {
  3149. this._emit("(function(cb) {"), this.compileIf(e, t, !0), this._emit("})(" + this._makeCallback()), this._addScopeLevel()
  3150. }, i._emitLoopBindings = function(e, t, n, r) {
  3151. var i = this;
  3152. [{
  3153. name: "index",
  3154. val: n + " + 1"
  3155. }, {
  3156. name: "index0",
  3157. val: n
  3158. }, {
  3159. name: "revindex",
  3160. val: r + " - " + n
  3161. }, {
  3162. name: "revindex0",
  3163. val: r + " - " + n + " - 1"
  3164. }, {
  3165. name: "first",
  3166. val: n + " === 0"
  3167. }, {
  3168. name: "last",
  3169. val: n + " === " + r + " - 1"
  3170. }, {
  3171. name: "length",
  3172. val: r
  3173. }].forEach((function(e) {
  3174. i._emitLine('frame.set("loop.' + e.name + '", ' + e.val + ");")
  3175. }))
  3176. }, i.compileFor = function(e, t) {
  3177. var n = this,
  3178. r = this._tmpid(),
  3179. i = this._tmpid(),
  3180. s = this._tmpid();
  3181. if (t = t.push(), this._emitLine("frame = frame.push();"), this._emit("var " + s + " = "), this._compileExpression(e.arr, t), this._emitLine(";"), this._emit("if(" + s + ") {"), this._emitLine(s + " = runtime.fromIterator(" + s + ");"), e.name instanceof hr.Array) {
  3182. this._emitLine("var " + r + ";"), this._emitLine("if(runtime.isArray(" + s + ")) {"), this._emitLine("var " + i + " = " + s + ".length;"), this._emitLine("for(" + r + "=0; " + r + " < " + s + ".length; " + r + "++) {"), e.name.children.forEach((function(i, a) {
  3183. var o = n._tmpid();
  3184. n._emitLine("var " + o + " = " + s + "[" + r + "][" + a + "];"), n._emitLine('frame.set("' + i + '", ' + s + "[" + r + "][" + a + "]);"), t.set(e.name.children[a].value, o)
  3185. })), this._emitLoopBindings(e, s, r, i), this._withScopedSyntax((function() {
  3186. n.compile(e.body, t)
  3187. })), this._emitLine("}"), this._emitLine("} else {");
  3188. var a = e.name.children,
  3189. o = a[0],
  3190. c = a[1],
  3191. l = this._tmpid(),
  3192. h = this._tmpid();
  3193. t.set(o.value, l), t.set(c.value, h), this._emitLine(r + " = -1;"), this._emitLine("var " + i + " = runtime.keys(" + s + ").length;"), this._emitLine("for(var " + l + " in " + s + ") {"), this._emitLine(r + "++;"), this._emitLine("var " + h + " = " + s + "[" + l + "];"), this._emitLine('frame.set("' + o.value + '", ' + l + ");"), this._emitLine('frame.set("' + c.value + '", ' + h + ");"), this._emitLoopBindings(e, s, r, i), this._withScopedSyntax((function() {
  3194. n.compile(e.body, t)
  3195. })), this._emitLine("}"), this._emitLine("}")
  3196. } else {
  3197. var u = this._tmpid();
  3198. t.set(e.name.value, u), this._emitLine("var " + i + " = " + s + ".length;"), this._emitLine("for(var " + r + "=0; " + r + " < " + s + ".length; " + r + "++) {"), this._emitLine("var " + u + " = " + s + "[" + r + "];"), this._emitLine('frame.set("' + e.name.value + '", ' + u + ");"), this._emitLoopBindings(e, s, r, i), this._withScopedSyntax((function() {
  3199. n.compile(e.body, t)
  3200. })), this._emitLine("}")
  3201. }
  3202. this._emitLine("}"), e.else_ && (this._emitLine("if (!" + i + ") {"), this.compile(e.else_, t), this._emitLine("}")), this._emitLine("frame = frame.pop();")
  3203. }, i._compileAsyncLoop = function(e, t, n) {
  3204. var r = this,
  3205. i = this._tmpid(),
  3206. s = this._tmpid(),
  3207. a = this._tmpid(),
  3208. o = n ? "asyncAll" : "asyncEach";
  3209. if (t = t.push(), this._emitLine("frame = frame.push();"), this._emit("var " + a + " = runtime.fromIterator("), this._compileExpression(e.arr, t), this._emitLine(");"), e.name instanceof hr.Array) {
  3210. var c = e.name.children.length;
  3211. this._emit("runtime." + o + "(" + a + ", " + c + ", function("), e.name.children.forEach((function(e) {
  3212. r._emit(e.value + ",")
  3213. })), this._emit(i + "," + s + ",next) {"), e.name.children.forEach((function(e) {
  3214. var n = e.value;
  3215. t.set(n, n), r._emitLine('frame.set("' + n + '", ' + n + ");")
  3216. }))
  3217. } else {
  3218. var l = e.name.value;
  3219. this._emitLine("runtime." + o + "(" + a + ", 1, function(" + l + ", " + i + ", " + s + ",next) {"), this._emitLine('frame.set("' + l + '", ' + l + ");"), t.set(l, l)
  3220. }
  3221. this._emitLoopBindings(e, a, i, s), this._withScopedSyntax((function() {
  3222. var s;
  3223. n && (s = r._pushBuffer()), r.compile(e.body, t), r._emitLine("next(" + i + (s ? "," + s : "") + ");"), n && r._popBuffer()
  3224. }));
  3225. var h = this._tmpid();
  3226. this._emitLine("}, " + this._makeCallback(h)), this._addScopeLevel(), n && this._emitLine(this.buffer + " += " + h + ";"), e.else_ && (this._emitLine("if (!" + a + ".length) {"), this.compile(e.else_, t), this._emitLine("}")), this._emitLine("frame = frame.pop();")
  3227. }, i.compileAsyncEach = function(e, t) {
  3228. this._compileAsyncLoop(e, t)
  3229. }, i.compileAsyncAll = function(e, t) {
  3230. this._compileAsyncLoop(e, t, !0)
  3231. }, i._compileMacro = function(e, t) {
  3232. var n = this,
  3233. r = [],
  3234. i = null,
  3235. s = "macro_" + this._tmpid(),
  3236. a = void 0 !== t;
  3237. e.args.children.forEach((function(t, s) {
  3238. s === e.args.children.length - 1 && t instanceof hr.Dict ? i = t : (n.assertType(t, hr.Symbol), r.push(t))
  3239. }));
  3240. var o, c = [].concat(r.map((function(e) {
  3241. return "l_" + e.value
  3242. })), ["kwargs"]),
  3243. l = r.map((function(e) {
  3244. return '"' + e.value + '"'
  3245. })),
  3246. h = (i && i.children || []).map((function(e) {
  3247. return '"' + e.key.value + '"'
  3248. }));
  3249. o = a ? t.push(!0) : new Rr, this._emitLines("var " + s + " = runtime.makeMacro(", "[" + l.join(", ") + "], ", "[" + h.join(", ") + "], ", "function (" + c.join(", ") + ") {", "var callerFrame = frame;", "frame = " + (a ? "frame.push(true);" : "new runtime.Frame();"), "kwargs = kwargs || {};", 'if (Object.prototype.hasOwnProperty.call(kwargs, "caller")) {', 'frame.set("caller", kwargs.caller); }'), r.forEach((function(e) {
  3250. n._emitLine('frame.set("' + e.value + '", l_' + e.value + ");"), o.set(e.value, "l_" + e.value)
  3251. })), i && i.children.forEach((function(e) {
  3252. var t = e.key.value;
  3253. n._emit('frame.set("' + t + '", '), n._emit('Object.prototype.hasOwnProperty.call(kwargs, "' + t + '")'), n._emit(' ? kwargs["' + t + '"] : '), n._compileExpression(e.value, o), n._emit(");")
  3254. }));
  3255. var u = this._pushBuffer();
  3256. return this._withScopedSyntax((function() {
  3257. n.compile(e.body, o)
  3258. })), this._emitLine("frame = " + (a ? "frame.pop();" : "callerFrame;")), this._emitLine("return new runtime.SafeString(" + u + ");"), this._emitLine("});"), this._popBuffer(), s
  3259. }, i.compileMacro = function(e, t) {
  3260. var n = this._compileMacro(e),
  3261. r = e.name.value;
  3262. t.set(r, n), t.parent ? this._emitLine('frame.set("' + r + '", ' + n + ");") : ("_" !== e.name.value.charAt(0) && this._emitLine('context.addExport("' + r + '");'), this._emitLine('context.setVariable("' + r + '", ' + n + ");"))
  3263. }, i.compileCaller = function(e, t) {
  3264. this._emit("(function (){");
  3265. var n = this._compileMacro(e, t);
  3266. this._emit("return " + n + ";})()")
  3267. }, i._compileGetTemplate = function(e, t, n, r) {
  3268. var i = this._tmpid(),
  3269. s = this._templateName(),
  3270. a = this._makeCallback(i),
  3271. o = n ? "true" : "false",
  3272. c = r ? "true" : "false";
  3273. return this._emit("env.getTemplate("), this._compileExpression(e.template, t), this._emitLine(", " + o + ", " + s + ", " + c + ", " + a), i
  3274. }, i.compileImport = function(e, t) {
  3275. var n = e.target.value,
  3276. r = this._compileGetTemplate(e, t, !1, !1);
  3277. this._addScopeLevel(), this._emitLine(r + ".getExported(" + (e.withContext ? "context.getVariables(), frame, " : "") + this._makeCallback(r)), this._addScopeLevel(), t.set(n, r), t.parent ? this._emitLine('frame.set("' + n + '", ' + r + ");") : this._emitLine('context.setVariable("' + n + '", ' + r + ");")
  3278. }, i.compileFromImport = function(e, t) {
  3279. var n = this,
  3280. r = this._compileGetTemplate(e, t, !1, !1);
  3281. this._addScopeLevel(), this._emitLine(r + ".getExported(" + (e.withContext ? "context.getVariables(), frame, " : "") + this._makeCallback(r)), this._addScopeLevel(), e.names.children.forEach((function(e) {
  3282. var i, s, a = n._tmpid();
  3283. e instanceof hr.Pair ? (i = e.key.value, s = e.value.value) : s = i = e.value, n._emitLine("if(Object.prototype.hasOwnProperty.call(" + r + ', "' + i + '")) {'), n._emitLine("var " + a + " = " + r + "." + i + ";"), n._emitLine("} else {"), n._emitLine("cb(new Error(\"cannot import '" + i + "'\")); return;"), n._emitLine("}"), t.set(s, a), t.parent ? n._emitLine('frame.set("' + s + '", ' + a + ");") : n._emitLine('context.setVariable("' + s + '", ' + a + ");")
  3284. }))
  3285. }, i.compileBlock = function(e) {
  3286. var t = this._tmpid();
  3287. this.inBlock || this._emit('(parentTemplate ? function(e, c, f, r, cb) { cb(""); } : '), this._emit('context.getBlock("' + e.name.value + '")'), this.inBlock || this._emit(")"), this._emitLine("(env, context, frame, runtime, " + this._makeCallback(t)), this._emitLine(this.buffer + " += " + t + ";"), this._addScopeLevel()
  3288. }, i.compileSuper = function(e, t) {
  3289. var n = e.blockName.value,
  3290. r = e.symbol.value,
  3291. i = this._makeCallback(r);
  3292. this._emitLine('context.getSuper(env, "' + n + '", b_' + n + ", frame, runtime, " + i), this._emitLine(r + " = runtime.markSafe(" + r + ");"), this._addScopeLevel(), t.set(r, r)
  3293. }, i.compileExtends = function(e, t) {
  3294. var n = this._tmpid(),
  3295. r = this._compileGetTemplate(e, t, !0, !1);
  3296. this._emitLine("parentTemplate = " + r), this._emitLine("for(var " + n + " in parentTemplate.blocks) {"), this._emitLine("context.addBlock(" + n + ", parentTemplate.blocks[" + n + "]);"), this._emitLine("}"), this._addScopeLevel()
  3297. }, i.compileInclude = function(e, t) {
  3298. this._emitLine("var tasks = [];"), this._emitLine("tasks.push("), this._emitLine("function(callback) {");
  3299. var n = this._compileGetTemplate(e, t, !1, e.ignoreMissing);
  3300. this._emitLine("callback(null," + n + ");});"), this._emitLine("});");
  3301. var r = this._tmpid();
  3302. this._emitLine("tasks.push("), this._emitLine("function(template, callback){"), this._emitLine("template.render(context.getVariables(), frame, " + this._makeCallback(r)), this._emitLine("callback(null," + r + ");});"), this._emitLine("});"), this._emitLine("tasks.push("), this._emitLine("function(result, callback){"), this._emitLine(this.buffer + " += result;"), this._emitLine("callback(null);"), this._emitLine("});"), this._emitLine("env.waterfall(tasks, function(){"), this._addScopeLevel()
  3303. }, i.compileTemplateData = function(e, t) {
  3304. this.compileLiteral(e, t)
  3305. }, i.compileCapture = function(e, t) {
  3306. var n = this,
  3307. r = this.buffer;
  3308. this.buffer = "output", this._emitLine("(function() {"), this._emitLine('var output = "";'), this._withScopedSyntax((function() {
  3309. n.compile(e.body, t)
  3310. })), this._emitLine("return output;"), this._emitLine("})()"), this.buffer = r
  3311. }, i.compileOutput = function(e, t) {
  3312. var n = this;
  3313. e.children.forEach((function(r) {
  3314. r instanceof hr.TemplateData ? r.value && (n._emit(n.buffer + " += "), n.compileLiteral(r, t), n._emitLine(";")) : (n._emit(n.buffer + " += runtime.suppressValue("), n.throwOnUndefined && n._emit("runtime.ensureDefined("), n.compile(r, t), n.throwOnUndefined && n._emit("," + e.lineno + "," + e.colno + ")"), n._emit(", env.opts.autoescape);\n"))
  3315. }))
  3316. }, i.compileRoot = function(e, t) {
  3317. var n = this;
  3318. t && this.fail("compileRoot: root node can't have frame"), t = new Rr, this._emitFuncBegin(e, "root"), this._emitLine("var parentTemplate = null;"), this._compileChildren(e, t), this._emitLine("if(parentTemplate) {"), this._emitLine("parentTemplate.rootRenderFunc(env, context, frame, runtime, cb);"), this._emitLine("} else {"), this._emitLine("cb(null, " + this.buffer + ");"), this._emitLine("}"), this._emitFuncEnd(!0), this.inBlock = !0;
  3319. var r = [],
  3320. i = e.findAll(hr.Block);
  3321. i.forEach((function(e, t) {
  3322. var i = e.name.value;
  3323. if (-1 !== r.indexOf(i)) throw new Error('Block "' + i + '" defined more than once.');
  3324. r.push(i), n._emitFuncBegin(e, "b_" + i);
  3325. var s = new Rr;
  3326. n._emitLine("var frame = frame.push(true);"), n.compile(e.body, s), n._emitFuncEnd()
  3327. })), this._emitLine("return {"), i.forEach((function(e, t) {
  3328. var r = "b_" + e.name.value;
  3329. n._emitLine(r + ": " + r + ",")
  3330. })), this._emitLine("root: root\n};")
  3331. }, i.compile = function(e, t) {
  3332. var n = this["compile" + e.typename];
  3333. n ? n.call(this, e, t) : this.fail("compile: Cannot compile node: " + e.typename, e.lineno, e.colno)
  3334. }, i.getCode = function() {
  3335. return this.codebuf.join("")
  3336. }, r
  3337. }(en.Obj),
  3338. xr = {
  3339. compile: function(e, t, n, r, i) {
  3340. void 0 === i && (i = {});
  3341. var s = new Pr(r, i.throwOnUndefined),
  3342. a = (n || []).map((function(e) {
  3343. return e.preprocess
  3344. })).filter((function(e) {
  3345. return !!e
  3346. })).reduce((function(e, t) {
  3347. return t(e)
  3348. }), e);
  3349. return s.compile(Nr.transform(fr.parse(a, n, i), t, r)), s.getCode()
  3350. },
  3351. Compiler: Pr
  3352. }, wr = Ke((function(e) {
  3353. var t = e.exports = {};
  3354. function n(e, t) {
  3355. return null == e || !1 === e ? t : e
  3356. }
  3357. function r(e) {
  3358. return e != e
  3359. }
  3360. function i(e) {
  3361. var t = (e = n(e, "")).toLowerCase();
  3362. return kr.copySafeness(e, t.charAt(0).toUpperCase() + t.slice(1))
  3363. }
  3364. function s(e) {
  3365. if (je.isString(e)) return e.split("");
  3366. if (je.isObject(e)) return je._entries(e || {}).map((function(e) {
  3367. return {
  3368. key: e[0],
  3369. value: e[1]
  3370. }
  3371. }));
  3372. if (je.isArray(e)) return e;
  3373. throw new je.TemplateError("list filter: type not iterable")
  3374. }
  3375. function a(e) {
  3376. return function(t, n, r) {
  3377. void 0 === n && (n = "truthy");
  3378. var i = this,
  3379. s = i.env.getTest(n);
  3380. return je.toArray(t).filter((function(t) {
  3381. return s.call(i, t, r) === e
  3382. }))
  3383. }
  3384. }
  3385. function o(e) {
  3386. return kr.copySafeness(e, e.replace(/^\s*|\s*$/g, ""))
  3387. }
  3388. t.abs = Math.abs, t.batch = function(e, t, n) {
  3389. var r, i = [],
  3390. s = [];
  3391. for (r = 0; r < e.length; r++) r % t == 0 && s.length && (i.push(s), s = []), s.push(e[r]);
  3392. if (s.length) {
  3393. if (n) for (r = s.length; r < t; r++) s.push(n);
  3394. i.push(s)
  3395. }
  3396. return i
  3397. }, t.capitalize = i, t.center = function(e, t) {
  3398. if (t = t || 80, (e = n(e, "")).length >= t) return e;
  3399. var r = t - e.length,
  3400. i = je.repeat(" ", r / 2 - r % 2),
  3401. s = je.repeat(" ", r / 2);
  3402. return kr.copySafeness(e, i + e + s)
  3403. }, t.
  3404. default = function(e, t, n) {
  3405. return n ? e || t : void 0 !== e ? e : t
  3406. }, t.dictsort = function(e, t, n) {
  3407. if (!je.isObject(e)) throw new je.TemplateError("dictsort filter: val must be an object");
  3408. var r, i = [];
  3409. for (var s in e) i.push([s, e[s]]);
  3410. if (void 0 === n || "key" === n) r = 0;
  3411. else {
  3412. if ("value" !== n) throw new je.TemplateError("dictsort filter: You can only sort by either key or value");
  3413. r = 1
  3414. }
  3415. return i.sort((function(e, n) {
  3416. var i = e[r],
  3417. s = n[r];
  3418. return t || (je.isString(i) && (i = i.toUpperCase()), je.isString(s) && (s = s.toUpperCase())), i > s ? 1 : i === s ? 0 : -1
  3419. })), i
  3420. }, t.dump = function(e, t) {
  3421. return JSON.stringify(e, null, t)
  3422. }, t.escape = function(e) {
  3423. return e instanceof kr.SafeString ? e : (e = null == e ? "" : e, kr.markSafe(je.escape(e.toString())))
  3424. }, t.safe = function(e) {
  3425. return e instanceof kr.SafeString ? e : (e = null == e ? "" : e, kr.markSafe(e.toString()))
  3426. }, t.first = function(e) {
  3427. return e[0]
  3428. }, t.forceescape = function(e) {
  3429. return e = null == e ? "" : e, kr.markSafe(je.escape(e.toString()))
  3430. }, t.groupby = function(e, t) {
  3431. return je.groupBy(e, t, this.env.opts.throwOnUndefined)
  3432. }, t.indent = function(e, t, r) {
  3433. if ("" === (e = n(e, ""))) return "";
  3434. t = t || 4;
  3435. var i = e.split("\n"),
  3436. s = je.repeat(" ", t),
  3437. a = i.map((function(e, t) {
  3438. return 0 !== t || r ? "" + s + e : e
  3439. })).join("\n");
  3440. return kr.copySafeness(e, a)
  3441. }, t.join = function(e, t, n) {
  3442. return t = t || "", n && (e = je.map(e, (function(e) {
  3443. return e[n]
  3444. }))), e.join(t)
  3445. }, t.last = function(e) {
  3446. return e[e.length - 1]
  3447. }, t.length = function(e) {
  3448. var t = n(e, "");
  3449. return void 0 !== t ? "function" == typeof Map && t instanceof Map || "function" == typeof Set && t instanceof Set ? t.size : !je.isObject(t) || t instanceof kr.SafeString ? t.length : je.keys(t).length : 0
  3450. }, t.list = s, t.lower = function(e) {
  3451. return (e = n(e, "")).toLowerCase()
  3452. }, t.nl2br = function(e) {
  3453. return null == e ? "" : kr.copySafeness(e, e.replace(/\r\n|\n/g, "<br />\n"))
  3454. }, t.random = function(e) {
  3455. return e[Math.floor(Math.random() * e.length)]
  3456. }, t.reject = a(!1), t.rejectattr = function(e, t) {
  3457. return e.filter((function(e) {
  3458. return !e[t]
  3459. }))
  3460. }, t.select = a(!0), t.selectattr = function(e, t) {
  3461. return e.filter((function(e) {
  3462. return !!e[t]
  3463. }))
  3464. }, t.replace = function(e, t, n, r) {
  3465. var i = e;
  3466. if (t instanceof RegExp) return e.replace(t, n);
  3467. void 0 === r && (r = -1);
  3468. var s = "";
  3469. if ("number" == typeof t) t = "" + t;
  3470. else if ("string" != typeof t) return e;
  3471. if ("number" == typeof e && (e = "" + e), "string" != typeof e && !(e instanceof kr.SafeString)) return e;
  3472. if ("" === t) return s = n + e.split("").join(n) + n, kr.copySafeness(e, s);
  3473. var a = e.indexOf(t);
  3474. if (0 === r || -1 === a) return e;
  3475. for (var o = 0, c = 0; a > -1 && (-1 === r || c < r);) s += e.substring(o, a) + n, o = a + t.length, c++, a = e.indexOf(t, o);
  3476. return o < e.length && (s += e.substring(o)), kr.copySafeness(i, s)
  3477. }, t.reverse = function(e) {
  3478. var t;
  3479. return (t = je.isString(e) ? s(e) : je.map(e, (function(e) {
  3480. return e
  3481. }))).reverse(), je.isString(e) ? kr.copySafeness(e, t.join("")) : t
  3482. }, t.round = function(e, t, n) {
  3483. t = t || 0;
  3484. var r = Math.pow(10, t);
  3485. return ("ceil" === n ? Math.ceil : "floor" === n ? Math.floor : Math.round)(e * r) / r
  3486. }, t.slice = function(e, t, n) {
  3487. for (var r = Math.floor(e.length / t), i = e.length % t, s = [], a = 0, o = 0; o < t; o++) {
  3488. var c = a + o * r;
  3489. o < i && a++;
  3490. var l = a + (o + 1) * r,
  3491. h = e.slice(c, l);
  3492. n && o >= i && h.push(n), s.push(h)
  3493. }
  3494. return s
  3495. }, t.sum = function(e, t, n) {
  3496. return void 0 === n && (n = 0), t && (e = je.map(e, (function(e) {
  3497. return e[t]
  3498. }))), n + e.reduce((function(e, t) {
  3499. return e + t
  3500. }), 0)
  3501. }, t.sort = kr.makeMacro(["value", "reverse", "case_sensitive", "attribute"], [], (function(e, t, n, r) {
  3502. var i = this,
  3503. s = je.map(e, (function(e) {
  3504. return e
  3505. })),
  3506. a = je.getAttrGetter(r);
  3507. return s.sort((function(e, s) {
  3508. var o = r ? a(e) : e,
  3509. c = r ? a(s) : s;
  3510. if (i.env.opts.throwOnUndefined && r && (void 0 === o || void 0 === c)) throw new TypeError('sort: attribute "' + r + '" resolved to undefined');
  3511. return !n && je.isString(o) && je.isString(c) && (o = o.toLowerCase(), c = c.toLowerCase()), o < c ? t ? 1 : -1 : o > c ? t ? -1 : 1 : 0
  3512. })), s
  3513. })), t.string = function(e) {
  3514. return kr.copySafeness(e, e)
  3515. }, t.striptags = function(e, t) {
  3516. var r = o((e = n(e, "")).replace(/<\/?([a-z][a-z0-9]*)\b[^>]*>|<!--[\s\S]*?-->/gi, "")),
  3517. i = "";
  3518. return i = t ? r.replace(/^ +| +$/gm, "").replace(/ +/g, " ").replace(/(\r\n)/g, "\n").replace(/\n\n\n+/g, "\n\n") : r.replace(/\s+/gi, " "), kr.copySafeness(e, i)
  3519. }, t.title = function(e) {
  3520. var t = (e = n(e, "")).split(" ").map((function(e) {
  3521. return i(e)
  3522. }));
  3523. return kr.copySafeness(e, t.join(" "))
  3524. }, t.trim = o, t.truncate = function(e, t, r, i) {
  3525. var s = e;
  3526. if (t = t || 255, (e = n(e, "")).length <= t) return e;
  3527. if (r) e = e.substring(0, t);
  3528. else {
  3529. var a = e.lastIndexOf(" ", t); - 1 === a && (a = t), e = e.substring(0, a)
  3530. }
  3531. return e += null != i ? i : "...", kr.copySafeness(s, e)
  3532. }, t.upper = function(e) {
  3533. return (e = n(e, "")).toUpperCase()
  3534. }, t.urlencode = function(e) {
  3535. var t = encodeURIComponent;
  3536. return je.isString(e) ? t(e) : (je.isArray(e) ? e : je._entries(e)).map((function(e) {
  3537. var n = e[0],
  3538. r = e[1];
  3539. return t(n) + "=" + t(r)
  3540. })).join("&")
  3541. };
  3542. var c = /^(?:\(|<|&lt;)?(.*?)(?:\.|,|\)|\n|&gt;)?$/,
  3543. l = /^[\w.!#$%&'*+\-\/=?\^`{|}~]+@[a-z\d\-]+(\.[a-z\d\-]+)+$/i,
  3544. h = /^https?:\/\/.*$/,
  3545. u = /^www\./,
  3546. p = /\.(?:org|net|com)(?:\:|\/|$)/;
  3547. t.urlize = function(e, t, n) {
  3548. r(t) && (t = 1 / 0);
  3549. var i = !0 === n ? ' rel="nofollow"' : "";
  3550. return e.split(/(\s+)/).filter((function(e) {
  3551. return e && e.length
  3552. })).map((function(e) {
  3553. var n = e.match(c),
  3554. r = n ? n[1] : e,
  3555. s = r.substr(0, t);
  3556. return h.test(r) ? '<a href="' + r + '"' + i + ">" + s + "</a>" : u.test(r) ? '<a href="http://' + r + '"' + i + ">" + s + "</a>" : l.test(r) ? '<a href="mailto:' + r + '">' + r + "</a>" : p.test(r) ? '<a href="http://' + r + '"' + i + ">" + s + "</a>" : e
  3557. })).join("")
  3558. }, t.wordcount = function(e) {
  3559. var t = (e = n(e, "")) ? e.match(/\w+/g) : null;
  3560. return t ? t.length : null
  3561. }, t.float = function(e, t) {
  3562. var n = parseFloat(e);
  3563. return r(n) ? t : n
  3564. };
  3565. var f = kr.makeMacro(["value", "default", "base"], [], (function(e, t, n) {
  3566. void 0 === n && (n = 10);
  3567. var i = parseInt(e, n);
  3568. return r(i) ? t : i
  3569. }));
  3570. t.int = f, t.d = t.
  3571. default, t.e = t.escape
  3572. })),
  3573. Br = {};
  3574. function Fr(e, t) {
  3575. for (var n = 0, r = e.length - 1; r >= 0; r--) {
  3576. var i = e[r];
  3577. "." === i ? e.splice(r, 1) : ".." === i ? (e.splice(r, 1), n++) : n && (e.splice(r, 1), n--)
  3578. }
  3579. if (t) for (; n--; n) e.unshift("..");
  3580. return e
  3581. }
  3582. var Ur = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,
  3583. Hr = function(e) {
  3584. return Ur.exec(e).slice(1)
  3585. };
  3586. function Gr() {
  3587. for (var e = "", t = !1, n = arguments.length - 1; n >= -1 && !t; n--) {
  3588. var r = n >= 0 ? arguments[n] : "/";
  3589. if ("string" != typeof r) throw new TypeError("Arguments to path.resolve must be strings");
  3590. r && (e = r + "/" + e, t = "/" === r.charAt(0))
  3591. }
  3592. return (t ? "/" : "") + (e = Fr(jr(e.split("/"), (function(e) {
  3593. return !!e
  3594. })), !t).join("/")) || "."
  3595. }
  3596. function Yr(e) {
  3597. var t = qr(e),
  3598. n = "/" === Vr(e, -1);
  3599. return (e = Fr(jr(e.split("/"), (function(e) {
  3600. return !!e
  3601. })), !t).join("/")) || t || (e = "."), e && n && (e += "/"), (t ? "/" : "") + e
  3602. }
  3603. function qr(e) {
  3604. return "/" === e.charAt(0)
  3605. }
  3606. var Kr = {
  3607. extname: function(e) {
  3608. return Hr(e)[3]
  3609. },
  3610. basename: function(e, t) {
  3611. var n = Hr(e)[2];
  3612. return t && n.substr(-1 * t.length) === t && (n = n.substr(0, n.length - t.length)), n
  3613. },
  3614. dirname: function(e) {
  3615. var t = Hr(e),
  3616. n = t[0],
  3617. r = t[1];
  3618. return n || r ? (r && (r = r.substr(0, r.length - 1)), n + r) : "."
  3619. },
  3620. sep: "/",
  3621. delimiter: ":",
  3622. relative: function(e, t) {
  3623. function n(e) {
  3624. for (var t = 0; t < e.length && "" === e[t]; t++);
  3625. for (var n = e.length - 1; n >= 0 && "" === e[n]; n--);
  3626. return t > n ? [] : e.slice(t, n - t + 1)
  3627. }
  3628. e = Gr(e).substr(1), t = Gr(t).substr(1);
  3629. for (var r = n(e.split("/")), i = n(t.split("/")), s = Math.min(r.length, i.length), a = s, o = 0; o < s; o++) if (r[o] !== i[o]) {
  3630. a = o;
  3631. break
  3632. }
  3633. var c = [];
  3634. for (o = a; o < r.length; o++) c.push("..");
  3635. return (c = c.concat(i.slice(a))).join("/")
  3636. },
  3637. join: function() {
  3638. var e = Array.prototype.slice.call(arguments, 0);
  3639. return Yr(jr(e, (function(e, t) {
  3640. if ("string" != typeof e) throw new TypeError("Arguments to path.join must be strings");
  3641. return e
  3642. })).join("/"))
  3643. },
  3644. isAbsolute: qr,
  3645. normalize: Yr,
  3646. resolve: Gr
  3647. };
  3648. function jr(e, t) {
  3649. if (e.filter) return e.filter(t);
  3650. for (var n = [], r = 0; r < e.length; r++) t(e[r], r, e) && n.push(e[r]);
  3651. return n
  3652. }
  3653. var Vr = "b" === "ab".substr(-1) ? function(e, t, n) {
  3654. return e.substr(t, n)
  3655. } : function(e, t, n) {
  3656. return t < 0 && (t = e.length + t), e.substr(t, n)
  3657. };
  3658. function Wr(e, t) {
  3659. return Wr = Object.setPrototypeOf || function(e, t) {
  3660. return e.__proto__ = t, e
  3661. }, Wr(e, t)
  3662. }
  3663. var Qr = function(e) {
  3664. var t, n;
  3665. function r() {
  3666. return e.apply(this, arguments) || this
  3667. }
  3668. n = e, (t = r).prototype = Object.create(n.prototype), t.prototype.constructor = t, Wr(t, n);
  3669. var i = r.prototype;
  3670. return i.resolve = function(e, t) {
  3671. return Kr.resolve(Kr.dirname(e), t)
  3672. }, i.isRelative = function(e) {
  3673. return 0 === e.indexOf("./") || 0 === e.indexOf("../")
  3674. }, r
  3675. }(en.EmitterObj);
  3676. function Xr(e, t) {
  3677. return Xr = Object.setPrototypeOf || function(e, t) {
  3678. return e.__proto__ = t, e
  3679. }, Xr(e, t)
  3680. }
  3681. var $r = function(e) {
  3682. var t, n;
  3683. function r(t) {
  3684. var n;
  3685. return (n = e.call(this) || this).precompiled = t || {}, n
  3686. }
  3687. return n = e, (t = r).prototype = Object.create(n.prototype), t.prototype.constructor = t, Xr(t, n), r.prototype.getSource = function(e) {
  3688. return this.precompiled[e] ? {
  3689. src: {
  3690. type: "code",
  3691. obj: this.precompiled[e]
  3692. },
  3693. path: e
  3694. } : null
  3695. }, r
  3696. }(Qr);
  3697. function zr(e, t) {
  3698. e.prototype = Object.create(t.prototype), e.prototype.constructor = e, Jr(e, t)
  3699. }
  3700. function Jr(e, t) {
  3701. return Jr = Object.setPrototypeOf || function(e, t) {
  3702. return e.__proto__ = t, e
  3703. }, Jr(e, t)
  3704. }
  3705. var Zr = {
  3706. PrecompiledLoader: $r
  3707. }.PrecompiledLoader,
  3708. ei = function(e) {
  3709. function t(t, n) {
  3710. var r;
  3711. return n = n || {}, (r = e.call(this) || this).pathsToNames = {}, r.noCache = !! n.noCache, t ? (t = Array.isArray(t) ? t : [t], r.searchPaths = t.map(Kr.normalize)) : r.searchPaths = ["."], r
  3712. }
  3713. return zr(t, e), t.prototype.getSource = function(e) {
  3714. for (var t = null, n = this.searchPaths, r = 0; r < n.length; r++) {
  3715. var i = Kr.resolve(n[r]),
  3716. s = Kr.resolve(n[r], e);
  3717. if (0 === s.indexOf(i) && Br.existsSync(s)) {
  3718. t = s;
  3719. break
  3720. }
  3721. }
  3722. if (!t) return null;
  3723. this.pathsToNames[t] = e;
  3724. var a = {
  3725. src: Br.readFileSync(t, "utf-8"),
  3726. path: t,
  3727. noCache: this.noCache
  3728. };
  3729. return this.emit("load", e, a), a
  3730. }, t
  3731. }(Qr),
  3732. ti = {
  3733. FileSystemLoader: ei,
  3734. PrecompiledLoader: Zr,
  3735. NodeResolveLoader: function(e) {
  3736. function t(t) {
  3737. var n;
  3738. return t = t || {}, (n = e.call(this) || this).pathsToNames = {}, n.noCache = !! t.noCache, n
  3739. }
  3740. return zr(t, e), t.prototype.getSource = function(e) {
  3741. if (/^\.?\.?(\/|\\)/.test(e)) return null;
  3742. if (/^[A-Z]:/.test(e)) return null;
  3743. var t;
  3744. try {
  3745. t = Ye.resolve(e)
  3746. } catch (e) {
  3747. return null
  3748. }
  3749. this.pathsToNames[t] = e;
  3750. var n = {
  3751. src: Br.readFileSync(t, "utf-8"),
  3752. path: t,
  3753. noCache: this.noCache
  3754. };
  3755. return this.emit("load", e, n), n
  3756. }, t
  3757. }(Qr)
  3758. }, ni = Ke((function(e, t) {
  3759. var n = kr.SafeString;
  3760. t.callable = function(e) {
  3761. return "function" == typeof e
  3762. }, t.defined = function(e) {
  3763. return void 0 !== e
  3764. }, t.divisibleby = function(e, t) {
  3765. return e % t == 0
  3766. }, t.escaped = function(e) {
  3767. return e instanceof n
  3768. }, t.equalto = function(e, t) {
  3769. return e === t
  3770. }, t.eq = t.equalto, t.sameas = t.equalto, t.even = function(e) {
  3771. return e % 2 == 0
  3772. }, t.falsy = function(e) {
  3773. return !e
  3774. }, t.ge = function(e, t) {
  3775. return e >= t
  3776. }, t.greaterthan = function(e, t) {
  3777. return e > t
  3778. }, t.gt = t.greaterthan, t.le = function(e, t) {
  3779. return e <= t
  3780. }, t.lessthan = function(e, t) {
  3781. return e < t
  3782. }, t.lt = t.lessthan, t.lower = function(e) {
  3783. return e.toLowerCase() === e
  3784. }, t.ne = function(e, t) {
  3785. return e !== t
  3786. }, t.null = function(e) {
  3787. return null === e
  3788. }, t.number = function(e) {
  3789. return "number" == typeof e
  3790. }, t.odd = function(e) {
  3791. return e % 2 == 1
  3792. }, t.string = function(e) {
  3793. return "string" == typeof e
  3794. }, t.truthy = function(e) {
  3795. return !!e
  3796. }, t.undefined = function(e) {
  3797. return void 0 === e
  3798. }, t.upper = function(e) {
  3799. return e.toUpperCase() === e
  3800. }, t.iterable = function(e) {
  3801. return "undefined" != typeof Symbol ? !! e[Symbol.iterator] : Array.isArray(e) || "string" == typeof e
  3802. }, t.mapping = function(e) {
  3803. var t = null != e && "object" == typeof e && !Array.isArray(e);
  3804. return Set ? t && !(e instanceof Set) : t
  3805. }
  3806. }));
  3807. function ri(e) {
  3808. var t = -1;
  3809. return {
  3810. current: null,
  3811. reset: function() {
  3812. t = -1, this.current = null
  3813. },
  3814. next: function() {
  3815. return ++t >= e.length && (t = 0), this.current = e[t], this.current
  3816. }
  3817. }
  3818. }
  3819. ni.callable, ni.defined, ni.divisibleby, ni.escaped, ni.equalto, ni.eq, ni.sameas, ni.even, ni.falsy, ni.ge, ni.greaterthan, ni.gt, ni.le, ni.lessthan, ni.lt, ni.lower, ni.ne, ni.number, ni.odd, ni.string, ni.truthy, ni.undefined, ni.upper, ni.iterable, ni.mapping;
  3820. var ii = function() {
  3821. return {
  3822. range: function(e, t, n) {
  3823. void 0 === t ? (t = e, e = 0, n = 1) : n || (n = 1);
  3824. var r = [];
  3825. if (n > 0) for (var i = e; i < t; i += n) r.push(i);
  3826. else for (var s = e; s > t; s += n) r.push(s);
  3827. return r
  3828. },
  3829. cycler: function() {
  3830. return ri(Array.prototype.slice.call(arguments))
  3831. },
  3832. joiner: function(e) {
  3833. return function(e) {
  3834. e = e || ",";
  3835. var t = !0;
  3836. return function() {
  3837. var n = t ? "" : e;
  3838. return t = !1, n
  3839. }
  3840. }(e)
  3841. }
  3842. }
  3843. };
  3844. function si(e, t) {
  3845. e.prototype = Object.create(t.prototype), e.prototype.constructor = e, ai(e, t)
  3846. }
  3847. function ai(e, t) {
  3848. return ai = Object.setPrototypeOf || function(e, t) {
  3849. return e.__proto__ = t, e
  3850. }, ai(e, t)
  3851. }
  3852. var oi = ti.FileSystemLoader,
  3853. ci = ti.WebLoader,
  3854. li = ti.PrecompiledLoader,
  3855. hi = en.Obj,
  3856. ui = en.EmitterObj,
  3857. pi = kr.handleError,
  3858. fi = kr.Frame;
  3859. function di(e, t, n) {
  3860. Gt((function() {
  3861. e(t, n)
  3862. }))
  3863. }
  3864. var Ei = {
  3865. type: "code",
  3866. obj: {
  3867. root: function(e, t, n, r, i) {
  3868. try {
  3869. i(null, "")
  3870. } catch (e) {
  3871. i(pi(e, null, null))
  3872. }
  3873. }
  3874. }
  3875. }, mi = function(e) {
  3876. function t() {
  3877. return e.apply(this, arguments) || this
  3878. }
  3879. si(t, e);
  3880. var n = t.prototype;
  3881. return n.init = function(e, t) {
  3882. var n = this;
  3883. t = this.opts = t || {}, this.opts.dev = !! t.dev, this.opts.autoescape = null == t.autoescape || t.autoescape, this.opts.throwOnUndefined = !! t.throwOnUndefined, this.opts.trimBlocks = !! t.trimBlocks, this.opts.lstripBlocks = !! t.lstripBlocks, this.loaders = [], e ? this.loaders = je.isArray(e) ? e : [e] : oi ? this.loaders = [new oi("views")] : ci && (this.loaders = [new ci("/views")]), "undefined" != typeof window && window.jinja2Precompiled && this.loaders.unshift(new li(window.jinja2Precompiled)), this._initLoaders(), this.globals = ii(), this.filters = {}, this.tests = {}, this.asyncFilters = [], this.extensions = {}, this.extensionsList = [], je._entries(wr).forEach((function(e) {
  3884. var t = e[0],
  3885. r = e[1];
  3886. return n.addFilter(t, r)
  3887. })), je._entries(ni).forEach((function(e) {
  3888. var t = e[0],
  3889. r = e[1];
  3890. return n.addTest(t, r)
  3891. }))
  3892. }, n._initLoaders = function() {
  3893. var e = this;
  3894. this.loaders.forEach((function(t) {
  3895. t.cache = {}, "function" == typeof t.on && (t.on("update", (function(n, r) {
  3896. t.cache[n] = null, e.emit("update", n, r, t)
  3897. })), t.on("load", (function(n, r) {
  3898. e.emit("load", n, r, t)
  3899. })))
  3900. }))
  3901. }, n.invalidateCache = function() {
  3902. this.loaders.forEach((function(e) {
  3903. e.cache = {}
  3904. }))
  3905. }, n.addExtension = function(e, t) {
  3906. return t.__name = e, this.extensions[e] = t, this.extensionsList.push(t), this
  3907. }, n.removeExtension = function(e) {
  3908. var t = this.getExtension(e);
  3909. t && (this.extensionsList = je.without(this.extensionsList, t), delete this.extensions[e])
  3910. }, n.getExtension = function(e) {
  3911. return this.extensions[e]
  3912. }, n.hasExtension = function(e) {
  3913. return !!this.extensions[e]
  3914. }, n.addGlobal = function(e, t) {
  3915. return this.globals[e] = t, this
  3916. }, n.getGlobal = function(e) {
  3917. if (void 0 === this.globals[e]) throw new Error("global not found: " + e);
  3918. return this.globals[e]
  3919. }, n.addFilter = function(e, t, n) {
  3920. var r = t;
  3921. return n && this.asyncFilters.push(e), this.filters[e] = r, this
  3922. }, n.getFilter = function(e) {
  3923. if (!this.filters[e]) throw new Error("filter not found: " + e);
  3924. return this.filters[e]
  3925. }, n.addTest = function(e, t) {
  3926. return this.tests[e] = t, this
  3927. }, n.getTest = function(e) {
  3928. if (!this.tests[e]) throw new Error("test not found: " + e);
  3929. return this.tests[e]
  3930. }, n.resolveTemplate = function(e, t, n) {
  3931. return !(!e.isRelative || !t) && e.isRelative(n) && e.resolve ? e.resolve(t, n) : n
  3932. }, n.getTemplate = function(e, t, n, r, i) {
  3933. var s, a = this,
  3934. o = this,
  3935. c = null;
  3936. if (e && e.raw && (e = e.raw), je.isFunction(n) && (i = n, n = null, t = t || !1), je.isFunction(t) && (i = t, t = !1), e instanceof _i) c = e;
  3937. else {
  3938. if ("string" != typeof e) throw new Error("template names must be a string: " + e);
  3939. for (var l = 0; l < this.loaders.length; l++) {
  3940. var h = this.loaders[l];
  3941. if (c = h.cache[this.resolveTemplate(h, n, e)]) break
  3942. }
  3943. }
  3944. if (c) return t && c.compile(), i ? void i(null, c) : c;
  3945. return je.asyncIter(this.loaders, (function(t, r, i, s) {
  3946. function a(e, n) {
  3947. e ? s(e) : n ? (n.loader = t, s(null, n)) : i()
  3948. }
  3949. e = o.resolveTemplate(t, n, e), t.async ? t.getSource(e, a) : a(null, t.getSource(e))
  3950. }), (function(n, o) {
  3951. if (o || n || r || (n = new Error("template not found: " + e)), n) {
  3952. if (i) return void i(n);
  3953. throw n
  3954. }
  3955. var c;
  3956. o ? (c = new _i(o.src, a, o.path, t), o.noCache || (o.loader.cache[e] = c)) : c = new _i(Ei, a, "", t), i ? i(null, c) : s = c
  3957. })), s
  3958. }, n.express = function(e) {
  3959. return function(e, t) {
  3960. function n(e, t) {
  3961. if (this.name = e, this.path = e, this.defaultEngine = t.defaultEngine, this.ext = Kr.extname(e), !this.ext && !this.defaultEngine) throw new Error("No default engine was specified and no extension was provided.");
  3962. this.ext || (this.name += this.ext = ("." !== this.defaultEngine[0] ? "." : "") + this.defaultEngine)
  3963. }
  3964. return n.prototype.render = function(t, n) {
  3965. e.render(this.name, t, n)
  3966. }, t.set("view", n), t.set("jinja2Env", e), e
  3967. }(this, e)
  3968. }, n.render = function(e, t, n) {
  3969. je.isFunction(t) && (n = t, t = null);
  3970. var r = null;
  3971. return this.getTemplate(e, (function(e, i) {
  3972. if (e && n) di(n, e);
  3973. else {
  3974. if (e) throw e;
  3975. r = i.render(t, n)
  3976. }
  3977. })), r
  3978. }, n.renderString = function(e, t, n, r) {
  3979. return je.isFunction(n) && (r = n, n = {}), new _i(e, this, (n = n || {}).path).render(t, r)
  3980. }, n.waterfall = function(e, t, n) {
  3981. return qt(e, t, n)
  3982. }, t
  3983. }(ui),
  3984. Ti = function(e) {
  3985. function t() {
  3986. return e.apply(this, arguments) || this
  3987. }
  3988. si(t, e);
  3989. var n = t.prototype;
  3990. return n.init = function(e, t, n) {
  3991. var r = this;
  3992. this.env = n || new mi, this.ctx = je.extend({}, e), this.blocks = {}, this.exported = [], je.keys(t).forEach((function(e) {
  3993. r.addBlock(e, t[e])
  3994. }))
  3995. }, n.lookup = function(e) {
  3996. return e in this.env.globals && !(e in this.ctx) ? this.env.globals[e] : this.ctx[e]
  3997. }, n.setVariable = function(e, t) {
  3998. this.ctx[e] = t
  3999. }, n.getVariables = function() {
  4000. return this.ctx
  4001. }, n.addBlock = function(e, t) {
  4002. return this.blocks[e] = this.blocks[e] || [], this.blocks[e].push(t), this
  4003. }, n.getBlock = function(e) {
  4004. if (!this.blocks[e]) throw new Error('unknown block "' + e + '"');
  4005. return this.blocks[e][0]
  4006. }, n.getSuper = function(e, t, n, r, i, s) {
  4007. var a = je.indexOf(this.blocks[t] || [], n),
  4008. o = this.blocks[t][a + 1];
  4009. if (-1 === a || !o) throw new Error('no super block available for "' + t + '"');
  4010. o(e, this, r, i, s)
  4011. }, n.addExport = function(e) {
  4012. this.exported.push(e)
  4013. }, n.getExported = function() {
  4014. var e = this,
  4015. t = {};
  4016. return this.exported.forEach((function(n) {
  4017. t[n] = e.ctx[n]
  4018. })), t
  4019. }, t
  4020. }(hi),
  4021. _i = function(e) {
  4022. function t() {
  4023. return e.apply(this, arguments) || this
  4024. }
  4025. si(t, e);
  4026. var n = t.prototype;
  4027. return n.init = function(e, t, n, r) {
  4028. if (this.env = t || new mi, je.isObject(e)) switch (e.type) {
  4029. case "code":
  4030. this.tmplProps = e.obj;
  4031. break;
  4032. case "string":
  4033. this.tmplStr = e.obj;
  4034. break;
  4035. default:
  4036. throw new Error("Unexpected template object type " + e.type + "; expected 'code', or 'string'")
  4037. } else {
  4038. if (!je.isString(e)) throw new Error("src must be a string or an object describing the source");
  4039. this.tmplStr = e
  4040. }
  4041. if (this.path = n, r) try {
  4042. this._compile()
  4043. } catch (e) {
  4044. throw je._prettifyError(this.path, this.env.opts.dev, e)
  4045. } else this.compiled = !1
  4046. }, n.render = function(e, t, n) {
  4047. var r = this;
  4048. "function" == typeof e ? (n = e, e = {}) : "function" == typeof t && (n = t, t = null);
  4049. var i = !t;
  4050. try {
  4051. this.compile()
  4052. } catch (e) {
  4053. var s = je._prettifyError(this.path, this.env.opts.dev, e);
  4054. if (n) return di(n, s);
  4055. throw s
  4056. }
  4057. var a = new Ti(e || {}, this.blocks, this.env),
  4058. o = t ? t.push(!0) : new fi;
  4059. o.topLevel = !0;
  4060. var c = null,
  4061. l = !1;
  4062. return this.rootRenderFunc(this.env, a, o, kr, (function(e, t) {
  4063. if (!l || !n || void 0 === t) if (e && (e = je._prettifyError(r.path, r.env.opts.dev, e), l = !0), n) i ? di(n, e, t) : n(e, t);
  4064. else {
  4065. if (e) throw e;
  4066. c = t
  4067. }
  4068. })), c
  4069. }, n.getExported = function(e, t, n) {
  4070. "function" == typeof e && (n = e, e = {}), "function" == typeof t && (n = t, t = null);
  4071. try {
  4072. this.compile()
  4073. } catch (e) {
  4074. if (n) return n(e);
  4075. throw e
  4076. }
  4077. var r = t ? t.push() : new fi;
  4078. r.topLevel = !0;
  4079. var i = new Ti(e || {}, this.blocks, this.env);
  4080. this.rootRenderFunc(this.env, i, r, kr, (function(e) {
  4081. e ? n(e, null) : n(null, i.getExported())
  4082. }))
  4083. }, n.compile = function() {
  4084. this.compiled || this._compile()
  4085. }, n._compile = function() {
  4086. var e;
  4087. if (this.tmplProps) e = this.tmplProps;
  4088. else {
  4089. var t = xr.compile(this.tmplStr, this.env.asyncFilters, this.env.extensionsList, this.path, this.env.opts);
  4090. e = new Function(t)()
  4091. }
  4092. this.blocks = this._getBlocks(e), this.rootRenderFunc = e.root, this.compiled = !0
  4093. }, n._getBlocks = function(e) {
  4094. var t = {};
  4095. return je.keys(e).forEach((function(n) {
  4096. "b_" === n.slice(0, 2) && (t[n.slice(2)] = e[n])
  4097. })), t
  4098. }, t
  4099. }(hi),
  4100. Ai = {
  4101. Environment: mi,
  4102. Template: _i
  4103. };
  4104. je._prettifyError;
  4105. var gi, Ni = Ai.Environment;
  4106. function Ci(e, t) {
  4107. var n;
  4108. return t = t || {}, je.isObject(e) && (t = e, e = null), ti.FileSystemLoader ? n = new ti.FileSystemLoader(e, {
  4109. watch: t.watch,
  4110. noCache: t.noCache
  4111. }) : ti.WebLoader && (n = new ti.WebLoader(e, {
  4112. useCache: t.web && t.web.useCache,
  4113. async: t.web && t.web.async
  4114. })), gi = new Ni(n, t), t && t.express && gi.express(t.express), gi
  4115. }
  4116. ti.FileSystemLoader, ti.NodeResolveLoader, ti.PrecompiledLoader, ti.WebLoader;
  4117. var Ii = function(e, t, n) {
  4118. return gi || Ci(), gi.renderString(e, t, n)
  4119. }, Si = function() {
  4120. return Si = Object.assign || function(e) {
  4121. for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in t = arguments[n]) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
  4122. return e
  4123. }, Si.apply(this, arguments)
  4124. };
  4125. function bi(e, t, n) {
  4126. return e ? e(null != t ? t : e._root.children, null, void 0, n).toString() : ""
  4127. }
  4128. function Oi(e, t) {
  4129. return bi(this, function(e, t) {
  4130. return !t && "object" == typeof e && null != e && !("length" in e) && !("type" in e)
  4131. }(e) ? void(t = e) : e, Si(Si(Si({}, n), null == this ? void 0 : this._options), i(null != t ? t : {})))
  4132. }
  4133. function yi(e) {
  4134. return bi(this, e, Si(Si({}, this._options), {
  4135. xmlMode: !0
  4136. }))
  4137. }
  4138. function Li(e) {
  4139. for (var t = e || (this ? this.root() : []), n = "", r = 0; r < t.length; r++) n += z(t[r]);
  4140. return n
  4141. }
  4142. function ki(e, t, r) {
  4143. if (void 0 === r && (r = "boolean" == typeof t && t), !e || "string" != typeof e) return null;
  4144. "boolean" == typeof t && (r = t);
  4145. var i = this.load(e, n, !1);
  4146. return r || i("script").remove(), i.root()[0].children.slice()
  4147. }
  4148. function vi() {
  4149. return this(this._root)
  4150. }
  4151. function Di(e, t) {
  4152. if (t === e) return !1;
  4153. for (var n = t; n && n !== n.parent;) if ((n = n.parent) === e) return !0;
  4154. return !1
  4155. }
  4156. function Ri(e, t) {
  4157. if (Mi(e) && Mi(t)) {
  4158. for (var n = e.length, r = +t.length, i = 0; i < r; i++) e[n++] = t[i];
  4159. return e.length = n, e
  4160. }
  4161. }
  4162. function Mi(e) {
  4163. if (Array.isArray(e)) return !0;
  4164. if ("object" != typeof e || !Object.prototype.hasOwnProperty.call(e, "length") || "number" != typeof e.length || e.length < 0) return !1;
  4165. for (var t = 0; t < e.length; t++) if (!(t in e)) return !1;
  4166. return !0
  4167. }
  4168. var Pi, xi = Object.freeze({
  4169. __proto__: null,
  4170. html: Oi,
  4171. xml: yi,
  4172. text: Li,
  4173. parseHTML: ki,
  4174. root: vi,
  4175. contains: Di,
  4176. merge: Ri,
  4177. jp: function(e, t) {
  4178. return He({
  4179. path: e,
  4180. json: t
  4181. })
  4182. },
  4183. jpo: function(e) {
  4184. return He(e)
  4185. },
  4186. jinja2: function(e, t) {
  4187. return Ii(e, t)
  4188. }
  4189. });
  4190. function wi(e) {
  4191. return null != e.cheerio
  4192. }
  4193. function Bi(e, t) {
  4194. for (var n = e.length, r = 0; r < n; r++) t(e[r], r);
  4195. return e
  4196. }
  4197. function Fi(e) {
  4198. var t = "length" in e ? Array.prototype.map.call(e, (function(e) {
  4199. return v(e, !0)
  4200. })) : [v(e, !0)],
  4201. n = new N(t);
  4202. return t.forEach((function(e) {
  4203. e.parent = n
  4204. })), t
  4205. }
  4206. function Ui(e) {
  4207. var t = e.indexOf("<");
  4208. if (t < 0 || t > e.length - 3) return !1;
  4209. var n = e.charCodeAt(t + 1);
  4210. return (n >= Pi.LowerA && n <= Pi.LowerZ || n >= Pi.UpperA && n <= Pi.UpperZ || n === Pi.Exclamation) && e.includes(">", t + 2)
  4211. }! function(e) {
  4212. e[e.LowerA = 97] = "LowerA", e[e.LowerZ = 122] = "LowerZ", e[e.UpperA = 65] = "UpperA", e[e.UpperZ = 90] = "UpperZ", e[e.Exclamation = 33] = "Exclamation"
  4213. }(Pi || (Pi = {}));
  4214. var Hi = Object.prototype.hasOwnProperty,
  4215. Gi = /\s+/,
  4216. Yi = {
  4217. null: null,
  4218. true: !0,
  4219. false: !1
  4220. }, qi = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
  4221. Ki = /^{[^]*}$|^\[[^]*]$/;
  4222. function ji(e, t, n) {
  4223. var r;
  4224. if (e && I(e)) return null !== (r = e.attribs) && void 0 !== r || (e.attribs = {}), t ? Hi.call(e.attribs, t) ? !n && qi.test(t) ? t : e.attribs[t] : "option" === e.name && "value" === t ? Li(e.children) : "input" !== e.name || "radio" !== e.attribs.type && "checkbox" !== e.attribs.type || "value" !== t ? void 0 : "on" : e.attribs
  4225. }
  4226. function Vi(e, t, n) {
  4227. null === n ? zi(e, t) : e.attribs[t] = "".concat(n)
  4228. }
  4229. function Wi(e, t, n) {
  4230. return t in e ? e[t] : !n && qi.test(t) ? void 0 !== ji(e, t, !1) : ji(e, t, n)
  4231. }
  4232. function Qi(e, t, n, r) {
  4233. t in e ? e[t] = n : Vi(e, t, !r && qi.test(t) ? n ? "" : null : "".concat(n))
  4234. }
  4235. function Xi(e, t, n) {
  4236. var r, i = e;
  4237. null !== (r = i.data) && void 0 !== r || (i.data = {}), "object" == typeof t ? Object.assign(i.data, t) : "string" == typeof t && void 0 !== n && (i.data[t] = n)
  4238. }
  4239. function $i(e, t) {
  4240. var n, r, i, s;
  4241. null == t ? r = (n = Object.keys(e.attribs).filter((function(e) {
  4242. return e.startsWith("data-")
  4243. }))).map((function(e) {
  4244. return e.slice("data-".length).replace(/[_.-](\w|$)/g, (function(e, t) {
  4245. return t.toUpperCase()
  4246. }))
  4247. })) : (n = ["data-" + (s = t, s.replace(/[A-Z]/g, "-$&").toLowerCase())], r = [t]);
  4248. for (var a = 0; a < n.length; ++a) {
  4249. var o = n[a],
  4250. c = r[a];
  4251. if (Hi.call(e.attribs, o) && !Hi.call(e.data, c)) {
  4252. if (i = e.attribs[o], Hi.call(Yi, i)) i = Yi[i];
  4253. else if (i === String(Number(i))) i = Number(i);
  4254. else if (Ki.test(i)) try {
  4255. i = JSON.parse(i)
  4256. } catch (e) {}
  4257. e.data[c] = i
  4258. }
  4259. }
  4260. return null == t ? e.data : i
  4261. }
  4262. function zi(e, t) {
  4263. e.attribs && Hi.call(e.attribs, t) && delete e.attribs[t]
  4264. }
  4265. function Ji(e) {
  4266. return e ? e.trim().split(Gi) : []
  4267. }
  4268. var Zi, es, ts = Object.freeze({
  4269. __proto__: null,
  4270. attr: function(e, t) {
  4271. if ("object" == typeof e || void 0 !== t) {
  4272. if ("function" == typeof t) {
  4273. if ("string" != typeof e) throw new Error("Bad combination of arguments.");
  4274. return Bi(this, (function(n, r) {
  4275. I(n) && Vi(n, e, t.call(n, r, n.attribs[e]))
  4276. }))
  4277. }
  4278. return Bi(this, (function(n) {
  4279. I(n) && ("object" == typeof e ? Object.keys(e).forEach((function(t) {
  4280. var r = e[t];
  4281. Vi(n, t, r)
  4282. })) : Vi(n, e, t))
  4283. }))
  4284. }
  4285. return arguments.length > 1 ? this : ji(this[0], e, this.options.xmlMode)
  4286. },
  4287. prop: function(e, t) {
  4288. var n, r = this;
  4289. if ("string" == typeof e && void 0 === t) {
  4290. var i = this[0];
  4291. if (!i || !I(i)) return;
  4292. switch (e) {
  4293. case "style":
  4294. var s = this.css(),
  4295. a = Object.keys(s);
  4296. return a.forEach((function(e, t) {
  4297. s[t] = e
  4298. })), s.length = a.length, s;
  4299. case "tagName":
  4300. case "nodeName":
  4301. return i.name.toUpperCase();
  4302. case "href":
  4303. case "src":
  4304. var o = null === (n = i.attribs) || void 0 === n ? void 0 : n[e];
  4305. return "undefined" == typeof URL || ("href" !== e || "a" !== i.tagName && "link" !== i.name) && ("src" !== e || "img" !== i.tagName && "iframe" !== i.tagName && "audio" !== i.tagName && "video" !== i.tagName && "source" !== i.tagName) || void 0 === o || !this.options.baseURI ? o : new URL(o, this.options.baseURI).href;
  4306. case "innerText":
  4307. return J(i);
  4308. case "textContent":
  4309. return z(i);
  4310. case "outerHTML":
  4311. return this.clone().wrap("<container />").parent().html();
  4312. case "innerHTML":
  4313. return this.html();
  4314. default:
  4315. return Wi(i, e, this.options.xmlMode)
  4316. }
  4317. }
  4318. if ("object" == typeof e || void 0 !== t) {
  4319. if ("function" == typeof t) {
  4320. if ("object" == typeof e) throw new Error("Bad combination of arguments.");
  4321. return Bi(this, (function(n, i) {
  4322. I(n) && Qi(n, e, t.call(n, i, Wi(n, e, r.options.xmlMode)), r.options.xmlMode)
  4323. }))
  4324. }
  4325. return Bi(this, (function(n) {
  4326. I(n) && ("object" == typeof e ? Object.keys(e).forEach((function(t) {
  4327. var i = e[t];
  4328. Qi(n, t, i, r.options.xmlMode)
  4329. })) : Qi(n, e, t, r.options.xmlMode))
  4330. }))
  4331. }
  4332. },
  4333. data: function(e, t) {
  4334. var n, r = this[0];
  4335. if (r && I(r)) {
  4336. var i = r;
  4337. return null !== (n = i.data) && void 0 !== n || (i.data = {}), e ? "object" == typeof e || void 0 !== t ? (Bi(this, (function(n) {
  4338. I(n) && ("object" == typeof e ? Xi(n, e) : Xi(n, e, t))
  4339. })), this) : Hi.call(i.data, e) ? i.data[e] : $i(i, e) : $i(i)
  4340. }
  4341. },
  4342. val: function(e) {
  4343. var t = 0 === arguments.length,
  4344. n = this[0];
  4345. if (!n || !I(n)) return t ? void 0 : this;
  4346. switch (n.name) {
  4347. case "textarea":
  4348. return this.text(e);
  4349. case "select":
  4350. var r = this.find("option:selected");
  4351. if (!t) {
  4352. if (null == this.attr("multiple") && "object" == typeof e) return this;
  4353. this.find("option").removeAttr("selected");
  4354. for (var i = "object" != typeof e ? [e] : e, s = 0; s < i.length; s++) this.find('option[value="'.concat(i[s], '"]')).attr("selected", "");
  4355. return this
  4356. }
  4357. return this.attr("multiple") ? r.toArray().map((function(e) {
  4358. return Li(e.children)
  4359. })) : r.attr("value");
  4360. case "input":
  4361. case "option":
  4362. return t ? this.attr("value") : this.attr("value", e)
  4363. }
  4364. },
  4365. removeAttr: function(e) {
  4366. for (var t = Ji(e), n = function(e) {
  4367. Bi(r, (function(n) {
  4368. I(n) && zi(n, t[e])
  4369. }))
  4370. }, r = this, i = 0; i < t.length; i++) n(i);
  4371. return this
  4372. },
  4373. hasClass: function(e) {
  4374. return this.toArray().some((function(t) {
  4375. var n = I(t) && t.attribs.class,
  4376. r = -1;
  4377. if (n && e.length) for (;
  4378. (r = n.indexOf(e, r + 1)) > -1;) {
  4379. var i = r + e.length;
  4380. if ((0 === r || Gi.test(n[r - 1])) && (i === n.length || Gi.test(n[i]))) return !0
  4381. }
  4382. return !1
  4383. }))
  4384. },
  4385. addClass: function e(t) {
  4386. if ("function" == typeof t) return Bi(this, (function(n, r) {
  4387. if (I(n)) {
  4388. var i = n.attribs.class || "";
  4389. e.call([n], t.call(n, r, i))
  4390. }
  4391. }));
  4392. if (!t || "string" != typeof t) return this;
  4393. for (var n = t.split(Gi), r = this.length, i = 0; i < r; i++) {
  4394. var s = this[i];
  4395. if (I(s)) {
  4396. var a = ji(s, "class", !1);
  4397. if (a) {
  4398. for (var o = " ".concat(a, " "), c = 0; c < n.length; c++) {
  4399. var l = "".concat(n[c], " ");
  4400. o.includes(" ".concat(l)) || (o += l)
  4401. }
  4402. Vi(s, "class", o.trim())
  4403. } else Vi(s, "class", n.join(" ").trim())
  4404. }
  4405. }
  4406. return this
  4407. },
  4408. removeClass: function e(t) {
  4409. if ("function" == typeof t) return Bi(this, (function(n, r) {
  4410. I(n) && e.call([n], t.call(n, r, n.attribs.class || ""))
  4411. }));
  4412. var n = Ji(t),
  4413. r = n.length,
  4414. i = 0 === arguments.length;
  4415. return Bi(this, (function(e) {
  4416. if (I(e)) if (i) e.attribs.class = "";
  4417. else {
  4418. for (var t = Ji(e.attribs.class), s = !1, a = 0; a < r; a++) {
  4419. var o = t.indexOf(n[a]);
  4420. o >= 0 && (t.splice(o, 1), s = !0, a--)
  4421. }
  4422. s && (e.attribs.class = t.join(" "))
  4423. }
  4424. }))
  4425. },
  4426. toggleClass: function e(t, n) {
  4427. if ("function" == typeof t) return Bi(this, (function(r, i) {
  4428. I(r) && e.call([r], t.call(r, i, r.attribs.class || "", n), n)
  4429. }));
  4430. if (!t || "string" != typeof t) return this;
  4431. for (var r = t.split(Gi), i = r.length, s = "boolean" == typeof n ? n ? 1 : -1 : 0, a = this.length, o = 0; o < a; o++) {
  4432. var c = this[o];
  4433. if (I(c)) {
  4434. for (var l = Ji(c.attribs.class), h = 0; h < i; h++) {
  4435. var u = l.indexOf(r[h]);
  4436. s >= 0 && u < 0 ? l.push(r[h]) : s <= 0 && u >= 0 && l.splice(u, 1)
  4437. }
  4438. c.attribs.class = l.join(" ")
  4439. }
  4440. }
  4441. return this
  4442. }
  4443. });
  4444. ! function(e) {
  4445. e.Attribute = "attribute", e.Pseudo = "pseudo", e.PseudoElement = "pseudo-element", e.Tag = "tag", e.Universal = "universal", e.Adjacent = "adjacent", e.Child = "child", e.Descendant = "descendant", e.Parent = "parent", e.Sibling = "sibling", e.ColumnCombinator = "column-combinator"
  4446. }(Zi || (Zi = {})),
  4447. function(e) {
  4448. e.Any = "any", e.Element = "element", e.End = "end", e.Equals = "equals", e.Exists = "exists", e.Hyphen = "hyphen", e.Not = "not", e.Start = "start"
  4449. }(es || (es = {}));
  4450. const ns = /^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/, rs = /\\([\da-f]{1,6}\s?|(\s)|.)/gi, is = new Map([
  4451. [126, es.Element],
  4452. [94, es.Start],
  4453. [36, es.End],
  4454. [42, es.Any],
  4455. [33, es.Not],
  4456. [124, es.Hyphen]
  4457. ]), ss = new Set(["has", "not", "matches", "is", "where", "host", "host-context"]);
  4458. function as(e) {
  4459. switch (e.type) {
  4460. case Zi.Adjacent:
  4461. case Zi.Child:
  4462. case Zi.Descendant:
  4463. case Zi.Parent:
  4464. case Zi.Sibling:
  4465. case Zi.ColumnCombinator:
  4466. return !0;
  4467. default:
  4468. return !1
  4469. }
  4470. }
  4471. const os = new Set(["contains", "icontains"]);
  4472. function cs(e, t, n) {
  4473. const r = parseInt(t, 16) - 65536;
  4474. return r != r || n ? t : r < 0 ? String.fromCharCode(r + 65536) : String.fromCharCode(r >> 10 | 55296, 1023 & r | 56320)
  4475. }
  4476. function ls(e) {
  4477. return e.replace(rs, cs)
  4478. }
  4479. function hs(e) {
  4480. return 39 === e || 34 === e
  4481. }
  4482. function us(e) {
  4483. return 32 === e || 9 === e || 10 === e || 12 === e || 13 === e
  4484. }
  4485. function ps(e) {
  4486. const t = [], n = fs(t, `${e}`, 0);
  4487. if (n < e.length) throw new Error(`Unmatched selector: ${e.slice(n)}`);
  4488. return t
  4489. }
  4490. function fs(e, t, n) {
  4491. let r = [];
  4492. function i(e) {
  4493. const r = t.slice(n + e).match(ns);
  4494. if (!r) throw new Error(`Expected name, found ${t.slice(n)}`);
  4495. const[i] = r;
  4496. return n += e + i.length, ls(i)
  4497. }
  4498. function s(e) {
  4499. for (n += e; n < t.length && us(t.charCodeAt(n));) n++
  4500. }
  4501. function a() {
  4502. const e = n += 1;
  4503. let r = 1;
  4504. for (; r > 0 && n < t.length; n++) 40 !== t.charCodeAt(n) || o(n) ? 41 !== t.charCodeAt(n) || o(n) || r-- : r++;
  4505. if (r) throw new Error("Parenthesis not matched");
  4506. return ls(t.slice(e, n - 1))
  4507. }
  4508. function o(e) {
  4509. let n = 0;
  4510. for (; 92 === t.charCodeAt(--e);) n++;
  4511. return 1 == (1 & n)
  4512. }
  4513. function c() {
  4514. if (r.length > 0 && as(r[r.length - 1])) throw new Error("Did not expect successive traversals.")
  4515. }
  4516. function l(e) {
  4517. r.length > 0 && r[r.length - 1].type === Zi.Descendant ? r[r.length - 1].type = e : (c(), r.push({
  4518. type: e
  4519. }))
  4520. }
  4521. function h(e, t) {
  4522. r.push({
  4523. type: Zi.Attribute,
  4524. name: e,
  4525. action: t,
  4526. value: i(1),
  4527. namespace: null,
  4528. ignoreCase: "quirks"
  4529. })
  4530. }
  4531. function u() {
  4532. if (r.length && r[r.length - 1].type === Zi.Descendant && r.pop(), 0 === r.length) throw new Error("Empty sub-selector");
  4533. e.push(r)
  4534. }
  4535. if (s(0), t.length === n) return n;
  4536. e: for (; n < t.length;) {
  4537. const e = t.charCodeAt(n);
  4538. switch (e) {
  4539. case 32:
  4540. case 9:
  4541. case 10:
  4542. case 12:
  4543. case 13:
  4544. 0 !== r.length && r[0].type === Zi.Descendant || (c(), r.push({
  4545. type: Zi.Descendant
  4546. })), s(1);
  4547. break;
  4548. case 62:
  4549. l(Zi.Child), s(1);
  4550. break;
  4551. case 60:
  4552. l(Zi.Parent), s(1);
  4553. break;
  4554. case 126:
  4555. l(Zi.Sibling), s(1);
  4556. break;
  4557. case 43:
  4558. l(Zi.Adjacent), s(1);
  4559. break;
  4560. case 46:
  4561. h("class", es.Element);
  4562. break;
  4563. case 35:
  4564. h("id", es.Equals);
  4565. break;
  4566. case 91:
  4567. {
  4568. let e;
  4569. s(1);
  4570. let a = null;
  4571. 124 === t.charCodeAt(n) ? e = i(1) : t.startsWith("*|", n) ? (a = "*", e = i(2)) : (e = i(0), 124 === t.charCodeAt(n) && 61 !== t.charCodeAt(n + 1) && (a = e, e = i(1))), s(0);
  4572. let c = es.Exists;
  4573. const l = is.get(t.charCodeAt(n));
  4574. if (l) {
  4575. if (c = l, 61 !== t.charCodeAt(n + 1)) throw new Error("Expected `=`");
  4576. s(2)
  4577. } else 61 === t.charCodeAt(n) && (c = es.Equals, s(1));
  4578. let h = "", u = null;
  4579. if ("exists" !== c) {
  4580. if (hs(t.charCodeAt(n))) {
  4581. const e = t.charCodeAt(n);
  4582. let r = n + 1;
  4583. for (; r < t.length && (t.charCodeAt(r) !== e || o(r));) r += 1;
  4584. if (t.charCodeAt(r) !== e) throw new Error("Attribute value didn't end");
  4585. h = ls(t.slice(n + 1, r)), n = r + 1
  4586. } else {
  4587. const e = n;
  4588. for (; n < t.length && (!us(t.charCodeAt(n)) && 93 !== t.charCodeAt(n) || o(n));) n += 1;
  4589. h = ls(t.slice(e, n))
  4590. }
  4591. s(0);
  4592. const e = 32 | t.charCodeAt(n);
  4593. 115 === e ? (u = !1, s(1)) : 105 === e && (u = !0, s(1))
  4594. }
  4595. if (93 !== t.charCodeAt(n)) throw new Error("Attribute selector didn't terminate");
  4596. n += 1;
  4597. const p = {
  4598. type: Zi.Attribute,
  4599. name: e,
  4600. action: c,
  4601. value: h,
  4602. namespace: a,
  4603. ignoreCase: u
  4604. };
  4605. r.push(p);
  4606. break
  4607. }
  4608. case 58:
  4609. {
  4610. if (58 === t.charCodeAt(n + 1)) {
  4611. r.push({
  4612. type: Zi.PseudoElement,
  4613. name: i(2).toLowerCase(),
  4614. data: 40 === t.charCodeAt(n) ? a() : null
  4615. });
  4616. continue
  4617. }
  4618. const e = i(1).toLowerCase();
  4619. let s = null;
  4620. if (40 === t.charCodeAt(n)) if (ss.has(e)) {
  4621. if (hs(t.charCodeAt(n + 1))) throw new Error(`Pseudo-selector ${e} cannot be quoted`);
  4622. if (s = [], n = fs(s, t, n + 1), 41 !== t.charCodeAt(n)) throw new Error(`Missing closing parenthesis in :${e} (${t})`);
  4623. n += 1
  4624. } else {
  4625. if (s = a(), os.has(e)) {
  4626. const e = s.charCodeAt(0);
  4627. e === s.charCodeAt(s.length - 1) && hs(e) && (s = s.slice(1, -1))
  4628. }
  4629. s = ls(s)
  4630. }
  4631. r.push({
  4632. type: Zi.Pseudo,
  4633. name: e,
  4634. data: s
  4635. });
  4636. break
  4637. }
  4638. case 44:
  4639. u(), r = [], s(1);
  4640. break;
  4641. default:
  4642. {
  4643. if (t.startsWith("/*", n)) {
  4644. const e = t.indexOf("*/", n + 2);
  4645. if (e < 0) throw new Error("Comment was not terminated");
  4646. n = e + 2, 0 === r.length && s(0);
  4647. break
  4648. }
  4649. let a, o = null;
  4650. if (42 === e) n += 1, a = "*";
  4651. else if (124 === e) {
  4652. if (a = "", 124 === t.charCodeAt(n + 1)) {
  4653. l(Zi.ColumnCombinator), s(2);
  4654. break
  4655. }
  4656. } else {
  4657. if (!ns.test(t.slice(n))) break e;
  4658. a = i(0)
  4659. }
  4660. 124 === t.charCodeAt(n) && 124 !== t.charCodeAt(n + 1) && (o = a, 42 === t.charCodeAt(n + 1) ? (a = "*", n += 2) : a = i(1)), r.push("*" === a ? {
  4661. type: Zi.Universal,
  4662. namespace: o
  4663. } : {
  4664. type: Zi.Tag,
  4665. name: a,
  4666. namespace: o
  4667. })
  4668. }
  4669. }
  4670. }
  4671. return u(),
  4672. n
  4673. }
  4674. var ds = {
  4675. trueFunc: function() {
  4676. return !0
  4677. },
  4678. falseFunc: function() {
  4679. return !1
  4680. }
  4681. }, Es = ds.trueFunc;
  4682. const ms = new Map([
  4683. [Zi.Universal, 50],
  4684. [Zi.Tag, 30],
  4685. [Zi.Attribute, 1],
  4686. [Zi.Pseudo, 0]
  4687. ]);
  4688. function Ts(e) {
  4689. return !ms.has(e.type)
  4690. }
  4691. const _s = new Map([
  4692. [es.Exists, 10],
  4693. [es.Equals, 8],
  4694. [es.Not, 7],
  4695. [es.Start, 6],
  4696. [es.End, 6],
  4697. [es.Any, 5]
  4698. ]);
  4699. function As(e) {
  4700. const t = e.map(gs);
  4701. for (let n = 1; n < e.length; n++) {
  4702. const r = t[n];
  4703. if (!(r < 0)) for (let i = n - 1; i >= 0 && r < t[i]; i--) {
  4704. const n = e[i + 1];
  4705. e[i + 1] = e[i], e[i] = n, t[i + 1] = t[i], t[i] = r
  4706. }
  4707. }
  4708. }
  4709. function gs(e) {
  4710. var t, n;
  4711. let r = null !== (t = ms.get(e.type)) && void 0 !== t ? t : -1;
  4712. return e.type === Zi.Attribute ? (r = null !== (n = _s.get(e.action)) && void 0 !== n ? n : 4, e.action === es.Equals && "id" === e.name && (r = 9), e.ignoreCase && (r >>= 1)) : e.type === Zi.Pseudo && (e.data ? "has" === e.name || "contains" === e.name ? r = 0 : Array.isArray(e.data) ? (r = Math.min(...e.data.map((e => Math.min(...e.map(gs))))), r < 0 && (r = 0)) : r = 2 : r = 3), r
  4713. }
  4714. const Ns = /[-[\]{}()*+?.,\\^$|#\s]/g;
  4715. function Cs(e) {
  4716. return e.replace(Ns, "\\$&")
  4717. }
  4718. const Is = new Set(["accept", "accept-charset", "align", "alink", "axis", "bgcolor", "charset", "checked", "clear", "codetype", "color", "compact", "declare", "defer", "dir", "direction", "disabled", "enctype", "face", "frame", "hreflang", "http-equiv", "lang", "language", "link", "media", "method", "multiple", "nohref", "noresize", "noshade", "nowrap", "readonly", "rel", "rev", "rules", "scope", "scrolling", "selected", "shape", "target", "text", "type", "valign", "valuetype", "vlink"]);
  4719. function Ss(e, t) {
  4720. return "boolean" == typeof e.ignoreCase ? e.ignoreCase : "quirks" === e.ignoreCase ? !! t.quirksMode : !t.xmlMode && Is.has(e.name)
  4721. }
  4722. const bs = {
  4723. equals(e, t, n) {
  4724. const {
  4725. adapter: r
  4726. } = n, {
  4727. name: i
  4728. } = t;
  4729. let {
  4730. value: s
  4731. } = t;
  4732. return Ss(t, n) ? (s = s.toLowerCase(), t => {
  4733. const n = r.getAttributeValue(t, i);
  4734. return null != n && n.length === s.length && n.toLowerCase() === s && e(t)
  4735. }) : t => r.getAttributeValue(t, i) === s && e(t)
  4736. }, hyphen(e, t, n) {
  4737. const {
  4738. adapter: r
  4739. } = n, {
  4740. name: i
  4741. } = t;
  4742. let {
  4743. value: s
  4744. } = t;
  4745. const a = s.length;
  4746. return Ss(t, n) ? (s = s.toLowerCase(), function(t) {
  4747. const n = r.getAttributeValue(t, i);
  4748. return null != n && (n.length === a || "-" === n.charAt(a)) && n.substr(0, a).toLowerCase() === s && e(t)
  4749. }) : function(t) {
  4750. const n = r.getAttributeValue(t, i);
  4751. return null != n && (n.length === a || "-" === n.charAt(a)) && n.substr(0, a) === s && e(t)
  4752. }
  4753. }, element(e, t, n) {
  4754. const {
  4755. adapter: r
  4756. } = n, {
  4757. name: i,
  4758. value: s
  4759. } = t;
  4760. if (/\s/.test(s)) return ds.falseFunc;
  4761. const a = new RegExp(`(?:^|\\s)${Cs(s)}(?:$|\\s)`, Ss(t, n) ? "i" : "");
  4762. return function(t) {
  4763. const n = r.getAttributeValue(t, i);
  4764. return null != n && n.length >= s.length && a.test(n) && e(t)
  4765. }
  4766. }, exists: (e, {
  4767. name: t
  4768. }, {
  4769. adapter: n
  4770. }) => r => n.hasAttrib(r, t) && e(r),
  4771. start(e, t, n) {
  4772. const {
  4773. adapter: r
  4774. } = n, {
  4775. name: i
  4776. } = t;
  4777. let {
  4778. value: s
  4779. } = t;
  4780. const a = s.length;
  4781. return 0 === a ? ds.falseFunc : Ss(t, n) ? (s = s.toLowerCase(), t => {
  4782. const n = r.getAttributeValue(t, i);
  4783. return null != n && n.length >= a && n.substr(0, a).toLowerCase() === s && e(t)
  4784. }) : t => {
  4785. var n;
  4786. return !!(null === (n = r.getAttributeValue(t, i)) || void 0 === n ? void 0 : n.startsWith(s)) && e(t)
  4787. }
  4788. },
  4789. end(e, t, n) {
  4790. const {
  4791. adapter: r
  4792. } = n, {
  4793. name: i
  4794. } = t;
  4795. let {
  4796. value: s
  4797. } = t;
  4798. const a = -s.length;
  4799. return 0 === a ? ds.falseFunc : Ss(t, n) ? (s = s.toLowerCase(), t => {
  4800. var n;
  4801. return (null === (n = r.getAttributeValue(t, i)) || void 0 === n ? void 0 : n.substr(a).toLowerCase()) === s && e(t)
  4802. }) : t => {
  4803. var n;
  4804. return !!(null === (n = r.getAttributeValue(t, i)) || void 0 === n ? void 0 : n.endsWith(s)) && e(t)
  4805. }
  4806. },
  4807. any(e, t, n) {
  4808. const {
  4809. adapter: r
  4810. } = n, {
  4811. name: i,
  4812. value: s
  4813. } = t;
  4814. if ("" === s) return ds.falseFunc;
  4815. if (Ss(t, n)) {
  4816. const t = new RegExp(Cs(s), "i");
  4817. return function(n) {
  4818. const a = r.getAttributeValue(n, i);
  4819. return null != a && a.length >= s.length && t.test(a) && e(n)
  4820. }
  4821. }
  4822. return t => {
  4823. var n;
  4824. return !!(null === (n = r.getAttributeValue(t, i)) || void 0 === n ? void 0 : n.includes(s)) && e(t)
  4825. }
  4826. },
  4827. not(e, t, n) {
  4828. const {
  4829. adapter: r
  4830. } = n, {
  4831. name: i
  4832. } = t;
  4833. let {
  4834. value: s
  4835. } = t;
  4836. return "" === s ? t => !! r.getAttributeValue(t, i) && e(t) : Ss(t, n) ? (s = s.toLowerCase(), t => {
  4837. const n = r.getAttributeValue(t, i);
  4838. return (null == n || n.length !== s.length || n.toLowerCase() !== s) && e(t)
  4839. }) : t => r.getAttributeValue(t, i) !== s && e(t)
  4840. }
  4841. };
  4842. var Os = Ke((function(e, t) {
  4843. Object.defineProperty(t, "__esModule", {
  4844. value: !0
  4845. }), t.parse = void 0;
  4846. var n = new Set([9, 10, 12, 13, 32]),
  4847. r = "0".charCodeAt(0),
  4848. i = "9".charCodeAt(0);
  4849. t.parse = function(e) {
  4850. if ("even" === (e = e.trim().toLowerCase())) return [2, 0];
  4851. if ("odd" === e) return [2, 1];
  4852. var t = 0,
  4853. s = 0,
  4854. a = c(),
  4855. o = l();
  4856. if (t < e.length && "n" === e.charAt(t) && (t++, s = a * (null != o ? o : 1), h(), t < e.length ? (a = c(), h(), o = l()) : a = o = 0), null === o || t < e.length) throw new Error("n-th rule couldn't be parsed ('" + e + "')");
  4857. return [s, a * o];
  4858. function c() {
  4859. return "-" === e.charAt(t) ? (t++, -1) : ("+" === e.charAt(t) && t++, 1)
  4860. }
  4861. function l() {
  4862. for (var n = t, s = 0; t < e.length && e.charCodeAt(t) >= r && e.charCodeAt(t) <= i;) s = 10 * s + (e.charCodeAt(t) - r), t++;
  4863. return t === n ? null : s
  4864. }
  4865. function h() {
  4866. for (; t < e.length && n.has(e.charCodeAt(t));) t++
  4867. }
  4868. }
  4869. }));
  4870. qe(Os), Os.parse;
  4871. var ys = Ke((function(e, t) {
  4872. Object.defineProperty(t, "__esModule", {
  4873. value: !0
  4874. }), t.compile = void 0, t.compile = function(e) {
  4875. var t = e[0],
  4876. n = e[1] - 1;
  4877. if (n < 0 && t <= 0) return ds.falseFunc;
  4878. if (-1 === t) return function(e) {
  4879. return e <= n
  4880. };
  4881. if (0 === t) return function(e) {
  4882. return e === n
  4883. };
  4884. if (1 === t) return n < 0 ? ds.trueFunc : function(e) {
  4885. return e >= n
  4886. };
  4887. var r = Math.abs(t),
  4888. i = (n % r + r) % r;
  4889. return t > 1 ? function(e) {
  4890. return e >= n && e % r === i
  4891. } : function(e) {
  4892. return e <= n && e % r === i
  4893. }
  4894. }
  4895. }));
  4896. qe(ys), ys.compile;
  4897. var Ls = Os,
  4898. ks = ys,
  4899. vs = Ke((function(e, t) {
  4900. Object.defineProperty(t, "__esModule", {
  4901. value: !0
  4902. }), t.compile = t.parse = void 0, Object.defineProperty(t, "parse", {
  4903. enumerable: !0,
  4904. get: function() {
  4905. return Ls.parse
  4906. }
  4907. }), Object.defineProperty(t, "compile", {
  4908. enumerable: !0,
  4909. get: function() {
  4910. return ks.compile
  4911. }
  4912. }), t.
  4913. default = function(e) {
  4914. return (0, ks.compile)((0, Ls.parse)(e))
  4915. }
  4916. })),
  4917. Ds = qe(vs);
  4918. function Rs(e, t) {
  4919. return n => {
  4920. const r = t.getParent(n);
  4921. return null != r && t.isTag(r) && e(n)
  4922. }
  4923. }
  4924. vs.compile, vs.parse;
  4925. const Ms = {
  4926. contains: (e, t, {
  4927. adapter: n
  4928. }) => function(r) {
  4929. return e(r) && n.getText(r).includes(t)
  4930. },
  4931. icontains(e, t, {
  4932. adapter: n
  4933. }) {
  4934. const r = t.toLowerCase();
  4935. return function(t) {
  4936. return e(t) && n.getText(t).toLowerCase().includes(r)
  4937. }
  4938. },
  4939. "nth-child" (e, t, {
  4940. adapter: n,
  4941. equals: r
  4942. }) {
  4943. const i = Ds(t);
  4944. return i === ds.falseFunc ? ds.falseFunc : i === ds.trueFunc ? Rs(e, n) : function(t) {
  4945. const s = n.getSiblings(t);
  4946. let a = 0;
  4947. for (let e = 0; e < s.length && !r(t, s[e]); e++) n.isTag(s[e]) && a++;
  4948. return i(a) && e(t)
  4949. }
  4950. },
  4951. "nth-last-child" (e, t, {
  4952. adapter: n,
  4953. equals: r
  4954. }) {
  4955. const i = Ds(t);
  4956. return i === ds.falseFunc ? ds.falseFunc : i === ds.trueFunc ? Rs(e, n) : function(t) {
  4957. const s = n.getSiblings(t);
  4958. let a = 0;
  4959. for (let e = s.length - 1; e >= 0 && !r(t, s[e]); e--) n.isTag(s[e]) && a++;
  4960. return i(a) && e(t)
  4961. }
  4962. },
  4963. "nth-of-type" (e, t, {
  4964. adapter: n,
  4965. equals: r
  4966. }) {
  4967. const i = Ds(t);
  4968. return i === ds.falseFunc ? ds.falseFunc : i === ds.trueFunc ? Rs(e, n) : function(t) {
  4969. const s = n.getSiblings(t);
  4970. let a = 0;
  4971. for (let e = 0; e < s.length; e++) {
  4972. const i = s[e];
  4973. if (r(t, i)) break;
  4974. n.isTag(i) && n.getName(i) === n.getName(t) && a++
  4975. }
  4976. return i(a) && e(t)
  4977. }
  4978. },
  4979. "nth-last-of-type" (e, t, {
  4980. adapter: n,
  4981. equals: r
  4982. }) {
  4983. const i = Ds(t);
  4984. return i === ds.falseFunc ? ds.falseFunc : i === ds.trueFunc ? Rs(e, n) : function(t) {
  4985. const s = n.getSiblings(t);
  4986. let a = 0;
  4987. for (let e = s.length - 1; e >= 0; e--) {
  4988. const i = s[e];
  4989. if (r(t, i)) break;
  4990. n.isTag(i) && n.getName(i) === n.getName(t) && a++
  4991. }
  4992. return i(a) && e(t)
  4993. }
  4994. },
  4995. root: (e, t, {
  4996. adapter: n
  4997. }) => t => {
  4998. const r = n.getParent(t);
  4999. return (null == r || !n.isTag(r)) && e(t)
  5000. },
  5001. scope(e, t, n, r) {
  5002. const {
  5003. equals: i
  5004. } = n;
  5005. return r && 0 !== r.length ? 1 === r.length ? t => i(r[0], t) && e(t) : t => r.includes(t) && e(t) : Ms.root(e, t, n)
  5006. },
  5007. hover: Ps("isHovered"),
  5008. visited: Ps("isVisited"),
  5009. active: Ps("isActive")
  5010. };
  5011. function Ps(e) {
  5012. return function(t, n, {
  5013. adapter: r
  5014. }) {
  5015. const i = r[e];
  5016. return "function" != typeof i ? ds.falseFunc : function(e) {
  5017. return i(e) && t(e)
  5018. }
  5019. }
  5020. }
  5021. const xs = {
  5022. empty: (e, {
  5023. adapter: t
  5024. }) => !t.getChildren(e).some((e => t.isTag(e) || "" !== t.getText(e))),
  5025. "first-child" (e, {
  5026. adapter: t,
  5027. equals: n
  5028. }) {
  5029. if (t.prevElementSibling) return null == t.prevElementSibling(e);
  5030. const r = t.getSiblings(e).find((e => t.isTag(e)));
  5031. return null != r && n(e, r)
  5032. },
  5033. "last-child" (e, {
  5034. adapter: t,
  5035. equals: n
  5036. }) {
  5037. const r = t.getSiblings(e);
  5038. for (let i = r.length - 1; i >= 0; i--) {
  5039. if (n(e, r[i])) return !0;
  5040. if (t.isTag(r[i])) break
  5041. }
  5042. return !1
  5043. },
  5044. "first-of-type" (e, {
  5045. adapter: t,
  5046. equals: n
  5047. }) {
  5048. const r = t.getSiblings(e), i = t.getName(e);
  5049. for (let s = 0; s < r.length; s++) {
  5050. const a = r[s];
  5051. if (n(e, a)) return !0;
  5052. if (t.isTag(a) && t.getName(a) === i) break
  5053. }
  5054. return !1
  5055. },
  5056. "last-of-type" (e, {
  5057. adapter: t,
  5058. equals: n
  5059. }) {
  5060. const r = t.getSiblings(e), i = t.getName(e);
  5061. for (let s = r.length - 1; s >= 0; s--) {
  5062. const a = r[s];
  5063. if (n(e, a)) return !0;
  5064. if (t.isTag(a) && t.getName(a) === i) break
  5065. }
  5066. return !1
  5067. },
  5068. "only-of-type" (e, {
  5069. adapter: t,
  5070. equals: n
  5071. }) {
  5072. const r = t.getName(e);
  5073. return t.getSiblings(e).every((i => n(e, i) || !t.isTag(i) || t.getName(i) !== r))
  5074. },
  5075. "only-child": (e, {
  5076. adapter: t,
  5077. equals: n
  5078. }) => t.getSiblings(e).every((r => n(e, r) || !t.isTag(r)))
  5079. };
  5080. function ws(e, t, n, r) {
  5081. if (null === n) {
  5082. if (e.length > r) throw new Error(`Pseudo-class :${t} requires an argument`)
  5083. } else if (e.length === r) throw new Error(`Pseudo-class :${t} doesn't have any arguments`)
  5084. }
  5085. const Bs = {
  5086. "any-link": ":is(a, area, link)[href]",
  5087. link: ":any-link:not(:visited)",
  5088. disabled: ":is(\n :is(button, input, select, textarea, optgroup, option)[disabled],\n optgroup[disabled] > option,\n fieldset[disabled]:not(fieldset[disabled] legend:first-of-type *)\n )",
  5089. enabled: ":not(:disabled)",
  5090. checked: ":is(:is(input[type=radio], input[type=checkbox])[checked], option:selected)",
  5091. required: ":is(input, select, textarea)[required]",
  5092. optional: ":is(input, select, textarea):not([required])",
  5093. selected: "option:is([selected], select:not([multiple]):not(:has(> option[selected])) > :first-of-type)",
  5094. checkbox: "[type=checkbox]",
  5095. file: "[type=file]",
  5096. password: "[type=password]",
  5097. radio: "[type=radio]",
  5098. reset: "[type=reset]",
  5099. image: "[type=image]",
  5100. submit: "[type=submit]",
  5101. parent: ":not(:empty)",
  5102. header: ":is(h1, h2, h3, h4, h5, h6)",
  5103. button: ":is(button, input[type=button])",
  5104. input: ":is(input, textarea, select, button)",
  5105. text: "input:is(:not([type!='']), [type=text])"
  5106. }, Fs = {};
  5107. function Us(e, t) {
  5108. const n = t.getSiblings(e);
  5109. if (n.length <= 1) return [];
  5110. const r = n.indexOf(e);
  5111. return r < 0 || r === n.length - 1 ? [] : n.slice(r + 1).filter(t.isTag)
  5112. }
  5113. function Hs(e) {
  5114. return {
  5115. xmlMode: !! e.xmlMode,
  5116. lowerCaseAttributeNames: !! e.lowerCaseAttributeNames,
  5117. lowerCaseTags: !! e.lowerCaseTags,
  5118. quirksMode: !! e.quirksMode,
  5119. cacheResults: !! e.cacheResults,
  5120. pseudos: e.pseudos,
  5121. adapter: e.adapter,
  5122. equals: e.equals
  5123. }
  5124. }
  5125. const Gs = (e, t, n, r, i) => {
  5126. const s = i(t, Hs(n), r);
  5127. return s === ds.trueFunc ? e : s === ds.falseFunc ? ds.falseFunc : t => s(t) && e(t)
  5128. }, Ys = {
  5129. is: Gs,
  5130. matches: Gs,
  5131. where: Gs,
  5132. not(e, t, n, r, i) {
  5133. const s = i(t, Hs(n), r);
  5134. return s === ds.falseFunc ? e : s === ds.trueFunc ? ds.falseFunc : t => !s(t) && e(t)
  5135. },
  5136. has(e, t, n, r, i) {
  5137. const {
  5138. adapter: s
  5139. } = n, a = Hs(n);
  5140. a.relativeSelector = !0;
  5141. const o = t.some((e => e.some(Ts))) ? [Fs] : void 0, c = i(t, a, o);
  5142. if (c === ds.falseFunc) return ds.falseFunc;
  5143. const l = function(e, t) {
  5144. return e === ds.falseFunc ? ds.falseFunc : n => t.isTag(n) && e(n)
  5145. }(c, s);
  5146. if (o && c !== ds.trueFunc) {
  5147. const {
  5148. shouldTestNextSiblings: t = !1
  5149. } = c;
  5150. return n => {
  5151. if (!e(n)) return !1;
  5152. o[0] = n;
  5153. const r = s.getChildren(n), i = t ? [...r, ...Us(n, s)] : r;
  5154. return s.existsOne(l, i)
  5155. }
  5156. }
  5157. return t => e(t) && s.existsOne(l, s.getChildren(t))
  5158. }
  5159. };
  5160. function qs(e, t) {
  5161. const n = t.getParent(e);
  5162. return n && t.isTag(n) ? n : null
  5163. }
  5164. function Ks(e, t, n, r, i) {
  5165. const {
  5166. adapter: s,
  5167. equals: a
  5168. } = n;
  5169. switch (t.type) {
  5170. case Zi.PseudoElement:
  5171. throw new Error("Pseudo-elements are not supported by css-select");
  5172. case Zi.ColumnCombinator:
  5173. throw new Error("Column combinators are not yet supported by css-select");
  5174. case Zi.Attribute:
  5175. if (null != t.namespace) throw new Error("Namespaced attributes are not yet supported by css-select");
  5176. return n.xmlMode && !n.lowerCaseAttributeNames || (t.name = t.name.toLowerCase()), bs[t.action](e, t, n);
  5177. case Zi.Pseudo:
  5178. return function(e, t, n, r, i) {
  5179. var s;
  5180. const {
  5181. name: a,
  5182. data: o
  5183. } = t;
  5184. if (Array.isArray(o)) {
  5185. if (!(a in Ys)) throw new Error(`Unknown pseudo-class :${a}(${o})`);
  5186. return Ys[a](e, o, n, r, i)
  5187. }
  5188. const c = null === (s = n.pseudos) || void 0 === s ? void 0 : s[a], l = "string" == typeof c ? c : Bs[a];
  5189. if ("string" == typeof l) {
  5190. if (null != o) throw new Error(`Pseudo ${a} doesn't have any arguments`);
  5191. const t = ps(l);
  5192. return Ys.is(e, t, n, r, i)
  5193. }
  5194. if ("function" == typeof c) return ws(c, a, o, 1), t => c(t, o) && e(t);
  5195. if (a in Ms) return Ms[a](e, o, n, r);
  5196. if (a in xs) {
  5197. const t = xs[a];
  5198. return ws(t, a, o, 2), r => t(r, n, o) && e(r)
  5199. }
  5200. throw new Error(`Unknown pseudo-class :${a}`)
  5201. }(e, t, n, r, i);
  5202. case Zi.Tag:
  5203. {
  5204. if (null != t.namespace) throw new Error("Namespaced tag names are not yet supported by css-select");
  5205. let {
  5206. name: r
  5207. } = t;
  5208. return n.xmlMode && !n.lowerCaseTags || (r = r.toLowerCase()),
  5209. function(t) {
  5210. return s.getName(t) === r && e(t)
  5211. }
  5212. }
  5213. case Zi.Descendant:
  5214. {
  5215. if (!1 === n.cacheResults || "undefined" == typeof WeakSet) return function(t) {
  5216. let n = t;
  5217. for (; n = qs(n, s);) if (e(n)) return !0;
  5218. return !1
  5219. };
  5220. const t = new WeakSet;
  5221. return function(n) {
  5222. let r = n;
  5223. for (; r = qs(r, s);) if (!t.has(r)) {
  5224. if (s.isTag(r) && e(r)) return !0;
  5225. t.add(r)
  5226. }
  5227. return !1
  5228. }
  5229. }
  5230. case "_flexibleDescendant":
  5231. return function(t) {
  5232. let n = t;
  5233. do {
  5234. if (e(n)) return !0
  5235. } while (n = qs(n, s));
  5236. return !1
  5237. };
  5238. case Zi.Parent:
  5239. return function(t) {
  5240. return s.getChildren(t).some((t => s.isTag(t) && e(t)))
  5241. };
  5242. case Zi.Child:
  5243. return function(t) {
  5244. const n = s.getParent(t);
  5245. return null != n && s.isTag(n) && e(n)
  5246. };
  5247. case Zi.Sibling:
  5248. return function(t) {
  5249. const n = s.getSiblings(t);
  5250. for (let r = 0; r < n.length; r++) {
  5251. const i = n[r];
  5252. if (a(t, i)) break;
  5253. if (s.isTag(i) && e(i)) return !0
  5254. }
  5255. return !1
  5256. };
  5257. case Zi.Adjacent:
  5258. return s.prevElementSibling ? function(t) {
  5259. const n = s.prevElementSibling(t);
  5260. return null != n && e(n)
  5261. } : function(t) {
  5262. const n = s.getSiblings(t);
  5263. let r;
  5264. for (let e = 0; e < n.length; e++) {
  5265. const i = n[e];
  5266. if (a(t, i)) break;
  5267. s.isTag(i) && (r = i)
  5268. }
  5269. return !!r && e(r)
  5270. };
  5271. case Zi.Universal:
  5272. if (null != t.namespace && "*" !== t.namespace) throw new Error("Namespaced universal selectors are not yet supported by css-select");
  5273. return e
  5274. }
  5275. }
  5276. function js(e) {
  5277. return e.type === Zi.Pseudo && ("scope" === e.name || Array.isArray(e.data) && e.data.some((e => e.some(js))))
  5278. }
  5279. const Vs = {
  5280. type: Zi.Descendant
  5281. }, Ws = {
  5282. type: "_flexibleDescendant"
  5283. }, Qs = {
  5284. type: Zi.Pseudo,
  5285. name: "scope",
  5286. data: null
  5287. };
  5288. function Xs(e, t, n) {
  5289. var r;
  5290. e.forEach(As), n = null !== (r = t.context) && void 0 !== r ? r : n;
  5291. const i = Array.isArray(n), s = n && (Array.isArray(n) ? n : [n]);
  5292. if (!1 !== t.relativeSelector)! function(e, {
  5293. adapter: t
  5294. }, n) {
  5295. const r = !! (null == n ? void 0 : n.every((e => {
  5296. const n = t.isTag(e) && t.getParent(e);
  5297. return e === Fs || n && t.isTag(n)
  5298. })));
  5299. for (const t of e) {
  5300. if (t.length > 0 && Ts(t[0]) && t[0].type !== Zi.Descendant);
  5301. else {
  5302. if (!r || t.some(js)) continue;
  5303. t.unshift(Vs)
  5304. }
  5305. t.unshift(Qs)
  5306. }
  5307. }(e, t, s);
  5308. else if (e.some((e => e.length > 0 && Ts(e[0])))) throw new Error("Relative selectors are not allowed when the `relativeSelector` option is disabled");
  5309. let a = !1;
  5310. const o = e.map((e => {
  5311. if (e.length >= 2) {
  5312. const[t, n] = e;
  5313. t.type !== Zi.Pseudo || "scope" !== t.name || (i && n.type === Zi.Descendant ? e[1] = Ws : n.type !== Zi.Adjacent && n.type !== Zi.Sibling || (a = !0))
  5314. }
  5315. return function(e, t, n) {
  5316. var r;
  5317. return e.reduce(((e, r) => e === ds.falseFunc ? ds.falseFunc : Ks(e, r, t, n, Xs)), null !== (r = t.rootFunc) && void 0 !== r ? r : ds.trueFunc)
  5318. }(e, t, s)
  5319. })).reduce($s, ds.falseFunc);
  5320. return o.shouldTestNextSiblings = a, o
  5321. }
  5322. function $s(e, t) {
  5323. return t === ds.falseFunc || e === ds.trueFunc ? e : e === ds.falseFunc || t === ds.trueFunc ? t : function(n) {
  5324. return e(n) || t(n)
  5325. }
  5326. }
  5327. const zs = (e, t) => e === t, Js = {
  5328. adapter: Se,
  5329. equals: zs
  5330. };
  5331. const Zs = (ea = Xs, function(e, t, n) {
  5332. const r = function(e) {
  5333. var t, n, r, i;
  5334. const s = null != e ? e : Js;
  5335. return null !== (t = s.adapter) && void 0 !== t || (s.adapter = Se), null !== (n = s.equals) && void 0 !== n || (s.equals = null !== (i = null === (r = s.adapter) || void 0 === r ? void 0 : r.equals) && void 0 !== i ? i : zs), s
  5336. }(t);
  5337. return ea(e, r, n)
  5338. });
  5339. var ea;
  5340. function ta(e, t, n = !1) {
  5341. return n && (e = function(e, t) {
  5342. const n = Array.isArray(e) ? e.slice(0) : [e], r = n.length;
  5343. for (let e = 0; e < r; e++) {
  5344. const r = Us(n[e], t);
  5345. n.push(...r)
  5346. }
  5347. return n
  5348. }(e, t)), Array.isArray(e) ? t.removeSubsets(e) : t.getChildren(e)
  5349. }
  5350. const na = new Set(["first", "last", "eq", "gt", "nth", "lt", "even", "odd"]);
  5351. function ra(e) {
  5352. return "pseudo" === e.type && ( !! na.has(e.name) || !("not" !== e.name || !Array.isArray(e.data)) && e.data.some((e => e.some(ra))))
  5353. }
  5354. function ia(e) {
  5355. const t = [], n = [];
  5356. for (const r of e) r.some(ra) ? t.push(r) : n.push(r);
  5357. return [n, t]
  5358. }
  5359. const sa = {
  5360. type: Zi.Universal,
  5361. namespace: null
  5362. }, aa = {
  5363. type: Zi.Pseudo,
  5364. name: "scope",
  5365. data: null
  5366. };
  5367. function oa(e, t, n = {}) {
  5368. return ca([e], t, n)
  5369. }
  5370. function ca(e, t, n = {}) {
  5371. if ("function" == typeof t) return e.some(t);
  5372. const[r, i] = ia(ps(t));
  5373. return r.length > 0 && e.some(Zs(r, n)) || i.some((t => ua(t, e, n).length > 0))
  5374. }
  5375. function la(e, t, n = {}) {
  5376. return ha(ps(e), t, n)
  5377. }
  5378. function ha(e, t, n) {
  5379. if (0 === t.length) return [];
  5380. const[r, i] = ia(e);
  5381. let s;
  5382. if (r.length) {
  5383. const e = Ea(t, r, n);
  5384. if (0 === i.length) return e;
  5385. e.length && (s = new Set(e))
  5386. }
  5387. for (let e = 0; e < i.length && (null == s ? void 0 : s.size) !== t.length; e++) {
  5388. const r = i[e], a = s ? t.filter((e => I(e) && !s.has(e))) : t;
  5389. if (0 === a.length) break;
  5390. const o = ua(r, t, n);
  5391. if (o.length) if (s) o.forEach((e => s.add(e)));
  5392. else {
  5393. if (e === i.length - 1) return o;
  5394. s = new Set(o)
  5395. }
  5396. }
  5397. return void 0 !== s ? s.size === t.length ? t : t.filter((e => s.has(e))) : []
  5398. }
  5399. function ua(e, t, n) {
  5400. var r;
  5401. if (e.some(as)) {
  5402. const i = null !== (r = n.root) && void 0 !== r ? r : function(e) {
  5403. for (; e.parent;) e = e.parent;
  5404. return e
  5405. }(t[0]), s = {...n, context: t,
  5406. relativeSelector: !1
  5407. };
  5408. return e.push(aa), pa(i, e, s, !0, t.length)
  5409. }
  5410. return pa(t, e, n, !1, t.length)
  5411. }
  5412. function pa(e, t, n, r, i) {
  5413. const s = t.findIndex(ra), a = t.slice(0, s), o = t[s], c = t.length - 1 === s ? i : 1 / 0, l = function(e, t, n) {
  5414. const r = null != t ? parseInt(t, 10) : NaN;
  5415. switch (e) {
  5416. case "first":
  5417. return 1;
  5418. case "nth":
  5419. case "eq":
  5420. return isFinite(r) ? r >= 0 ? r + 1 : 1 / 0 : 0;
  5421. case "lt":
  5422. return isFinite(r) ? r >= 0 ? Math.min(r, n) : 1 / 0 : 0;
  5423. case "gt":
  5424. return isFinite(r) ? 1 / 0 : 0;
  5425. case "odd":
  5426. return 2 * n;
  5427. case "even":
  5428. return 2 * n - 1;
  5429. case "last":
  5430. case "not":
  5431. return 1 / 0
  5432. }
  5433. }(o.name, o.data, c);
  5434. if (0 === l) return [];
  5435. const h = (0 !== a.length || Array.isArray(e) ? 0 === a.length ? (Array.isArray(e) ? e : [e]).filter(I) : r || a.some(as) ? fa(e, [a], n, l) : Ea(e, [a], n) : Z(e).filter(I)).slice(0, l);
  5436. let u = function(e, t, n, r) {
  5437. const i = "string" == typeof n ? parseInt(n, 10) : NaN;
  5438. switch (e) {
  5439. case "first":
  5440. case "lt":
  5441. return t;
  5442. case "last":
  5443. return t.length > 0 ? [t[t.length - 1]] : t;
  5444. case "nth":
  5445. case "eq":
  5446. return isFinite(i) && Math.abs(i) < t.length ? [i < 0 ? t[t.length + i] : t[i]] : [];
  5447. case "gt":
  5448. return isFinite(i) ? t.slice(i + 1) : [];
  5449. case "even":
  5450. return t.filter(((e, t) => t % 2 == 0));
  5451. case "odd":
  5452. return t.filter(((e, t) => t % 2 == 1));
  5453. case "not":
  5454. {
  5455. const e = new Set(ha(n, t, r));
  5456. return t.filter((t => !e.has(t)))
  5457. }
  5458. }
  5459. }(o.name, h, o.data, n);
  5460. if (0 === u.length || t.length === s + 1) return u;
  5461. const p = t.slice(s + 1), f = p.some(as);
  5462. if (f) {
  5463. if (as(p[0])) {
  5464. const {
  5465. type: e
  5466. } = p[0];
  5467. e !== Zi.Sibling && e !== Zi.Adjacent || (u = ta(u, Se, !0)), p.unshift(sa)
  5468. }
  5469. n = {...n, relativeSelector: !1,
  5470. rootFunc: e => u.includes(e)
  5471. }
  5472. } else n.rootFunc && n.rootFunc !== Es && (n = {...n, rootFunc: Es
  5473. });
  5474. return p.some(ra) ? pa(u, p, n, !1, i) : f ? fa(u, [p], n, i) : Ea(u, [p], n)
  5475. }
  5476. function fa(e, t, n, r) {
  5477. return da(e, Zs(t, n, e), r)
  5478. }
  5479. function da(e, t, n = 1 / 0) {
  5480. return ae((e => I(e) && t(e)), ta(e, Se, t.shouldTestNextSiblings), !0, n)
  5481. }
  5482. function Ea(e, t, n) {
  5483. const r = (Array.isArray(e) ? e : [e]).filter(I);
  5484. if (0 === r.length) return r;
  5485. const i = Zs(t, n);
  5486. return i === Es ? r : r.filter(i)
  5487. }
  5488. var ma = function(e, t, n) {
  5489. if (n || 2 === arguments.length) for (var r, i = 0, s = t.length; i < s; i++)!r && i in t || (r || (r = Array.prototype.slice.call(t, 0, i)), r[i] = t[i]);
  5490. return e.concat(r || Array.prototype.slice.call(t))
  5491. }, Ta = /^\s*[~+]/;
  5492. function _a(e) {
  5493. return function(t) {
  5494. for (var n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r];
  5495. return function(r) {
  5496. var i, s = e(t, this);
  5497. return r && (s = xa(s, r, this.options.xmlMode, null === (i = this._root) || void 0 === i ? void 0 : i[0])), this._make(this.length > 1 && s.length > 1 ? n.reduce((function(e, t) {
  5498. return t(e)
  5499. }), s) : s)
  5500. }
  5501. }
  5502. }
  5503. var Aa = _a((function(e, t) {
  5504. for (var n, r = [], i = 0; i < t.length; i++) {
  5505. var s = e(t[i]);
  5506. r.push(s)
  5507. }
  5508. return (n = new Array).concat.apply(n, r)
  5509. })),
  5510. ga = _a((function(e, t) {
  5511. for (var n = [], r = 0; r < t.length; r++) {
  5512. var i = e(t[r]);
  5513. null !== i && n.push(i)
  5514. }
  5515. return n
  5516. }));
  5517. function Na(e) {
  5518. for (var t = [], n = 1; n < arguments.length; n++) t[n - 1] = arguments[n];
  5519. var r = null,
  5520. i = _a((function(e, t) {
  5521. var n = [];
  5522. return Bi(t, (function(t) {
  5523. for (var i;
  5524. (i = e(t)) && !(null == r ? void 0 : r(i, n.length)); t = i) n.push(i)
  5525. })), n
  5526. })).apply(void 0, ma([e], t, !1));
  5527. return function(e, t) {
  5528. var n = this;
  5529. r = "string" == typeof e ? function(t) {
  5530. return oa(t, e, n.options)
  5531. } : e ? Pa(e) : null;
  5532. var s = i.call(this, t);
  5533. return r = null, s
  5534. }
  5535. }
  5536. function Ca(e) {
  5537. return Array.from(new Set(e))
  5538. }
  5539. var Ia = ga((function(e) {
  5540. var t = e.parent;
  5541. return t && !L(t) ? t : null
  5542. }), Ca),
  5543. Sa = Aa((function(e) {
  5544. for (var t = []; e.parent && !L(e.parent);) t.push(e.parent), e = e.parent;
  5545. return t
  5546. }), Ee, (function(e) {
  5547. return e.reverse()
  5548. })),
  5549. ba = Na((function(e) {
  5550. var t = e.parent;
  5551. return t && !L(t) ? t : null
  5552. }), Ee, (function(e) {
  5553. return e.reverse()
  5554. }));
  5555. var Oa = ga((function(e) {
  5556. return ne(e)
  5557. })),
  5558. ya = Aa((function(e) {
  5559. for (var t = []; e.next;) I(e = e.next) && t.push(e);
  5560. return t
  5561. }), Ca),
  5562. La = Na((function(e) {
  5563. return ne(e)
  5564. }), Ca),
  5565. ka = ga((function(e) {
  5566. return re(e)
  5567. })),
  5568. va = Aa((function(e) {
  5569. for (var t = []; e.prev;) I(e = e.prev) && t.push(e);
  5570. return t
  5571. }), Ca),
  5572. Da = Na((function(e) {
  5573. return re(e)
  5574. }), Ca),
  5575. Ra = Aa((function(e) {
  5576. return te(e).filter((function(t) {
  5577. return I(t) && t !== e
  5578. }))
  5579. }), Ee),
  5580. Ma = Aa((function(e) {
  5581. return Z(e).filter(I)
  5582. }), Ca);
  5583. function Pa(e) {
  5584. return "function" == typeof e ? function(t, n) {
  5585. return e.call(t, n, t)
  5586. } : wi(e) ? function(t) {
  5587. return Array.prototype.includes.call(e, t)
  5588. } : function(t) {
  5589. return e === t
  5590. }
  5591. }
  5592. function xa(e, t, n, r) {
  5593. return "string" == typeof t ? la(t, e, {
  5594. xmlMode: n,
  5595. root: r
  5596. }) : e.filter(Pa(t))
  5597. }
  5598. var wa = Object.freeze({
  5599. __proto__: null,
  5600. find: function(e) {
  5601. var t;
  5602. if (!e) return this._make([]);
  5603. var n = this.toArray();
  5604. if ("string" != typeof e) {
  5605. var r = wi(e) ? e.toArray() : [e];
  5606. return this._make(r.filter((function(e) {
  5607. return n.some((function(t) {
  5608. return Di(t, e)
  5609. }))
  5610. })))
  5611. }
  5612. var i = Ta.test(e) ? n : this.children().toArray(),
  5613. s = {
  5614. context: n,
  5615. root: null === (t = this._root) || void 0 === t ? void 0 : t[0],
  5616. xmlMode: this.options.xmlMode,
  5617. lowerCaseTags: this.options.lowerCaseTags,
  5618. lowerCaseAttributeNames: this.options.lowerCaseAttributeNames,
  5619. pseudos: this.options.pseudos,
  5620. quirksMode: this.options.quirksMode
  5621. };
  5622. return this._make(function(e, t, n = {}, r = 1 / 0) {
  5623. if ("function" == typeof e) return da(t, e);
  5624. const[i, s] = ia(ps(e)), a = s.map((e => pa(t, e, n, !0, r)));
  5625. return i.length && a.push(fa(t, i, n, r)), 0 === a.length ? [] : 1 === a.length ? a[0] : Ee(a.reduce(((e, t) => [...e, ...t])))
  5626. }(e, i, s))
  5627. },
  5628. parent: Ia,
  5629. parents: Sa,
  5630. parentsUntil: ba,
  5631. closest: function(e) {
  5632. var t, n = [];
  5633. if (!e) return this._make(n);
  5634. var r = {
  5635. xmlMode: this.options.xmlMode,
  5636. root: null === (t = this._root) || void 0 === t ? void 0 : t[0]
  5637. }, i = "string" == typeof e ? function(t) {
  5638. return oa(t, e, r)
  5639. } : Pa(e);
  5640. return Bi(this, (function(e) {
  5641. for (; e && I(e);) {
  5642. if (i(e, 0)) {
  5643. n.includes(e) || n.push(e);
  5644. break
  5645. }
  5646. e = e.parent
  5647. }
  5648. })), this._make(n)
  5649. },
  5650. next: Oa,
  5651. nextAll: ya,
  5652. nextUntil: La,
  5653. prev: ka,
  5654. prevAll: va,
  5655. prevUntil: Da,
  5656. siblings: Ra,
  5657. children: Ma,
  5658. contents: function() {
  5659. var e = this.toArray().reduce((function(e, t) {
  5660. return k(t) ? e.concat(t.children) : e
  5661. }), []);
  5662. return this._make(e)
  5663. },
  5664. each: function(e) {
  5665. for (var t = 0, n = this.length; t < n && !1 !== e.call(this[t], t, this[t]);)++t;
  5666. return this
  5667. },
  5668. map: function(e) {
  5669. for (var t = [], n = 0; n < this.length; n++) {
  5670. var r = this[n],
  5671. i = e.call(r, n, r);
  5672. null != i && (t = t.concat(i))
  5673. }
  5674. return this._make(t)
  5675. },
  5676. filter: function(e) {
  5677. var t;
  5678. return this._make(xa(this.toArray(), e, this.options.xmlMode, null === (t = this._root) || void 0 === t ? void 0 : t[0]))
  5679. },
  5680. filterArray: xa,
  5681. is: function(e) {
  5682. var t = this.toArray();
  5683. return "string" == typeof e ? ca(t.filter(I), e, this.options) : !! e && t.some(Pa(e))
  5684. },
  5685. not: function(e) {
  5686. var t = this.toArray();
  5687. if ("string" == typeof e) {
  5688. var n = new Set(la(e, t, this.options));
  5689. t = t.filter((function(e) {
  5690. return !n.has(e)
  5691. }))
  5692. } else {
  5693. var r = Pa(e);
  5694. t = t.filter((function(e, t) {
  5695. return !r(e, t)
  5696. }))
  5697. }
  5698. return this._make(t)
  5699. },
  5700. has: function(e) {
  5701. var t = this;
  5702. return this.filter("string" == typeof e ? ":has(".concat(e, ")") : function(n, r) {
  5703. return t._make(r).find(e).length > 0
  5704. })
  5705. },
  5706. first: function() {
  5707. return this.length > 1 ? this._make(this[0]) : this
  5708. },
  5709. last: function() {
  5710. return this.length > 0 ? this._make(this[this.length - 1]) : this
  5711. },
  5712. eq: function(e) {
  5713. var t;
  5714. return 0 === (e = +e) && this.length <= 1 ? this : (e < 0 && (e = this.length + e), this._make(null !== (t = this[e]) && void 0 !== t ? t : []))
  5715. },
  5716. get: function(e) {
  5717. return null == e ? this.toArray() : this[e < 0 ? this.length + e : e]
  5718. },
  5719. toArray: function() {
  5720. return Array.prototype.slice.call(this)
  5721. },
  5722. index: function(e) {
  5723. var t, n;
  5724. return null == e ? (t = this.parent().children(), n = this[0]) : "string" == typeof e ? (t = this._make(e), n = this[0]) : (t = this, n = wi(e) ? e[0] : e), Array.prototype.indexOf.call(t, n)
  5725. },
  5726. slice: function(e, t) {
  5727. return this._make(Array.prototype.slice.call(this, e, t))
  5728. },
  5729. end: function() {
  5730. var e;
  5731. return null !== (e = this.prevObject) && void 0 !== e ? e : this._make([])
  5732. },
  5733. add: function(e, t) {
  5734. var n = this._make(e, t),
  5735. r = Ee(ma(ma([], this.get(), !0), n.get(), !0));
  5736. return this._make(r)
  5737. },
  5738. addBack: function(e) {
  5739. return this.prevObject ? this.add(e ? this.prevObject.filter(e) : this.prevObject) : this
  5740. }
  5741. });
  5742. function Ba(e, t) {
  5743. var n = Array.isArray(e) ? e : [e];
  5744. t ? t.children = n : t = null;
  5745. for (var r = 0; r < n.length; r++) {
  5746. var i = n[r];
  5747. i.parent && i.parent.children !== n && ie(i), t ? (i.prev = n[r - 1] || null, i.next = n[r + 1] || null) : i.prev = i.next = null, i.parent = t
  5748. }
  5749. return t
  5750. }
  5751. var Fa = function(e, t, n) {
  5752. if (n || 2 === arguments.length) for (var r, i = 0, s = t.length; i < s; i++)!r && i in t || (r || (r = Array.prototype.slice.call(t, 0, i)), r[i] = t[i]);
  5753. return e.concat(r || Array.prototype.slice.call(t))
  5754. };
  5755. function Ua(e) {
  5756. return function() {
  5757. for (var t = this, n = [], r = 0; r < arguments.length; r++) n[r] = arguments[r];
  5758. var i = this.length - 1;
  5759. return Bi(this, (function(r, s) {
  5760. if (k(r)) {
  5761. var a = "function" == typeof n[0] ? n[0].call(r, s, t._render(r.children)) : n,
  5762. o = t._makeDomArray(a, s < i);
  5763. e(o, r.children, r)
  5764. }
  5765. }))
  5766. }
  5767. }
  5768. function Ha(e, t, n, r, i) {
  5769. for (var s, a, o = Fa([t, n], r, !0), c = 0 === t ? null : e[t - 1], l = t + n >= e.length ? null : e[t + n], h = 0; h < r.length; ++h) {
  5770. var u = r[h],
  5771. p = u.parent;
  5772. if (p) {
  5773. var f = p.children.indexOf(u);
  5774. f > -1 && (p.children.splice(f, 1), i === p && t > f && o[0]--)
  5775. }
  5776. u.parent = i, u.prev && (u.prev.next = null !== (s = u.next) && void 0 !== s ? s : null), u.next && (u.next.prev = null !== (a = u.prev) && void 0 !== a ? a : null), u.prev = 0 === h ? c : r[h - 1], u.next = h === r.length - 1 ? l : r[h + 1]
  5777. }
  5778. return c && (c.next = r[0]), l && (l.prev = r[r.length - 1]), e.splice.apply(e, o)
  5779. }
  5780. var Ga = Ua((function(e, t, n) {
  5781. Ha(t, t.length, 0, e, n)
  5782. })),
  5783. Ya = Ua((function(e, t, n) {
  5784. Ha(t, 0, 0, e, n)
  5785. }));
  5786. function qa(e) {
  5787. return function(t) {
  5788. for (var n = this.length - 1, r = this.parents().last(), i = 0; i < this.length; i++) {
  5789. var s = this[i],
  5790. a = "function" == typeof t ? t.call(s, i, s) : "string" != typeof t || Ui(t) ? t : r.find(t).clone(),
  5791. o = this._makeDomArray(a, i < n)[0];
  5792. if (o && k(o)) {
  5793. for (var c = o, l = 0; l < c.children.length;) {
  5794. var h = c.children[l];
  5795. I(h) ? (c = h, l = 0) : l++
  5796. }
  5797. e(s, c, [o])
  5798. }
  5799. }
  5800. return this
  5801. }
  5802. }
  5803. var Ka = qa((function(e, t, n) {
  5804. var r = e.parent;
  5805. if (r) {
  5806. var i = r.children,
  5807. s = i.indexOf(e);
  5808. Ba([e], t), Ha(i, s, 0, n, r)
  5809. }
  5810. })),
  5811. ja = qa((function(e, t, n) {
  5812. k(e) && (Ba(e.children, t), Ba(n, e))
  5813. }));
  5814. var Va = Object.freeze({
  5815. __proto__: null,
  5816. _makeDomArray: function(e, t) {
  5817. var n = this;
  5818. return null == e ? [] : wi(e) ? t ? Fi(e.get()) : e.get() : Array.isArray(e) ? e.reduce((function(e, r) {
  5819. return e.concat(n._makeDomArray(r, t))
  5820. }), []) : "string" == typeof e ? this._parse(e, this.options, !1, null).children : t ? Fi([e]) : [e]
  5821. },
  5822. appendTo: function(e) {
  5823. return (wi(e) ? e : this._make(e)).append(this), this
  5824. },
  5825. prependTo: function(e) {
  5826. return (wi(e) ? e : this._make(e)).prepend(this), this
  5827. },
  5828. append: Ga,
  5829. prepend: Ya,
  5830. wrap: Ka,
  5831. wrapInner: ja,
  5832. unwrap: function(e) {
  5833. var t = this;
  5834. return this.parent(e).not("body").each((function(e, n) {
  5835. t._make(n).replaceWith(n.children)
  5836. })), this
  5837. },
  5838. wrapAll: function(e) {
  5839. var t = this[0];
  5840. if (t) {
  5841. for (var n = this._make("function" == typeof e ? e.call(t, 0, t) : e).insertBefore(t), r = void 0, i = 0; i < n.length; i++) "tag" === n[i].type && (r = n[i]);
  5842. for (var s = 0; r && s < r.children.length;) {
  5843. var a = r.children[s];
  5844. "tag" === a.type ? (r = a, s = 0) : s++
  5845. }
  5846. r && this._make(r).append(this)
  5847. }
  5848. return this
  5849. },
  5850. after: function() {
  5851. for (var e = this, t = [], n = 0; n < arguments.length; n++) t[n] = arguments[n];
  5852. var r = this.length - 1;
  5853. return Bi(this, (function(n, i) {
  5854. var s = n.parent;
  5855. if (k(n) && s) {
  5856. var a = s.children,
  5857. o = a.indexOf(n);
  5858. if (!(o < 0)) {
  5859. var c = "function" == typeof t[0] ? t[0].call(n, i, e._render(n.children)) : t;
  5860. Ha(a, o + 1, 0, e._makeDomArray(c, i < r), s)
  5861. }
  5862. }
  5863. }))
  5864. },
  5865. insertAfter: function(e) {
  5866. var t = this;
  5867. "string" == typeof e && (e = this._make(e)), this.remove();
  5868. var n = [];
  5869. return this._makeDomArray(e).forEach((function(e) {
  5870. var r = t.clone().toArray(),
  5871. i = e.parent;
  5872. if (i) {
  5873. var s = i.children,
  5874. a = s.indexOf(e);
  5875. a < 0 || (Ha(s, a + 1, 0, r, i), n.push.apply(n, r))
  5876. }
  5877. })), this._make(n)
  5878. },
  5879. before: function() {
  5880. for (var e = this, t = [], n = 0; n < arguments.length; n++) t[n] = arguments[n];
  5881. var r = this.length - 1;
  5882. return Bi(this, (function(n, i) {
  5883. var s = n.parent;
  5884. if (k(n) && s) {
  5885. var a = s.children,
  5886. o = a.indexOf(n);
  5887. if (!(o < 0)) {
  5888. var c = "function" == typeof t[0] ? t[0].call(n, i, e._render(n.children)) : t;
  5889. Ha(a, o, 0, e._makeDomArray(c, i < r), s)
  5890. }
  5891. }
  5892. }))
  5893. },
  5894. insertBefore: function(e) {
  5895. var t = this,
  5896. n = this._make(e);
  5897. this.remove();
  5898. var r = [];
  5899. return Bi(n, (function(e) {
  5900. var n = t.clone().toArray(),
  5901. i = e.parent;
  5902. if (i) {
  5903. var s = i.children,
  5904. a = s.indexOf(e);
  5905. a < 0 || (Ha(s, a, 0, n, i), r.push.apply(r, n))
  5906. }
  5907. })), this._make(r)
  5908. },
  5909. remove: function(e) {
  5910. return Bi(e ? this.filter(e) : this, (function(e) {
  5911. ie(e), e.prev = e.next = e.parent = null
  5912. })), this
  5913. },
  5914. replaceWith: function(e) {
  5915. var t = this;
  5916. return Bi(this, (function(n, r) {
  5917. var i = n.parent;
  5918. if (i) {
  5919. var s = i.children,
  5920. a = "function" == typeof e ? e.call(n, r, n) : e,
  5921. o = t._makeDomArray(a);
  5922. Ba(o, null);
  5923. var c = s.indexOf(n);
  5924. Ha(s, c, 1, o, i), o.includes(n) || (n.parent = n.prev = n.next = null)
  5925. }
  5926. }))
  5927. },
  5928. empty: function() {
  5929. return Bi(this, (function(e) {
  5930. k(e) && (e.children.forEach((function(e) {
  5931. e.next = e.prev = e.parent = null
  5932. })), e.children.length = 0)
  5933. }))
  5934. },
  5935. html: function(e) {
  5936. var t = this;
  5937. if (void 0 === e) {
  5938. var n = this[0];
  5939. return n && k(n) ? this._render(n.children) : null
  5940. }
  5941. return Bi(this, (function(n) {
  5942. k(n) && (n.children.forEach((function(e) {
  5943. e.next = e.prev = e.parent = null
  5944. })), Ba(wi(e) ? e.toArray() : t._parse("".concat(e), t.options, !1, n).children, n))
  5945. }))
  5946. },
  5947. toString: function() {
  5948. return this._render(this)
  5949. },
  5950. text: function(e) {
  5951. var t = this;
  5952. return void 0 === e ? Li(this) : Bi(this, "function" == typeof e ? function(n, r) {
  5953. return t._make(n).text(e.call(n, r, Li([n])))
  5954. } : function(t) {
  5955. k(t) && (t.children.forEach((function(e) {
  5956. e.next = e.prev = e.parent = null
  5957. })), Ba(new m("".concat(e)), t))
  5958. })
  5959. },
  5960. clone: function() {
  5961. return this._make(Fi(this.get()))
  5962. }
  5963. });
  5964. function Wa(e, t, n, r) {
  5965. if ("string" == typeof t) {
  5966. var i = Qa(e),
  5967. s = "function" == typeof n ? n.call(e, r, i[t]) : n;
  5968. "" === s ? delete i[t] : null != s && (i[t] = s), e.attribs.style = (a = i, Object.keys(a).reduce((function(e, t) {
  5969. return "".concat(e).concat(e ? " " : "").concat(t, ": ").concat(a[t], ";")
  5970. }), ""))
  5971. } else "object" == typeof t && Object.keys(t).forEach((function(n, r) {
  5972. Wa(e, n, t[n], r)
  5973. }));
  5974. var a
  5975. }
  5976. function Qa(e, t) {
  5977. if (e && I(e)) {
  5978. var n = function(e) {
  5979. if (!(e = (e || "").trim())) return {};
  5980. for (var t, n = {}, r = 0, i = e.split(";"); r < i.length; r++) {
  5981. var s = i[r],
  5982. a = s.indexOf(":");
  5983. if (a < 1 || a === s.length - 1) {
  5984. var o = s.trimEnd();
  5985. o.length > 0 && void 0 !== t && (n[t] += ";".concat(o))
  5986. } else n[t = s.slice(0, a).trim()] = s.slice(a + 1).trim()
  5987. }
  5988. return n
  5989. }(e.attribs.style);
  5990. if ("string" == typeof t) return n[t];
  5991. if (Array.isArray(t)) {
  5992. var r = {};
  5993. return t.forEach((function(e) {
  5994. null != n[e] && (r[e] = n[e])
  5995. })), r
  5996. }
  5997. return n
  5998. }
  5999. }
  6000. var Xa = Object.freeze({
  6001. __proto__: null,
  6002. css: function(e, t) {
  6003. return null != e && null != t || "object" == typeof e && !Array.isArray(e) ? Bi(this, (function(n, r) {
  6004. I(n) && Wa(n, e, t, r)
  6005. })) : 0 !== this.length ? Qa(this[0], e) : void 0
  6006. }
  6007. }),
  6008. $a = /%20/g,
  6009. za = /\r?\n/g;
  6010. var Ja = Object.freeze({
  6011. __proto__: null,
  6012. serialize: function() {
  6013. var e = this.serializeArray().map((function(e) {
  6014. return "".concat(encodeURIComponent(e.name), "=").concat(encodeURIComponent(e.value))
  6015. }));
  6016. return e.join("&").replace($a, "+")
  6017. },
  6018. serializeArray: function() {
  6019. var e = this;
  6020. return this.map((function(t, n) {
  6021. var r = e._make(n);
  6022. return I(n) && "form" === n.name ? r.find("input,select,textarea,keygen").toArray() : r.filter("input,select,textarea,keygen").toArray()
  6023. })).filter('[name!=""]:enabled:not(:submit, :button, :image, :reset, :file):matches([checked], :not(:checkbox, :radio))').map((function(t, n) {
  6024. var r, i = e._make(n),
  6025. s = i.attr("name"),
  6026. a = null !== (r = i.val()) && void 0 !== r ? r : "";
  6027. return Array.isArray(a) ? a.map((function(e) {
  6028. return {
  6029. name: s,
  6030. value: e.replace(za, "\r\n")
  6031. }
  6032. })) : {
  6033. name: s,
  6034. value: a.replace(za, "\r\n")
  6035. }
  6036. })).toArray()
  6037. }
  6038. }),
  6039. Za = function(e, t, n) {
  6040. if (this.length = 0, this.options = n, this._root = t, e) {
  6041. for (var r = 0; r < e.length; r++) this[r] = e[r];
  6042. this.length = e.length
  6043. }
  6044. };
  6045. Za.prototype.cheerio = "[cheerio object]", Za.prototype.splice = Array.prototype.splice, Za.prototype[Symbol.iterator] = Array.prototype[Symbol.iterator], Object.assign(Za.prototype, ts, wa, Va, Xa, Ja);
  6046. var eo, to = (eo = function(e, t) {
  6047. return eo = Object.setPrototypeOf || {
  6048. __proto__: []
  6049. }
  6050. instanceof Array && function(e, t) {
  6051. e.__proto__ = t
  6052. } || function(e, t) {
  6053. for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n])
  6054. }, eo(e, t)
  6055. }, function(e, t) {
  6056. if ("function" != typeof t && null !== t) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
  6057. function n() {
  6058. this.constructor = e
  6059. }
  6060. eo(e, t), e.prototype = null === t ? Object.create(t) : (n.prototype = t.prototype, new n)
  6061. }),
  6062. no = function() {
  6063. return no = Object.assign || function(e) {
  6064. for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in t = arguments[n]) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
  6065. return e
  6066. }, no.apply(this, arguments)
  6067. };
  6068. const ro = new Set([65534, 65535, 131070, 131071, 196606, 196607, 262142, 262143, 327678, 327679, 393214, 393215, 458750, 458751, 524286, 524287, 589822, 589823, 655358, 655359, 720894, 720895, 786430, 786431, 851966, 851967, 917502, 917503, 983038, 983039, 1048574, 1048575, 1114110, 1114111]);
  6069. var io;
  6070. ! function(e) {
  6071. e[e.EOF = -1] = "EOF", e[e.NULL = 0] = "NULL", e[e.TABULATION = 9] = "TABULATION", e[e.CARRIAGE_RETURN = 13] = "CARRIAGE_RETURN", e[e.LINE_FEED = 10] = "LINE_FEED", e[e.FORM_FEED = 12] = "FORM_FEED", e[e.SPACE = 32] = "SPACE", e[e.EXCLAMATION_MARK = 33] = "EXCLAMATION_MARK", e[e.QUOTATION_MARK = 34] = "QUOTATION_MARK", e[e.NUMBER_SIGN = 35] = "NUMBER_SIGN", e[e.AMPERSAND = 38] = "AMPERSAND", e[e.APOSTROPHE = 39] = "APOSTROPHE", e[e.HYPHEN_MINUS = 45] = "HYPHEN_MINUS", e[e.SOLIDUS = 47] = "SOLIDUS", e[e.DIGIT_0 = 48] = "DIGIT_0", e[e.DIGIT_9 = 57] = "DIGIT_9", e[e.SEMICOLON = 59] = "SEMICOLON", e[e.LESS_THAN_SIGN = 60] = "LESS_THAN_SIGN", e[e.EQUALS_SIGN = 61] = "EQUALS_SIGN", e[e.GREATER_THAN_SIGN = 62] = "GREATER_THAN_SIGN", e[e.QUESTION_MARK = 63] = "QUESTION_MARK", e[e.LATIN_CAPITAL_A = 65] = "LATIN_CAPITAL_A", e[e.LATIN_CAPITAL_F = 70] = "LATIN_CAPITAL_F", e[e.LATIN_CAPITAL_X = 88] = "LATIN_CAPITAL_X", e[e.LATIN_CAPITAL_Z = 90] = "LATIN_CAPITAL_Z", e[e.RIGHT_SQUARE_BRACKET = 93] = "RIGHT_SQUARE_BRACKET", e[e.GRAVE_ACCENT = 96] = "GRAVE_ACCENT", e[e.LATIN_SMALL_A = 97] = "LATIN_SMALL_A", e[e.LATIN_SMALL_F = 102] = "LATIN_SMALL_F", e[e.LATIN_SMALL_X = 120] = "LATIN_SMALL_X", e[e.LATIN_SMALL_Z = 122] = "LATIN_SMALL_Z", e[e.REPLACEMENT_CHARACTER = 65533] = "REPLACEMENT_CHARACTER"
  6072. }(io = io || (io = {}));
  6073. const so = "--", ao = "[CDATA[", oo = "doctype", co = "script", lo = "public", ho = "system";
  6074. function uo(e) {
  6075. return e >= 55296 && e <= 57343
  6076. }
  6077. function po(e) {
  6078. return 32 !== e && 10 !== e && 13 !== e && 9 !== e && 12 !== e && e >= 1 && e <= 31 || e >= 127 && e <= 159
  6079. }
  6080. function fo(e) {
  6081. return e >= 64976 && e <= 65007 || ro.has(e)
  6082. }
  6083. var Eo;
  6084. ! function(e) {
  6085. e.controlCharacterInInputStream = "control-character-in-input-stream", e.noncharacterInInputStream = "noncharacter-in-input-stream", e.surrogateInInputStream = "surrogate-in-input-stream", e.nonVoidHtmlElementStartTagWithTrailingSolidus = "non-void-html-element-start-tag-with-trailing-solidus", e.endTagWithAttributes = "end-tag-with-attributes", e.endTagWithTrailingSolidus = "end-tag-with-trailing-solidus", e.unexpectedSolidusInTag = "unexpected-solidus-in-tag", e.unexpectedNullCharacter = "unexpected-null-character", e.unexpectedQuestionMarkInsteadOfTagName = "unexpected-question-mark-instead-of-tag-name", e.invalidFirstCharacterOfTagName = "invalid-first-character-of-tag-name", e.unexpectedEqualsSignBeforeAttributeName = "unexpected-equals-sign-before-attribute-name", e.missingEndTagName = "missing-end-tag-name", e.unexpectedCharacterInAttributeName = "unexpected-character-in-attribute-name", e.unknownNamedCharacterReference = "unknown-named-character-reference", e.missingSemicolonAfterCharacterReference = "missing-semicolon-after-character-reference", e.unexpectedCharacterAfterDoctypeSystemIdentifier = "unexpected-character-after-doctype-system-identifier", e.unexpectedCharacterInUnquotedAttributeValue = "unexpected-character-in-unquoted-attribute-value", e.eofBeforeTagName = "eof-before-tag-name", e.eofInTag = "eof-in-tag", e.missingAttributeValue = "missing-attribute-value", e.missingWhitespaceBetweenAttributes = "missing-whitespace-between-attributes", e.missingWhitespaceAfterDoctypePublicKeyword = "missing-whitespace-after-doctype-public-keyword", e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers = "missing-whitespace-between-doctype-public-and-system-identifiers", e.missingWhitespaceAfterDoctypeSystemKeyword = "missing-whitespace-after-doctype-system-keyword", e.missingQuoteBeforeDoctypePublicIdentifier = "missing-quote-before-doctype-public-identifier", e.missingQuoteBeforeDoctypeSystemIdentifier = "missing-quote-before-doctype-system-identifier", e.missingDoctypePublicIdentifier = "missing-doctype-public-identifier", e.missingDoctypeSystemIdentifier = "missing-doctype-system-identifier", e.abruptDoctypePublicIdentifier = "abrupt-doctype-public-identifier", e.abruptDoctypeSystemIdentifier = "abrupt-doctype-system-identifier", e.cdataInHtmlContent = "cdata-in-html-content", e.incorrectlyOpenedComment = "incorrectly-opened-comment", e.eofInScriptHtmlCommentLikeText = "eof-in-script-html-comment-like-text", e.eofInDoctype = "eof-in-doctype", e.nestedComment = "nested-comment", e.abruptClosingOfEmptyComment = "abrupt-closing-of-empty-comment", e.eofInComment = "eof-in-comment", e.incorrectlyClosedComment = "incorrectly-closed-comment", e.eofInCdata = "eof-in-cdata", e.absenceOfDigitsInNumericCharacterReference = "absence-of-digits-in-numeric-character-reference", e.nullCharacterReference = "null-character-reference", e.surrogateCharacterReference = "surrogate-character-reference", e.characterReferenceOutsideUnicodeRange = "character-reference-outside-unicode-range", e.controlCharacterReference = "control-character-reference", e.noncharacterCharacterReference = "noncharacter-character-reference", e.missingWhitespaceBeforeDoctypeName = "missing-whitespace-before-doctype-name", e.missingDoctypeName = "missing-doctype-name", e.invalidCharacterSequenceAfterDoctypeName = "invalid-character-sequence-after-doctype-name", e.duplicateAttribute = "duplicate-attribute", e.nonConformingDoctype = "non-conforming-doctype", e.missingDoctype = "missing-doctype", e.misplacedDoctype = "misplaced-doctype", e.endTagWithoutMatchingOpenElement = "end-tag-without-matching-open-element", e.closingOfElementWithOpenChildElements = "closing-of-element-with-open-child-elements", e.disallowedContentInNoscriptInHead = "disallowed-content-in-noscript-in-head", e.openElementsLeftAfterEof = "open-elements-left-after-eof", e.abandonedHeadElementChild = "abandoned-head-element-child", e.misplacedStartTagForHeadElement = "misplaced-start-tag-for-head-element", e.nestedNoscriptInHead = "nested-noscript-in-head", e.eofInElementThatCanContainOnlyText = "eof-in-element-that-can-contain-only-text"
  6086. }(Eo = Eo || (Eo = {}));
  6087. class mo {
  6088. constructor(e) {
  6089. this.handler = e, this.html = "", this.pos = -1, this.lastGapPos = -2, this.gapStack = [], this.skipNextNewLine = !1, this.lastChunkWritten = !1, this.endOfChunkHit = !1, this.bufferWaterline = 65536, this.isEol = !1, this.lineStartPos = 0, this.droppedBufferSize = 0, this.line = 1, this.lastErrOffset = -1
  6090. }
  6091. get col() {
  6092. return this.pos - this.lineStartPos + Number(this.lastGapPos !== this.pos)
  6093. }
  6094. get offset() {
  6095. return this.droppedBufferSize + this.pos
  6096. }
  6097. getError(e) {
  6098. const {
  6099. line: t,
  6100. col: n,
  6101. offset: r
  6102. } = this;
  6103. return {
  6104. code: e,
  6105. startLine: t,
  6106. endLine: t,
  6107. startCol: n,
  6108. endCol: n,
  6109. startOffset: r,
  6110. endOffset: r
  6111. }
  6112. }
  6113. _err(e) {
  6114. this.handler.onParseError && this.lastErrOffset !== this.offset && (this.lastErrOffset = this.offset, this.handler.onParseError(this.getError(e)))
  6115. }
  6116. _addGap() {
  6117. this.gapStack.push(this.lastGapPos), this.lastGapPos = this.pos
  6118. }
  6119. _processSurrogate(e) {
  6120. if (this.pos !== this.html.length - 1) {
  6121. const t = this.html.charCodeAt(this.pos + 1);
  6122. if (function(e) {
  6123. return e >= 56320 && e <= 57343
  6124. }(t)) return this.pos++, this._addGap(), 1024 * (e - 55296) + 9216 + t
  6125. } else if (!this.lastChunkWritten) return this.endOfChunkHit = !0, io.EOF;
  6126. return this._err(Eo.surrogateInInputStream), e
  6127. }
  6128. willDropParsedChunk() {
  6129. return this.pos > this.bufferWaterline
  6130. }
  6131. dropParsedChunk() {
  6132. this.willDropParsedChunk() && (this.html = this.html.substring(this.pos), this.lineStartPos -= this.pos, this.droppedBufferSize += this.pos, this.pos = 0, this.lastGapPos = -2, this.gapStack.length = 0)
  6133. }
  6134. write(e, t) {
  6135. this.html.length > 0 ? this.html += e : this.html = e, this.endOfChunkHit = !1, this.lastChunkWritten = t
  6136. }
  6137. insertHtmlAtCurrentPos(e) {
  6138. this.html = this.html.substring(0, this.pos + 1) + e + this.html.substring(this.pos + 1), this.endOfChunkHit = !1
  6139. }
  6140. startsWith(e, t) {
  6141. if (this.pos + e.length > this.html.length) return this.endOfChunkHit = !this.lastChunkWritten, !1;
  6142. if (t) return this.html.startsWith(e, this.pos);
  6143. for (let t = 0; t < e.length; t++) {
  6144. if ((32 | this.html.charCodeAt(this.pos + t)) !== e.charCodeAt(t)) return !1
  6145. }
  6146. return !0
  6147. }
  6148. peek(e) {
  6149. const t = this.pos + e;
  6150. return t >= this.html.length ? (this.endOfChunkHit = !this.lastChunkWritten, io.EOF) : this.html.charCodeAt(t)
  6151. }
  6152. advance() {
  6153. if (this.pos++, this.isEol && (this.isEol = !1, this.line++, this.lineStartPos = this.pos), this.pos >= this.html.length) return this.endOfChunkHit = !this.lastChunkWritten, io.EOF;
  6154. let e = this.html.charCodeAt(this.pos);
  6155. if (e === io.CARRIAGE_RETURN) return this.isEol = !0, this.skipNextNewLine = !0, io.LINE_FEED;
  6156. if (e === io.LINE_FEED && (this.isEol = !0, this.skipNextNewLine)) return this.line--, this.skipNextNewLine = !1, this._addGap(), this.advance();
  6157. this.skipNextNewLine = !1, uo(e) && (e = this._processSurrogate(e));
  6158. return null === this.handler.onParseError || e > 31 && e < 127 || e === io.LINE_FEED || e === io.CARRIAGE_RETURN || e > 159 && e < 64976 || this._checkForProblematicCharacters(e), e
  6159. }
  6160. _checkForProblematicCharacters(e) {
  6161. po(e) ? this._err(Eo.controlCharacterInInputStream) : fo(e) && this._err(Eo.noncharacterInInputStream)
  6162. }
  6163. retreat(e) {
  6164. for (this.pos -= e; this.pos < this.lastGapPos;) this.lastGapPos = this.gapStack.pop(), this.pos--;
  6165. this.isEol = !1
  6166. }
  6167. }
  6168. var To;
  6169. function _o(e, t) {
  6170. for (let n = e.attrs.length - 1; n >= 0; n--) if (e.attrs[n].name === t) return e.attrs[n].value;
  6171. return null
  6172. }! function(e) {
  6173. e[e.CHARACTER = 0] = "CHARACTER", e[e.NULL_CHARACTER = 1] = "NULL_CHARACTER", e[e.WHITESPACE_CHARACTER = 2] = "WHITESPACE_CHARACTER", e[e.START_TAG = 3] = "START_TAG", e[e.END_TAG = 4] = "END_TAG", e[e.COMMENT = 5] = "COMMENT", e[e.DOCTYPE = 6] = "DOCTYPE", e[e.EOF = 7] = "EOF", e[e.HIBERNATION = 8] = "HIBERNATION"
  6174. }(To = To || (To = {}));
  6175. var Ao = Ke((function(e, t) {
  6176. Object.defineProperty(t, "__esModule", {
  6177. value: !0
  6178. }), t.
  6179. default = new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map((function(e) {
  6180. return e.charCodeAt(0)
  6181. })))
  6182. }));
  6183. qe(Ao);
  6184. var go = Ke((function(e, t) {
  6185. Object.defineProperty(t, "__esModule", {
  6186. value: !0
  6187. }), t.
  6188. default = new Uint16Array("Ȁaglq\tɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map((function(e) {
  6189. return e.charCodeAt(0)
  6190. })))
  6191. }));
  6192. qe(go);
  6193. var No = Ke((function(e, t) {
  6194. var n;
  6195. Object.defineProperty(t, "__esModule", {
  6196. value: !0
  6197. }), t.replaceCodePoint = t.fromCodePoint = void 0;
  6198. var r = new Map([
  6199. [0, 65533],
  6200. [128, 8364],
  6201. [130, 8218],
  6202. [131, 402],
  6203. [132, 8222],
  6204. [133, 8230],
  6205. [134, 8224],
  6206. [135, 8225],
  6207. [136, 710],
  6208. [137, 8240],
  6209. [138, 352],
  6210. [139, 8249],
  6211. [140, 338],
  6212. [142, 381],
  6213. [145, 8216],
  6214. [146, 8217],
  6215. [147, 8220],
  6216. [148, 8221],
  6217. [149, 8226],
  6218. [150, 8211],
  6219. [151, 8212],
  6220. [152, 732],
  6221. [153, 8482],
  6222. [154, 353],
  6223. [155, 8250],
  6224. [156, 339],
  6225. [158, 382],
  6226. [159, 376]
  6227. ]);
  6228. function i(e) {
  6229. var t;
  6230. return e >= 55296 && e <= 57343 || e > 1114111 ? 65533 : null !== (t = r.get(e)) && void 0 !== t ? t : e
  6231. }
  6232. t.fromCodePoint = null !== (n = String.fromCodePoint) && void 0 !== n ? n : function(e) {
  6233. var t = "";
  6234. return e > 65535 && (e -= 65536, t += String.fromCharCode(e >>> 10 & 1023 | 55296), e = 56320 | 1023 & e), t += String.fromCharCode(e)
  6235. }, t.replaceCodePoint = i, t.
  6236. default = function(e) {
  6237. return (0, t.fromCodePoint)(i(e))
  6238. }
  6239. }));
  6240. qe(No), No.replaceCodePoint, No.fromCodePoint;
  6241. var Co = Ao,
  6242. Io = go,
  6243. So = No,
  6244. bo = Ke((function(e, t) {
  6245. var n = Ge && Ge.__importDefault || function(e) {
  6246. return e && e.__esModule ? e : {
  6247. default: e
  6248. }
  6249. };
  6250. Object.defineProperty(t, "__esModule", {
  6251. value: !0
  6252. }), t.decodeXML = t.decodeHTMLStrict = t.decodeHTML = t.determineBranch = t.BinTrieFlags = t.fromCodePoint = t.replaceCodePoint = t.decodeCodePoint = t.xmlDecodeTree = t.htmlDecodeTree = void 0;
  6253. var r = n(Co);
  6254. t.htmlDecodeTree = r.
  6255. default;
  6256. var i = n(Io);
  6257. t.xmlDecodeTree = i.
  6258. default;
  6259. var s = n(So);
  6260. t.decodeCodePoint = s.
  6261. default;
  6262. var a, o, c = So;
  6263. function l(e) {
  6264. return function(t, n) {
  6265. for (var r = "", i = 0, c = 0;
  6266. (c = t.indexOf("&", c)) >= 0;) if (r += t.slice(i, c), i = c, c += 1, t.charCodeAt(c) !== a.NUM) {
  6267. for (var l = 0, u = 1, p = 0, f = e[p]; c < t.length && !((p = h(e, f, p + 1, t.charCodeAt(c))) < 0); c++, u++) {
  6268. var d = (f = e[p]) & o.VALUE_LENGTH;
  6269. if (d) {
  6270. var E;
  6271. if (n && t.charCodeAt(c) !== a.SEMI || (l = p, u = 0), 0 === (E = (d >> 14) - 1)) break;
  6272. p += E
  6273. }
  6274. }
  6275. if (0 !== l) r += 1 === (E = (e[l] & o.VALUE_LENGTH) >> 14) ? String.fromCharCode(e[l] & ~o.VALUE_LENGTH) : 2 === E ? String.fromCharCode(e[l + 1]) : String.fromCharCode(e[l + 1], e[l + 2]), i = c - u + 1
  6276. } else {
  6277. var m = c + 1,
  6278. T = 10,
  6279. _ = t.charCodeAt(m);
  6280. (_ | a.To_LOWER_BIT) === a.LOWER_X && (T = 16, c += 1, m += 1);
  6281. do {
  6282. _ = t.charCodeAt(++c)
  6283. } while (_ >= a.ZERO && _ <= a.NINE || 16 === T && (_ | a.To_LOWER_BIT) >= a.LOWER_A && (_ | a.To_LOWER_BIT) <= a.LOWER_F);
  6284. if (m !== c) {
  6285. var A = t.substring(m, c),
  6286. g = parseInt(A, T);
  6287. if (t.charCodeAt(c) === a.SEMI) c += 1;
  6288. else if (n) continue;
  6289. r += (0, s.
  6290. default)(g), i = c
  6291. }
  6292. }
  6293. return r + t.slice(i)
  6294. }
  6295. }
  6296. function h(e, t, n, r) {
  6297. var i = (t & o.BRANCH_LENGTH) >> 7,
  6298. s = t & o.JUMP_TABLE;
  6299. if (0 === i) return 0 !== s && r === s ? n : -1;
  6300. if (s) {
  6301. var a = r - s;
  6302. return a < 0 || a >= i ? -1 : e[n + a] - 1
  6303. }
  6304. for (var c = n, l = c + i - 1; c <= l;) {
  6305. var h = c + l >>> 1,
  6306. u = e[h];
  6307. if (u < r) c = h + 1;
  6308. else {
  6309. if (!(u > r)) return e[h + i];
  6310. l = h - 1
  6311. }
  6312. }
  6313. return -1
  6314. }
  6315. Object.defineProperty(t, "replaceCodePoint", {
  6316. enumerable: !0,
  6317. get: function() {
  6318. return c.replaceCodePoint
  6319. }
  6320. }), Object.defineProperty(t, "fromCodePoint", {
  6321. enumerable: !0,
  6322. get: function() {
  6323. return c.fromCodePoint
  6324. }
  6325. }),
  6326. function(e) {
  6327. e[e.NUM = 35] = "NUM", e[e.SEMI = 59] = "SEMI", e[e.ZERO = 48] = "ZERO", e[e.NINE = 57] = "NINE", e[e.LOWER_A = 97] = "LOWER_A", e[e.LOWER_F = 102] = "LOWER_F", e[e.LOWER_X = 120] = "LOWER_X", e[e.To_LOWER_BIT = 32] = "To_LOWER_BIT"
  6328. }(a || (a = {})),
  6329. function(e) {
  6330. e[e.VALUE_LENGTH = 49152] = "VALUE_LENGTH", e[e.BRANCH_LENGTH = 16256] = "BRANCH_LENGTH", e[e.JUMP_TABLE = 127] = "JUMP_TABLE"
  6331. }(o = t.BinTrieFlags || (t.BinTrieFlags = {})), t.determineBranch = h;
  6332. var u = l(r.
  6333. default),
  6334. p = l(i.
  6335. default);
  6336. t.decodeHTML = function(e) {
  6337. return u(e, !1)
  6338. }, t.decodeHTMLStrict = function(e) {
  6339. return u(e, !0)
  6340. }, t.decodeXML = function(e) {
  6341. return p(e, !0)
  6342. }
  6343. }));
  6344. qe(bo), bo.decodeXML, bo.decodeHTMLStrict, bo.decodeHTML;
  6345. var Oo = bo.determineBranch,
  6346. yo = bo.BinTrieFlags,
  6347. Lo = bo.fromCodePoint,
  6348. ko = bo.replaceCodePoint;
  6349. bo.decodeCodePoint;
  6350. var vo, Do, Ro, Mo, Po, xo = bo.xmlDecodeTree,
  6351. wo = bo.htmlDecodeTree;
  6352. ! function(e) {
  6353. e.HTML = "http://www.w3.org/1999/xhtml", e.MATHML = "http://www.w3.org/1998/Math/MathML", e.SVG = "http://www.w3.org/2000/svg", e.XLINK = "http://www.w3.org/1999/xlink", e.XML = "http://www.w3.org/XML/1998/namespace", e.XMLNS = "http://www.w3.org/2000/xmlns/"
  6354. }(vo = vo || (vo = {})),
  6355. function(e) {
  6356. e.TYPE = "type", e.ACTION = "action", e.ENCODING = "encoding", e.PROMPT = "prompt", e.NAME = "name", e.COLOR = "color", e.FACE = "face", e.SIZE = "size"
  6357. }(Do = Do || (Do = {})),
  6358. function(e) {
  6359. e.NO_QUIRKS = "no-quirks", e.QUIRKS = "quirks", e.LIMITED_QUIRKS = "limited-quirks"
  6360. }(Ro = Ro || (Ro = {})),
  6361. function(e) {
  6362. e.A = "a", e.ADDRESS = "address", e.ANNOTATION_XML = "annotation-xml", e.APPLET = "applet", e.AREA = "area", e.ARTICLE = "article", e.ASIDE = "aside", e.B = "b", e.BASE = "base", e.BASEFONT = "basefont", e.BGSOUND = "bgsound", e.BIG = "big", e.BLOCKQUOTE = "blockquote", e.BODY = "body", e.BR = "br", e.BUTTON = "button", e.CAPTION = "caption", e.CENTER = "center", e.CODE = "code", e.COL = "col", e.COLGROUP = "colgroup", e.DD = "dd", e.DESC = "desc", e.DETAILS = "details", e.DIALOG = "dialog", e.DIR = "dir", e.DIV = "div", e.DL = "dl", e.DT = "dt", e.EM = "em", e.EMBED = "embed", e.FIELDSET = "fieldset", e.FIGCAPTION = "figcaption", e.FIGURE = "figure", e.FONT = "font", e.FOOTER = "footer", e.FOREIGN_OBJECT = "foreignObject", e.FORM = "form", e.FRAME = "frame", e.FRAMESET = "frameset", e.H1 = "h1", e.H2 = "h2", e.H3 = "h3", e.H4 = "h4", e.H5 = "h5", e.H6 = "h6", e.HEAD = "head", e.HEADER = "header", e.HGROUP = "hgroup", e.HR = "hr", e.HTML = "html", e.I = "i", e.IMG = "img", e.IMAGE = "image", e.INPUT = "input", e.IFRAME = "iframe", e.KEYGEN = "keygen", e.LABEL = "label", e.LI = "li", e.LINK = "link", e.LISTING = "listing", e.MAIN = "main", e.MALIGNMARK = "malignmark", e.MARQUEE = "marquee", e.MATH = "math", e.MENU = "menu", e.META = "meta", e.MGLYPH = "mglyph", e.MI = "mi", e.MO = "mo", e.MN = "mn", e.MS = "ms", e.MTEXT = "mtext", e.NAV = "nav", e.NOBR = "nobr", e.NOFRAMES = "noframes", e.NOEMBED = "noembed", e.NOSCRIPT = "noscript", e.OBJECT = "object", e.OL = "ol", e.OPTGROUP = "optgroup", e.OPTION = "option", e.P = "p", e.PARAM = "param", e.PLAINTEXT = "plaintext", e.PRE = "pre", e.RB = "rb", e.RP = "rp", e.RT = "rt", e.RTC = "rtc", e.RUBY = "ruby", e.S = "s", e.SCRIPT = "script", e.SECTION = "section", e.SELECT = "select", e.SOURCE = "source", e.SMALL = "small", e.SPAN = "span", e.STRIKE = "strike", e.STRONG = "strong", e.STYLE = "style", e.SUB = "sub", e.SUMMARY = "summary", e.SUP = "sup", e.TABLE = "table", e.TBODY = "tbody", e.TEMPLATE = "template", e.TEXTAREA = "textarea", e.TFOOT = "tfoot", e.TD = "td", e.TH = "th", e.THEAD = "thead", e.TITLE = "title", e.TR = "tr", e.TRACK = "track", e.TT = "tt", e.U = "u", e.UL = "ul", e.SVG = "svg", e.VAR = "var", e.WBR = "wbr", e.XMP = "xmp"
  6363. }(Mo = Mo || (Mo = {})),
  6364. function(e) {
  6365. e[e.UNKNOWN = 0] = "UNKNOWN", e[e.A = 1] = "A", e[e.ADDRESS = 2] = "ADDRESS", e[e.ANNOTATION_XML = 3] = "ANNOTATION_XML", e[e.APPLET = 4] = "APPLET", e[e.AREA = 5] = "AREA", e[e.ARTICLE = 6] = "ARTICLE", e[e.ASIDE = 7] = "ASIDE", e[e.B = 8] = "B", e[e.BASE = 9] = "BASE", e[e.BASEFONT = 10] = "BASEFONT", e[e.BGSOUND = 11] = "BGSOUND", e[e.BIG = 12] = "BIG", e[e.BLOCKQUOTE = 13] = "BLOCKQUOTE", e[e.BODY = 14] = "BODY", e[e.BR = 15] = "BR", e[e.BUTTON = 16] = "BUTTON", e[e.CAPTION = 17] = "CAPTION", e[e.CENTER = 18] = "CENTER", e[e.CODE = 19] = "CODE", e[e.COL = 20] = "COL", e[e.COLGROUP = 21] = "COLGROUP", e[e.DD = 22] = "DD", e[e.DESC = 23] = "DESC", e[e.DETAILS = 24] = "DETAILS", e[e.DIALOG = 25] = "DIALOG", e[e.DIR = 26] = "DIR", e[e.DIV = 27] = "DIV", e[e.DL = 28] = "DL", e[e.DT = 29] = "DT", e[e.EM = 30] = "EM", e[e.EMBED = 31] = "EMBED", e[e.FIELDSET = 32] = "FIELDSET", e[e.FIGCAPTION = 33] = "FIGCAPTION", e[e.FIGURE = 34] = "FIGURE", e[e.FONT = 35] = "FONT", e[e.FOOTER = 36] = "FOOTER", e[e.FOREIGN_OBJECT = 37] = "FOREIGN_OBJECT", e[e.FORM = 38] = "FORM", e[e.FRAME = 39] = "FRAME", e[e.FRAMESET = 40] = "FRAMESET", e[e.H1 = 41] = "H1", e[e.H2 = 42] = "H2", e[e.H3 = 43] = "H3", e[e.H4 = 44] = "H4", e[e.H5 = 45] = "H5", e[e.H6 = 46] = "H6", e[e.HEAD = 47] = "HEAD", e[e.HEADER = 48] = "HEADER", e[e.HGROUP = 49] = "HGROUP", e[e.HR = 50] = "HR", e[e.HTML = 51] = "HTML", e[e.I = 52] = "I", e[e.IMG = 53] = "IMG", e[e.IMAGE = 54] = "IMAGE", e[e.INPUT = 55] = "INPUT", e[e.IFRAME = 56] = "IFRAME", e[e.KEYGEN = 57] = "KEYGEN", e[e.LABEL = 58] = "LABEL", e[e.LI = 59] = "LI", e[e.LINK = 60] = "LINK", e[e.LISTING = 61] = "LISTING", e[e.MAIN = 62] = "MAIN", e[e.MALIGNMARK = 63] = "MALIGNMARK", e[e.MARQUEE = 64] = "MARQUEE", e[e.MATH = 65] = "MATH", e[e.MENU = 66] = "MENU", e[e.META = 67] = "META", e[e.MGLYPH = 68] = "MGLYPH", e[e.MI = 69] = "MI", e[e.MO = 70] = "MO", e[e.MN = 71] = "MN", e[e.MS = 72] = "MS", e[e.MTEXT = 73] = "MTEXT", e[e.NAV = 74] = "NAV", e[e.NOBR = 75] = "NOBR", e[e.NOFRAMES = 76] = "NOFRAMES", e[e.NOEMBED = 77] = "NOEMBED", e[e.NOSCRIPT = 78] = "NOSCRIPT", e[e.OBJECT = 79] = "OBJECT", e[e.OL = 80] = "OL", e[e.OPTGROUP = 81] = "OPTGROUP", e[e.OPTION = 82] = "OPTION", e[e.P = 83] = "P", e[e.PARAM = 84] = "PARAM", e[e.PLAINTEXT = 85] = "PLAINTEXT", e[e.PRE = 86] = "PRE", e[e.RB = 87] = "RB", e[e.RP = 88] = "RP", e[e.RT = 89] = "RT", e[e.RTC = 90] = "RTC", e[e.RUBY = 91] = "RUBY", e[e.S = 92] = "S", e[e.SCRIPT = 93] = "SCRIPT", e[e.SECTION = 94] = "SECTION", e[e.SELECT = 95] = "SELECT", e[e.SOURCE = 96] = "SOURCE", e[e.SMALL = 97] = "SMALL", e[e.SPAN = 98] = "SPAN", e[e.STRIKE = 99] = "STRIKE", e[e.STRONG = 100] = "STRONG", e[e.STYLE = 101] = "STYLE", e[e.SUB = 102] = "SUB", e[e.SUMMARY = 103] = "SUMMARY", e[e.SUP = 104] = "SUP", e[e.TABLE = 105] = "TABLE", e[e.TBODY = 106] = "TBODY", e[e.TEMPLATE = 107] = "TEMPLATE", e[e.TEXTAREA = 108] = "TEXTAREA", e[e.TFOOT = 109] = "TFOOT", e[e.TD = 110] = "TD", e[e.TH = 111] = "TH", e[e.THEAD = 112] = "THEAD", e[e.TITLE = 113] = "TITLE", e[e.TR = 114] = "TR", e[e.TRACK = 115] = "TRACK", e[e.TT = 116] = "TT", e[e.U = 117] = "U", e[e.UL = 118] = "UL", e[e.SVG = 119] = "SVG", e[e.VAR = 120] = "VAR", e[e.WBR = 121] = "WBR", e[e.XMP = 122] = "XMP"
  6366. }(Po = Po || (Po = {}));
  6367. const Bo = new Map([
  6368. [Mo.A, Po.A],
  6369. [Mo.ADDRESS, Po.ADDRESS],
  6370. [Mo.ANNOTATION_XML, Po.ANNOTATION_XML],
  6371. [Mo.APPLET, Po.APPLET],
  6372. [Mo.AREA, Po.AREA],
  6373. [Mo.ARTICLE, Po.ARTICLE],
  6374. [Mo.ASIDE, Po.ASIDE],
  6375. [Mo.B, Po.B],
  6376. [Mo.BASE, Po.BASE],
  6377. [Mo.BASEFONT, Po.BASEFONT],
  6378. [Mo.BGSOUND, Po.BGSOUND],
  6379. [Mo.BIG, Po.BIG],
  6380. [Mo.BLOCKQUOTE, Po.BLOCKQUOTE],
  6381. [Mo.BODY, Po.BODY],
  6382. [Mo.BR, Po.BR],
  6383. [Mo.BUTTON, Po.BUTTON],
  6384. [Mo.CAPTION, Po.CAPTION],
  6385. [Mo.CENTER, Po.CENTER],
  6386. [Mo.CODE, Po.CODE],
  6387. [Mo.COL, Po.COL],
  6388. [Mo.COLGROUP, Po.COLGROUP],
  6389. [Mo.DD, Po.DD],
  6390. [Mo.DESC, Po.DESC],
  6391. [Mo.DETAILS, Po.DETAILS],
  6392. [Mo.DIALOG, Po.DIALOG],
  6393. [Mo.DIR, Po.DIR],
  6394. [Mo.DIV, Po.DIV],
  6395. [Mo.DL, Po.DL],
  6396. [Mo.DT, Po.DT],
  6397. [Mo.EM, Po.EM],
  6398. [Mo.EMBED, Po.EMBED],
  6399. [Mo.FIELDSET, Po.FIELDSET],
  6400. [Mo.FIGCAPTION, Po.FIGCAPTION],
  6401. [Mo.FIGURE, Po.FIGURE],
  6402. [Mo.FONT, Po.FONT],
  6403. [Mo.FOOTER, Po.FOOTER],
  6404. [Mo.FOREIGN_OBJECT, Po.FOREIGN_OBJECT],
  6405. [Mo.FORM, Po.FORM],
  6406. [Mo.FRAME, Po.FRAME],
  6407. [Mo.FRAMESET, Po.FRAMESET],
  6408. [Mo.H1, Po.H1],
  6409. [Mo.H2, Po.H2],
  6410. [Mo.H3, Po.H3],
  6411. [Mo.H4, Po.H4],
  6412. [Mo.H5, Po.H5],
  6413. [Mo.H6, Po.H6],
  6414. [Mo.HEAD, Po.HEAD],
  6415. [Mo.HEADER, Po.HEADER],
  6416. [Mo.HGROUP, Po.HGROUP],
  6417. [Mo.HR, Po.HR],
  6418. [Mo.HTML, Po.HTML],
  6419. [Mo.I, Po.I],
  6420. [Mo.IMG, Po.IMG],
  6421. [Mo.IMAGE, Po.IMAGE],
  6422. [Mo.INPUT, Po.INPUT],
  6423. [Mo.IFRAME, Po.IFRAME],
  6424. [Mo.KEYGEN, Po.KEYGEN],
  6425. [Mo.LABEL, Po.LABEL],
  6426. [Mo.LI, Po.LI],
  6427. [Mo.LINK, Po.LINK],
  6428. [Mo.LISTING, Po.LISTING],
  6429. [Mo.MAIN, Po.MAIN],
  6430. [Mo.MALIGNMARK, Po.MALIGNMARK],
  6431. [Mo.MARQUEE, Po.MARQUEE],
  6432. [Mo.MATH, Po.MATH],
  6433. [Mo.MENU, Po.MENU],
  6434. [Mo.META, Po.META],
  6435. [Mo.MGLYPH, Po.MGLYPH],
  6436. [Mo.MI, Po.MI],
  6437. [Mo.MO, Po.MO],
  6438. [Mo.MN, Po.MN],
  6439. [Mo.MS, Po.MS],
  6440. [Mo.MTEXT, Po.MTEXT],
  6441. [Mo.NAV, Po.NAV],
  6442. [Mo.NOBR, Po.NOBR],
  6443. [Mo.NOFRAMES, Po.NOFRAMES],
  6444. [Mo.NOEMBED, Po.NOEMBED],
  6445. [Mo.NOSCRIPT, Po.NOSCRIPT],
  6446. [Mo.OBJECT, Po.OBJECT],
  6447. [Mo.OL, Po.OL],
  6448. [Mo.OPTGROUP, Po.OPTGROUP],
  6449. [Mo.OPTION, Po.OPTION],
  6450. [Mo.P, Po.P],
  6451. [Mo.PARAM, Po.PARAM],
  6452. [Mo.PLAINTEXT, Po.PLAINTEXT],
  6453. [Mo.PRE, Po.PRE],
  6454. [Mo.RB, Po.RB],
  6455. [Mo.RP, Po.RP],
  6456. [Mo.RT, Po.RT],
  6457. [Mo.RTC, Po.RTC],
  6458. [Mo.RUBY, Po.RUBY],
  6459. [Mo.S, Po.S],
  6460. [Mo.SCRIPT, Po.SCRIPT],
  6461. [Mo.SECTION, Po.SECTION],
  6462. [Mo.SELECT, Po.SELECT],
  6463. [Mo.SOURCE, Po.SOURCE],
  6464. [Mo.SMALL, Po.SMALL],
  6465. [Mo.SPAN, Po.SPAN],
  6466. [Mo.STRIKE, Po.STRIKE],
  6467. [Mo.STRONG, Po.STRONG],
  6468. [Mo.STYLE, Po.STYLE],
  6469. [Mo.SUB, Po.SUB],
  6470. [Mo.SUMMARY, Po.SUMMARY],
  6471. [Mo.SUP, Po.SUP],
  6472. [Mo.TABLE, Po.TABLE],
  6473. [Mo.TBODY, Po.TBODY],
  6474. [Mo.TEMPLATE, Po.TEMPLATE],
  6475. [Mo.TEXTAREA, Po.TEXTAREA],
  6476. [Mo.TFOOT, Po.TFOOT],
  6477. [Mo.TD, Po.TD],
  6478. [Mo.TH, Po.TH],
  6479. [Mo.THEAD, Po.THEAD],
  6480. [Mo.TITLE, Po.TITLE],
  6481. [Mo.TR, Po.TR],
  6482. [Mo.TRACK, Po.TRACK],
  6483. [Mo.TT, Po.TT],
  6484. [Mo.U, Po.U],
  6485. [Mo.UL, Po.UL],
  6486. [Mo.SVG, Po.SVG],
  6487. [Mo.VAR, Po.VAR],
  6488. [Mo.WBR, Po.WBR],
  6489. [Mo.XMP, Po.XMP]
  6490. ]);
  6491. function Fo(e) {
  6492. var t;
  6493. return null !== (t = Bo.get(e)) && void 0 !== t ? t : Po.UNKNOWN
  6494. }
  6495. const Uo = Po, Ho = {
  6496. [vo.HTML]: new Set([Uo.ADDRESS, Uo.APPLET, Uo.AREA, Uo.ARTICLE, Uo.ASIDE, Uo.BASE, Uo.BASEFONT, Uo.BGSOUND, Uo.BLOCKQUOTE, Uo.BODY, Uo.BR, Uo.BUTTON, Uo.CAPTION, Uo.CENTER, Uo.COL, Uo.COLGROUP, Uo.DD, Uo.DETAILS, Uo.DIR, Uo.DIV, Uo.DL, Uo.DT, Uo.EMBED, Uo.FIELDSET, Uo.FIGCAPTION, Uo.FIGURE, Uo.FOOTER, Uo.FORM, Uo.FRAME, Uo.FRAMESET, Uo.H1, Uo.H2, Uo.H3, Uo.H4, Uo.H5, Uo.H6, Uo.HEAD, Uo.HEADER, Uo.HGROUP, Uo.HR, Uo.HTML, Uo.IFRAME, Uo.IMG, Uo.INPUT, Uo.LI, Uo.LINK, Uo.LISTING, Uo.MAIN, Uo.MARQUEE, Uo.MENU, Uo.META, Uo.NAV, Uo.NOEMBED, Uo.NOFRAMES, Uo.NOSCRIPT, Uo.OBJECT, Uo.OL, Uo.P, Uo.PARAM, Uo.PLAINTEXT, Uo.PRE, Uo.SCRIPT, Uo.SECTION, Uo.SELECT, Uo.SOURCE, Uo.STYLE, Uo.SUMMARY, Uo.TABLE, Uo.TBODY, Uo.TD, Uo.TEMPLATE, Uo.TEXTAREA, Uo.TFOOT, Uo.TH, Uo.THEAD, Uo.TITLE, Uo.TR, Uo.TRACK, Uo.UL, Uo.WBR, Uo.XMP]),
  6497. [vo.MATHML]: new Set([Uo.MI, Uo.MO, Uo.MN, Uo.MS, Uo.MTEXT, Uo.ANNOTATION_XML]),
  6498. [vo.SVG]: new Set([Uo.TITLE, Uo.FOREIGN_OBJECT, Uo.DESC]),
  6499. [vo.XLINK]: new Set,
  6500. [vo.XML]: new Set,
  6501. [vo.XMLNS]: new Set
  6502. };
  6503. function Go(e) {
  6504. return e === Uo.H1 || e === Uo.H2 || e === Uo.H3 || e === Uo.H4 || e === Uo.H5 || e === Uo.H6
  6505. }
  6506. const Yo = new Set([Mo.STYLE, Mo.SCRIPT, Mo.XMP, Mo.IFRAME, Mo.NOEMBED, Mo.NOFRAMES, Mo.PLAINTEXT]);
  6507. const qo = new Map([
  6508. [128, 8364],
  6509. [130, 8218],
  6510. [131, 402],
  6511. [132, 8222],
  6512. [133, 8230],
  6513. [134, 8224],
  6514. [135, 8225],
  6515. [136, 710],
  6516. [137, 8240],
  6517. [138, 352],
  6518. [139, 8249],
  6519. [140, 338],
  6520. [142, 381],
  6521. [145, 8216],
  6522. [146, 8217],
  6523. [147, 8220],
  6524. [148, 8221],
  6525. [149, 8226],
  6526. [150, 8211],
  6527. [151, 8212],
  6528. [152, 732],
  6529. [153, 8482],
  6530. [154, 353],
  6531. [155, 8250],
  6532. [156, 339],
  6533. [158, 382],
  6534. [159, 376]
  6535. ]);
  6536. var Ko;
  6537. ! function(e) {
  6538. e[e.DATA = 0] = "DATA", e[e.RCDATA = 1] = "RCDATA", e[e.RAWTEXT = 2] = "RAWTEXT", e[e.SCRIPT_DATA = 3] = "SCRIPT_DATA", e[e.PLAINTEXT = 4] = "PLAINTEXT", e[e.TAG_OPEN = 5] = "TAG_OPEN", e[e.END_TAG_OPEN = 6] = "END_TAG_OPEN", e[e.TAG_NAME = 7] = "TAG_NAME", e[e.RCDATA_LESS_THAN_SIGN = 8] = "RCDATA_LESS_THAN_SIGN", e[e.RCDATA_END_TAG_OPEN = 9] = "RCDATA_END_TAG_OPEN", e[e.RCDATA_END_TAG_NAME = 10] = "RCDATA_END_TAG_NAME", e[e.RAWTEXT_LESS_THAN_SIGN = 11] = "RAWTEXT_LESS_THAN_SIGN", e[e.RAWTEXT_END_TAG_OPEN = 12] = "RAWTEXT_END_TAG_OPEN", e[e.RAWTEXT_END_TAG_NAME = 13] = "RAWTEXT_END_TAG_NAME", e[e.SCRIPT_DATA_LESS_THAN_SIGN = 14] = "SCRIPT_DATA_LESS_THAN_SIGN", e[e.SCRIPT_DATA_END_TAG_OPEN = 15] = "SCRIPT_DATA_END_TAG_OPEN", e[e.SCRIPT_DATA_END_TAG_NAME = 16] = "SCRIPT_DATA_END_TAG_NAME", e[e.SCRIPT_DATA_ESCAPE_START = 17] = "SCRIPT_DATA_ESCAPE_START", e[e.SCRIPT_DATA_ESCAPE_START_DASH = 18] = "SCRIPT_DATA_ESCAPE_START_DASH", e[e.SCRIPT_DATA_ESCAPED = 19] = "SCRIPT_DATA_ESCAPED", e[e.SCRIPT_DATA_ESCAPED_DASH = 20] = "SCRIPT_DATA_ESCAPED_DASH", e[e.SCRIPT_DATA_ESCAPED_DASH_DASH = 21] = "SCRIPT_DATA_ESCAPED_DASH_DASH", e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN = 22] = "SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN", e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN = 23] = "SCRIPT_DATA_ESCAPED_END_TAG_OPEN", e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME = 24] = "SCRIPT_DATA_ESCAPED_END_TAG_NAME", e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START = 25] = "SCRIPT_DATA_DOUBLE_ESCAPE_START", e[e.SCRIPT_DATA_DOUBLE_ESCAPED = 26] = "SCRIPT_DATA_DOUBLE_ESCAPED", e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH = 27] = "SCRIPT_DATA_DOUBLE_ESCAPED_DASH", e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH = 28] = "SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH", e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN = 29] = "SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN", e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END = 30] = "SCRIPT_DATA_DOUBLE_ESCAPE_END", e[e.BEFORE_ATTRIBUTE_NAME = 31] = "BEFORE_ATTRIBUTE_NAME", e[e.ATTRIBUTE_NAME = 32] = "ATTRIBUTE_NAME", e[e.AFTER_ATTRIBUTE_NAME = 33] = "AFTER_ATTRIBUTE_NAME", e[e.BEFORE_ATTRIBUTE_VALUE = 34] = "BEFORE_ATTRIBUTE_VALUE", e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED = 35] = "ATTRIBUTE_VALUE_DOUBLE_QUOTED", e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED = 36] = "ATTRIBUTE_VALUE_SINGLE_QUOTED", e[e.ATTRIBUTE_VALUE_UNQUOTED = 37] = "ATTRIBUTE_VALUE_UNQUOTED", e[e.AFTER_ATTRIBUTE_VALUE_QUOTED = 38] = "AFTER_ATTRIBUTE_VALUE_QUOTED", e[e.SELF_CLOSING_START_TAG = 39] = "SELF_CLOSING_START_TAG", e[e.BOGUS_COMMENT = 40] = "BOGUS_COMMENT", e[e.MARKUP_DECLARATION_OPEN = 41] = "MARKUP_DECLARATION_OPEN", e[e.COMMENT_START = 42] = "COMMENT_START", e[e.COMMENT_START_DASH = 43] = "COMMENT_START_DASH", e[e.COMMENT = 44] = "COMMENT", e[e.COMMENT_LESS_THAN_SIGN = 45] = "COMMENT_LESS_THAN_SIGN", e[e.COMMENT_LESS_THAN_SIGN_BANG = 46] = "COMMENT_LESS_THAN_SIGN_BANG", e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH = 47] = "COMMENT_LESS_THAN_SIGN_BANG_DASH", e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH = 48] = "COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH", e[e.COMMENT_END_DASH = 49] = "COMMENT_END_DASH", e[e.COMMENT_END = 50] = "COMMENT_END", e[e.COMMENT_END_BANG = 51] = "COMMENT_END_BANG", e[e.DOCTYPE = 52] = "DOCTYPE", e[e.BEFORE_DOCTYPE_NAME = 53] = "BEFORE_DOCTYPE_NAME", e[e.DOCTYPE_NAME = 54] = "DOCTYPE_NAME", e[e.AFTER_DOCTYPE_NAME = 55] = "AFTER_DOCTYPE_NAME", e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD = 56] = "AFTER_DOCTYPE_PUBLIC_KEYWORD", e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER = 57] = "BEFORE_DOCTYPE_PUBLIC_IDENTIFIER", e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED = 58] = "DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED", e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED = 59] = "DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED", e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER = 60] = "AFTER_DOCTYPE_PUBLIC_IDENTIFIER", e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS = 61] = "BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS", e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD = 62] = "AFTER_DOCTYPE_SYSTEM_KEYWORD", e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER = 63] = "BEFORE_DOCTYPE_SYSTEM_IDENTIFIER", e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED = 64] = "DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED", e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED = 65] = "DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED", e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER = 66] = "AFTER_DOCTYPE_SYSTEM_IDENTIFIER", e[e.BOGUS_DOCTYPE = 67] = "BOGUS_DOCTYPE", e[e.CDATA_SECTION = 68] = "CDATA_SECTION", e[e.CDATA_SECTION_BRACKET = 69] = "CDATA_SECTION_BRACKET", e[e.CDATA_SECTION_END = 70] = "CDATA_SECTION_END", e[e.CHARACTER_REFERENCE = 71] = "CHARACTER_REFERENCE", e[e.NAMED_CHARACTER_REFERENCE = 72] = "NAMED_CHARACTER_REFERENCE", e[e.AMBIGUOUS_AMPERSAND = 73] = "AMBIGUOUS_AMPERSAND", e[e.NUMERIC_CHARACTER_REFERENCE = 74] = "NUMERIC_CHARACTER_REFERENCE", e[e.HEXADEMICAL_CHARACTER_REFERENCE_START = 75] = "HEXADEMICAL_CHARACTER_REFERENCE_START", e[e.HEXADEMICAL_CHARACTER_REFERENCE = 76] = "HEXADEMICAL_CHARACTER_REFERENCE", e[e.DECIMAL_CHARACTER_REFERENCE = 77] = "DECIMAL_CHARACTER_REFERENCE", e[e.NUMERIC_CHARACTER_REFERENCE_END = 78] = "NUMERIC_CHARACTER_REFERENCE_END"
  6539. }(Ko || (Ko = {}));
  6540. const jo = {
  6541. DATA: Ko.DATA,
  6542. RCDATA: Ko.RCDATA,
  6543. RAWTEXT: Ko.RAWTEXT,
  6544. SCRIPT_DATA: Ko.SCRIPT_DATA,
  6545. PLAINTEXT: Ko.PLAINTEXT,
  6546. CDATA_SECTION: Ko.CDATA_SECTION
  6547. };
  6548. function Vo(e) {
  6549. return e >= io.DIGIT_0 && e <= io.DIGIT_9
  6550. }
  6551. function Wo(e) {
  6552. return e >= io.LATIN_CAPITAL_A && e <= io.LATIN_CAPITAL_Z
  6553. }
  6554. function Qo(e) {
  6555. return function(e) {
  6556. return e >= io.LATIN_SMALL_A && e <= io.LATIN_SMALL_Z
  6557. }(e) || Wo(e)
  6558. }
  6559. function Xo(e) {
  6560. return Qo(e) || Vo(e)
  6561. }
  6562. function $o(e) {
  6563. return e >= io.LATIN_CAPITAL_A && e <= io.LATIN_CAPITAL_F
  6564. }
  6565. function zo(e) {
  6566. return e >= io.LATIN_SMALL_A && e <= io.LATIN_SMALL_F
  6567. }
  6568. function Jo(e) {
  6569. return e + 32
  6570. }
  6571. function Zo(e) {
  6572. return e === io.SPACE || e === io.LINE_FEED || e === io.TABULATION || e === io.FORM_FEED
  6573. }
  6574. function ec(e) {
  6575. return Zo(e) || e === io.SOLIDUS || e === io.GREATER_THAN_SIGN
  6576. }
  6577. class tc {
  6578. constructor(e, t) {
  6579. this.options = e, this.handler = t, this.paused = !1, this.inLoop = !1, this.inForeignNode = !1, this.lastStartTagName = "", this.active = !1, this.state = Ko.DATA, this.returnState = Ko.DATA, this.charRefCode = -1, this.consumedAfterSnapshot = -1, this.currentCharacterToken = null, this.currentToken = null, this.currentAttr = {
  6580. name: "",
  6581. value: ""
  6582. }, this.preprocessor = new mo(t), this.currentLocation = this.getCurrentLocation(-1)
  6583. }
  6584. _err(e) {
  6585. var t, n;
  6586. null === (n = (t = this.handler).onParseError) || void 0 === n || n.call(t, this.preprocessor.getError(e))
  6587. }
  6588. getCurrentLocation(e) {
  6589. return this.options.sourceCodeLocationInfo ? {
  6590. startLine: this.preprocessor.line,
  6591. startCol: this.preprocessor.col - e,
  6592. startOffset: this.preprocessor.offset - e,
  6593. endLine: -1,
  6594. endCol: -1,
  6595. endOffset: -1
  6596. } : null
  6597. }
  6598. _runParsingLoop() {
  6599. if (!this.inLoop) {
  6600. for (this.inLoop = !0; this.active && !this.paused;) {
  6601. this.consumedAfterSnapshot = 0;
  6602. const e = this._consume();
  6603. this._ensureHibernation() || this._callState(e)
  6604. }
  6605. this.inLoop = !1
  6606. }
  6607. }
  6608. pause() {
  6609. this.paused = !0
  6610. }
  6611. resume(e) {
  6612. if (!this.paused) throw new Error("Parser was already resumed");
  6613. this.paused = !1, this.inLoop || (this._runParsingLoop(), this.paused || null == e || e())
  6614. }
  6615. write(e, t, n) {
  6616. this.active = !0, this.preprocessor.write(e, t), this._runParsingLoop(), this.paused || null == n || n()
  6617. }
  6618. insertHtmlAtCurrentPos(e) {
  6619. this.active = !0, this.preprocessor.insertHtmlAtCurrentPos(e), this._runParsingLoop()
  6620. }
  6621. _ensureHibernation() {
  6622. return !!this.preprocessor.endOfChunkHit && (this._unconsume(this.consumedAfterSnapshot), this.active = !1, !0)
  6623. }
  6624. _consume() {
  6625. return this.consumedAfterSnapshot++, this.preprocessor.advance()
  6626. }
  6627. _unconsume(e) {
  6628. this.consumedAfterSnapshot -= e, this.preprocessor.retreat(e)
  6629. }
  6630. _reconsumeInState(e, t) {
  6631. this.state = e, this._callState(t)
  6632. }
  6633. _advanceBy(e) {
  6634. this.consumedAfterSnapshot += e;
  6635. for (let t = 0; t < e; t++) this.preprocessor.advance()
  6636. }
  6637. _consumeSequenceIfMatch(e, t) {
  6638. return !!this.preprocessor.startsWith(e, t) && (this._advanceBy(e.length - 1), !0)
  6639. }
  6640. _createStartTagToken() {
  6641. this.currentToken = {
  6642. type: To.START_TAG,
  6643. tagName: "",
  6644. tagID: Po.UNKNOWN,
  6645. selfClosing: !1,
  6646. ackSelfClosing: !1,
  6647. attrs: [],
  6648. location: this.getCurrentLocation(1)
  6649. }
  6650. }
  6651. _createEndTagToken() {
  6652. this.currentToken = {
  6653. type: To.END_TAG,
  6654. tagName: "",
  6655. tagID: Po.UNKNOWN,
  6656. selfClosing: !1,
  6657. ackSelfClosing: !1,
  6658. attrs: [],
  6659. location: this.getCurrentLocation(2)
  6660. }
  6661. }
  6662. _createCommentToken(e) {
  6663. this.currentToken = {
  6664. type: To.COMMENT,
  6665. data: "",
  6666. location: this.getCurrentLocation(e)
  6667. }
  6668. }
  6669. _createDoctypeToken(e) {
  6670. this.currentToken = {
  6671. type: To.DOCTYPE,
  6672. name: e,
  6673. forceQuirks: !1,
  6674. publicId: null,
  6675. systemId: null,
  6676. location: this.currentLocation
  6677. }
  6678. }
  6679. _createCharacterToken(e, t) {
  6680. this.currentCharacterToken = {
  6681. type: e,
  6682. chars: t,
  6683. location: this.currentLocation
  6684. }
  6685. }
  6686. _createAttr(e) {
  6687. this.currentAttr = {
  6688. name: e,
  6689. value: ""
  6690. }, this.currentLocation = this.getCurrentLocation(0)
  6691. }
  6692. _leaveAttrName() {
  6693. var e, t;
  6694. const n = this.currentToken;
  6695. if (null === _o(n, this.currentAttr.name)) {
  6696. if (n.attrs.push(this.currentAttr), n.location && this.currentLocation) {
  6697. (null !== (e = (t = n.location).attrs) && void 0 !== e ? e : t.attrs = Object.create(null))[this.currentAttr.name] = this.currentLocation, this._leaveAttrValue()
  6698. }
  6699. } else this._err(Eo.duplicateAttribute)
  6700. }
  6701. _leaveAttrValue() {
  6702. this.currentLocation && (this.currentLocation.endLine = this.preprocessor.line, this.currentLocation.endCol = this.preprocessor.col, this.currentLocation.endOffset = this.preprocessor.offset)
  6703. }
  6704. prepareToken(e) {
  6705. this._emitCurrentCharacterToken(e.location), this.currentToken = null, e.location && (e.location.endLine = this.preprocessor.line, e.location.endCol = this.preprocessor.col + 1, e.location.endOffset = this.preprocessor.offset + 1), this.currentLocation = this.getCurrentLocation(-1)
  6706. }
  6707. emitCurrentTagToken() {
  6708. const e = this.currentToken;
  6709. this.prepareToken(e), e.tagID = Fo(e.tagName), e.type === To.START_TAG ? (this.lastStartTagName = e.tagName, this.handler.onStartTag(e)) : (e.attrs.length > 0 && this._err(Eo.endTagWithAttributes), e.selfClosing && this._err(Eo.endTagWithTrailingSolidus), this.handler.onEndTag(e)), this.preprocessor.dropParsedChunk()
  6710. }
  6711. emitCurrentComment(e) {
  6712. this.prepareToken(e), this.handler.onComment(e), this.preprocessor.dropParsedChunk()
  6713. }
  6714. emitCurrentDoctype(e) {
  6715. this.prepareToken(e), this.handler.onDoctype(e), this.preprocessor.dropParsedChunk()
  6716. }
  6717. _emitCurrentCharacterToken(e) {
  6718. if (this.currentCharacterToken) {
  6719. switch (e && this.currentCharacterToken.location && (this.currentCharacterToken.location.endLine = e.startLine, this.currentCharacterToken.location.endCol = e.startCol, this.currentCharacterToken.location.endOffset = e.startOffset), this.currentCharacterToken.type) {
  6720. case To.CHARACTER:
  6721. this.handler.onCharacter(this.currentCharacterToken);
  6722. break;
  6723. case To.NULL_CHARACTER:
  6724. this.handler.onNullCharacter(this.currentCharacterToken);
  6725. break;
  6726. case To.WHITESPACE_CHARACTER:
  6727. this.handler.onWhitespaceCharacter(this.currentCharacterToken)
  6728. }
  6729. this.currentCharacterToken = null
  6730. }
  6731. }
  6732. _emitEOFToken() {
  6733. const e = this.getCurrentLocation(0);
  6734. e && (e.endLine = e.startLine, e.endCol = e.startCol, e.endOffset = e.startOffset), this._emitCurrentCharacterToken(e), this.handler.onEof({
  6735. type: To.EOF,
  6736. location: e
  6737. }), this.active = !1
  6738. }
  6739. _appendCharToCurrentCharacterToken(e, t) {
  6740. if (this.currentCharacterToken) {
  6741. if (this.currentCharacterToken.type === e) return void(this.currentCharacterToken.chars += t);
  6742. this.currentLocation = this.getCurrentLocation(0), this._emitCurrentCharacterToken(this.currentLocation), this.preprocessor.dropParsedChunk()
  6743. }
  6744. this._createCharacterToken(e, t)
  6745. }
  6746. _emitCodePoint(e) {
  6747. const t = Zo(e) ? To.WHITESPACE_CHARACTER : e === io.NULL ? To.NULL_CHARACTER : To.CHARACTER;
  6748. this._appendCharToCurrentCharacterToken(t, String.fromCodePoint(e))
  6749. }
  6750. _emitChars(e) {
  6751. this._appendCharToCurrentCharacterToken(To.CHARACTER, e)
  6752. }
  6753. _matchNamedCharacterReference(e) {
  6754. let t = null, n = 0, r = !1;
  6755. for (let s = 0, a = wo[0]; s >= 0 && (s = Oo(wo, a, s + 1, e), !(s < 0)); e = this._consume()) {
  6756. n += 1, a = wo[s];
  6757. const o = a & yo.VALUE_LENGTH;
  6758. if (o) {
  6759. const a = (o >> 14) - 1;
  6760. if (e !== io.SEMICOLON && this._isCharacterReferenceInAttribute() && ((i = this.preprocessor.peek(1)) === io.EQUALS_SIGN || Xo(i)) ? (t = [io.AMPERSAND], s += a) : (t = 0 === a ? [wo[s] & ~yo.VALUE_LENGTH] : 1 === a ? [wo[++s]] : [wo[++s], wo[++s]], n = 0, r = e !== io.SEMICOLON), 0 === a) {
  6761. this._consume();
  6762. break
  6763. }
  6764. }
  6765. }
  6766. var i;
  6767. return this._unconsume(n), r && !this.preprocessor.endOfChunkHit && this._err(Eo.missingSemicolonAfterCharacterReference), this._unconsume(1), t
  6768. }
  6769. _isCharacterReferenceInAttribute() {
  6770. return this.returnState === Ko.ATTRIBUTE_VALUE_DOUBLE_QUOTED || this.returnState === Ko.ATTRIBUTE_VALUE_SINGLE_QUOTED || this.returnState === Ko.ATTRIBUTE_VALUE_UNQUOTED
  6771. }
  6772. _flushCodePointConsumedAsCharacterReference(e) {
  6773. this._isCharacterReferenceInAttribute() ? this.currentAttr.value += String.fromCodePoint(e) : this._emitCodePoint(e)
  6774. }
  6775. _callState(e) {
  6776. switch (this.state) {
  6777. case Ko.DATA:
  6778. this._stateData(e);
  6779. break;
  6780. case Ko.RCDATA:
  6781. this._stateRcdata(e);
  6782. break;
  6783. case Ko.RAWTEXT:
  6784. this._stateRawtext(e);
  6785. break;
  6786. case Ko.SCRIPT_DATA:
  6787. this._stateScriptData(e);
  6788. break;
  6789. case Ko.PLAINTEXT:
  6790. this._statePlaintext(e);
  6791. break;
  6792. case Ko.TAG_OPEN:
  6793. this._stateTagOpen(e);
  6794. break;
  6795. case Ko.END_TAG_OPEN:
  6796. this._stateEndTagOpen(e);
  6797. break;
  6798. case Ko.TAG_NAME:
  6799. this._stateTagName(e);
  6800. break;
  6801. case Ko.RCDATA_LESS_THAN_SIGN:
  6802. this._stateRcdataLessThanSign(e);
  6803. break;
  6804. case Ko.RCDATA_END_TAG_OPEN:
  6805. this._stateRcdataEndTagOpen(e);
  6806. break;
  6807. case Ko.RCDATA_END_TAG_NAME:
  6808. this._stateRcdataEndTagName(e);
  6809. break;
  6810. case Ko.RAWTEXT_LESS_THAN_SIGN:
  6811. this._stateRawtextLessThanSign(e);
  6812. break;
  6813. case Ko.RAWTEXT_END_TAG_OPEN:
  6814. this._stateRawtextEndTagOpen(e);
  6815. break;
  6816. case Ko.RAWTEXT_END_TAG_NAME:
  6817. this._stateRawtextEndTagName(e);
  6818. break;
  6819. case Ko.SCRIPT_DATA_LESS_THAN_SIGN:
  6820. this._stateScriptDataLessThanSign(e);
  6821. break;
  6822. case Ko.SCRIPT_DATA_END_TAG_OPEN:
  6823. this._stateScriptDataEndTagOpen(e);
  6824. break;
  6825. case Ko.SCRIPT_DATA_END_TAG_NAME:
  6826. this._stateScriptDataEndTagName(e);
  6827. break;
  6828. case Ko.SCRIPT_DATA_ESCAPE_START:
  6829. this._stateScriptDataEscapeStart(e);
  6830. break;
  6831. case Ko.SCRIPT_DATA_ESCAPE_START_DASH:
  6832. this._stateScriptDataEscapeStartDash(e);
  6833. break;
  6834. case Ko.SCRIPT_DATA_ESCAPED:
  6835. this._stateScriptDataEscaped(e);
  6836. break;
  6837. case Ko.SCRIPT_DATA_ESCAPED_DASH:
  6838. this._stateScriptDataEscapedDash(e);
  6839. break;
  6840. case Ko.SCRIPT_DATA_ESCAPED_DASH_DASH:
  6841. this._stateScriptDataEscapedDashDash(e);
  6842. break;
  6843. case Ko.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:
  6844. this._stateScriptDataEscapedLessThanSign(e);
  6845. break;
  6846. case Ko.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:
  6847. this._stateScriptDataEscapedEndTagOpen(e);
  6848. break;
  6849. case Ko.SCRIPT_DATA_ESCAPED_END_TAG_NAME:
  6850. this._stateScriptDataEscapedEndTagName(e);
  6851. break;
  6852. case Ko.SCRIPT_DATA_DOUBLE_ESCAPE_START:
  6853. this._stateScriptDataDoubleEscapeStart(e);
  6854. break;
  6855. case Ko.SCRIPT_DATA_DOUBLE_ESCAPED:
  6856. this._stateScriptDataDoubleEscaped(e);
  6857. break;
  6858. case Ko.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:
  6859. this._stateScriptDataDoubleEscapedDash(e);
  6860. break;
  6861. case Ko.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:
  6862. this._stateScriptDataDoubleEscapedDashDash(e);
  6863. break;
  6864. case Ko.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:
  6865. this._stateScriptDataDoubleEscapedLessThanSign(e);
  6866. break;
  6867. case Ko.SCRIPT_DATA_DOUBLE_ESCAPE_END:
  6868. this._stateScriptDataDoubleEscapeEnd(e);
  6869. break;
  6870. case Ko.BEFORE_ATTRIBUTE_NAME:
  6871. this._stateBeforeAttributeName(e);
  6872. break;
  6873. case Ko.ATTRIBUTE_NAME:
  6874. this._stateAttributeName(e);
  6875. break;
  6876. case Ko.AFTER_ATTRIBUTE_NAME:
  6877. this._stateAfterAttributeName(e);
  6878. break;
  6879. case Ko.BEFORE_ATTRIBUTE_VALUE:
  6880. this._stateBeforeAttributeValue(e);
  6881. break;
  6882. case Ko.ATTRIBUTE_VALUE_DOUBLE_QUOTED:
  6883. this._stateAttributeValueDoubleQuoted(e);
  6884. break;
  6885. case Ko.ATTRIBUTE_VALUE_SINGLE_QUOTED:
  6886. this._stateAttributeValueSingleQuoted(e);
  6887. break;
  6888. case Ko.ATTRIBUTE_VALUE_UNQUOTED:
  6889. this._stateAttributeValueUnquoted(e);
  6890. break;
  6891. case Ko.AFTER_ATTRIBUTE_VALUE_QUOTED:
  6892. this._stateAfterAttributeValueQuoted(e);
  6893. break;
  6894. case Ko.SELF_CLOSING_START_TAG:
  6895. this._stateSelfClosingStartTag(e);
  6896. break;
  6897. case Ko.BOGUS_COMMENT:
  6898. this._stateBogusComment(e);
  6899. break;
  6900. case Ko.MARKUP_DECLARATION_OPEN:
  6901. this._stateMarkupDeclarationOpen(e);
  6902. break;
  6903. case Ko.COMMENT_START:
  6904. this._stateCommentStart(e);
  6905. break;
  6906. case Ko.COMMENT_START_DASH:
  6907. this._stateCommentStartDash(e);
  6908. break;
  6909. case Ko.COMMENT:
  6910. this._stateComment(e);
  6911. break;
  6912. case Ko.COMMENT_LESS_THAN_SIGN:
  6913. this._stateCommentLessThanSign(e);
  6914. break;
  6915. case Ko.COMMENT_LESS_THAN_SIGN_BANG:
  6916. this._stateCommentLessThanSignBang(e);
  6917. break;
  6918. case Ko.COMMENT_LESS_THAN_SIGN_BANG_DASH:
  6919. this._stateCommentLessThanSignBangDash(e);
  6920. break;
  6921. case Ko.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:
  6922. this._stateCommentLessThanSignBangDashDash(e);
  6923. break;
  6924. case Ko.COMMENT_END_DASH:
  6925. this._stateCommentEndDash(e);
  6926. break;
  6927. case Ko.COMMENT_END:
  6928. this._stateCommentEnd(e);
  6929. break;
  6930. case Ko.COMMENT_END_BANG:
  6931. this._stateCommentEndBang(e);
  6932. break;
  6933. case Ko.DOCTYPE:
  6934. this._stateDoctype(e);
  6935. break;
  6936. case Ko.BEFORE_DOCTYPE_NAME:
  6937. this._stateBeforeDoctypeName(e);
  6938. break;
  6939. case Ko.DOCTYPE_NAME:
  6940. this._stateDoctypeName(e);
  6941. break;
  6942. case Ko.AFTER_DOCTYPE_NAME:
  6943. this._stateAfterDoctypeName(e);
  6944. break;
  6945. case Ko.AFTER_DOCTYPE_PUBLIC_KEYWORD:
  6946. this._stateAfterDoctypePublicKeyword(e);
  6947. break;
  6948. case Ko.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:
  6949. this._stateBeforeDoctypePublicIdentifier(e);
  6950. break;
  6951. case Ko.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:
  6952. this._stateDoctypePublicIdentifierDoubleQuoted(e);
  6953. break;
  6954. case Ko.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:
  6955. this._stateDoctypePublicIdentifierSingleQuoted(e);
  6956. break;
  6957. case Ko.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:
  6958. this._stateAfterDoctypePublicIdentifier(e);
  6959. break;
  6960. case Ko.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:
  6961. this._stateBetweenDoctypePublicAndSystemIdentifiers(e);
  6962. break;
  6963. case Ko.AFTER_DOCTYPE_SYSTEM_KEYWORD:
  6964. this._stateAfterDoctypeSystemKeyword(e);
  6965. break;
  6966. case Ko.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:
  6967. this._stateBeforeDoctypeSystemIdentifier(e);
  6968. break;
  6969. case Ko.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:
  6970. this._stateDoctypeSystemIdentifierDoubleQuoted(e);
  6971. break;
  6972. case Ko.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:
  6973. this._stateDoctypeSystemIdentifierSingleQuoted(e);
  6974. break;
  6975. case Ko.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:
  6976. this._stateAfterDoctypeSystemIdentifier(e);
  6977. break;
  6978. case Ko.BOGUS_DOCTYPE:
  6979. this._stateBogusDoctype(e);
  6980. break;
  6981. case Ko.CDATA_SECTION:
  6982. this._stateCdataSection(e);
  6983. break;
  6984. case Ko.CDATA_SECTION_BRACKET:
  6985. this._stateCdataSectionBracket(e);
  6986. break;
  6987. case Ko.CDATA_SECTION_END:
  6988. this._stateCdataSectionEnd(e);
  6989. break;
  6990. case Ko.CHARACTER_REFERENCE:
  6991. this._stateCharacterReference(e);
  6992. break;
  6993. case Ko.NAMED_CHARACTER_REFERENCE:
  6994. this._stateNamedCharacterReference(e);
  6995. break;
  6996. case Ko.AMBIGUOUS_AMPERSAND:
  6997. this._stateAmbiguousAmpersand(e);
  6998. break;
  6999. case Ko.NUMERIC_CHARACTER_REFERENCE:
  7000. this._stateNumericCharacterReference(e);
  7001. break;
  7002. case Ko.HEXADEMICAL_CHARACTER_REFERENCE_START:
  7003. this._stateHexademicalCharacterReferenceStart(e);
  7004. break;
  7005. case Ko.HEXADEMICAL_CHARACTER_REFERENCE:
  7006. this._stateHexademicalCharacterReference(e);
  7007. break;
  7008. case Ko.DECIMAL_CHARACTER_REFERENCE:
  7009. this._stateDecimalCharacterReference(e);
  7010. break;
  7011. case Ko.NUMERIC_CHARACTER_REFERENCE_END:
  7012. this._stateNumericCharacterReferenceEnd(e);
  7013. break;
  7014. default:
  7015. throw new Error("Unknown state")
  7016. }
  7017. }
  7018. _stateData(e) {
  7019. switch (e) {
  7020. case io.LESS_THAN_SIGN:
  7021. this.state = Ko.TAG_OPEN;
  7022. break;
  7023. case io.AMPERSAND:
  7024. this.returnState = Ko.DATA, this.state = Ko.CHARACTER_REFERENCE;
  7025. break;
  7026. case io.NULL:
  7027. this._err(Eo.unexpectedNullCharacter), this._emitCodePoint(e);
  7028. break;
  7029. case io.EOF:
  7030. this._emitEOFToken();
  7031. break;
  7032. default:
  7033. this._emitCodePoint(e)
  7034. }
  7035. }
  7036. _stateRcdata(e) {
  7037. switch (e) {
  7038. case io.AMPERSAND:
  7039. this.returnState = Ko.RCDATA, this.state = Ko.CHARACTER_REFERENCE;
  7040. break;
  7041. case io.LESS_THAN_SIGN:
  7042. this.state = Ko.RCDATA_LESS_THAN_SIGN;
  7043. break;
  7044. case io.NULL:
  7045. this._err(Eo.unexpectedNullCharacter), this._emitChars("�");
  7046. break;
  7047. case io.EOF:
  7048. this._emitEOFToken();
  7049. break;
  7050. default:
  7051. this._emitCodePoint(e)
  7052. }
  7053. }
  7054. _stateRawtext(e) {
  7055. switch (e) {
  7056. case io.LESS_THAN_SIGN:
  7057. this.state = Ko.RAWTEXT_LESS_THAN_SIGN;
  7058. break;
  7059. case io.NULL:
  7060. this._err(Eo.unexpectedNullCharacter), this._emitChars("�");
  7061. break;
  7062. case io.EOF:
  7063. this._emitEOFToken();
  7064. break;
  7065. default:
  7066. this._emitCodePoint(e)
  7067. }
  7068. }
  7069. _stateScriptData(e) {
  7070. switch (e) {
  7071. case io.LESS_THAN_SIGN:
  7072. this.state = Ko.SCRIPT_DATA_LESS_THAN_SIGN;
  7073. break;
  7074. case io.NULL:
  7075. this._err(Eo.unexpectedNullCharacter), this._emitChars("�");
  7076. break;
  7077. case io.EOF:
  7078. this._emitEOFToken();
  7079. break;
  7080. default:
  7081. this._emitCodePoint(e)
  7082. }
  7083. }
  7084. _statePlaintext(e) {
  7085. switch (e) {
  7086. case io.NULL:
  7087. this._err(Eo.unexpectedNullCharacter), this._emitChars("�");
  7088. break;
  7089. case io.EOF:
  7090. this._emitEOFToken();
  7091. break;
  7092. default:
  7093. this._emitCodePoint(e)
  7094. }
  7095. }
  7096. _stateTagOpen(e) {
  7097. if (Qo(e)) this._createStartTagToken(), this.state = Ko.TAG_NAME, this._stateTagName(e);
  7098. else switch (e) {
  7099. case io.EXCLAMATION_MARK:
  7100. this.state = Ko.MARKUP_DECLARATION_OPEN;
  7101. break;
  7102. case io.SOLIDUS:
  7103. this.state = Ko.END_TAG_OPEN;
  7104. break;
  7105. case io.QUESTION_MARK:
  7106. this._err(Eo.unexpectedQuestionMarkInsteadOfTagName), this._createCommentToken(1), this.state = Ko.BOGUS_COMMENT, this._stateBogusComment(e);
  7107. break;
  7108. case io.EOF:
  7109. this._err(Eo.eofBeforeTagName), this._emitChars("<"), this._emitEOFToken();
  7110. break;
  7111. default:
  7112. this._err(Eo.invalidFirstCharacterOfTagName), this._emitChars("<"), this.state = Ko.DATA, this._stateData(e)
  7113. }
  7114. }
  7115. _stateEndTagOpen(e) {
  7116. if (Qo(e)) this._createEndTagToken(), this.state = Ko.TAG_NAME, this._stateTagName(e);
  7117. else switch (e) {
  7118. case io.GREATER_THAN_SIGN:
  7119. this._err(Eo.missingEndTagName), this.state = Ko.DATA;
  7120. break;
  7121. case io.EOF:
  7122. this._err(Eo.eofBeforeTagName), this._emitChars("</"), this._emitEOFToken();
  7123. break;
  7124. default:
  7125. this._err(Eo.invalidFirstCharacterOfTagName), this._createCommentToken(2), this.state = Ko.BOGUS_COMMENT, this._stateBogusComment(e)
  7126. }
  7127. }
  7128. _stateTagName(e) {
  7129. const t = this.currentToken;
  7130. switch (e) {
  7131. case io.SPACE:
  7132. case io.LINE_FEED:
  7133. case io.TABULATION:
  7134. case io.FORM_FEED:
  7135. this.state = Ko.BEFORE_ATTRIBUTE_NAME;
  7136. break;
  7137. case io.SOLIDUS:
  7138. this.state = Ko.SELF_CLOSING_START_TAG;
  7139. break;
  7140. case io.GREATER_THAN_SIGN:
  7141. this.state = Ko.DATA, this.emitCurrentTagToken();
  7142. break;
  7143. case io.NULL:
  7144. this._err(Eo.unexpectedNullCharacter), t.tagName += "�";
  7145. break;
  7146. case io.EOF:
  7147. this._err(Eo.eofInTag), this._emitEOFToken();
  7148. break;
  7149. default:
  7150. t.tagName += String.fromCodePoint(Wo(e) ? Jo(e) : e)
  7151. }
  7152. }
  7153. _stateRcdataLessThanSign(e) {
  7154. e === io.SOLIDUS ? this.state = Ko.RCDATA_END_TAG_OPEN : (this._emitChars("<"), this.state = Ko.RCDATA, this._stateRcdata(e))
  7155. }
  7156. _stateRcdataEndTagOpen(e) {
  7157. Qo(e) ? (this.state = Ko.RCDATA_END_TAG_NAME, this._stateRcdataEndTagName(e)) : (this._emitChars("</"), this.state = Ko.RCDATA, this._stateRcdata(e))
  7158. }
  7159. handleSpecialEndTag(e) {
  7160. if (!this.preprocessor.startsWith(this.lastStartTagName, !1)) return !this._ensureHibernation();
  7161. this._createEndTagToken();
  7162. this.currentToken.tagName = this.lastStartTagName;
  7163. switch (this.preprocessor.peek(this.lastStartTagName.length)) {
  7164. case io.SPACE:
  7165. case io.LINE_FEED:
  7166. case io.TABULATION:
  7167. case io.FORM_FEED:
  7168. return this._advanceBy(this.lastStartTagName.length), this.state = Ko.BEFORE_ATTRIBUTE_NAME, !1;
  7169. case io.SOLIDUS:
  7170. return this._advanceBy(this.lastStartTagName.length), this.state = Ko.SELF_CLOSING_START_TAG, !1;
  7171. case io.GREATER_THAN_SIGN:
  7172. return this._advanceBy(this.lastStartTagName.length), this.emitCurrentTagToken(), this.state = Ko.DATA, !1;
  7173. default:
  7174. return !this._ensureHibernation()
  7175. }
  7176. }
  7177. _stateRcdataEndTagName(e) {
  7178. this.handleSpecialEndTag(e) && (this._emitChars("</"), this.state = Ko.RCDATA, this._stateRcdata(e))
  7179. }
  7180. _stateRawtextLessThanSign(e) {
  7181. e === io.SOLIDUS ? this.state = Ko.RAWTEXT_END_TAG_OPEN : (this._emitChars("<"), this.state = Ko.RAWTEXT, this._stateRawtext(e))
  7182. }
  7183. _stateRawtextEndTagOpen(e) {
  7184. Qo(e) ? (this.state = Ko.RAWTEXT_END_TAG_NAME, this._stateRawtextEndTagName(e)) : (this._emitChars("</"), this.state = Ko.RAWTEXT, this._stateRawtext(e))
  7185. }
  7186. _stateRawtextEndTagName(e) {
  7187. this.handleSpecialEndTag(e) && (this._emitChars("</"), this.state = Ko.RAWTEXT, this._stateRawtext(e))
  7188. }
  7189. _stateScriptDataLessThanSign(e) {
  7190. switch (e) {
  7191. case io.SOLIDUS:
  7192. this.state = Ko.SCRIPT_DATA_END_TAG_OPEN;
  7193. break;
  7194. case io.EXCLAMATION_MARK:
  7195. this.state = Ko.SCRIPT_DATA_ESCAPE_START, this._emitChars("<!");
  7196. break;
  7197. default:
  7198. this._emitChars("<"), this.state = Ko.SCRIPT_DATA, this._stateScriptData(e)
  7199. }
  7200. }
  7201. _stateScriptDataEndTagOpen(e) {
  7202. Qo(e) ? (this.state = Ko.SCRIPT_DATA_END_TAG_NAME, this._stateScriptDataEndTagName(e)) : (this._emitChars("</"), this.state = Ko.SCRIPT_DATA, this._stateScriptData(e))
  7203. }
  7204. _stateScriptDataEndTagName(e) {
  7205. this.handleSpecialEndTag(e) && (this._emitChars("</"), this.state = Ko.SCRIPT_DATA, this._stateScriptData(e))
  7206. }
  7207. _stateScriptDataEscapeStart(e) {
  7208. e === io.HYPHEN_MINUS ? (this.state = Ko.SCRIPT_DATA_ESCAPE_START_DASH, this._emitChars("-")) : (this.state = Ko.SCRIPT_DATA, this._stateScriptData(e))
  7209. }
  7210. _stateScriptDataEscapeStartDash(e) {
  7211. e === io.HYPHEN_MINUS ? (this.state = Ko.SCRIPT_DATA_ESCAPED_DASH_DASH, this._emitChars("-")) : (this.state = Ko.SCRIPT_DATA, this._stateScriptData(e))
  7212. }
  7213. _stateScriptDataEscaped(e) {
  7214. switch (e) {
  7215. case io.HYPHEN_MINUS:
  7216. this.state = Ko.SCRIPT_DATA_ESCAPED_DASH, this._emitChars("-");
  7217. break;
  7218. case io.LESS_THAN_SIGN:
  7219. this.state = Ko.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;
  7220. break;
  7221. case io.NULL:
  7222. this._err(Eo.unexpectedNullCharacter), this._emitChars("�");
  7223. break;
  7224. case io.EOF:
  7225. this._err(Eo.eofInScriptHtmlCommentLikeText), this._emitEOFToken();
  7226. break;
  7227. default:
  7228. this._emitCodePoint(e)
  7229. }
  7230. }
  7231. _stateScriptDataEscapedDash(e) {
  7232. switch (e) {
  7233. case io.HYPHEN_MINUS:
  7234. this.state = Ko.SCRIPT_DATA_ESCAPED_DASH_DASH, this._emitChars("-");
  7235. break;
  7236. case io.LESS_THAN_SIGN:
  7237. this.state = Ko.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;
  7238. break;
  7239. case io.NULL:
  7240. this._err(Eo.unexpectedNullCharacter), this.state = Ko.SCRIPT_DATA_ESCAPED, this._emitChars("�");
  7241. break;
  7242. case io.EOF:
  7243. this._err(Eo.eofInScriptHtmlCommentLikeText), this._emitEOFToken();
  7244. break;
  7245. default:
  7246. this.state = Ko.SCRIPT_DATA_ESCAPED, this._emitCodePoint(e)
  7247. }
  7248. }
  7249. _stateScriptDataEscapedDashDash(e) {
  7250. switch (e) {
  7251. case io.HYPHEN_MINUS:
  7252. this._emitChars("-");
  7253. break;
  7254. case io.LESS_THAN_SIGN:
  7255. this.state = Ko.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;
  7256. break;
  7257. case io.GREATER_THAN_SIGN:
  7258. this.state = Ko.SCRIPT_DATA, this._emitChars(">");
  7259. break;
  7260. case io.NULL:
  7261. this._err(Eo.unexpectedNullCharacter), this.state = Ko.SCRIPT_DATA_ESCAPED, this._emitChars("�");
  7262. break;
  7263. case io.EOF:
  7264. this._err(Eo.eofInScriptHtmlCommentLikeText), this._emitEOFToken();
  7265. break;
  7266. default:
  7267. this.state = Ko.SCRIPT_DATA_ESCAPED, this._emitCodePoint(e)
  7268. }
  7269. }
  7270. _stateScriptDataEscapedLessThanSign(e) {
  7271. e === io.SOLIDUS ? this.state = Ko.SCRIPT_DATA_ESCAPED_END_TAG_OPEN : Qo(e) ? (this._emitChars("<"), this.state = Ko.SCRIPT_DATA_DOUBLE_ESCAPE_START, this._stateScriptDataDoubleEscapeStart(e)) : (this._emitChars("<"), this.state = Ko.SCRIPT_DATA_ESCAPED, this._stateScriptDataEscaped(e))
  7272. }
  7273. _stateScriptDataEscapedEndTagOpen(e) {
  7274. Qo(e) ? (this.state = Ko.SCRIPT_DATA_ESCAPED_END_TAG_NAME, this._stateScriptDataEscapedEndTagName(e)) : (this._emitChars("</"), this.state = Ko.SCRIPT_DATA_ESCAPED, this._stateScriptDataEscaped(e))
  7275. }
  7276. _stateScriptDataEscapedEndTagName(e) {
  7277. this.handleSpecialEndTag(e) && (this._emitChars("</"), this.state = Ko.SCRIPT_DATA_ESCAPED, this._stateScriptDataEscaped(e))
  7278. }
  7279. _stateScriptDataDoubleEscapeStart(e) {
  7280. if (this.preprocessor.startsWith(co, !1) && ec(this.preprocessor.peek(co.length))) {
  7281. this._emitCodePoint(e);
  7282. for (let e = 0; e < co.length; e++) this._emitCodePoint(this._consume());
  7283. this.state = Ko.SCRIPT_DATA_DOUBLE_ESCAPED
  7284. } else this._ensureHibernation() || (this.state = Ko.SCRIPT_DATA_ESCAPED, this._stateScriptDataEscaped(e))
  7285. }
  7286. _stateScriptDataDoubleEscaped(e) {
  7287. switch (e) {
  7288. case io.HYPHEN_MINUS:
  7289. this.state = Ko.SCRIPT_DATA_DOUBLE_ESCAPED_DASH, this._emitChars("-");
  7290. break;
  7291. case io.LESS_THAN_SIGN:
  7292. this.state = Ko.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN, this._emitChars("<");
  7293. break;
  7294. case io.NULL:
  7295. this._err(Eo.unexpectedNullCharacter), this._emitChars("�");
  7296. break;
  7297. case io.EOF:
  7298. this._err(Eo.eofInScriptHtmlCommentLikeText), this._emitEOFToken();
  7299. break;
  7300. default:
  7301. this._emitCodePoint(e)
  7302. }
  7303. }
  7304. _stateScriptDataDoubleEscapedDash(e) {
  7305. switch (e) {
  7306. case io.HYPHEN_MINUS:
  7307. this.state = Ko.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH, this._emitChars("-");
  7308. break;
  7309. case io.LESS_THAN_SIGN:
  7310. this.state = Ko.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN, this._emitChars("<");
  7311. break;
  7312. case io.NULL:
  7313. this._err(Eo.unexpectedNullCharacter), this.state = Ko.SCRIPT_DATA_DOUBLE_ESCAPED, this._emitChars("�");
  7314. break;
  7315. case io.EOF:
  7316. this._err(Eo.eofInScriptHtmlCommentLikeText), this._emitEOFToken();
  7317. break;
  7318. default:
  7319. this.state = Ko.SCRIPT_DATA_DOUBLE_ESCAPED, this._emitCodePoint(e)
  7320. }
  7321. }
  7322. _stateScriptDataDoubleEscapedDashDash(e) {
  7323. switch (e) {
  7324. case io.HYPHEN_MINUS:
  7325. this._emitChars("-");
  7326. break;
  7327. case io.LESS_THAN_SIGN:
  7328. this.state = Ko.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN, this._emitChars("<");
  7329. break;
  7330. case io.GREATER_THAN_SIGN:
  7331. this.state = Ko.SCRIPT_DATA, this._emitChars(">");
  7332. break;
  7333. case io.NULL:
  7334. this._err(Eo.unexpectedNullCharacter), this.state = Ko.SCRIPT_DATA_DOUBLE_ESCAPED, this._emitChars("�");
  7335. break;
  7336. case io.EOF:
  7337. this._err(Eo.eofInScriptHtmlCommentLikeText), this._emitEOFToken();
  7338. break;
  7339. default:
  7340. this.state = Ko.SCRIPT_DATA_DOUBLE_ESCAPED, this._emitCodePoint(e)
  7341. }
  7342. }
  7343. _stateScriptDataDoubleEscapedLessThanSign(e) {
  7344. e === io.SOLIDUS ? (this.state = Ko.SCRIPT_DATA_DOUBLE_ESCAPE_END, this._emitChars("/")) : (this.state = Ko.SCRIPT_DATA_DOUBLE_ESCAPED, this._stateScriptDataDoubleEscaped(e))
  7345. }
  7346. _stateScriptDataDoubleEscapeEnd(e) {
  7347. if (this.preprocessor.startsWith(co, !1) && ec(this.preprocessor.peek(co.length))) {
  7348. this._emitCodePoint(e);
  7349. for (let e = 0; e < co.length; e++) this._emitCodePoint(this._consume());
  7350. this.state = Ko.SCRIPT_DATA_ESCAPED
  7351. } else this._ensureHibernation() || (this.state = Ko.SCRIPT_DATA_DOUBLE_ESCAPED, this._stateScriptDataDoubleEscaped(e))
  7352. }
  7353. _stateBeforeAttributeName(e) {
  7354. switch (e) {
  7355. case io.SPACE:
  7356. case io.LINE_FEED:
  7357. case io.TABULATION:
  7358. case io.FORM_FEED:
  7359. break;
  7360. case io.SOLIDUS:
  7361. case io.GREATER_THAN_SIGN:
  7362. case io.EOF:
  7363. this.state = Ko.AFTER_ATTRIBUTE_NAME, this._stateAfterAttributeName(e);
  7364. break;
  7365. case io.EQUALS_SIGN:
  7366. this._err(Eo.unexpectedEqualsSignBeforeAttributeName), this._createAttr("="), this.state = Ko.ATTRIBUTE_NAME;
  7367. break;
  7368. default:
  7369. this._createAttr(""), this.state = Ko.ATTRIBUTE_NAME, this._stateAttributeName(e)
  7370. }
  7371. }
  7372. _stateAttributeName(e) {
  7373. switch (e) {
  7374. case io.SPACE:
  7375. case io.LINE_FEED:
  7376. case io.TABULATION:
  7377. case io.FORM_FEED:
  7378. case io.SOLIDUS:
  7379. case io.GREATER_THAN_SIGN:
  7380. case io.EOF:
  7381. this._leaveAttrName(), this.state = Ko.AFTER_ATTRIBUTE_NAME, this._stateAfterAttributeName(e);
  7382. break;
  7383. case io.EQUALS_SIGN:
  7384. this._leaveAttrName(), this.state = Ko.BEFORE_ATTRIBUTE_VALUE;
  7385. break;
  7386. case io.QUOTATION_MARK:
  7387. case io.APOSTROPHE:
  7388. case io.LESS_THAN_SIGN:
  7389. this._err(Eo.unexpectedCharacterInAttributeName), this.currentAttr.name += String.fromCodePoint(e);
  7390. break;
  7391. case io.NULL:
  7392. this._err(Eo.unexpectedNullCharacter), this.currentAttr.name += "�";
  7393. break;
  7394. default:
  7395. this.currentAttr.name += String.fromCodePoint(Wo(e) ? Jo(e) : e)
  7396. }
  7397. }
  7398. _stateAfterAttributeName(e) {
  7399. switch (e) {
  7400. case io.SPACE:
  7401. case io.LINE_FEED:
  7402. case io.TABULATION:
  7403. case io.FORM_FEED:
  7404. break;
  7405. case io.SOLIDUS:
  7406. this.state = Ko.SELF_CLOSING_START_TAG;
  7407. break;
  7408. case io.EQUALS_SIGN:
  7409. this.state = Ko.BEFORE_ATTRIBUTE_VALUE;
  7410. break;
  7411. case io.GREATER_THAN_SIGN:
  7412. this.state = Ko.DATA, this.emitCurrentTagToken();
  7413. break;
  7414. case io.EOF:
  7415. this._err(Eo.eofInTag), this._emitEOFToken();
  7416. break;
  7417. default:
  7418. this._createAttr(""), this.state = Ko.ATTRIBUTE_NAME, this._stateAttributeName(e)
  7419. }
  7420. }
  7421. _stateBeforeAttributeValue(e) {
  7422. switch (e) {
  7423. case io.SPACE:
  7424. case io.LINE_FEED:
  7425. case io.TABULATION:
  7426. case io.FORM_FEED:
  7427. break;
  7428. case io.QUOTATION_MARK:
  7429. this.state = Ko.ATTRIBUTE_VALUE_DOUBLE_QUOTED;
  7430. break;
  7431. case io.APOSTROPHE:
  7432. this.state = Ko.ATTRIBUTE_VALUE_SINGLE_QUOTED;
  7433. break;
  7434. case io.GREATER_THAN_SIGN:
  7435. this._err(Eo.missingAttributeValue), this.state = Ko.DATA, this.emitCurrentTagToken();
  7436. break;
  7437. default:
  7438. this.state = Ko.ATTRIBUTE_VALUE_UNQUOTED, this._stateAttributeValueUnquoted(e)
  7439. }
  7440. }
  7441. _stateAttributeValueDoubleQuoted(e) {
  7442. switch (e) {
  7443. case io.QUOTATION_MARK:
  7444. this.state = Ko.AFTER_ATTRIBUTE_VALUE_QUOTED;
  7445. break;
  7446. case io.AMPERSAND:
  7447. this.returnState = Ko.ATTRIBUTE_VALUE_DOUBLE_QUOTED, this.state = Ko.CHARACTER_REFERENCE;
  7448. break;
  7449. case io.NULL:
  7450. this._err(Eo.unexpectedNullCharacter), this.currentAttr.value += "�";
  7451. break;
  7452. case io.EOF:
  7453. this._err(Eo.eofInTag), this._emitEOFToken();
  7454. break;
  7455. default:
  7456. this.currentAttr.value += String.fromCodePoint(e)
  7457. }
  7458. }
  7459. _stateAttributeValueSingleQuoted(e) {
  7460. switch (e) {
  7461. case io.APOSTROPHE:
  7462. this.state = Ko.AFTER_ATTRIBUTE_VALUE_QUOTED;
  7463. break;
  7464. case io.AMPERSAND:
  7465. this.returnState = Ko.ATTRIBUTE_VALUE_SINGLE_QUOTED, this.state = Ko.CHARACTER_REFERENCE;
  7466. break;
  7467. case io.NULL:
  7468. this._err(Eo.unexpectedNullCharacter), this.currentAttr.value += "�";
  7469. break;
  7470. case io.EOF:
  7471. this._err(Eo.eofInTag), this._emitEOFToken();
  7472. break;
  7473. default:
  7474. this.currentAttr.value += String.fromCodePoint(e)
  7475. }
  7476. }
  7477. _stateAttributeValueUnquoted(e) {
  7478. switch (e) {
  7479. case io.SPACE:
  7480. case io.LINE_FEED:
  7481. case io.TABULATION:
  7482. case io.FORM_FEED:
  7483. this._leaveAttrValue(), this.state = Ko.BEFORE_ATTRIBUTE_NAME;
  7484. break;
  7485. case io.AMPERSAND:
  7486. this.returnState = Ko.ATTRIBUTE_VALUE_UNQUOTED, this.state = Ko.CHARACTER_REFERENCE;
  7487. break;
  7488. case io.GREATER_THAN_SIGN:
  7489. this._leaveAttrValue(), this.state = Ko.DATA, this.emitCurrentTagToken();
  7490. break;
  7491. case io.NULL:
  7492. this._err(Eo.unexpectedNullCharacter), this.currentAttr.value += "�";
  7493. break;
  7494. case io.QUOTATION_MARK:
  7495. case io.APOSTROPHE:
  7496. case io.LESS_THAN_SIGN:
  7497. case io.EQUALS_SIGN:
  7498. case io.GRAVE_ACCENT:
  7499. this._err(Eo.unexpectedCharacterInUnquotedAttributeValue), this.currentAttr.value += String.fromCodePoint(e);
  7500. break;
  7501. case io.EOF:
  7502. this._err(Eo.eofInTag), this._emitEOFToken();
  7503. break;
  7504. default:
  7505. this.currentAttr.value += String.fromCodePoint(e)
  7506. }
  7507. }
  7508. _stateAfterAttributeValueQuoted(e) {
  7509. switch (e) {
  7510. case io.SPACE:
  7511. case io.LINE_FEED:
  7512. case io.TABULATION:
  7513. case io.FORM_FEED:
  7514. this._leaveAttrValue(), this.state = Ko.BEFORE_ATTRIBUTE_NAME;
  7515. break;
  7516. case io.SOLIDUS:
  7517. this._leaveAttrValue(), this.state = Ko.SELF_CLOSING_START_TAG;
  7518. break;
  7519. case io.GREATER_THAN_SIGN:
  7520. this._leaveAttrValue(), this.state = Ko.DATA, this.emitCurrentTagToken();
  7521. break;
  7522. case io.EOF:
  7523. this._err(Eo.eofInTag), this._emitEOFToken();
  7524. break;
  7525. default:
  7526. this._err(Eo.missingWhitespaceBetweenAttributes), this.state = Ko.BEFORE_ATTRIBUTE_NAME, this._stateBeforeAttributeName(e)
  7527. }
  7528. }
  7529. _stateSelfClosingStartTag(e) {
  7530. switch (e) {
  7531. case io.GREATER_THAN_SIGN:
  7532. this.currentToken.selfClosing = !0, this.state = Ko.DATA, this.emitCurrentTagToken();
  7533. break;
  7534. case io.EOF:
  7535. this._err(Eo.eofInTag), this._emitEOFToken();
  7536. break;
  7537. default:
  7538. this._err(Eo.unexpectedSolidusInTag), this.state = Ko.BEFORE_ATTRIBUTE_NAME, this._stateBeforeAttributeName(e)
  7539. }
  7540. }
  7541. _stateBogusComment(e) {
  7542. const t = this.currentToken;
  7543. switch (e) {
  7544. case io.GREATER_THAN_SIGN:
  7545. this.state = Ko.DATA, this.emitCurrentComment(t);
  7546. break;
  7547. case io.EOF:
  7548. this.emitCurrentComment(t), this._emitEOFToken();
  7549. break;
  7550. case io.NULL:
  7551. this._err(Eo.unexpectedNullCharacter), t.data += "�";
  7552. break;
  7553. default:
  7554. t.data += String.fromCodePoint(e)
  7555. }
  7556. }
  7557. _stateMarkupDeclarationOpen(e) {
  7558. this._consumeSequenceIfMatch(so, !0) ? (this._createCommentToken(so.length + 1), this.state = Ko.COMMENT_START) : this._consumeSequenceIfMatch(oo, !1) ? (this.currentLocation = this.getCurrentLocation(oo.length + 1), this.state = Ko.DOCTYPE) : this._consumeSequenceIfMatch(ao, !0) ? this.inForeignNode ? this.state = Ko.CDATA_SECTION : (this._err(Eo.cdataInHtmlContent), this._createCommentToken(ao.length + 1), this.currentToken.data = "[CDATA[", this.state = Ko.BOGUS_COMMENT) : this._ensureHibernation() || (this._err(Eo.incorrectlyOpenedComment), this._createCommentToken(2), this.state = Ko.BOGUS_COMMENT, this._stateBogusComment(e))
  7559. }
  7560. _stateCommentStart(e) {
  7561. switch (e) {
  7562. case io.HYPHEN_MINUS:
  7563. this.state = Ko.COMMENT_START_DASH;
  7564. break;
  7565. case io.GREATER_THAN_SIGN:
  7566. {
  7567. this._err(Eo.abruptClosingOfEmptyComment), this.state = Ko.DATA;
  7568. const e = this.currentToken;
  7569. this.emitCurrentComment(e);
  7570. break
  7571. }
  7572. default:
  7573. this.state = Ko.COMMENT, this._stateComment(e)
  7574. }
  7575. }
  7576. _stateCommentStartDash(e) {
  7577. const t = this.currentToken;
  7578. switch (e) {
  7579. case io.HYPHEN_MINUS:
  7580. this.state = Ko.COMMENT_END;
  7581. break;
  7582. case io.GREATER_THAN_SIGN:
  7583. this._err(Eo.abruptClosingOfEmptyComment), this.state = Ko.DATA, this.emitCurrentComment(t);
  7584. break;
  7585. case io.EOF:
  7586. this._err(Eo.eofInComment), this.emitCurrentComment(t), this._emitEOFToken();
  7587. break;
  7588. default:
  7589. t.data += "-", this.state = Ko.COMMENT, this._stateComment(e)
  7590. }
  7591. }
  7592. _stateComment(e) {
  7593. const t = this.currentToken;
  7594. switch (e) {
  7595. case io.HYPHEN_MINUS:
  7596. this.state = Ko.COMMENT_END_DASH;
  7597. break;
  7598. case io.LESS_THAN_SIGN:
  7599. t.data += "<", this.state = Ko.COMMENT_LESS_THAN_SIGN;
  7600. break;
  7601. case io.NULL:
  7602. this._err(Eo.unexpectedNullCharacter), t.data += "�";
  7603. break;
  7604. case io.EOF:
  7605. this._err(Eo.eofInComment), this.emitCurrentComment(t), this._emitEOFToken();
  7606. break;
  7607. default:
  7608. t.data += String.fromCodePoint(e)
  7609. }
  7610. }
  7611. _stateCommentLessThanSign(e) {
  7612. const t = this.currentToken;
  7613. switch (e) {
  7614. case io.EXCLAMATION_MARK:
  7615. t.data += "!", this.state = Ko.COMMENT_LESS_THAN_SIGN_BANG;
  7616. break;
  7617. case io.LESS_THAN_SIGN:
  7618. t.data += "<";
  7619. break;
  7620. default:
  7621. this.state = Ko.COMMENT, this._stateComment(e)
  7622. }
  7623. }
  7624. _stateCommentLessThanSignBang(e) {
  7625. e === io.HYPHEN_MINUS ? this.state = Ko.COMMENT_LESS_THAN_SIGN_BANG_DASH : (this.state = Ko.COMMENT, this._stateComment(e))
  7626. }
  7627. _stateCommentLessThanSignBangDash(e) {
  7628. e === io.HYPHEN_MINUS ? this.state = Ko.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH : (this.state = Ko.COMMENT_END_DASH, this._stateCommentEndDash(e))
  7629. }
  7630. _stateCommentLessThanSignBangDashDash(e) {
  7631. e !== io.GREATER_THAN_SIGN && e !== io.EOF && this._err(Eo.nestedComment), this.state = Ko.COMMENT_END, this._stateCommentEnd(e)
  7632. }
  7633. _stateCommentEndDash(e) {
  7634. const t = this.currentToken;
  7635. switch (e) {
  7636. case io.HYPHEN_MINUS:
  7637. this.state = Ko.COMMENT_END;
  7638. break;
  7639. case io.EOF:
  7640. this._err(Eo.eofInComment), this.emitCurrentComment(t), this._emitEOFToken();
  7641. break;
  7642. default:
  7643. t.data += "-", this.state = Ko.COMMENT, this._stateComment(e)
  7644. }
  7645. }
  7646. _stateCommentEnd(e) {
  7647. const t = this.currentToken;
  7648. switch (e) {
  7649. case io.GREATER_THAN_SIGN:
  7650. this.state = Ko.DATA, this.emitCurrentComment(t);
  7651. break;
  7652. case io.EXCLAMATION_MARK:
  7653. this.state = Ko.COMMENT_END_BANG;
  7654. break;
  7655. case io.HYPHEN_MINUS:
  7656. t.data += "-";
  7657. break;
  7658. case io.EOF:
  7659. this._err(Eo.eofInComment), this.emitCurrentComment(t), this._emitEOFToken();
  7660. break;
  7661. default:
  7662. t.data += "--", this.state = Ko.COMMENT, this._stateComment(e)
  7663. }
  7664. }
  7665. _stateCommentEndBang(e) {
  7666. const t = this.currentToken;
  7667. switch (e) {
  7668. case io.HYPHEN_MINUS:
  7669. t.data += "--!", this.state = Ko.COMMENT_END_DASH;
  7670. break;
  7671. case io.GREATER_THAN_SIGN:
  7672. this._err(Eo.incorrectlyClosedComment), this.state = Ko.DATA, this.emitCurrentComment(t);
  7673. break;
  7674. case io.EOF:
  7675. this._err(Eo.eofInComment), this.emitCurrentComment(t), this._emitEOFToken();
  7676. break;
  7677. default:
  7678. t.data += "--!", this.state = Ko.COMMENT, this._stateComment(e)
  7679. }
  7680. }
  7681. _stateDoctype(e) {
  7682. switch (e) {
  7683. case io.SPACE:
  7684. case io.LINE_FEED:
  7685. case io.TABULATION:
  7686. case io.FORM_FEED:
  7687. this.state = Ko.BEFORE_DOCTYPE_NAME;
  7688. break;
  7689. case io.GREATER_THAN_SIGN:
  7690. this.state = Ko.BEFORE_DOCTYPE_NAME, this._stateBeforeDoctypeName(e);
  7691. break;
  7692. case io.EOF:
  7693. {
  7694. this._err(Eo.eofInDoctype), this._createDoctypeToken(null);
  7695. const e = this.currentToken;
  7696. e.forceQuirks = !0, this.emitCurrentDoctype(e), this._emitEOFToken();
  7697. break
  7698. }
  7699. default:
  7700. this._err(Eo.missingWhitespaceBeforeDoctypeName), this.state = Ko.BEFORE_DOCTYPE_NAME, this._stateBeforeDoctypeName(e)
  7701. }
  7702. }
  7703. _stateBeforeDoctypeName(e) {
  7704. if (Wo(e)) this._createDoctypeToken(String.fromCharCode(Jo(e))), this.state = Ko.DOCTYPE_NAME;
  7705. else switch (e) {
  7706. case io.SPACE:
  7707. case io.LINE_FEED:
  7708. case io.TABULATION:
  7709. case io.FORM_FEED:
  7710. break;
  7711. case io.NULL:
  7712. this._err(Eo.unexpectedNullCharacter), this._createDoctypeToken("�"), this.state = Ko.DOCTYPE_NAME;
  7713. break;
  7714. case io.GREATER_THAN_SIGN:
  7715. {
  7716. this._err(Eo.missingDoctypeName), this._createDoctypeToken(null);
  7717. const e = this.currentToken;
  7718. e.forceQuirks = !0, this.emitCurrentDoctype(e), this.state = Ko.DATA;
  7719. break
  7720. }
  7721. case io.EOF:
  7722. {
  7723. this._err(Eo.eofInDoctype), this._createDoctypeToken(null);
  7724. const e = this.currentToken;
  7725. e.forceQuirks = !0, this.emitCurrentDoctype(e), this._emitEOFToken();
  7726. break
  7727. }
  7728. default:
  7729. this._createDoctypeToken(String.fromCodePoint(e)), this.state = Ko.DOCTYPE_NAME
  7730. }
  7731. }
  7732. _stateDoctypeName(e) {
  7733. const t = this.currentToken;
  7734. switch (e) {
  7735. case io.SPACE:
  7736. case io.LINE_FEED:
  7737. case io.TABULATION:
  7738. case io.FORM_FEED:
  7739. this.state = Ko.AFTER_DOCTYPE_NAME;
  7740. break;
  7741. case io.GREATER_THAN_SIGN:
  7742. this.state = Ko.DATA, this.emitCurrentDoctype(t);
  7743. break;
  7744. case io.NULL:
  7745. this._err(Eo.unexpectedNullCharacter), t.name += "�";
  7746. break;
  7747. case io.EOF:
  7748. this._err(Eo.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
  7749. break;
  7750. default:
  7751. t.name += String.fromCodePoint(Wo(e) ? Jo(e) : e)
  7752. }
  7753. }
  7754. _stateAfterDoctypeName(e) {
  7755. const t = this.currentToken;
  7756. switch (e) {
  7757. case io.SPACE:
  7758. case io.LINE_FEED:
  7759. case io.TABULATION:
  7760. case io.FORM_FEED:
  7761. break;
  7762. case io.GREATER_THAN_SIGN:
  7763. this.state = Ko.DATA, this.emitCurrentDoctype(t);
  7764. break;
  7765. case io.EOF:
  7766. this._err(Eo.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
  7767. break;
  7768. default:
  7769. this._consumeSequenceIfMatch(lo, !1) ? this.state = Ko.AFTER_DOCTYPE_PUBLIC_KEYWORD : this._consumeSequenceIfMatch(ho, !1) ? this.state = Ko.AFTER_DOCTYPE_SYSTEM_KEYWORD : this._ensureHibernation() || (this._err(Eo.invalidCharacterSequenceAfterDoctypeName), t.forceQuirks = !0, this.state = Ko.BOGUS_DOCTYPE, this._stateBogusDoctype(e))
  7770. }
  7771. }
  7772. _stateAfterDoctypePublicKeyword(e) {
  7773. const t = this.currentToken;
  7774. switch (e) {
  7775. case io.SPACE:
  7776. case io.LINE_FEED:
  7777. case io.TABULATION:
  7778. case io.FORM_FEED:
  7779. this.state = Ko.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;
  7780. break;
  7781. case io.QUOTATION_MARK:
  7782. this._err(Eo.missingWhitespaceAfterDoctypePublicKeyword), t.publicId = "", this.state = Ko.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;
  7783. break;
  7784. case io.APOSTROPHE:
  7785. this._err(Eo.missingWhitespaceAfterDoctypePublicKeyword), t.publicId = "", this.state = Ko.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;
  7786. break;
  7787. case io.GREATER_THAN_SIGN:
  7788. this._err(Eo.missingDoctypePublicIdentifier), t.forceQuirks = !0, this.state = Ko.DATA, this.emitCurrentDoctype(t);
  7789. break;
  7790. case io.EOF:
  7791. this._err(Eo.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
  7792. break;
  7793. default:
  7794. this._err(Eo.missingQuoteBeforeDoctypePublicIdentifier), t.forceQuirks = !0, this.state = Ko.BOGUS_DOCTYPE, this._stateBogusDoctype(e)
  7795. }
  7796. }
  7797. _stateBeforeDoctypePublicIdentifier(e) {
  7798. const t = this.currentToken;
  7799. switch (e) {
  7800. case io.SPACE:
  7801. case io.LINE_FEED:
  7802. case io.TABULATION:
  7803. case io.FORM_FEED:
  7804. break;
  7805. case io.QUOTATION_MARK:
  7806. t.publicId = "", this.state = Ko.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;
  7807. break;
  7808. case io.APOSTROPHE:
  7809. t.publicId = "", this.state = Ko.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;
  7810. break;
  7811. case io.GREATER_THAN_SIGN:
  7812. this._err(Eo.missingDoctypePublicIdentifier), t.forceQuirks = !0, this.state = Ko.DATA, this.emitCurrentDoctype(t);
  7813. break;
  7814. case io.EOF:
  7815. this._err(Eo.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
  7816. break;
  7817. default:
  7818. this._err(Eo.missingQuoteBeforeDoctypePublicIdentifier), t.forceQuirks = !0, this.state = Ko.BOGUS_DOCTYPE, this._stateBogusDoctype(e)
  7819. }
  7820. }
  7821. _stateDoctypePublicIdentifierDoubleQuoted(e) {
  7822. const t = this.currentToken;
  7823. switch (e) {
  7824. case io.QUOTATION_MARK:
  7825. this.state = Ko.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;
  7826. break;
  7827. case io.NULL:
  7828. this._err(Eo.unexpectedNullCharacter), t.publicId += "�";
  7829. break;
  7830. case io.GREATER_THAN_SIGN:
  7831. this._err(Eo.abruptDoctypePublicIdentifier), t.forceQuirks = !0, this.emitCurrentDoctype(t), this.state = Ko.DATA;
  7832. break;
  7833. case io.EOF:
  7834. this._err(Eo.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
  7835. break;
  7836. default:
  7837. t.publicId += String.fromCodePoint(e)
  7838. }
  7839. }
  7840. _stateDoctypePublicIdentifierSingleQuoted(e) {
  7841. const t = this.currentToken;
  7842. switch (e) {
  7843. case io.APOSTROPHE:
  7844. this.state = Ko.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;
  7845. break;
  7846. case io.NULL:
  7847. this._err(Eo.unexpectedNullCharacter), t.publicId += "�";
  7848. break;
  7849. case io.GREATER_THAN_SIGN:
  7850. this._err(Eo.abruptDoctypePublicIdentifier), t.forceQuirks = !0, this.emitCurrentDoctype(t), this.state = Ko.DATA;
  7851. break;
  7852. case io.EOF:
  7853. this._err(Eo.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
  7854. break;
  7855. default:
  7856. t.publicId += String.fromCodePoint(e)
  7857. }
  7858. }
  7859. _stateAfterDoctypePublicIdentifier(e) {
  7860. const t = this.currentToken;
  7861. switch (e) {
  7862. case io.SPACE:
  7863. case io.LINE_FEED:
  7864. case io.TABULATION:
  7865. case io.FORM_FEED:
  7866. this.state = Ko.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;
  7867. break;
  7868. case io.GREATER_THAN_SIGN:
  7869. this.state = Ko.DATA, this.emitCurrentDoctype(t);
  7870. break;
  7871. case io.QUOTATION_MARK:
  7872. this._err(Eo.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers), t.systemId = "", this.state = Ko.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;
  7873. break;
  7874. case io.APOSTROPHE:
  7875. this._err(Eo.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers), t.systemId = "", this.state = Ko.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;
  7876. break;
  7877. case io.EOF:
  7878. this._err(Eo.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
  7879. break;
  7880. default:
  7881. this._err(Eo.missingQuoteBeforeDoctypeSystemIdentifier), t.forceQuirks = !0, this.state = Ko.BOGUS_DOCTYPE, this._stateBogusDoctype(e)
  7882. }
  7883. }
  7884. _stateBetweenDoctypePublicAndSystemIdentifiers(e) {
  7885. const t = this.currentToken;
  7886. switch (e) {
  7887. case io.SPACE:
  7888. case io.LINE_FEED:
  7889. case io.TABULATION:
  7890. case io.FORM_FEED:
  7891. break;
  7892. case io.GREATER_THAN_SIGN:
  7893. this.emitCurrentDoctype(t), this.state = Ko.DATA;
  7894. break;
  7895. case io.QUOTATION_MARK:
  7896. t.systemId = "", this.state = Ko.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;
  7897. break;
  7898. case io.APOSTROPHE:
  7899. t.systemId = "", this.state = Ko.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;
  7900. break;
  7901. case io.EOF:
  7902. this._err(Eo.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
  7903. break;
  7904. default:
  7905. this._err(Eo.missingQuoteBeforeDoctypeSystemIdentifier), t.forceQuirks = !0, this.state = Ko.BOGUS_DOCTYPE, this._stateBogusDoctype(e)
  7906. }
  7907. }
  7908. _stateAfterDoctypeSystemKeyword(e) {
  7909. const t = this.currentToken;
  7910. switch (e) {
  7911. case io.SPACE:
  7912. case io.LINE_FEED:
  7913. case io.TABULATION:
  7914. case io.FORM_FEED:
  7915. this.state = Ko.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;
  7916. break;
  7917. case io.QUOTATION_MARK:
  7918. this._err(Eo.missingWhitespaceAfterDoctypeSystemKeyword), t.systemId = "", this.state = Ko.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;
  7919. break;
  7920. case io.APOSTROPHE:
  7921. this._err(Eo.missingWhitespaceAfterDoctypeSystemKeyword), t.systemId = "", this.state = Ko.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;
  7922. break;
  7923. case io.GREATER_THAN_SIGN:
  7924. this._err(Eo.missingDoctypeSystemIdentifier), t.forceQuirks = !0, this.state = Ko.DATA, this.emitCurrentDoctype(t);
  7925. break;
  7926. case io.EOF:
  7927. this._err(Eo.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
  7928. break;
  7929. default:
  7930. this._err(Eo.missingQuoteBeforeDoctypeSystemIdentifier), t.forceQuirks = !0, this.state = Ko.BOGUS_DOCTYPE, this._stateBogusDoctype(e)
  7931. }
  7932. }
  7933. _stateBeforeDoctypeSystemIdentifier(e) {
  7934. const t = this.currentToken;
  7935. switch (e) {
  7936. case io.SPACE:
  7937. case io.LINE_FEED:
  7938. case io.TABULATION:
  7939. case io.FORM_FEED:
  7940. break;
  7941. case io.QUOTATION_MARK:
  7942. t.systemId = "", this.state = Ko.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;
  7943. break;
  7944. case io.APOSTROPHE:
  7945. t.systemId = "", this.state = Ko.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;
  7946. break;
  7947. case io.GREATER_THAN_SIGN:
  7948. this._err(Eo.missingDoctypeSystemIdentifier), t.forceQuirks = !0, this.state = Ko.DATA, this.emitCurrentDoctype(t);
  7949. break;
  7950. case io.EOF:
  7951. this._err(Eo.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
  7952. break;
  7953. default:
  7954. this._err(Eo.missingQuoteBeforeDoctypeSystemIdentifier), t.forceQuirks = !0, this.state = Ko.BOGUS_DOCTYPE, this._stateBogusDoctype(e)
  7955. }
  7956. }
  7957. _stateDoctypeSystemIdentifierDoubleQuoted(e) {
  7958. const t = this.currentToken;
  7959. switch (e) {
  7960. case io.QUOTATION_MARK:
  7961. this.state = Ko.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;
  7962. break;
  7963. case io.NULL:
  7964. this._err(Eo.unexpectedNullCharacter), t.systemId += "�";
  7965. break;
  7966. case io.GREATER_THAN_SIGN:
  7967. this._err(Eo.abruptDoctypeSystemIdentifier), t.forceQuirks = !0, this.emitCurrentDoctype(t), this.state = Ko.DATA;
  7968. break;
  7969. case io.EOF:
  7970. this._err(Eo.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
  7971. break;
  7972. default:
  7973. t.systemId += String.fromCodePoint(e)
  7974. }
  7975. }
  7976. _stateDoctypeSystemIdentifierSingleQuoted(e) {
  7977. const t = this.currentToken;
  7978. switch (e) {
  7979. case io.APOSTROPHE:
  7980. this.state = Ko.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;
  7981. break;
  7982. case io.NULL:
  7983. this._err(Eo.unexpectedNullCharacter), t.systemId += "�";
  7984. break;
  7985. case io.GREATER_THAN_SIGN:
  7986. this._err(Eo.abruptDoctypeSystemIdentifier), t.forceQuirks = !0, this.emitCurrentDoctype(t), this.state = Ko.DATA;
  7987. break;
  7988. case io.EOF:
  7989. this._err(Eo.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
  7990. break;
  7991. default:
  7992. t.systemId += String.fromCodePoint(e)
  7993. }
  7994. }
  7995. _stateAfterDoctypeSystemIdentifier(e) {
  7996. const t = this.currentToken;
  7997. switch (e) {
  7998. case io.SPACE:
  7999. case io.LINE_FEED:
  8000. case io.TABULATION:
  8001. case io.FORM_FEED:
  8002. break;
  8003. case io.GREATER_THAN_SIGN:
  8004. this.emitCurrentDoctype(t), this.state = Ko.DATA;
  8005. break;
  8006. case io.EOF:
  8007. this._err(Eo.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
  8008. break;
  8009. default:
  8010. this._err(Eo.unexpectedCharacterAfterDoctypeSystemIdentifier), this.state = Ko.BOGUS_DOCTYPE, this._stateBogusDoctype(e)
  8011. }
  8012. }
  8013. _stateBogusDoctype(e) {
  8014. const t = this.currentToken;
  8015. switch (e) {
  8016. case io.GREATER_THAN_SIGN:
  8017. this.emitCurrentDoctype(t), this.state = Ko.DATA;
  8018. break;
  8019. case io.NULL:
  8020. this._err(Eo.unexpectedNullCharacter);
  8021. break;
  8022. case io.EOF:
  8023. this.emitCurrentDoctype(t), this._emitEOFToken()
  8024. }
  8025. }
  8026. _stateCdataSection(e) {
  8027. switch (e) {
  8028. case io.RIGHT_SQUARE_BRACKET:
  8029. this.state = Ko.CDATA_SECTION_BRACKET;
  8030. break;
  8031. case io.EOF:
  8032. this._err(Eo.eofInCdata), this._emitEOFToken();
  8033. break;
  8034. default:
  8035. this._emitCodePoint(e)
  8036. }
  8037. }
  8038. _stateCdataSectionBracket(e) {
  8039. e === io.RIGHT_SQUARE_BRACKET ? this.state = Ko.CDATA_SECTION_END : (this._emitChars("]"), this.state = Ko.CDATA_SECTION, this._stateCdataSection(e))
  8040. }
  8041. _stateCdataSectionEnd(e) {
  8042. switch (e) {
  8043. case io.GREATER_THAN_SIGN:
  8044. this.state = Ko.DATA;
  8045. break;
  8046. case io.RIGHT_SQUARE_BRACKET:
  8047. this._emitChars("]");
  8048. break;
  8049. default:
  8050. this._emitChars("]]"), this.state = Ko.CDATA_SECTION, this._stateCdataSection(e)
  8051. }
  8052. }
  8053. _stateCharacterReference(e) {
  8054. e === io.NUMBER_SIGN ? this.state = Ko.NUMERIC_CHARACTER_REFERENCE : Xo(e) ? (this.state = Ko.NAMED_CHARACTER_REFERENCE, this._stateNamedCharacterReference(e)) : (this._flushCodePointConsumedAsCharacterReference(io.AMPERSAND), this._reconsumeInState(this.returnState, e))
  8055. }
  8056. _stateNamedCharacterReference(e) {
  8057. const t = this._matchNamedCharacterReference(e);
  8058. if (this._ensureHibernation());
  8059. else if (t) {
  8060. for (let e = 0; e < t.length; e++) this._flushCodePointConsumedAsCharacterReference(t[e]);
  8061. this.state = this.returnState
  8062. } else this._flushCodePointConsumedAsCharacterReference(io.AMPERSAND), this.state = Ko.AMBIGUOUS_AMPERSAND
  8063. }
  8064. _stateAmbiguousAmpersand(e) {
  8065. Xo(e) ? this._flushCodePointConsumedAsCharacterReference(e) : (e === io.SEMICOLON && this._err(Eo.unknownNamedCharacterReference), this._reconsumeInState(this.returnState, e))
  8066. }
  8067. _stateNumericCharacterReference(e) {
  8068. this.charRefCode = 0, e === io.LATIN_SMALL_X || e === io.LATIN_CAPITAL_X ? this.state = Ko.HEXADEMICAL_CHARACTER_REFERENCE_START : Vo(e) ? (this.state = Ko.DECIMAL_CHARACTER_REFERENCE, this._stateDecimalCharacterReference(e)) : (this._err(Eo.absenceOfDigitsInNumericCharacterReference), this._flushCodePointConsumedAsCharacterReference(io.AMPERSAND), this._flushCodePointConsumedAsCharacterReference(io.NUMBER_SIGN), this._reconsumeInState(this.returnState, e))
  8069. }
  8070. _stateHexademicalCharacterReferenceStart(e) {
  8071. ! function(e) {
  8072. return Vo(e) || $o(e) || zo(e)
  8073. }(e) ? (this._err(Eo.absenceOfDigitsInNumericCharacterReference), this._flushCodePointConsumedAsCharacterReference(io.AMPERSAND), this._flushCodePointConsumedAsCharacterReference(io.NUMBER_SIGN), this._unconsume(2), this.state = this.returnState) : (this.state = Ko.HEXADEMICAL_CHARACTER_REFERENCE, this._stateHexademicalCharacterReference(e))
  8074. }
  8075. _stateHexademicalCharacterReference(e) {
  8076. $o(e) ? this.charRefCode = 16 * this.charRefCode + e - 55 : zo(e) ? this.charRefCode = 16 * this.charRefCode + e - 87 : Vo(e) ? this.charRefCode = 16 * this.charRefCode + e - 48 : e === io.SEMICOLON ? this.state = Ko.NUMERIC_CHARACTER_REFERENCE_END : (this._err(Eo.missingSemicolonAfterCharacterReference), this.state = Ko.NUMERIC_CHARACTER_REFERENCE_END, this._stateNumericCharacterReferenceEnd(e))
  8077. }
  8078. _stateDecimalCharacterReference(e) {
  8079. Vo(e) ? this.charRefCode = 10 * this.charRefCode + e - 48 : e === io.SEMICOLON ? this.state = Ko.NUMERIC_CHARACTER_REFERENCE_END : (this._err(Eo.missingSemicolonAfterCharacterReference), this.state = Ko.NUMERIC_CHARACTER_REFERENCE_END, this._stateNumericCharacterReferenceEnd(e))
  8080. }
  8081. _stateNumericCharacterReferenceEnd(e) {
  8082. if (this.charRefCode === io.NULL) this._err(Eo.nullCharacterReference), this.charRefCode = io.REPLACEMENT_CHARACTER;
  8083. else if (this.charRefCode > 1114111) this._err(Eo.characterReferenceOutsideUnicodeRange), this.charRefCode = io.REPLACEMENT_CHARACTER;
  8084. else if (uo(this.charRefCode)) this._err(Eo.surrogateCharacterReference), this.charRefCode = io.REPLACEMENT_CHARACTER;
  8085. else if (fo(this.charRefCode)) this._err(Eo.noncharacterCharacterReference);
  8086. else if (po(this.charRefCode) || this.charRefCode === io.CARRIAGE_RETURN) {
  8087. this._err(Eo.controlCharacterReference);
  8088. const e = qo.get(this.charRefCode);
  8089. void 0 !== e && (this.charRefCode = e)
  8090. }
  8091. this._flushCodePointConsumedAsCharacterReference(this.charRefCode), this._reconsumeInState(this.returnState, e)
  8092. }
  8093. }
  8094. const nc = new Set([Po.DD, Po.DT, Po.LI, Po.OPTGROUP, Po.OPTION, Po.P, Po.RB, Po.RP, Po.RT, Po.RTC]), rc = new Set([...nc, Po.CAPTION, Po.COLGROUP, Po.TBODY, Po.TD, Po.TFOOT, Po.TH, Po.THEAD, Po.TR]), ic = new Map([
  8095. [Po.APPLET, vo.HTML],
  8096. [Po.CAPTION, vo.HTML],
  8097. [Po.HTML, vo.HTML],
  8098. [Po.MARQUEE, vo.HTML],
  8099. [Po.OBJECT, vo.HTML],
  8100. [Po.TABLE, vo.HTML],
  8101. [Po.TD, vo.HTML],
  8102. [Po.TEMPLATE, vo.HTML],
  8103. [Po.TH, vo.HTML],
  8104. [Po.ANNOTATION_XML, vo.MATHML],
  8105. [Po.MI, vo.MATHML],
  8106. [Po.MN, vo.MATHML],
  8107. [Po.MO, vo.MATHML],
  8108. [Po.MS, vo.MATHML],
  8109. [Po.MTEXT, vo.MATHML],
  8110. [Po.DESC, vo.SVG],
  8111. [Po.FOREIGN_OBJECT, vo.SVG],
  8112. [Po.TITLE, vo.SVG]
  8113. ]), sc = [Po.H1, Po.H2, Po.H3, Po.H4, Po.H5, Po.H6], ac = [Po.TR, Po.TEMPLATE, Po.HTML], oc = [Po.TBODY, Po.TFOOT, Po.THEAD, Po.TEMPLATE, Po.HTML], cc = [Po.TABLE, Po.TEMPLATE, Po.HTML], lc = [Po.TD, Po.TH];
  8114. class hc {
  8115. constructor(e, t, n) {
  8116. this.treeAdapter = t, this.handler = n, this.items = [], this.tagIDs = [], this.stackTop = -1, this.tmplCount = 0, this.currentTagId = Po.UNKNOWN, this.current = e
  8117. }
  8118. get currentTmplContentOrNode() {
  8119. return this._isInTemplate() ? this.treeAdapter.getTemplateContent(this.current) : this.current
  8120. }
  8121. _indexOf(e) {
  8122. return this.items.lastIndexOf(e, this.stackTop)
  8123. }
  8124. _isInTemplate() {
  8125. return this.currentTagId === Po.TEMPLATE && this.treeAdapter.getNamespaceURI(this.current) === vo.HTML
  8126. }
  8127. _updateCurrentElement() {
  8128. this.current = this.items[this.stackTop], this.currentTagId = this.tagIDs[this.stackTop]
  8129. }
  8130. push(e, t) {
  8131. this.stackTop++, this.items[this.stackTop] = e, this.current = e, this.tagIDs[this.stackTop] = t, this.currentTagId = t, this._isInTemplate() && this.tmplCount++, this.handler.onItemPush(e, t, !0)
  8132. }
  8133. pop() {
  8134. const e = this.current;
  8135. this.tmplCount > 0 && this._isInTemplate() && this.tmplCount--, this.stackTop--, this._updateCurrentElement(), this.handler.onItemPop(e, !0)
  8136. }
  8137. replace(e, t) {
  8138. const n = this._indexOf(e);
  8139. this.items[n] = t, n === this.stackTop && (this.current = t)
  8140. }
  8141. insertAfter(e, t, n) {
  8142. const r = this._indexOf(e) + 1;
  8143. this.items.splice(r, 0, t), this.tagIDs.splice(r, 0, n), this.stackTop++, r === this.stackTop && this._updateCurrentElement(), this.handler.onItemPush(this.current, this.currentTagId, r === this.stackTop)
  8144. }
  8145. popUntilTagNamePopped(e) {
  8146. let t = this.stackTop + 1;
  8147. do {
  8148. t = this.tagIDs.lastIndexOf(e, t - 1)
  8149. } while (t > 0 && this.treeAdapter.getNamespaceURI(this.items[t]) !== vo.HTML);
  8150. this.shortenToLength(t < 0 ? 0 : t)
  8151. }
  8152. shortenToLength(e) {
  8153. for (; this.stackTop >= e;) {
  8154. const t = this.current;
  8155. this.tmplCount > 0 && this._isInTemplate() && (this.tmplCount -= 1), this.stackTop--, this._updateCurrentElement(), this.handler.onItemPop(t, this.stackTop < e)
  8156. }
  8157. }
  8158. popUntilElementPopped(e) {
  8159. const t = this._indexOf(e);
  8160. this.shortenToLength(t < 0 ? 0 : t)
  8161. }
  8162. popUntilPopped(e, t) {
  8163. const n = this._indexOfTagNames(e, t);
  8164. this.shortenToLength(n < 0 ? 0 : n)
  8165. }
  8166. popUntilNumberedHeaderPopped() {
  8167. this.popUntilPopped(sc, vo.HTML)
  8168. }
  8169. popUntilTableCellPopped() {
  8170. this.popUntilPopped(lc, vo.HTML)
  8171. }
  8172. popAllUpToHtmlElement() {
  8173. this.tmplCount = 0, this.shortenToLength(1)
  8174. }
  8175. _indexOfTagNames(e, t) {
  8176. for (let n = this.stackTop; n >= 0; n--) if (e.includes(this.tagIDs[n]) && this.treeAdapter.getNamespaceURI(this.items[n]) === t) return n;
  8177. return -1
  8178. }
  8179. clearBackTo(e, t) {
  8180. const n = this._indexOfTagNames(e, t);
  8181. this.shortenToLength(n + 1)
  8182. }
  8183. clearBackToTableContext() {
  8184. this.clearBackTo(cc, vo.HTML)
  8185. }
  8186. clearBackToTableBodyContext() {
  8187. this.clearBackTo(oc, vo.HTML)
  8188. }
  8189. clearBackToTableRowContext() {
  8190. this.clearBackTo(ac, vo.HTML)
  8191. }
  8192. remove(e) {
  8193. const t = this._indexOf(e);
  8194. t >= 0 && (t === this.stackTop ? this.pop() : (this.items.splice(t, 1), this.tagIDs.splice(t, 1), this.stackTop--, this._updateCurrentElement(), this.handler.onItemPop(e, !1)))
  8195. }
  8196. tryPeekProperlyNestedBodyElement() {
  8197. return this.stackTop >= 1 && this.tagIDs[1] === Po.BODY ? this.items[1] : null
  8198. }
  8199. contains(e) {
  8200. return this._indexOf(e) > -1
  8201. }
  8202. getCommonAncestor(e) {
  8203. const t = this._indexOf(e) - 1;
  8204. return t >= 0 ? this.items[t] : null
  8205. }
  8206. isRootHtmlElementCurrent() {
  8207. return 0 === this.stackTop && this.tagIDs[0] === Po.HTML
  8208. }
  8209. hasInScope(e) {
  8210. for (let t = this.stackTop; t >= 0; t--) {
  8211. const n = this.tagIDs[t], r = this.treeAdapter.getNamespaceURI(this.items[t]);
  8212. if (n === e && r === vo.HTML) return !0;
  8213. if (ic.get(n) === r) return !1
  8214. }
  8215. return !0
  8216. }
  8217. hasNumberedHeaderInScope() {
  8218. for (let e = this.stackTop; e >= 0; e--) {
  8219. const t = this.tagIDs[e], n = this.treeAdapter.getNamespaceURI(this.items[e]);
  8220. if (Go(t) && n === vo.HTML) return !0;
  8221. if (ic.get(t) === n) return !1
  8222. }
  8223. return !0
  8224. }
  8225. hasInListItemScope(e) {
  8226. for (let t = this.stackTop; t >= 0; t--) {
  8227. const n = this.tagIDs[t], r = this.treeAdapter.getNamespaceURI(this.items[t]);
  8228. if (n === e && r === vo.HTML) return !0;
  8229. if ((n === Po.UL || n === Po.OL) && r === vo.HTML || ic.get(n) === r) return !1
  8230. }
  8231. return !0
  8232. }
  8233. hasInButtonScope(e) {
  8234. for (let t = this.stackTop; t >= 0; t--) {
  8235. const n = this.tagIDs[t], r = this.treeAdapter.getNamespaceURI(this.items[t]);
  8236. if (n === e && r === vo.HTML) return !0;
  8237. if (n === Po.BUTTON && r === vo.HTML || ic.get(n) === r) return !1
  8238. }
  8239. return !0
  8240. }
  8241. hasInTableScope(e) {
  8242. for (let t = this.stackTop; t >= 0; t--) {
  8243. const n = this.tagIDs[t];
  8244. if (this.treeAdapter.getNamespaceURI(this.items[t]) === vo.HTML) {
  8245. if (n === e) return !0;
  8246. if (n === Po.TABLE || n === Po.TEMPLATE || n === Po.HTML) return !1
  8247. }
  8248. }
  8249. return !0
  8250. }
  8251. hasTableBodyContextInTableScope() {
  8252. for (let e = this.stackTop; e >= 0; e--) {
  8253. const t = this.tagIDs[e];
  8254. if (this.treeAdapter.getNamespaceURI(this.items[e]) === vo.HTML) {
  8255. if (t === Po.TBODY || t === Po.THEAD || t === Po.TFOOT) return !0;
  8256. if (t === Po.TABLE || t === Po.HTML) return !1
  8257. }
  8258. }
  8259. return !0
  8260. }
  8261. hasInSelectScope(e) {
  8262. for (let t = this.stackTop; t >= 0; t--) {
  8263. const n = this.tagIDs[t];
  8264. if (this.treeAdapter.getNamespaceURI(this.items[t]) === vo.HTML) {
  8265. if (n === e) return !0;
  8266. if (n !== Po.OPTION && n !== Po.OPTGROUP) return !1
  8267. }
  8268. }
  8269. return !0
  8270. }
  8271. generateImpliedEndTags() {
  8272. for (; nc.has(this.currentTagId);) this.pop()
  8273. }
  8274. generateImpliedEndTagsThoroughly() {
  8275. for (; rc.has(this.currentTagId);) this.pop()
  8276. }
  8277. generateImpliedEndTagsWithExclusion(e) {
  8278. for (; this.currentTagId !== e && rc.has(this.currentTagId);) this.pop()
  8279. }
  8280. }
  8281. var uc;
  8282. ! function(e) {
  8283. e[e.Marker = 0] = "Marker", e[e.Element = 1] = "Element"
  8284. }(uc = uc || (uc = {}));
  8285. const pc = {
  8286. type: uc.Marker
  8287. };
  8288. class fc {
  8289. constructor(e) {
  8290. this.treeAdapter = e, this.entries = [], this.bookmark = null
  8291. }
  8292. _getNoahArkConditionCandidates(e, t) {
  8293. const n = [], r = t.length, i = this.treeAdapter.getTagName(e), s = this.treeAdapter.getNamespaceURI(e);
  8294. for (let e = 0; e < this.entries.length; e++) {
  8295. const t = this.entries[e];
  8296. if (t.type === uc.Marker) break;
  8297. const {
  8298. element: a
  8299. } = t;
  8300. if (this.treeAdapter.getTagName(a) === i && this.treeAdapter.getNamespaceURI(a) === s) {
  8301. const t = this.treeAdapter.getAttrList(a);
  8302. t.length === r && n.push({
  8303. idx: e,
  8304. attrs: t
  8305. })
  8306. }
  8307. }
  8308. return n
  8309. }
  8310. _ensureNoahArkCondition(e) {
  8311. if (this.entries.length < 3) return;
  8312. const t = this.treeAdapter.getAttrList(e), n = this._getNoahArkConditionCandidates(e, t);
  8313. if (n.length < 3) return;
  8314. const r = new Map(t.map((e => [e.name, e.value])));
  8315. let i = 0;
  8316. for (let e = 0; e < n.length; e++) {
  8317. const t = n[e];
  8318. t.attrs.every((e => r.get(e.name) === e.value)) && (i += 1, i >= 3 && this.entries.splice(t.idx, 1))
  8319. }
  8320. }
  8321. insertMarker() {
  8322. this.entries.unshift(pc)
  8323. }
  8324. pushElement(e, t) {
  8325. this._ensureNoahArkCondition(e), this.entries.unshift({
  8326. type: uc.Element,
  8327. element: e,
  8328. token: t
  8329. })
  8330. }
  8331. insertElementAfterBookmark(e, t) {
  8332. const n = this.entries.indexOf(this.bookmark);
  8333. this.entries.splice(n, 0, {
  8334. type: uc.Element,
  8335. element: e,
  8336. token: t
  8337. })
  8338. }
  8339. removeEntry(e) {
  8340. const t = this.entries.indexOf(e);
  8341. t >= 0 && this.entries.splice(t, 1)
  8342. }
  8343. clearToLastMarker() {
  8344. const e = this.entries.indexOf(pc);
  8345. e >= 0 ? this.entries.splice(0, e + 1) : this.entries.length = 0
  8346. }
  8347. getElementEntryInScopeWithTagName(e) {
  8348. const t = this.entries.find((t => t.type === uc.Marker || this.treeAdapter.getTagName(t.element) === e));
  8349. return t && t.type === uc.Element ? t : null
  8350. }
  8351. getElementEntry(e) {
  8352. return this.entries.find((t => t.type === uc.Element && t.element === e))
  8353. }
  8354. }
  8355. function dc(e) {
  8356. return {
  8357. nodeName: "#text",
  8358. value: e,
  8359. parentNode: null
  8360. }
  8361. }
  8362. const Ec = {
  8363. createDocument: () => ({
  8364. nodeName: "#document",
  8365. mode: Ro.NO_QUIRKS,
  8366. childNodes: []
  8367. }),
  8368. createDocumentFragment: () => ({
  8369. nodeName: "#document-fragment",
  8370. childNodes: []
  8371. }),
  8372. createElement: (e, t, n) => ({
  8373. nodeName: e,
  8374. tagName: e,
  8375. attrs: n,
  8376. namespaceURI: t,
  8377. childNodes: [],
  8378. parentNode: null
  8379. }),
  8380. createCommentNode: e => ({
  8381. nodeName: "#comment",
  8382. data: e,
  8383. parentNode: null
  8384. }),
  8385. appendChild(e, t) {
  8386. e.childNodes.push(t), t.parentNode = e
  8387. },
  8388. insertBefore(e, t, n) {
  8389. const r = e.childNodes.indexOf(n);
  8390. e.childNodes.splice(r, 0, t), t.parentNode = e
  8391. },
  8392. setTemplateContent(e, t) {
  8393. e.content = t
  8394. },
  8395. getTemplateContent: e => e.content,
  8396. setDocumentType(e, t, n, r) {
  8397. const i = e.childNodes.find((e => "#documentType" === e.nodeName));
  8398. if (i) i.name = t, i.publicId = n, i.systemId = r;
  8399. else {
  8400. const i = {
  8401. nodeName: "#documentType",
  8402. name: t,
  8403. publicId: n,
  8404. systemId: r,
  8405. parentNode: null
  8406. };
  8407. Ec.appendChild(e, i)
  8408. }
  8409. },
  8410. setDocumentMode(e, t) {
  8411. e.mode = t
  8412. },
  8413. getDocumentMode: e => e.mode,
  8414. detachNode(e) {
  8415. if (e.parentNode) {
  8416. const t = e.parentNode.childNodes.indexOf(e);
  8417. e.parentNode.childNodes.splice(t, 1), e.parentNode = null
  8418. }
  8419. },
  8420. insertText(e, t) {
  8421. if (e.childNodes.length > 0) {
  8422. const n = e.childNodes[e.childNodes.length - 1];
  8423. if (Ec.isTextNode(n)) return void(n.value += t)
  8424. }
  8425. Ec.appendChild(e, dc(t))
  8426. },
  8427. insertTextBefore(e, t, n) {
  8428. const r = e.childNodes[e.childNodes.indexOf(n) - 1];
  8429. r && Ec.isTextNode(r) ? r.value += t : Ec.insertBefore(e, dc(t), n)
  8430. },
  8431. adoptAttributes(e, t) {
  8432. const n = new Set(e.attrs.map((e => e.name)));
  8433. for (let r = 0; r < t.length; r++) n.has(t[r].name) || e.attrs.push(t[r])
  8434. },
  8435. getFirstChild: e => e.childNodes[0],
  8436. getChildNodes: e => e.childNodes,
  8437. getParentNode: e => e.parentNode,
  8438. getAttrList: e => e.attrs,
  8439. getTagName: e => e.tagName,
  8440. getNamespaceURI: e => e.namespaceURI,
  8441. getTextNodeContent: e => e.value,
  8442. getCommentNodeContent: e => e.data,
  8443. getDocumentTypeNodeName: e => e.name,
  8444. getDocumentTypeNodePublicId: e => e.publicId,
  8445. getDocumentTypeNodeSystemId: e => e.systemId,
  8446. isTextNode: e => "#text" === e.nodeName,
  8447. isCommentNode: e => "#comment" === e.nodeName,
  8448. isDocumentTypeNode: e => "#documentType" === e.nodeName,
  8449. isElementNode: e => Object.prototype.hasOwnProperty.call(e, "tagName"),
  8450. setNodeSourceCodeLocation(e, t) {
  8451. e.sourceCodeLocation = t
  8452. },
  8453. getNodeSourceCodeLocation: e => e.sourceCodeLocation,
  8454. updateNodeSourceCodeLocation(e, t) {
  8455. e.sourceCodeLocation = {...e.sourceCodeLocation, ...t
  8456. }
  8457. }
  8458. }, mc = ["+//silmaril//dtd html pro v0r11 19970101//", "-//as//dtd html 3.0 aswedit + extensions//", "-//advasoft ltd//dtd html 3.0 aswedit + extensions//", "-//ietf//dtd html 2.0 level 1//", "-//ietf//dtd html 2.0 level 2//", "-//ietf//dtd html 2.0 strict level 1//", "-//ietf//dtd html 2.0 strict level 2//", "-//ietf//dtd html 2.0 strict//", "-//ietf//dtd html 2.0//", "-//ietf//dtd html 2.1e//", "-//ietf//dtd html 3.0//", "-//ietf//dtd html 3.2 final//", "-//ietf//dtd html 3.2//", "-//ietf//dtd html 3//", "-//ietf//dtd html level 0//", "-//ietf//dtd html level 1//", "-//ietf//dtd html level 2//", "-//ietf//dtd html level 3//", "-//ietf//dtd html strict level 0//", "-//ietf//dtd html strict level 1//", "-//ietf//dtd html strict level 2//", "-//ietf//dtd html strict level 3//", "-//ietf//dtd html strict//", "-//ietf//dtd html//", "-//metrius//dtd metrius presentational//", "-//microsoft//dtd internet explorer 2.0 html strict//", "-//microsoft//dtd internet explorer 2.0 html//", "-//microsoft//dtd internet explorer 2.0 tables//", "-//microsoft//dtd internet explorer 3.0 html strict//", "-//microsoft//dtd internet explorer 3.0 html//", "-//microsoft//dtd internet explorer 3.0 tables//", "-//netscape comm. corp.//dtd html//", "-//netscape comm. corp.//dtd strict html//", "-//o'reilly and associates//dtd html 2.0//", "-//o'reilly and associates//dtd html extended 1.0//", "-//o'reilly and associates//dtd html extended relaxed 1.0//", "-//sq//dtd html 2.0 hotmetal + extensions//", "-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//", "-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//", "-//spyglass//dtd html 2.0 extended//", "-//sun microsystems corp.//dtd hotjava html//", "-//sun microsystems corp.//dtd hotjava strict html//", "-//w3c//dtd html 3 1995-03-24//", "-//w3c//dtd html 3.2 draft//", "-//w3c//dtd html 3.2 final//", "-//w3c//dtd html 3.2//", "-//w3c//dtd html 3.2s draft//", "-//w3c//dtd html 4.0 frameset//", "-//w3c//dtd html 4.0 transitional//", "-//w3c//dtd html experimental 19960712//", "-//w3c//dtd html experimental 970421//", "-//w3c//dtd w3 html//", "-//w3o//dtd w3 html 3.0//", "-//webtechs//dtd mozilla html 2.0//", "-//webtechs//dtd mozilla html//"], Tc = [...mc, "-//w3c//dtd html 4.01 frameset//", "-//w3c//dtd html 4.01 transitional//"], _c = new Set(["-//w3o//dtd w3 html strict 3.0//en//", "-/w3c/dtd html 4.0 transitional/en", "html"]), Ac = ["-//w3c//dtd xhtml 1.0 frameset//", "-//w3c//dtd xhtml 1.0 transitional//"], gc = [...Ac, "-//w3c//dtd html 4.01 frameset//", "-//w3c//dtd html 4.01 transitional//"];
  8459. function Nc(e, t) {
  8460. return t.some((t => e.startsWith(t)))
  8461. }
  8462. const Cc = "text/html", Ic = "application/xhtml+xml", Sc = new Map(["attributeName", "attributeType", "baseFrequency", "baseProfile", "calcMode", "clipPathUnits", "diffuseConstant", "edgeMode", "filterUnits", "glyphRef", "gradientTransform", "gradientUnits", "kernelMatrix", "kernelUnitLength", "keyPoints", "keySplines", "keyTimes", "lengthAdjust", "limitingConeAngle", "markerHeight", "markerUnits", "markerWidth", "maskContentUnits", "maskUnits", "numOctaves", "pathLength", "patternContentUnits", "patternTransform", "patternUnits", "pointsAtX", "pointsAtY", "pointsAtZ", "preserveAlpha", "preserveAspectRatio", "primitiveUnits", "refX", "refY", "repeatCount", "repeatDur", "requiredExtensions", "requiredFeatures", "specularConstant", "specularExponent", "spreadMethod", "startOffset", "stdDeviation", "stitchTiles", "surfaceScale", "systemLanguage", "tableValues", "targetX", "targetY", "textLength", "viewBox", "viewTarget", "xChannelSelector", "yChannelSelector", "zoomAndPan"].map((e => [e.toLowerCase(), e]))), bc = new Map([
  8463. ["xlink:actuate", {
  8464. prefix: "xlink",
  8465. name: "actuate",
  8466. namespace: vo.XLINK
  8467. }],
  8468. ["xlink:arcrole", {
  8469. prefix: "xlink",
  8470. name: "arcrole",
  8471. namespace: vo.XLINK
  8472. }],
  8473. ["xlink:href", {
  8474. prefix: "xlink",
  8475. name: "href",
  8476. namespace: vo.XLINK
  8477. }],
  8478. ["xlink:role", {
  8479. prefix: "xlink",
  8480. name: "role",
  8481. namespace: vo.XLINK
  8482. }],
  8483. ["xlink:show", {
  8484. prefix: "xlink",
  8485. name: "show",
  8486. namespace: vo.XLINK
  8487. }],
  8488. ["xlink:title", {
  8489. prefix: "xlink",
  8490. name: "title",
  8491. namespace: vo.XLINK
  8492. }],
  8493. ["xlink:type", {
  8494. prefix: "xlink",
  8495. name: "type",
  8496. namespace: vo.XLINK
  8497. }],
  8498. ["xml:base", {
  8499. prefix: "xml",
  8500. name: "base",
  8501. namespace: vo.XML
  8502. }],
  8503. ["xml:lang", {
  8504. prefix: "xml",
  8505. name: "lang",
  8506. namespace: vo.XML
  8507. }],
  8508. ["xml:space", {
  8509. prefix: "xml",
  8510. name: "space",
  8511. namespace: vo.XML
  8512. }],
  8513. ["xmlns", {
  8514. prefix: "",
  8515. name: "xmlns",
  8516. namespace: vo.XMLNS
  8517. }],
  8518. ["xmlns:xlink", {
  8519. prefix: "xmlns",
  8520. name: "xlink",
  8521. namespace: vo.XMLNS
  8522. }]
  8523. ]), Oc = new Map(["altGlyph", "altGlyphDef", "altGlyphItem", "animateColor", "animateMotion", "animateTransform", "clipPath", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "foreignObject", "glyphRef", "linearGradient", "radialGradient", "textPath"].map((e => [e.toLowerCase(), e]))), yc = new Set([Po.B, Po.BIG, Po.BLOCKQUOTE, Po.BODY, Po.BR, Po.CENTER, Po.CODE, Po.DD, Po.DIV, Po.DL, Po.DT, Po.EM, Po.EMBED, Po.H1, Po.H2, Po.H3, Po.H4, Po.H5, Po.H6, Po.HEAD, Po.HR, Po.I, Po.IMG, Po.LI, Po.LISTING, Po.MENU, Po.META, Po.NOBR, Po.OL, Po.P, Po.PRE, Po.RUBY, Po.S, Po.SMALL, Po.SPAN, Po.STRONG, Po.STRIKE, Po.SUB, Po.SUP, Po.TABLE, Po.TT, Po.U, Po.UL, Po.VAR]);
  8524. function Lc(e) {
  8525. for (let t = 0; t < e.attrs.length; t++) if ("definitionurl" === e.attrs[t].name) {
  8526. e.attrs[t].name = "definitionURL";
  8527. break
  8528. }
  8529. }
  8530. function kc(e) {
  8531. for (let t = 0; t < e.attrs.length; t++) {
  8532. const n = Sc.get(e.attrs[t].name);
  8533. null != n && (e.attrs[t].name = n)
  8534. }
  8535. }
  8536. function vc(e) {
  8537. for (let t = 0; t < e.attrs.length; t++) {
  8538. const n = bc.get(e.attrs[t].name);
  8539. n && (e.attrs[t].prefix = n.prefix, e.attrs[t].name = n.name, e.attrs[t].namespace = n.namespace)
  8540. }
  8541. }
  8542. function Dc(e, t, n, r) {
  8543. return (!r || r === vo.HTML) && function(e, t, n) {
  8544. if (t === vo.MATHML && e === Po.ANNOTATION_XML) for (let e = 0; e < n.length; e++) if (n[e].name === Do.ENCODING) {
  8545. const t = n[e].value.toLowerCase();
  8546. return t === Cc || t === Ic
  8547. }
  8548. return t === vo.SVG && (e === Po.FOREIGN_OBJECT || e === Po.DESC || e === Po.TITLE)
  8549. }(e, t, n) || (!r || r === vo.MATHML) && function(e, t) {
  8550. return t === vo.MATHML && (e === Po.MI || e === Po.MO || e === Po.MN || e === Po.MS || e === Po.MTEXT)
  8551. }(e, t)
  8552. }
  8553. var Rc;
  8554. ! function(e) {
  8555. e[e.INITIAL = 0] = "INITIAL", e[e.BEFORE_HTML = 1] = "BEFORE_HTML", e[e.BEFORE_HEAD = 2] = "BEFORE_HEAD", e[e.IN_HEAD = 3] = "IN_HEAD", e[e.IN_HEAD_NO_SCRIPT = 4] = "IN_HEAD_NO_SCRIPT", e[e.AFTER_HEAD = 5] = "AFTER_HEAD", e[e.IN_BODY = 6] = "IN_BODY", e[e.TEXT = 7] = "TEXT", e[e.IN_TABLE = 8] = "IN_TABLE", e[e.IN_TABLE_TEXT = 9] = "IN_TABLE_TEXT", e[e.IN_CAPTION = 10] = "IN_CAPTION", e[e.IN_COLUMN_GROUP = 11] = "IN_COLUMN_GROUP", e[e.IN_TABLE_BODY = 12] = "IN_TABLE_BODY", e[e.IN_ROW = 13] = "IN_ROW", e[e.IN_CELL = 14] = "IN_CELL", e[e.IN_SELECT = 15] = "IN_SELECT", e[e.IN_SELECT_IN_TABLE = 16] = "IN_SELECT_IN_TABLE", e[e.IN_TEMPLATE = 17] = "IN_TEMPLATE", e[e.AFTER_BODY = 18] = "AFTER_BODY", e[e.IN_FRAMESET = 19] = "IN_FRAMESET", e[e.AFTER_FRAMESET = 20] = "AFTER_FRAMESET", e[e.AFTER_AFTER_BODY = 21] = "AFTER_AFTER_BODY", e[e.AFTER_AFTER_FRAMESET = 22] = "AFTER_AFTER_FRAMESET"
  8556. }(Rc || (Rc = {}));
  8557. const Mc = {
  8558. startLine: -1,
  8559. startCol: -1,
  8560. startOffset: -1,
  8561. endLine: -1,
  8562. endCol: -1,
  8563. endOffset: -1
  8564. }, Pc = new Set([Po.TABLE, Po.TBODY, Po.TFOOT, Po.THEAD, Po.TR]), xc = {
  8565. scriptingEnabled: !0,
  8566. sourceCodeLocationInfo: !1,
  8567. treeAdapter: Ec,
  8568. onParseError: null
  8569. };
  8570. class wc {
  8571. constructor(e, t, n = null, r = null) {
  8572. this.fragmentContext = n, this.scriptHandler = r, this.currentToken = null, this.stopped = !1, this.insertionMode = Rc.INITIAL, this.originalInsertionMode = Rc.INITIAL, this.headElement = null, this.formElement = null, this.currentNotInHTML = !1, this.tmplInsertionModeStack = [], this.pendingCharacterTokens = [], this.hasNonWhitespacePendingCharacterToken = !1, this.framesetOk = !0, this.skipNextNewLine = !1, this.fosterParentingEnabled = !1, this.options = {...xc, ...e
  8573. }, this.treeAdapter = this.options.treeAdapter, this.onParseError = this.options.onParseError, this.onParseError && (this.options.sourceCodeLocationInfo = !0), this.document = null != t ? t : this.treeAdapter.createDocument(), this.tokenizer = new tc(this.options, this), this.activeFormattingElements = new fc(this.treeAdapter), this.fragmentContextID = n ? Fo(this.treeAdapter.getTagName(n)) : Po.UNKNOWN, this._setContextModes(null != n ? n : this.document, this.fragmentContextID), this.openElements = new hc(this.document, this.treeAdapter, this)
  8574. }
  8575. static parse(e, t) {
  8576. const n = new this(t);
  8577. return n.tokenizer.write(e, !0), n.document
  8578. }
  8579. static getFragmentParser(e, t) {
  8580. const n = {...xc, ...t
  8581. };
  8582. null != e || (e = n.treeAdapter.createElement(Mo.TEMPLATE, vo.HTML, []));
  8583. const r = n.treeAdapter.createElement("documentmock", vo.HTML, []), i = new this(n, r, e);
  8584. return i.fragmentContextID === Po.TEMPLATE && i.tmplInsertionModeStack.unshift(Rc.IN_TEMPLATE), i._initTokenizerForFragmentParsing(), i._insertFakeRootElement(), i._resetInsertionMode(), i._findFormInFragmentContext(), i
  8585. }
  8586. getFragment() {
  8587. const e = this.treeAdapter.getFirstChild(this.document), t = this.treeAdapter.createDocumentFragment();
  8588. return this._adoptNodes(e, t), t
  8589. }
  8590. _err(e, t, n) {
  8591. var r;
  8592. if (!this.onParseError) return;
  8593. const i = null !== (r = e.location) && void 0 !== r ? r : Mc, s = {
  8594. code: t,
  8595. startLine: i.startLine,
  8596. startCol: i.startCol,
  8597. startOffset: i.startOffset,
  8598. endLine: n ? i.startLine : i.endLine,
  8599. endCol: n ? i.startCol : i.endCol,
  8600. endOffset: n ? i.startOffset : i.endOffset
  8601. };
  8602. this.onParseError(s)
  8603. }
  8604. onItemPush(e, t, n) {
  8605. var r, i;
  8606. null === (i = (r = this.treeAdapter).onItemPush) || void 0 === i || i.call(r, e), n && this.openElements.stackTop > 0 && this._setContextModes(e, t)
  8607. }
  8608. onItemPop(e, t) {
  8609. var n, r;
  8610. if (this.options.sourceCodeLocationInfo && this._setEndLocation(e, this.currentToken), null === (r = (n = this.treeAdapter).onItemPop) || void 0 === r || r.call(n, e, this.openElements.current), t) {
  8611. let e, t;
  8612. 0 === this.openElements.stackTop && this.fragmentContext ? (e = this.fragmentContext, t = this.fragmentContextID) : ({
  8613. current: e,
  8614. currentTagId: t
  8615. } = this.openElements), this._setContextModes(e, t)
  8616. }
  8617. }
  8618. _setContextModes(e, t) {
  8619. const n = e === this.document || this.treeAdapter.getNamespaceURI(e) === vo.HTML;
  8620. this.currentNotInHTML = !n, this.tokenizer.inForeignNode = !n && !this._isIntegrationPoint(t, e)
  8621. }
  8622. _switchToTextParsing(e, t) {
  8623. this._insertElement(e, vo.HTML), this.tokenizer.state = t, this.originalInsertionMode = this.insertionMode, this.insertionMode = Rc.TEXT
  8624. }
  8625. switchToPlaintextParsing() {
  8626. this.insertionMode = Rc.TEXT, this.originalInsertionMode = Rc.IN_BODY, this.tokenizer.state = jo.PLAINTEXT
  8627. }
  8628. _getAdjustedCurrentElement() {
  8629. return 0 === this.openElements.stackTop && this.fragmentContext ? this.fragmentContext : this.openElements.current
  8630. }
  8631. _findFormInFragmentContext() {
  8632. let e = this.fragmentContext;
  8633. for (; e;) {
  8634. if (this.treeAdapter.getTagName(e) === Mo.FORM) {
  8635. this.formElement = e;
  8636. break
  8637. }
  8638. e = this.treeAdapter.getParentNode(e)
  8639. }
  8640. }
  8641. _initTokenizerForFragmentParsing() {
  8642. if (this.fragmentContext && this.treeAdapter.getNamespaceURI(this.fragmentContext) === vo.HTML) switch (this.fragmentContextID) {
  8643. case Po.TITLE:
  8644. case Po.TEXTAREA:
  8645. this.tokenizer.state = jo.RCDATA;
  8646. break;
  8647. case Po.STYLE:
  8648. case Po.XMP:
  8649. case Po.IFRAME:
  8650. case Po.NOEMBED:
  8651. case Po.NOFRAMES:
  8652. case Po.NOSCRIPT:
  8653. this.tokenizer.state = jo.RAWTEXT;
  8654. break;
  8655. case Po.SCRIPT:
  8656. this.tokenizer.state = jo.SCRIPT_DATA;
  8657. break;
  8658. case Po.PLAINTEXT:
  8659. this.tokenizer.state = jo.PLAINTEXT
  8660. }
  8661. }
  8662. _setDocumentType(e) {
  8663. const t = e.name || "", n = e.publicId || "", r = e.systemId || "";
  8664. if (this.treeAdapter.setDocumentType(this.document, t, n, r), e.location) {
  8665. const t = this.treeAdapter.getChildNodes(this.document).find((e => this.treeAdapter.isDocumentTypeNode(e)));
  8666. t && this.treeAdapter.setNodeSourceCodeLocation(t, e.location)
  8667. }
  8668. }
  8669. _attachElementToTree(e, t) {
  8670. if (this.options.sourceCodeLocationInfo) {
  8671. const n = t && {...t, startTag: t
  8672. };
  8673. this.treeAdapter.setNodeSourceCodeLocation(e, n)
  8674. }
  8675. if (this._shouldFosterParentOnInsertion()) this._fosterParentElement(e);
  8676. else {
  8677. const t = this.openElements.currentTmplContentOrNode;
  8678. this.treeAdapter.appendChild(t, e)
  8679. }
  8680. }
  8681. _appendElement(e, t) {
  8682. const n = this.treeAdapter.createElement(e.tagName, t, e.attrs);
  8683. this._attachElementToTree(n, e.location)
  8684. }
  8685. _insertElement(e, t) {
  8686. const n = this.treeAdapter.createElement(e.tagName, t, e.attrs);
  8687. this._attachElementToTree(n, e.location), this.openElements.push(n, e.tagID)
  8688. }
  8689. _insertFakeElement(e, t) {
  8690. const n = this.treeAdapter.createElement(e, vo.HTML, []);
  8691. this._attachElementToTree(n, null), this.openElements.push(n, t)
  8692. }
  8693. _insertTemplate(e) {
  8694. const t = this.treeAdapter.createElement(e.tagName, vo.HTML, e.attrs), n = this.treeAdapter.createDocumentFragment();
  8695. this.treeAdapter.setTemplateContent(t, n), this._attachElementToTree(t, e.location), this.openElements.push(t, e.tagID), this.options.sourceCodeLocationInfo && this.treeAdapter.setNodeSourceCodeLocation(n, null)
  8696. }
  8697. _insertFakeRootElement() {
  8698. const e = this.treeAdapter.createElement(Mo.HTML, vo.HTML, []);
  8699. this.options.sourceCodeLocationInfo && this.treeAdapter.setNodeSourceCodeLocation(e, null), this.treeAdapter.appendChild(this.openElements.current, e), this.openElements.push(e, Po.HTML)
  8700. }
  8701. _appendCommentNode(e, t) {
  8702. const n = this.treeAdapter.createCommentNode(e.data);
  8703. this.treeAdapter.appendChild(t, n), this.options.sourceCodeLocationInfo && this.treeAdapter.setNodeSourceCodeLocation(n, e.location)
  8704. }
  8705. _insertCharacters(e) {
  8706. let t, n;
  8707. if (this._shouldFosterParentOnInsertion() ? (({
  8708. parent: t,
  8709. beforeElement: n
  8710. } = this._findFosterParentingLocation()), n ? this.treeAdapter.insertTextBefore(t, e.chars, n) : this.treeAdapter.insertText(t, e.chars)) : (t = this.openElements.currentTmplContentOrNode, this.treeAdapter.insertText(t, e.chars)), !e.location) return;
  8711. const r = this.treeAdapter.getChildNodes(t), i = n ? r.lastIndexOf(n) : r.length, s = r[i - 1];
  8712. if (this.treeAdapter.getNodeSourceCodeLocation(s)) {
  8713. const {
  8714. endLine: t,
  8715. endCol: n,
  8716. endOffset: r
  8717. } = e.location;
  8718. this.treeAdapter.updateNodeSourceCodeLocation(s, {
  8719. endLine: t,
  8720. endCol: n,
  8721. endOffset: r
  8722. })
  8723. } else this.options.sourceCodeLocationInfo && this.treeAdapter.setNodeSourceCodeLocation(s, e.location)
  8724. }
  8725. _adoptNodes(e, t) {
  8726. for (let n = this.treeAdapter.getFirstChild(e); n; n = this.treeAdapter.getFirstChild(e)) this.treeAdapter.detachNode(n), this.treeAdapter.appendChild(t, n)
  8727. }
  8728. _setEndLocation(e, t) {
  8729. if (this.treeAdapter.getNodeSourceCodeLocation(e) && t.location) {
  8730. const n = t.location, r = this.treeAdapter.getTagName(e), i = t.type === To.END_TAG && r === t.tagName ? {
  8731. endTag: {...n
  8732. },
  8733. endLine: n.endLine,
  8734. endCol: n.endCol,
  8735. endOffset: n.endOffset
  8736. } : {
  8737. endLine: n.startLine,
  8738. endCol: n.startCol,
  8739. endOffset: n.startOffset
  8740. };
  8741. this.treeAdapter.updateNodeSourceCodeLocation(e, i)
  8742. }
  8743. }
  8744. shouldProcessStartTagTokenInForeignContent(e) {
  8745. if (!this.currentNotInHTML) return !1;
  8746. let t, n;
  8747. return 0 === this.openElements.stackTop && this.fragmentContext ? (t = this.fragmentContext, n = this.fragmentContextID) : ({
  8748. current: t,
  8749. currentTagId: n
  8750. } = this.openElements), (e.tagID !== Po.SVG || this.treeAdapter.getTagName(t) !== Mo.ANNOTATION_XML || this.treeAdapter.getNamespaceURI(t) !== vo.MATHML) && (this.tokenizer.inForeignNode || (e.tagID === Po.MGLYPH || e.tagID === Po.MALIGNMARK) && !this._isIntegrationPoint(n, t, vo.HTML))
  8751. }
  8752. _processToken(e) {
  8753. switch (e.type) {
  8754. case To.CHARACTER:
  8755. this.onCharacter(e);
  8756. break;
  8757. case To.NULL_CHARACTER:
  8758. this.onNullCharacter(e);
  8759. break;
  8760. case To.COMMENT:
  8761. this.onComment(e);
  8762. break;
  8763. case To.DOCTYPE:
  8764. this.onDoctype(e);
  8765. break;
  8766. case To.START_TAG:
  8767. this._processStartTag(e);
  8768. break;
  8769. case To.END_TAG:
  8770. this.onEndTag(e);
  8771. break;
  8772. case To.EOF:
  8773. this.onEof(e);
  8774. break;
  8775. case To.WHITESPACE_CHARACTER:
  8776. this.onWhitespaceCharacter(e)
  8777. }
  8778. }
  8779. _isIntegrationPoint(e, t, n) {
  8780. return Dc(e, this.treeAdapter.getNamespaceURI(t), this.treeAdapter.getAttrList(t), n)
  8781. }
  8782. _reconstructActiveFormattingElements() {
  8783. const e = this.activeFormattingElements.entries.length;
  8784. if (e) {
  8785. const t = this.activeFormattingElements.entries.findIndex((e => e.type === uc.Marker || this.openElements.contains(e.element)));
  8786. for (let n = t < 0 ? e - 1 : t - 1; n >= 0; n--) {
  8787. const e = this.activeFormattingElements.entries[n];
  8788. this._insertElement(e.token, this.treeAdapter.getNamespaceURI(e.element)), e.element = this.openElements.current
  8789. }
  8790. }
  8791. }
  8792. _closeTableCell() {
  8793. this.openElements.generateImpliedEndTags(), this.openElements.popUntilTableCellPopped(), this.activeFormattingElements.clearToLastMarker(), this.insertionMode = Rc.IN_ROW
  8794. }
  8795. _closePElement() {
  8796. this.openElements.generateImpliedEndTagsWithExclusion(Po.P), this.openElements.popUntilTagNamePopped(Po.P)
  8797. }
  8798. _resetInsertionMode() {
  8799. for (let e = this.openElements.stackTop; e >= 0; e--) switch (0 === e && this.fragmentContext ? this.fragmentContextID : this.openElements.tagIDs[e]) {
  8800. case Po.TR:
  8801. return void(this.insertionMode = Rc.IN_ROW);
  8802. case Po.TBODY:
  8803. case Po.THEAD:
  8804. case Po.TFOOT:
  8805. return void(this.insertionMode = Rc.IN_TABLE_BODY);
  8806. case Po.CAPTION:
  8807. return void(this.insertionMode = Rc.IN_CAPTION);
  8808. case Po.COLGROUP:
  8809. return void(this.insertionMode = Rc.IN_COLUMN_GROUP);
  8810. case Po.TABLE:
  8811. return void(this.insertionMode = Rc.IN_TABLE);
  8812. case Po.BODY:
  8813. return void(this.insertionMode = Rc.IN_BODY);
  8814. case Po.FRAMESET:
  8815. return void(this.insertionMode = Rc.IN_FRAMESET);
  8816. case Po.SELECT:
  8817. return void this._resetInsertionModeForSelect(e);
  8818. case Po.TEMPLATE:
  8819. return void(this.insertionMode = this.tmplInsertionModeStack[0]);
  8820. case Po.HTML:
  8821. return void(this.insertionMode = this.headElement ? Rc.AFTER_HEAD : Rc.BEFORE_HEAD);
  8822. case Po.TD:
  8823. case Po.TH:
  8824. if (e > 0) return void(this.insertionMode = Rc.IN_CELL);
  8825. break;
  8826. case Po.HEAD:
  8827. if (e > 0) return void(this.insertionMode = Rc.IN_HEAD)
  8828. }
  8829. this.insertionMode = Rc.IN_BODY
  8830. }
  8831. _resetInsertionModeForSelect(e) {
  8832. if (e > 0) for (let t = e - 1; t > 0; t--) {
  8833. const e = this.openElements.tagIDs[t];
  8834. if (e === Po.TEMPLATE) break;
  8835. if (e === Po.TABLE) return void(this.insertionMode = Rc.IN_SELECT_IN_TABLE)
  8836. }
  8837. this.insertionMode = Rc.IN_SELECT
  8838. }
  8839. _isElementCausesFosterParenting(e) {
  8840. return Pc.has(e)
  8841. }
  8842. _shouldFosterParentOnInsertion() {
  8843. return this.fosterParentingEnabled && this._isElementCausesFosterParenting(this.openElements.currentTagId)
  8844. }
  8845. _findFosterParentingLocation() {
  8846. for (let e = this.openElements.stackTop; e >= 0; e--) {
  8847. const t = this.openElements.items[e];
  8848. switch (this.openElements.tagIDs[e]) {
  8849. case Po.TEMPLATE:
  8850. if (this.treeAdapter.getNamespaceURI(t) === vo.HTML) return {
  8851. parent: this.treeAdapter.getTemplateContent(t),
  8852. beforeElement: null
  8853. };
  8854. break;
  8855. case Po.TABLE:
  8856. {
  8857. const n = this.treeAdapter.getParentNode(t);
  8858. return n ? {
  8859. parent: n,
  8860. beforeElement: t
  8861. } : {
  8862. parent: this.openElements.items[e - 1],
  8863. beforeElement: null
  8864. }
  8865. }
  8866. }
  8867. }
  8868. return {
  8869. parent: this.openElements.items[0],
  8870. beforeElement: null
  8871. }
  8872. }
  8873. _fosterParentElement(e) {
  8874. const t = this._findFosterParentingLocation();
  8875. t.beforeElement ? this.treeAdapter.insertBefore(t.parent, e, t.beforeElement) : this.treeAdapter.appendChild(t.parent, e)
  8876. }
  8877. _isSpecialElement(e, t) {
  8878. const n = this.treeAdapter.getNamespaceURI(e);
  8879. return Ho[n].has(t)
  8880. }
  8881. onCharacter(e) {
  8882. if (this.skipNextNewLine = !1, this.tokenizer.inForeignNode)! function(e, t) {
  8883. e._insertCharacters(t), e.framesetOk = !1
  8884. }(this, e);
  8885. else switch (this.insertionMode) {
  8886. case Rc.INITIAL:
  8887. Vc(this, e);
  8888. break;
  8889. case Rc.BEFORE_HTML:
  8890. Wc(this, e);
  8891. break;
  8892. case Rc.BEFORE_HEAD:
  8893. Qc(this, e);
  8894. break;
  8895. case Rc.IN_HEAD:
  8896. zc(this, e);
  8897. break;
  8898. case Rc.IN_HEAD_NO_SCRIPT:
  8899. Jc(this, e);
  8900. break;
  8901. case Rc.AFTER_HEAD:
  8902. Zc(this, e);
  8903. break;
  8904. case Rc.IN_BODY:
  8905. case Rc.IN_CAPTION:
  8906. case Rc.IN_CELL:
  8907. case Rc.IN_TEMPLATE:
  8908. nl(this, e);
  8909. break;
  8910. case Rc.TEXT:
  8911. case Rc.IN_SELECT:
  8912. case Rc.IN_SELECT_IN_TABLE:
  8913. this._insertCharacters(e);
  8914. break;
  8915. case Rc.IN_TABLE:
  8916. case Rc.IN_TABLE_BODY:
  8917. case Rc.IN_ROW:
  8918. ul(this, e);
  8919. break;
  8920. case Rc.IN_TABLE_TEXT:
  8921. ml(this, e);
  8922. break;
  8923. case Rc.IN_COLUMN_GROUP:
  8924. gl(this, e);
  8925. break;
  8926. case Rc.AFTER_BODY:
  8927. kl(this, e);
  8928. break;
  8929. case Rc.AFTER_AFTER_BODY:
  8930. vl(this, e)
  8931. }
  8932. }
  8933. onNullCharacter(e) {
  8934. if (this.skipNextNewLine = !1, this.tokenizer.inForeignNode)! function(e, t) {
  8935. t.chars = "�", e._insertCharacters(t)
  8936. }(this, e);
  8937. else switch (this.insertionMode) {
  8938. case Rc.INITIAL:
  8939. Vc(this, e);
  8940. break;
  8941. case Rc.BEFORE_HTML:
  8942. Wc(this, e);
  8943. break;
  8944. case Rc.BEFORE_HEAD:
  8945. Qc(this, e);
  8946. break;
  8947. case Rc.IN_HEAD:
  8948. zc(this, e);
  8949. break;
  8950. case Rc.IN_HEAD_NO_SCRIPT:
  8951. Jc(this, e);
  8952. break;
  8953. case Rc.AFTER_HEAD:
  8954. Zc(this, e);
  8955. break;
  8956. case Rc.TEXT:
  8957. this._insertCharacters(e);
  8958. break;
  8959. case Rc.IN_TABLE:
  8960. case Rc.IN_TABLE_BODY:
  8961. case Rc.IN_ROW:
  8962. ul(this, e);
  8963. break;
  8964. case Rc.IN_COLUMN_GROUP:
  8965. gl(this, e);
  8966. break;
  8967. case Rc.AFTER_BODY:
  8968. kl(this, e);
  8969. break;
  8970. case Rc.AFTER_AFTER_BODY:
  8971. vl(this, e)
  8972. }
  8973. }
  8974. onComment(e) {
  8975. if (this.skipNextNewLine = !1, this.currentNotInHTML) Kc(this, e);
  8976. else switch (this.insertionMode) {
  8977. case Rc.INITIAL:
  8978. case Rc.BEFORE_HTML:
  8979. case Rc.BEFORE_HEAD:
  8980. case Rc.IN_HEAD:
  8981. case Rc.IN_HEAD_NO_SCRIPT:
  8982. case Rc.AFTER_HEAD:
  8983. case Rc.IN_BODY:
  8984. case Rc.IN_TABLE:
  8985. case Rc.IN_CAPTION:
  8986. case Rc.IN_COLUMN_GROUP:
  8987. case Rc.IN_TABLE_BODY:
  8988. case Rc.IN_ROW:
  8989. case Rc.IN_CELL:
  8990. case Rc.IN_SELECT:
  8991. case Rc.IN_SELECT_IN_TABLE:
  8992. case Rc.IN_TEMPLATE:
  8993. case Rc.IN_FRAMESET:
  8994. case Rc.AFTER_FRAMESET:
  8995. Kc(this, e);
  8996. break;
  8997. case Rc.IN_TABLE_TEXT:
  8998. Tl(this, e);
  8999. break;
  9000. case Rc.AFTER_BODY:
  9001. ! function(e, t) {
  9002. e._appendCommentNode(t, e.openElements.items[0])
  9003. }(this, e);
  9004. break;
  9005. case Rc.AFTER_AFTER_BODY:
  9006. case Rc.AFTER_AFTER_FRAMESET:
  9007. ! function(e, t) {
  9008. e._appendCommentNode(t, e.document)
  9009. }(this, e)
  9010. }
  9011. }
  9012. onDoctype(e) {
  9013. switch (this.skipNextNewLine = !1, this.insertionMode) {
  9014. case Rc.INITIAL:
  9015. ! function(e, t) {
  9016. e._setDocumentType(t);
  9017. const n = t.forceQuirks ? Ro.QUIRKS : function(e) {
  9018. if ("html" !== e.name) return Ro.QUIRKS;
  9019. const {
  9020. systemId: t
  9021. } = e;
  9022. if (t && "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd" === t.toLowerCase()) return Ro.QUIRKS;
  9023. let {
  9024. publicId: n
  9025. } = e;
  9026. if (null !== n) {
  9027. if (n = n.toLowerCase(), _c.has(n)) return Ro.QUIRKS;
  9028. let e = null === t ? Tc : mc;
  9029. if (Nc(n, e)) return Ro.QUIRKS;
  9030. if (e = null === t ? Ac : gc, Nc(n, e)) return Ro.LIMITED_QUIRKS
  9031. }
  9032. return Ro.NO_QUIRKS
  9033. }(t);
  9034. (function(e) {
  9035. return "html" === e.name && null === e.publicId && (null === e.systemId || "about:legacy-compat" === e.systemId)
  9036. })(t) || e._err(t, Eo.nonConformingDoctype);
  9037. e.treeAdapter.setDocumentMode(e.document, n), e.insertionMode = Rc.BEFORE_HTML
  9038. }(this, e);
  9039. break;
  9040. case Rc.BEFORE_HEAD:
  9041. case Rc.IN_HEAD:
  9042. case Rc.IN_HEAD_NO_SCRIPT:
  9043. case Rc.AFTER_HEAD:
  9044. this._err(e, Eo.misplacedDoctype);
  9045. break;
  9046. case Rc.IN_TABLE_TEXT:
  9047. Tl(this, e)
  9048. }
  9049. }
  9050. onStartTag(e) {
  9051. this.skipNextNewLine = !1, this.currentToken = e, this._processStartTag(e), e.selfClosing && !e.ackSelfClosing && this._err(e, Eo.nonVoidHtmlElementStartTagWithTrailingSolidus)
  9052. }
  9053. _processStartTag(e) {
  9054. this.shouldProcessStartTagTokenInForeignContent(e) ? function(e, t) {
  9055. if (function(e) {
  9056. const t = e.tagID;
  9057. return t === Po.FONT && e.attrs.some((({
  9058. name: e
  9059. }) => e === Do.COLOR || e === Do.SIZE || e === Do.FACE)) || yc.has(t)
  9060. }(t)) Dl(e), e._startTagOutsideForeignContent(t);
  9061. else {
  9062. const n = e._getAdjustedCurrentElement(), r = e.treeAdapter.getNamespaceURI(n);
  9063. r === vo.MATHML ? Lc(t) : r === vo.SVG && (! function(e) {
  9064. const t = Oc.get(e.tagName);
  9065. null != t && (e.tagName = t, e.tagID = Fo(e.tagName))
  9066. }(t), kc(t)), vc(t), t.selfClosing ? e._appendElement(t, r) : e._insertElement(t, r), t.ackSelfClosing = !0
  9067. }
  9068. }(this, e) : this._startTagOutsideForeignContent(e)
  9069. }
  9070. _startTagOutsideForeignContent(e) {
  9071. switch (this.insertionMode) {
  9072. case Rc.INITIAL:
  9073. Vc(this, e);
  9074. break;
  9075. case Rc.BEFORE_HTML:
  9076. ! function(e, t) {
  9077. t.tagID === Po.HTML ? (e._insertElement(t, vo.HTML), e.insertionMode = Rc.BEFORE_HEAD) : Wc(e, t)
  9078. }(this, e);
  9079. break;
  9080. case Rc.BEFORE_HEAD:
  9081. ! function(e, t) {
  9082. switch (t.tagID) {
  9083. case Po.HTML:
  9084. ol(e, t);
  9085. break;
  9086. case Po.HEAD:
  9087. e._insertElement(t, vo.HTML), e.headElement = e.openElements.current, e.insertionMode = Rc.IN_HEAD;
  9088. break;
  9089. default:
  9090. Qc(e, t)
  9091. }
  9092. }(this, e);
  9093. break;
  9094. case Rc.IN_HEAD:
  9095. Xc(this, e);
  9096. break;
  9097. case Rc.IN_HEAD_NO_SCRIPT:
  9098. ! function(e, t) {
  9099. switch (t.tagID) {
  9100. case Po.HTML:
  9101. ol(e, t);
  9102. break;
  9103. case Po.BASEFONT:
  9104. case Po.BGSOUND:
  9105. case Po.HEAD:
  9106. case Po.LINK:
  9107. case Po.META:
  9108. case Po.NOFRAMES:
  9109. case Po.STYLE:
  9110. Xc(e, t);
  9111. break;
  9112. case Po.NOSCRIPT:
  9113. e._err(t, Eo.nestedNoscriptInHead);
  9114. break;
  9115. default:
  9116. Jc(e, t)
  9117. }
  9118. }(this, e);
  9119. break;
  9120. case Rc.AFTER_HEAD:
  9121. ! function(e, t) {
  9122. switch (t.tagID) {
  9123. case Po.HTML:
  9124. ol(e, t);
  9125. break;
  9126. case Po.BODY:
  9127. e._insertElement(t, vo.HTML), e.framesetOk = !1, e.insertionMode = Rc.IN_BODY;
  9128. break;
  9129. case Po.FRAMESET:
  9130. e._insertElement(t, vo.HTML), e.insertionMode = Rc.IN_FRAMESET;
  9131. break;
  9132. case Po.BASE:
  9133. case Po.BASEFONT:
  9134. case Po.BGSOUND:
  9135. case Po.LINK:
  9136. case Po.META:
  9137. case Po.NOFRAMES:
  9138. case Po.SCRIPT:
  9139. case Po.STYLE:
  9140. case Po.TEMPLATE:
  9141. case Po.TITLE:
  9142. e._err(t, Eo.abandonedHeadElementChild), e.openElements.push(e.headElement, Po.HEAD), Xc(e, t), e.openElements.remove(e.headElement);
  9143. break;
  9144. case Po.HEAD:
  9145. e._err(t, Eo.misplacedStartTagForHeadElement);
  9146. break;
  9147. default:
  9148. Zc(e, t)
  9149. }
  9150. }(this, e);
  9151. break;
  9152. case Rc.IN_BODY:
  9153. ol(this, e);
  9154. break;
  9155. case Rc.IN_TABLE:
  9156. pl(this, e);
  9157. break;
  9158. case Rc.IN_TABLE_TEXT:
  9159. Tl(this, e);
  9160. break;
  9161. case Rc.IN_CAPTION:
  9162. ! function(e, t) {
  9163. const n = t.tagID;
  9164. _l.has(n) ? e.openElements.hasInTableScope(Po.CAPTION) && (e.openElements.generateImpliedEndTags(), e.openElements.popUntilTagNamePopped(Po.CAPTION), e.activeFormattingElements.clearToLastMarker(), e.insertionMode = Rc.IN_TABLE, pl(e, t)) : ol(e, t)
  9165. }(this, e);
  9166. break;
  9167. case Rc.IN_COLUMN_GROUP:
  9168. Al(this, e);
  9169. break;
  9170. case Rc.IN_TABLE_BODY:
  9171. Nl(this, e);
  9172. break;
  9173. case Rc.IN_ROW:
  9174. Il(this, e);
  9175. break;
  9176. case Rc.IN_CELL:
  9177. ! function(e, t) {
  9178. const n = t.tagID;
  9179. _l.has(n) ? (e.openElements.hasInTableScope(Po.TD) || e.openElements.hasInTableScope(Po.TH)) && (e._closeTableCell(), Il(e, t)) : ol(e, t)
  9180. }(this, e);
  9181. break;
  9182. case Rc.IN_SELECT:
  9183. bl(this, e);
  9184. break;
  9185. case Rc.IN_SELECT_IN_TABLE:
  9186. ! function(e, t) {
  9187. const n = t.tagID;
  9188. n === Po.CAPTION || n === Po.TABLE || n === Po.TBODY || n === Po.TFOOT || n === Po.THEAD || n === Po.TR || n === Po.TD || n === Po.TH ? (e.openElements.popUntilTagNamePopped(Po.SELECT), e._resetInsertionMode(), e._processStartTag(t)) : bl(e, t)
  9189. }(this, e);
  9190. break;
  9191. case Rc.IN_TEMPLATE:
  9192. ! function(e, t) {
  9193. switch (t.tagID) {
  9194. case Po.BASE:
  9195. case Po.BASEFONT:
  9196. case Po.BGSOUND:
  9197. case Po.LINK:
  9198. case Po.META:
  9199. case Po.NOFRAMES:
  9200. case Po.SCRIPT:
  9201. case Po.STYLE:
  9202. case Po.TEMPLATE:
  9203. case Po.TITLE:
  9204. Xc(e, t);
  9205. break;
  9206. case Po.CAPTION:
  9207. case Po.COLGROUP:
  9208. case Po.TBODY:
  9209. case Po.TFOOT:
  9210. case Po.THEAD:
  9211. e.tmplInsertionModeStack[0] = Rc.IN_TABLE, e.insertionMode = Rc.IN_TABLE, pl(e, t);
  9212. break;
  9213. case Po.COL:
  9214. e.tmplInsertionModeStack[0] = Rc.IN_COLUMN_GROUP, e.insertionMode = Rc.IN_COLUMN_GROUP, Al(e, t);
  9215. break;
  9216. case Po.TR:
  9217. e.tmplInsertionModeStack[0] = Rc.IN_TABLE_BODY, e.insertionMode = Rc.IN_TABLE_BODY, Nl(e, t);
  9218. break;
  9219. case Po.TD:
  9220. case Po.TH:
  9221. e.tmplInsertionModeStack[0] = Rc.IN_ROW, e.insertionMode = Rc.IN_ROW, Il(e, t);
  9222. break;
  9223. default:
  9224. e.tmplInsertionModeStack[0] = Rc.IN_BODY, e.insertionMode = Rc.IN_BODY, ol(e, t)
  9225. }
  9226. }(this, e);
  9227. break;
  9228. case Rc.AFTER_BODY:
  9229. ! function(e, t) {
  9230. t.tagID === Po.HTML ? ol(e, t) : kl(e, t)
  9231. }(this, e);
  9232. break;
  9233. case Rc.IN_FRAMESET:
  9234. ! function(e, t) {
  9235. switch (t.tagID) {
  9236. case Po.HTML:
  9237. ol(e, t);
  9238. break;
  9239. case Po.FRAMESET:
  9240. e._insertElement(t, vo.HTML);
  9241. break;
  9242. case Po.FRAME:
  9243. e._appendElement(t, vo.HTML), t.ackSelfClosing = !0;
  9244. break;
  9245. case Po.NOFRAMES:
  9246. Xc(e, t)
  9247. }
  9248. }(this, e);
  9249. break;
  9250. case Rc.AFTER_FRAMESET:
  9251. ! function(e, t) {
  9252. switch (t.tagID) {
  9253. case Po.HTML:
  9254. ol(e, t);
  9255. break;
  9256. case Po.NOFRAMES:
  9257. Xc(e, t)
  9258. }
  9259. }(this, e);
  9260. break;
  9261. case Rc.AFTER_AFTER_BODY:
  9262. ! function(e, t) {
  9263. t.tagID === Po.HTML ? ol(e, t) : vl(e, t)
  9264. }(this, e);
  9265. break;
  9266. case Rc.AFTER_AFTER_FRAMESET:
  9267. ! function(e, t) {
  9268. switch (t.tagID) {
  9269. case Po.HTML:
  9270. ol(e, t);
  9271. break;
  9272. case Po.NOFRAMES:
  9273. Xc(e, t)
  9274. }
  9275. }(this, e)
  9276. }
  9277. }
  9278. onEndTag(e) {
  9279. this.skipNextNewLine = !1, this.currentToken = e, this.currentNotInHTML ? function(e, t) {
  9280. if (t.tagID === Po.P || t.tagID === Po.BR) return Dl(e), void e._endTagOutsideForeignContent(t);
  9281. for (let n = e.openElements.stackTop; n > 0; n--) {
  9282. const r = e.openElements.items[n];
  9283. if (e.treeAdapter.getNamespaceURI(r) === vo.HTML) {
  9284. e._endTagOutsideForeignContent(t);
  9285. break
  9286. }
  9287. const i = e.treeAdapter.getTagName(r);
  9288. if (i.toLowerCase() === t.tagName) {
  9289. t.tagName = i, e.openElements.shortenToLength(n);
  9290. break
  9291. }
  9292. }
  9293. }(this, e) : this._endTagOutsideForeignContent(e)
  9294. }
  9295. _endTagOutsideForeignContent(e) {
  9296. switch (this.insertionMode) {
  9297. case Rc.INITIAL:
  9298. Vc(this, e);
  9299. break;
  9300. case Rc.BEFORE_HTML:
  9301. ! function(e, t) {
  9302. const n = t.tagID;
  9303. n !== Po.HTML && n !== Po.HEAD && n !== Po.BODY && n !== Po.BR || Wc(e, t)
  9304. }(this, e);
  9305. break;
  9306. case Rc.BEFORE_HEAD:
  9307. ! function(e, t) {
  9308. const n = t.tagID;
  9309. n === Po.HEAD || n === Po.BODY || n === Po.HTML || n === Po.BR ? Qc(e, t) : e._err(t, Eo.endTagWithoutMatchingOpenElement)
  9310. }(this, e);
  9311. break;
  9312. case Rc.IN_HEAD:
  9313. ! function(e, t) {
  9314. switch (t.tagID) {
  9315. case Po.HEAD:
  9316. e.openElements.pop(), e.insertionMode = Rc.AFTER_HEAD;
  9317. break;
  9318. case Po.BODY:
  9319. case Po.BR:
  9320. case Po.HTML:
  9321. zc(e, t);
  9322. break;
  9323. case Po.TEMPLATE:
  9324. $c(e, t);
  9325. break;
  9326. default:
  9327. e._err(t, Eo.endTagWithoutMatchingOpenElement)
  9328. }
  9329. }(this, e);
  9330. break;
  9331. case Rc.IN_HEAD_NO_SCRIPT:
  9332. ! function(e, t) {
  9333. switch (t.tagID) {
  9334. case Po.NOSCRIPT:
  9335. e.openElements.pop(), e.insertionMode = Rc.IN_HEAD;
  9336. break;
  9337. case Po.BR:
  9338. Jc(e, t);
  9339. break;
  9340. default:
  9341. e._err(t, Eo.endTagWithoutMatchingOpenElement)
  9342. }
  9343. }(this, e);
  9344. break;
  9345. case Rc.AFTER_HEAD:
  9346. ! function(e, t) {
  9347. switch (t.tagID) {
  9348. case Po.BODY:
  9349. case Po.HTML:
  9350. case Po.BR:
  9351. Zc(e, t);
  9352. break;
  9353. case Po.TEMPLATE:
  9354. $c(e, t);
  9355. break;
  9356. default:
  9357. e._err(t, Eo.endTagWithoutMatchingOpenElement)
  9358. }
  9359. }(this, e);
  9360. break;
  9361. case Rc.IN_BODY:
  9362. ll(this, e);
  9363. break;
  9364. case Rc.TEXT:
  9365. ! function(e, t) {
  9366. var n;
  9367. t.tagID === Po.SCRIPT && (null === (n = e.scriptHandler) || void 0 === n || n.call(e, e.openElements.current));
  9368. e.openElements.pop(), e.insertionMode = e.originalInsertionMode
  9369. }(this, e);
  9370. break;
  9371. case Rc.IN_TABLE:
  9372. fl(this, e);
  9373. break;
  9374. case Rc.IN_TABLE_TEXT:
  9375. Tl(this, e);
  9376. break;
  9377. case Rc.IN_CAPTION:
  9378. ! function(e, t) {
  9379. const n = t.tagID;
  9380. switch (n) {
  9381. case Po.CAPTION:
  9382. case Po.TABLE:
  9383. e.openElements.hasInTableScope(Po.CAPTION) && (e.openElements.generateImpliedEndTags(), e.openElements.popUntilTagNamePopped(Po.CAPTION), e.activeFormattingElements.clearToLastMarker(), e.insertionMode = Rc.IN_TABLE, n === Po.TABLE && fl(e, t));
  9384. break;
  9385. case Po.BODY:
  9386. case Po.COL:
  9387. case Po.COLGROUP:
  9388. case Po.HTML:
  9389. case Po.TBODY:
  9390. case Po.TD:
  9391. case Po.TFOOT:
  9392. case Po.TH:
  9393. case Po.THEAD:
  9394. case Po.TR:
  9395. break;
  9396. default:
  9397. ll(e, t)
  9398. }
  9399. }(this, e);
  9400. break;
  9401. case Rc.IN_COLUMN_GROUP:
  9402. ! function(e, t) {
  9403. switch (t.tagID) {
  9404. case Po.COLGROUP:
  9405. e.openElements.currentTagId === Po.COLGROUP && (e.openElements.pop(), e.insertionMode = Rc.IN_TABLE);
  9406. break;
  9407. case Po.TEMPLATE:
  9408. $c(e, t);
  9409. break;
  9410. case Po.COL:
  9411. break;
  9412. default:
  9413. gl(e, t)
  9414. }
  9415. }(this, e);
  9416. break;
  9417. case Rc.IN_TABLE_BODY:
  9418. Cl(this, e);
  9419. break;
  9420. case Rc.IN_ROW:
  9421. Sl(this, e);
  9422. break;
  9423. case Rc.IN_CELL:
  9424. ! function(e, t) {
  9425. const n = t.tagID;
  9426. switch (n) {
  9427. case Po.TD:
  9428. case Po.TH:
  9429. e.openElements.hasInTableScope(n) && (e.openElements.generateImpliedEndTags(), e.openElements.popUntilTagNamePopped(n), e.activeFormattingElements.clearToLastMarker(), e.insertionMode = Rc.IN_ROW);
  9430. break;
  9431. case Po.TABLE:
  9432. case Po.TBODY:
  9433. case Po.TFOOT:
  9434. case Po.THEAD:
  9435. case Po.TR:
  9436. e.openElements.hasInTableScope(n) && (e._closeTableCell(), Sl(e, t));
  9437. break;
  9438. case Po.BODY:
  9439. case Po.CAPTION:
  9440. case Po.COL:
  9441. case Po.COLGROUP:
  9442. case Po.HTML:
  9443. break;
  9444. default:
  9445. ll(e, t)
  9446. }
  9447. }(this, e);
  9448. break;
  9449. case Rc.IN_SELECT:
  9450. Ol(this, e);
  9451. break;
  9452. case Rc.IN_SELECT_IN_TABLE:
  9453. ! function(e, t) {
  9454. const n = t.tagID;
  9455. n === Po.CAPTION || n === Po.TABLE || n === Po.TBODY || n === Po.TFOOT || n === Po.THEAD || n === Po.TR || n === Po.TD || n === Po.TH ? e.openElements.hasInTableScope(n) && (e.openElements.popUntilTagNamePopped(Po.SELECT), e._resetInsertionMode(), e.onEndTag(t)) : Ol(e, t)
  9456. }(this, e);
  9457. break;
  9458. case Rc.IN_TEMPLATE:
  9459. ! function(e, t) {
  9460. t.tagID === Po.TEMPLATE && $c(e, t)
  9461. }(this, e);
  9462. break;
  9463. case Rc.AFTER_BODY:
  9464. Ll(this, e);
  9465. break;
  9466. case Rc.IN_FRAMESET:
  9467. ! function(e, t) {
  9468. t.tagID !== Po.FRAMESET || e.openElements.isRootHtmlElementCurrent() || (e.openElements.pop(), e.fragmentContext || e.openElements.currentTagId === Po.FRAMESET || (e.insertionMode = Rc.AFTER_FRAMESET))
  9469. }(this, e);
  9470. break;
  9471. case Rc.AFTER_FRAMESET:
  9472. ! function(e, t) {
  9473. t.tagID === Po.HTML && (e.insertionMode = Rc.AFTER_AFTER_FRAMESET)
  9474. }(this, e);
  9475. break;
  9476. case Rc.AFTER_AFTER_BODY:
  9477. vl(this, e)
  9478. }
  9479. }
  9480. onEof(e) {
  9481. switch (this.insertionMode) {
  9482. case Rc.INITIAL:
  9483. Vc(this, e);
  9484. break;
  9485. case Rc.BEFORE_HTML:
  9486. Wc(this, e);
  9487. break;
  9488. case Rc.BEFORE_HEAD:
  9489. Qc(this, e);
  9490. break;
  9491. case Rc.IN_HEAD:
  9492. zc(this, e);
  9493. break;
  9494. case Rc.IN_HEAD_NO_SCRIPT:
  9495. Jc(this, e);
  9496. break;
  9497. case Rc.AFTER_HEAD:
  9498. Zc(this, e);
  9499. break;
  9500. case Rc.IN_BODY:
  9501. case Rc.IN_TABLE:
  9502. case Rc.IN_CAPTION:
  9503. case Rc.IN_COLUMN_GROUP:
  9504. case Rc.IN_TABLE_BODY:
  9505. case Rc.IN_ROW:
  9506. case Rc.IN_CELL:
  9507. case Rc.IN_SELECT:
  9508. case Rc.IN_SELECT_IN_TABLE:
  9509. hl(this, e);
  9510. break;
  9511. case Rc.TEXT:
  9512. ! function(e, t) {
  9513. e._err(t, Eo.eofInElementThatCanContainOnlyText), e.openElements.pop(), e.insertionMode = e.originalInsertionMode, e.onEof(t)
  9514. }(this, e);
  9515. break;
  9516. case Rc.IN_TABLE_TEXT:
  9517. Tl(this, e);
  9518. break;
  9519. case Rc.IN_TEMPLATE:
  9520. yl(this, e);
  9521. break;
  9522. case Rc.AFTER_BODY:
  9523. case Rc.IN_FRAMESET:
  9524. case Rc.AFTER_FRAMESET:
  9525. case Rc.AFTER_AFTER_BODY:
  9526. case Rc.AFTER_AFTER_FRAMESET:
  9527. jc(this, e)
  9528. }
  9529. }
  9530. onWhitespaceCharacter(e) {
  9531. if (this.skipNextNewLine && (this.skipNextNewLine = !1, e.chars.charCodeAt(0) === io.LINE_FEED)) {
  9532. if (1 === e.chars.length) return;
  9533. e.chars = e.chars.substr(1)
  9534. }
  9535. if (this.tokenizer.inForeignNode) this._insertCharacters(e);
  9536. else switch (this.insertionMode) {
  9537. case Rc.IN_HEAD:
  9538. case Rc.IN_HEAD_NO_SCRIPT:
  9539. case Rc.AFTER_HEAD:
  9540. case Rc.TEXT:
  9541. case Rc.IN_COLUMN_GROUP:
  9542. case Rc.IN_SELECT:
  9543. case Rc.IN_SELECT_IN_TABLE:
  9544. case Rc.IN_FRAMESET:
  9545. case Rc.AFTER_FRAMESET:
  9546. this._insertCharacters(e);
  9547. break;
  9548. case Rc.IN_BODY:
  9549. case Rc.IN_CAPTION:
  9550. case Rc.IN_CELL:
  9551. case Rc.IN_TEMPLATE:
  9552. case Rc.AFTER_BODY:
  9553. case Rc.AFTER_AFTER_BODY:
  9554. case Rc.AFTER_AFTER_FRAMESET:
  9555. tl(this, e);
  9556. break;
  9557. case Rc.IN_TABLE:
  9558. case Rc.IN_TABLE_BODY:
  9559. case Rc.IN_ROW:
  9560. ul(this, e);
  9561. break;
  9562. case Rc.IN_TABLE_TEXT:
  9563. El(this, e)
  9564. }
  9565. }
  9566. }
  9567. function Bc(e, t) {
  9568. let n = e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);
  9569. return n ? e.openElements.contains(n.element) ? e.openElements.hasInScope(t.tagID) || (n = null) : (e.activeFormattingElements.removeEntry(n), n = null) : cl(e, t), n
  9570. }
  9571. function Fc(e, t) {
  9572. let n = null, r = e.openElements.stackTop;
  9573. for (; r >= 0; r--) {
  9574. const i = e.openElements.items[r];
  9575. if (i === t.element) break;
  9576. e._isSpecialElement(i, e.openElements.tagIDs[r]) && (n = i)
  9577. }
  9578. return n || (e.openElements.shortenToLength(r < 0 ? 0 : r), e.activeFormattingElements.removeEntry(t)), n
  9579. }
  9580. function Uc(e, t, n) {
  9581. let r = t, i = e.openElements.getCommonAncestor(t);
  9582. for (let s = 0, a = i; a !== n; s++, a = i) {
  9583. i = e.openElements.getCommonAncestor(a);
  9584. const n = e.activeFormattingElements.getElementEntry(a), o = n && s >= 3;
  9585. !n || o ? (o && e.activeFormattingElements.removeEntry(n), e.openElements.remove(a)) : (a = Hc(e, n), r === t && (e.activeFormattingElements.bookmark = n), e.treeAdapter.detachNode(r), e.treeAdapter.appendChild(a, r), r = a)
  9586. }
  9587. return r
  9588. }
  9589. function Hc(e, t) {
  9590. const n = e.treeAdapter.getNamespaceURI(t.element), r = e.treeAdapter.createElement(t.token.tagName, n, t.token.attrs);
  9591. return e.openElements.replace(t.element, r), t.element = r, r
  9592. }
  9593. function Gc(e, t, n) {
  9594. const r = Fo(e.treeAdapter.getTagName(t));
  9595. if (e._isElementCausesFosterParenting(r)) e._fosterParentElement(n);
  9596. else {
  9597. const i = e.treeAdapter.getNamespaceURI(t);
  9598. r === Po.TEMPLATE && i === vo.HTML && (t = e.treeAdapter.getTemplateContent(t)), e.treeAdapter.appendChild(t, n)
  9599. }
  9600. }
  9601. function Yc(e, t, n) {
  9602. const r = e.treeAdapter.getNamespaceURI(n.element), {
  9603. token: i
  9604. } = n, s = e.treeAdapter.createElement(i.tagName, r, i.attrs);
  9605. e._adoptNodes(t, s), e.treeAdapter.appendChild(t, s), e.activeFormattingElements.insertElementAfterBookmark(s, i), e.activeFormattingElements.removeEntry(n), e.openElements.remove(n.element), e.openElements.insertAfter(t, s, i.tagID)
  9606. }
  9607. function qc(e, t) {
  9608. for (let n = 0; n < 8; n++) {
  9609. const n = Bc(e, t);
  9610. if (!n) break;
  9611. const r = Fc(e, n);
  9612. if (!r) break;
  9613. e.activeFormattingElements.bookmark = n;
  9614. const i = Uc(e, r, n.element), s = e.openElements.getCommonAncestor(n.element);
  9615. e.treeAdapter.detachNode(i), s && Gc(e, s, i), Yc(e, r, n)
  9616. }
  9617. }
  9618. function Kc(e, t) {
  9619. e._appendCommentNode(t, e.openElements.currentTmplContentOrNode)
  9620. }
  9621. function jc(e, t) {
  9622. if (e.stopped = !0, t.location) {
  9623. const n = e.fragmentContext ? 0 : 2;
  9624. for (let r = e.openElements.stackTop; r >= n; r--) e._setEndLocation(e.openElements.items[r], t);
  9625. if (!e.fragmentContext && e.openElements.stackTop >= 0) {
  9626. const n = e.openElements.items[0], r = e.treeAdapter.getNodeSourceCodeLocation(n);
  9627. if (r && !r.endTag && (e._setEndLocation(n, t), e.openElements.stackTop >= 1)) {
  9628. const n = e.openElements.items[1], r = e.treeAdapter.getNodeSourceCodeLocation(n);
  9629. r && !r.endTag && e._setEndLocation(n, t)
  9630. }
  9631. }
  9632. }
  9633. }
  9634. function Vc(e, t) {
  9635. e._err(t, Eo.missingDoctype, !0), e.treeAdapter.setDocumentMode(e.document, Ro.QUIRKS), e.insertionMode = Rc.BEFORE_HTML, e._processToken(t)
  9636. }
  9637. function Wc(e, t) {
  9638. e._insertFakeRootElement(), e.insertionMode = Rc.BEFORE_HEAD, e._processToken(t)
  9639. }
  9640. function Qc(e, t) {
  9641. e._insertFakeElement(Mo.HEAD, Po.HEAD), e.headElement = e.openElements.current, e.insertionMode = Rc.IN_HEAD, e._processToken(t)
  9642. }
  9643. function Xc(e, t) {
  9644. switch (t.tagID) {
  9645. case Po.HTML:
  9646. ol(e, t);
  9647. break;
  9648. case Po.BASE:
  9649. case Po.BASEFONT:
  9650. case Po.BGSOUND:
  9651. case Po.LINK:
  9652. case Po.META:
  9653. e._appendElement(t, vo.HTML), t.ackSelfClosing = !0;
  9654. break;
  9655. case Po.TITLE:
  9656. e._switchToTextParsing(t, jo.RCDATA);
  9657. break;
  9658. case Po.NOSCRIPT:
  9659. e.options.scriptingEnabled ? e._switchToTextParsing(t, jo.RAWTEXT) : (e._insertElement(t, vo.HTML), e.insertionMode = Rc.IN_HEAD_NO_SCRIPT);
  9660. break;
  9661. case Po.NOFRAMES:
  9662. case Po.STYLE:
  9663. e._switchToTextParsing(t, jo.RAWTEXT);
  9664. break;
  9665. case Po.SCRIPT:
  9666. e._switchToTextParsing(t, jo.SCRIPT_DATA);
  9667. break;
  9668. case Po.TEMPLATE:
  9669. e._insertTemplate(t), e.activeFormattingElements.insertMarker(), e.framesetOk = !1, e.insertionMode = Rc.IN_TEMPLATE, e.tmplInsertionModeStack.unshift(Rc.IN_TEMPLATE);
  9670. break;
  9671. case Po.HEAD:
  9672. e._err(t, Eo.misplacedStartTagForHeadElement);
  9673. break;
  9674. default:
  9675. zc(e, t)
  9676. }
  9677. }
  9678. function $c(e, t) {
  9679. e.openElements.tmplCount > 0 ? (e.openElements.generateImpliedEndTagsThoroughly(), e.openElements.currentTagId !== Po.TEMPLATE && e._err(t, Eo.closingOfElementWithOpenChildElements), e.openElements.popUntilTagNamePopped(Po.TEMPLATE), e.activeFormattingElements.clearToLastMarker(), e.tmplInsertionModeStack.shift(), e._resetInsertionMode()) : e._err(t, Eo.endTagWithoutMatchingOpenElement)
  9680. }
  9681. function zc(e, t) {
  9682. e.openElements.pop(), e.insertionMode = Rc.AFTER_HEAD, e._processToken(t)
  9683. }
  9684. function Jc(e, t) {
  9685. const n = t.type === To.EOF ? Eo.openElementsLeftAfterEof : Eo.disallowedContentInNoscriptInHead;
  9686. e._err(t, n), e.openElements.pop(), e.insertionMode = Rc.IN_HEAD, e._processToken(t)
  9687. }
  9688. function Zc(e, t) {
  9689. e._insertFakeElement(Mo.BODY, Po.BODY), e.insertionMode = Rc.IN_BODY, el(e, t)
  9690. }
  9691. function el(e, t) {
  9692. switch (t.type) {
  9693. case To.CHARACTER:
  9694. nl(e, t);
  9695. break;
  9696. case To.WHITESPACE_CHARACTER:
  9697. tl(e, t);
  9698. break;
  9699. case To.COMMENT:
  9700. Kc(e, t);
  9701. break;
  9702. case To.START_TAG:
  9703. ol(e, t);
  9704. break;
  9705. case To.END_TAG:
  9706. ll(e, t);
  9707. break;
  9708. case To.EOF:
  9709. hl(e, t)
  9710. }
  9711. }
  9712. function tl(e, t) {
  9713. e._reconstructActiveFormattingElements(), e._insertCharacters(t)
  9714. }
  9715. function nl(e, t) {
  9716. e._reconstructActiveFormattingElements(), e._insertCharacters(t), e.framesetOk = !1
  9717. }
  9718. function rl(e, t) {
  9719. e._reconstructActiveFormattingElements(), e._appendElement(t, vo.HTML), e.framesetOk = !1, t.ackSelfClosing = !0
  9720. }
  9721. function il(e) {
  9722. const t = _o(e, Do.TYPE);
  9723. return null != t && "hidden" === t.toLowerCase()
  9724. }
  9725. function sl(e, t) {
  9726. e._switchToTextParsing(t, jo.RAWTEXT)
  9727. }
  9728. function al(e, t) {
  9729. e._reconstructActiveFormattingElements(), e._insertElement(t, vo.HTML)
  9730. }
  9731. function ol(e, t) {
  9732. switch (t.tagID) {
  9733. case Po.I:
  9734. case Po.S:
  9735. case Po.B:
  9736. case Po.U:
  9737. case Po.EM:
  9738. case Po.TT:
  9739. case Po.BIG:
  9740. case Po.CODE:
  9741. case Po.FONT:
  9742. case Po.SMALL:
  9743. case Po.STRIKE:
  9744. case Po.STRONG:
  9745. ! function(e, t) {
  9746. e._reconstructActiveFormattingElements(), e._insertElement(t, vo.HTML), e.activeFormattingElements.pushElement(e.openElements.current, t)
  9747. }(e, t);
  9748. break;
  9749. case Po.A:
  9750. ! function(e, t) {
  9751. const n = e.activeFormattingElements.getElementEntryInScopeWithTagName(Mo.A);
  9752. n && (qc(e, t), e.openElements.remove(n.element), e.activeFormattingElements.removeEntry(n)), e._reconstructActiveFormattingElements(), e._insertElement(t, vo.HTML), e.activeFormattingElements.pushElement(e.openElements.current, t)
  9753. }(e, t);
  9754. break;
  9755. case Po.H1:
  9756. case Po.H2:
  9757. case Po.H3:
  9758. case Po.H4:
  9759. case Po.H5:
  9760. case Po.H6:
  9761. ! function(e, t) {
  9762. e.openElements.hasInButtonScope(Po.P) && e._closePElement(), Go(e.openElements.currentTagId) && e.openElements.pop(), e._insertElement(t, vo.HTML)
  9763. }(e, t);
  9764. break;
  9765. case Po.P:
  9766. case Po.DL:
  9767. case Po.OL:
  9768. case Po.UL:
  9769. case Po.DIV:
  9770. case Po.DIR:
  9771. case Po.NAV:
  9772. case Po.MAIN:
  9773. case Po.MENU:
  9774. case Po.ASIDE:
  9775. case Po.CENTER:
  9776. case Po.FIGURE:
  9777. case Po.FOOTER:
  9778. case Po.HEADER:
  9779. case Po.HGROUP:
  9780. case Po.DIALOG:
  9781. case Po.DETAILS:
  9782. case Po.ADDRESS:
  9783. case Po.ARTICLE:
  9784. case Po.SECTION:
  9785. case Po.SUMMARY:
  9786. case Po.FIELDSET:
  9787. case Po.BLOCKQUOTE:
  9788. case Po.FIGCAPTION:
  9789. ! function(e, t) {
  9790. e.openElements.hasInButtonScope(Po.P) && e._closePElement(), e._insertElement(t, vo.HTML)
  9791. }(e, t);
  9792. break;
  9793. case Po.LI:
  9794. case Po.DD:
  9795. case Po.DT:
  9796. ! function(e, t) {
  9797. e.framesetOk = !1;
  9798. const n = t.tagID;
  9799. for (let t = e.openElements.stackTop; t >= 0; t--) {
  9800. const r = e.openElements.tagIDs[t];
  9801. if (n === Po.LI && r === Po.LI || (n === Po.DD || n === Po.DT) && (r === Po.DD || r === Po.DT)) {
  9802. e.openElements.generateImpliedEndTagsWithExclusion(r), e.openElements.popUntilTagNamePopped(r);
  9803. break
  9804. }
  9805. if (r !== Po.ADDRESS && r !== Po.DIV && r !== Po.P && e._isSpecialElement(e.openElements.items[t], r)) break
  9806. }
  9807. e.openElements.hasInButtonScope(Po.P) && e._closePElement(), e._insertElement(t, vo.HTML)
  9808. }(e, t);
  9809. break;
  9810. case Po.BR:
  9811. case Po.IMG:
  9812. case Po.WBR:
  9813. case Po.AREA:
  9814. case Po.EMBED:
  9815. case Po.KEYGEN:
  9816. rl(e, t);
  9817. break;
  9818. case Po.HR:
  9819. ! function(e, t) {
  9820. e.openElements.hasInButtonScope(Po.P) && e._closePElement(), e._appendElement(t, vo.HTML), e.framesetOk = !1, t.ackSelfClosing = !0
  9821. }(e, t);
  9822. break;
  9823. case Po.RB:
  9824. case Po.RTC:
  9825. ! function(e, t) {
  9826. e.openElements.hasInScope(Po.RUBY) && e.openElements.generateImpliedEndTags(), e._insertElement(t, vo.HTML)
  9827. }(e, t);
  9828. break;
  9829. case Po.RT:
  9830. case Po.RP:
  9831. ! function(e, t) {
  9832. e.openElements.hasInScope(Po.RUBY) && e.openElements.generateImpliedEndTagsWithExclusion(Po.RTC), e._insertElement(t, vo.HTML)
  9833. }(e, t);
  9834. break;
  9835. case Po.PRE:
  9836. case Po.LISTING:
  9837. ! function(e, t) {
  9838. e.openElements.hasInButtonScope(Po.P) && e._closePElement(), e._insertElement(t, vo.HTML), e.skipNextNewLine = !0, e.framesetOk = !1
  9839. }(e, t);
  9840. break;
  9841. case Po.XMP:
  9842. ! function(e, t) {
  9843. e.openElements.hasInButtonScope(Po.P) && e._closePElement(), e._reconstructActiveFormattingElements(), e.framesetOk = !1, e._switchToTextParsing(t, jo.RAWTEXT)
  9844. }(e, t);
  9845. break;
  9846. case Po.SVG:
  9847. ! function(e, t) {
  9848. e._reconstructActiveFormattingElements(), kc(t), vc(t), t.selfClosing ? e._appendElement(t, vo.SVG) : e._insertElement(t, vo.SVG), t.ackSelfClosing = !0
  9849. }(e, t);
  9850. break;
  9851. case Po.HTML:
  9852. ! function(e, t) {
  9853. 0 === e.openElements.tmplCount && e.treeAdapter.adoptAttributes(e.openElements.items[0], t.attrs)
  9854. }(e, t);
  9855. break;
  9856. case Po.BASE:
  9857. case Po.LINK:
  9858. case Po.META:
  9859. case Po.STYLE:
  9860. case Po.TITLE:
  9861. case Po.SCRIPT:
  9862. case Po.BGSOUND:
  9863. case Po.BASEFONT:
  9864. case Po.TEMPLATE:
  9865. Xc(e, t);
  9866. break;
  9867. case Po.BODY:
  9868. ! function(e, t) {
  9869. const n = e.openElements.tryPeekProperlyNestedBodyElement();
  9870. n && 0 === e.openElements.tmplCount && (e.framesetOk = !1, e.treeAdapter.adoptAttributes(n, t.attrs))
  9871. }(e, t);
  9872. break;
  9873. case Po.FORM:
  9874. ! function(e, t) {
  9875. const n = e.openElements.tmplCount > 0;
  9876. e.formElement && !n || (e.openElements.hasInButtonScope(Po.P) && e._closePElement(), e._insertElement(t, vo.HTML), n || (e.formElement = e.openElements.current))
  9877. }(e, t);
  9878. break;
  9879. case Po.NOBR:
  9880. ! function(e, t) {
  9881. e._reconstructActiveFormattingElements(), e.openElements.hasInScope(Po.NOBR) && (qc(e, t), e._reconstructActiveFormattingElements()), e._insertElement(t, vo.HTML), e.activeFormattingElements.pushElement(e.openElements.current, t)
  9882. }(e, t);
  9883. break;
  9884. case Po.MATH:
  9885. ! function(e, t) {
  9886. e._reconstructActiveFormattingElements(), Lc(t), vc(t), t.selfClosing ? e._appendElement(t, vo.MATHML) : e._insertElement(t, vo.MATHML), t.ackSelfClosing = !0
  9887. }(e, t);
  9888. break;
  9889. case Po.TABLE:
  9890. ! function(e, t) {
  9891. e.treeAdapter.getDocumentMode(e.document) !== Ro.QUIRKS && e.openElements.hasInButtonScope(Po.P) && e._closePElement(), e._insertElement(t, vo.HTML), e.framesetOk = !1, e.insertionMode = Rc.IN_TABLE
  9892. }(e, t);
  9893. break;
  9894. case Po.INPUT:
  9895. ! function(e, t) {
  9896. e._reconstructActiveFormattingElements(), e._appendElement(t, vo.HTML), il(t) || (e.framesetOk = !1), t.ackSelfClosing = !0
  9897. }(e, t);
  9898. break;
  9899. case Po.PARAM:
  9900. case Po.TRACK:
  9901. case Po.SOURCE:
  9902. ! function(e, t) {
  9903. e._appendElement(t, vo.HTML), t.ackSelfClosing = !0
  9904. }(e, t);
  9905. break;
  9906. case Po.IMAGE:
  9907. ! function(e, t) {
  9908. t.tagName = Mo.IMG, t.tagID = Po.IMG, rl(e, t)
  9909. }(e, t);
  9910. break;
  9911. case Po.BUTTON:
  9912. ! function(e, t) {
  9913. e.openElements.hasInScope(Po.BUTTON) && (e.openElements.generateImpliedEndTags(), e.openElements.popUntilTagNamePopped(Po.BUTTON)), e._reconstructActiveFormattingElements(), e._insertElement(t, vo.HTML), e.framesetOk = !1
  9914. }(e, t);
  9915. break;
  9916. case Po.APPLET:
  9917. case Po.OBJECT:
  9918. case Po.MARQUEE:
  9919. ! function(e, t) {
  9920. e._reconstructActiveFormattingElements(), e._insertElement(t, vo.HTML), e.activeFormattingElements.insertMarker(), e.framesetOk = !1
  9921. }(e, t);
  9922. break;
  9923. case Po.IFRAME:
  9924. ! function(e, t) {
  9925. e.framesetOk = !1, e._switchToTextParsing(t, jo.RAWTEXT)
  9926. }(e, t);
  9927. break;
  9928. case Po.SELECT:
  9929. ! function(e, t) {
  9930. e._reconstructActiveFormattingElements(), e._insertElement(t, vo.HTML), e.framesetOk = !1, e.insertionMode = e.insertionMode === Rc.IN_TABLE || e.insertionMode === Rc.IN_CAPTION || e.insertionMode === Rc.IN_TABLE_BODY || e.insertionMode === Rc.IN_ROW || e.insertionMode === Rc.IN_CELL ? Rc.IN_SELECT_IN_TABLE : Rc.IN_SELECT
  9931. }(e, t);
  9932. break;
  9933. case Po.OPTION:
  9934. case Po.OPTGROUP:
  9935. ! function(e, t) {
  9936. e.openElements.currentTagId === Po.OPTION && e.openElements.pop(), e._reconstructActiveFormattingElements(), e._insertElement(t, vo.HTML)
  9937. }(e, t);
  9938. break;
  9939. case Po.NOEMBED:
  9940. sl(e, t);
  9941. break;
  9942. case Po.FRAMESET:
  9943. ! function(e, t) {
  9944. const n = e.openElements.tryPeekProperlyNestedBodyElement();
  9945. e.framesetOk && n && (e.treeAdapter.detachNode(n), e.openElements.popAllUpToHtmlElement(), e._insertElement(t, vo.HTML), e.insertionMode = Rc.IN_FRAMESET)
  9946. }(e, t);
  9947. break;
  9948. case Po.TEXTAREA:
  9949. ! function(e, t) {
  9950. e._insertElement(t, vo.HTML), e.skipNextNewLine = !0, e.tokenizer.state = jo.RCDATA, e.originalInsertionMode = e.insertionMode, e.framesetOk = !1, e.insertionMode = Rc.TEXT
  9951. }(e, t);
  9952. break;
  9953. case Po.NOSCRIPT:
  9954. e.options.scriptingEnabled ? sl(e, t) : al(e, t);
  9955. break;
  9956. case Po.PLAINTEXT:
  9957. ! function(e, t) {
  9958. e.openElements.hasInButtonScope(Po.P) && e._closePElement(), e._insertElement(t, vo.HTML), e.tokenizer.state = jo.PLAINTEXT
  9959. }(e, t);
  9960. break;
  9961. case Po.COL:
  9962. case Po.TH:
  9963. case Po.TD:
  9964. case Po.TR:
  9965. case Po.HEAD:
  9966. case Po.FRAME:
  9967. case Po.TBODY:
  9968. case Po.TFOOT:
  9969. case Po.THEAD:
  9970. case Po.CAPTION:
  9971. case Po.COLGROUP:
  9972. break;
  9973. default:
  9974. al(e, t)
  9975. }
  9976. }
  9977. function cl(e, t) {
  9978. const n = t.tagName, r = t.tagID;
  9979. for (let t = e.openElements.stackTop; t > 0; t--) {
  9980. const i = e.openElements.items[t], s = e.openElements.tagIDs[t];
  9981. if (r === s && (r !== Po.UNKNOWN || e.treeAdapter.getTagName(i) === n)) {
  9982. e.openElements.generateImpliedEndTagsWithExclusion(r), e.openElements.stackTop >= t && e.openElements.shortenToLength(t);
  9983. break
  9984. }
  9985. if (e._isSpecialElement(i, s)) break
  9986. }
  9987. }
  9988. function ll(e, t) {
  9989. switch (t.tagID) {
  9990. case Po.A:
  9991. case Po.B:
  9992. case Po.I:
  9993. case Po.S:
  9994. case Po.U:
  9995. case Po.EM:
  9996. case Po.TT:
  9997. case Po.BIG:
  9998. case Po.CODE:
  9999. case Po.FONT:
  10000. case Po.NOBR:
  10001. case Po.SMALL:
  10002. case Po.STRIKE:
  10003. case Po.STRONG:
  10004. qc(e, t);
  10005. break;
  10006. case Po.P:
  10007. ! function(e) {
  10008. e.openElements.hasInButtonScope(Po.P) || e._insertFakeElement(Mo.P, Po.P), e._closePElement()
  10009. }(e);
  10010. break;
  10011. case Po.DL:
  10012. case Po.UL:
  10013. case Po.OL:
  10014. case Po.DIR:
  10015. case Po.DIV:
  10016. case Po.NAV:
  10017. case Po.PRE:
  10018. case Po.MAIN:
  10019. case Po.MENU:
  10020. case Po.ASIDE:
  10021. case Po.BUTTON:
  10022. case Po.CENTER:
  10023. case Po.FIGURE:
  10024. case Po.FOOTER:
  10025. case Po.HEADER:
  10026. case Po.HGROUP:
  10027. case Po.DIALOG:
  10028. case Po.ADDRESS:
  10029. case Po.ARTICLE:
  10030. case Po.DETAILS:
  10031. case Po.SECTION:
  10032. case Po.SUMMARY:
  10033. case Po.LISTING:
  10034. case Po.FIELDSET:
  10035. case Po.BLOCKQUOTE:
  10036. case Po.FIGCAPTION:
  10037. ! function(e, t) {
  10038. const n = t.tagID;
  10039. e.openElements.hasInScope(n) && (e.openElements.generateImpliedEndTags(), e.openElements.popUntilTagNamePopped(n))
  10040. }(e, t);
  10041. break;
  10042. case Po.LI:
  10043. ! function(e) {
  10044. e.openElements.hasInListItemScope(Po.LI) && (e.openElements.generateImpliedEndTagsWithExclusion(Po.LI), e.openElements.popUntilTagNamePopped(Po.LI))
  10045. }(e);
  10046. break;
  10047. case Po.DD:
  10048. case Po.DT:
  10049. ! function(e, t) {
  10050. const n = t.tagID;
  10051. e.openElements.hasInScope(n) && (e.openElements.generateImpliedEndTagsWithExclusion(n), e.openElements.popUntilTagNamePopped(n))
  10052. }(e, t);
  10053. break;
  10054. case Po.H1:
  10055. case Po.H2:
  10056. case Po.H3:
  10057. case Po.H4:
  10058. case Po.H5:
  10059. case Po.H6:
  10060. ! function(e) {
  10061. e.openElements.hasNumberedHeaderInScope() && (e.openElements.generateImpliedEndTags(), e.openElements.popUntilNumberedHeaderPopped())
  10062. }(e);
  10063. break;
  10064. case Po.BR:
  10065. ! function(e) {
  10066. e._reconstructActiveFormattingElements(), e._insertFakeElement(Mo.BR, Po.BR), e.openElements.pop(), e.framesetOk = !1
  10067. }(e);
  10068. break;
  10069. case Po.BODY:
  10070. ! function(e, t) {
  10071. if (e.openElements.hasInScope(Po.BODY) && (e.insertionMode = Rc.AFTER_BODY, e.options.sourceCodeLocationInfo)) {
  10072. const n = e.openElements.tryPeekProperlyNestedBodyElement();
  10073. n && e._setEndLocation(n, t)
  10074. }
  10075. }(e, t);
  10076. break;
  10077. case Po.HTML:
  10078. ! function(e, t) {
  10079. e.openElements.hasInScope(Po.BODY) && (e.insertionMode = Rc.AFTER_BODY, Ll(e, t))
  10080. }(e, t);
  10081. break;
  10082. case Po.FORM:
  10083. ! function(e) {
  10084. const t = e.openElements.tmplCount > 0, {
  10085. formElement: n
  10086. } = e;
  10087. t || (e.formElement = null), (n || t) && e.openElements.hasInScope(Po.FORM) && (e.openElements.generateImpliedEndTags(), t ? e.openElements.popUntilTagNamePopped(Po.FORM) : n && e.openElements.remove(n))
  10088. }(e);
  10089. break;
  10090. case Po.APPLET:
  10091. case Po.OBJECT:
  10092. case Po.MARQUEE:
  10093. ! function(e, t) {
  10094. const n = t.tagID;
  10095. e.openElements.hasInScope(n) && (e.openElements.generateImpliedEndTags(), e.openElements.popUntilTagNamePopped(n), e.activeFormattingElements.clearToLastMarker())
  10096. }(e, t);
  10097. break;
  10098. case Po.TEMPLATE:
  10099. $c(e, t);
  10100. break;
  10101. default:
  10102. cl(e, t)
  10103. }
  10104. }
  10105. function hl(e, t) {
  10106. e.tmplInsertionModeStack.length > 0 ? yl(e, t) : jc(e, t)
  10107. }
  10108. function ul(e, t) {
  10109. if (Pc.has(e.openElements.currentTagId)) switch (e.pendingCharacterTokens.length = 0, e.hasNonWhitespacePendingCharacterToken = !1, e.originalInsertionMode = e.insertionMode, e.insertionMode = Rc.IN_TABLE_TEXT, t.type) {
  10110. case To.CHARACTER:
  10111. ml(e, t);
  10112. break;
  10113. case To.WHITESPACE_CHARACTER:
  10114. El(e, t)
  10115. } else dl(e, t)
  10116. }
  10117. function pl(e, t) {
  10118. switch (t.tagID) {
  10119. case Po.TD:
  10120. case Po.TH:
  10121. case Po.TR:
  10122. ! function(e, t) {
  10123. e.openElements.clearBackToTableContext(), e._insertFakeElement(Mo.TBODY, Po.TBODY), e.insertionMode = Rc.IN_TABLE_BODY, Nl(e, t)
  10124. }(e, t);
  10125. break;
  10126. case Po.STYLE:
  10127. case Po.SCRIPT:
  10128. case Po.TEMPLATE:
  10129. Xc(e, t);
  10130. break;
  10131. case Po.COL:
  10132. ! function(e, t) {
  10133. e.openElements.clearBackToTableContext(), e._insertFakeElement(Mo.COLGROUP, Po.COLGROUP), e.insertionMode = Rc.IN_COLUMN_GROUP, Al(e, t)
  10134. }(e, t);
  10135. break;
  10136. case Po.FORM:
  10137. ! function(e, t) {
  10138. e.formElement || 0 !== e.openElements.tmplCount || (e._insertElement(t, vo.HTML), e.formElement = e.openElements.current, e.openElements.pop())
  10139. }(e, t);
  10140. break;
  10141. case Po.TABLE:
  10142. ! function(e, t) {
  10143. e.openElements.hasInTableScope(Po.TABLE) && (e.openElements.popUntilTagNamePopped(Po.TABLE), e._resetInsertionMode(), e._processStartTag(t))
  10144. }(e, t);
  10145. break;
  10146. case Po.TBODY:
  10147. case Po.TFOOT:
  10148. case Po.THEAD:
  10149. ! function(e, t) {
  10150. e.openElements.clearBackToTableContext(), e._insertElement(t, vo.HTML), e.insertionMode = Rc.IN_TABLE_BODY
  10151. }(e, t);
  10152. break;
  10153. case Po.INPUT:
  10154. ! function(e, t) {
  10155. il(t) ? e._appendElement(t, vo.HTML) : dl(e, t), t.ackSelfClosing = !0
  10156. }(e, t);
  10157. break;
  10158. case Po.CAPTION:
  10159. ! function(e, t) {
  10160. e.openElements.clearBackToTableContext(), e.activeFormattingElements.insertMarker(), e._insertElement(t, vo.HTML), e.insertionMode = Rc.IN_CAPTION
  10161. }(e, t);
  10162. break;
  10163. case Po.COLGROUP:
  10164. ! function(e, t) {
  10165. e.openElements.clearBackToTableContext(), e._insertElement(t, vo.HTML), e.insertionMode = Rc.IN_COLUMN_GROUP
  10166. }(e, t);
  10167. break;
  10168. default:
  10169. dl(e, t)
  10170. }
  10171. }
  10172. function fl(e, t) {
  10173. switch (t.tagID) {
  10174. case Po.TABLE:
  10175. e.openElements.hasInTableScope(Po.TABLE) && (e.openElements.popUntilTagNamePopped(Po.TABLE), e._resetInsertionMode());
  10176. break;
  10177. case Po.TEMPLATE:
  10178. $c(e, t);
  10179. break;
  10180. case Po.BODY:
  10181. case Po.CAPTION:
  10182. case Po.COL:
  10183. case Po.COLGROUP:
  10184. case Po.HTML:
  10185. case Po.TBODY:
  10186. case Po.TD:
  10187. case Po.TFOOT:
  10188. case Po.TH:
  10189. case Po.THEAD:
  10190. case Po.TR:
  10191. break;
  10192. default:
  10193. dl(e, t)
  10194. }
  10195. }
  10196. function dl(e, t) {
  10197. const n = e.fosterParentingEnabled;
  10198. e.fosterParentingEnabled = !0, el(e, t), e.fosterParentingEnabled = n
  10199. }
  10200. function El(e, t) {
  10201. e.pendingCharacterTokens.push(t)
  10202. }
  10203. function ml(e, t) {
  10204. e.pendingCharacterTokens.push(t), e.hasNonWhitespacePendingCharacterToken = !0
  10205. }
  10206. function Tl(e, t) {
  10207. let n = 0;
  10208. if (e.hasNonWhitespacePendingCharacterToken) for (; n < e.pendingCharacterTokens.length; n++) dl(e, e.pendingCharacterTokens[n]);
  10209. else for (; n < e.pendingCharacterTokens.length; n++) e._insertCharacters(e.pendingCharacterTokens[n]);
  10210. e.insertionMode = e.originalInsertionMode, e._processToken(t)
  10211. }
  10212. const _l = new Set([Po.CAPTION, Po.COL, Po.COLGROUP, Po.TBODY, Po.TD, Po.TFOOT, Po.TH, Po.THEAD, Po.TR]);
  10213. function Al(e, t) {
  10214. switch (t.tagID) {
  10215. case Po.HTML:
  10216. ol(e, t);
  10217. break;
  10218. case Po.COL:
  10219. e._appendElement(t, vo.HTML), t.ackSelfClosing = !0;
  10220. break;
  10221. case Po.TEMPLATE:
  10222. Xc(e, t);
  10223. break;
  10224. default:
  10225. gl(e, t)
  10226. }
  10227. }
  10228. function gl(e, t) {
  10229. e.openElements.currentTagId === Po.COLGROUP && (e.openElements.pop(), e.insertionMode = Rc.IN_TABLE, e._processToken(t))
  10230. }
  10231. function Nl(e, t) {
  10232. switch (t.tagID) {
  10233. case Po.TR:
  10234. e.openElements.clearBackToTableBodyContext(), e._insertElement(t, vo.HTML), e.insertionMode = Rc.IN_ROW;
  10235. break;
  10236. case Po.TH:
  10237. case Po.TD:
  10238. e.openElements.clearBackToTableBodyContext(), e._insertFakeElement(Mo.TR, Po.TR), e.insertionMode = Rc.IN_ROW, Il(e, t);
  10239. break;
  10240. case Po.CAPTION:
  10241. case Po.COL:
  10242. case Po.COLGROUP:
  10243. case Po.TBODY:
  10244. case Po.TFOOT:
  10245. case Po.THEAD:
  10246. e.openElements.hasTableBodyContextInTableScope() && (e.openElements.clearBackToTableBodyContext(), e.openElements.pop(), e.insertionMode = Rc.IN_TABLE, pl(e, t));
  10247. break;
  10248. default:
  10249. pl(e, t)
  10250. }
  10251. }
  10252. function Cl(e, t) {
  10253. const n = t.tagID;
  10254. switch (t.tagID) {
  10255. case Po.TBODY:
  10256. case Po.TFOOT:
  10257. case Po.THEAD:
  10258. e.openElements.hasInTableScope(n) && (e.openElements.clearBackToTableBodyContext(), e.openElements.pop(), e.insertionMode = Rc.IN_TABLE);
  10259. break;
  10260. case Po.TABLE:
  10261. e.openElements.hasTableBodyContextInTableScope() && (e.openElements.clearBackToTableBodyContext(), e.openElements.pop(), e.insertionMode = Rc.IN_TABLE, fl(e, t));
  10262. break;
  10263. case Po.BODY:
  10264. case Po.CAPTION:
  10265. case Po.COL:
  10266. case Po.COLGROUP:
  10267. case Po.HTML:
  10268. case Po.TD:
  10269. case Po.TH:
  10270. case Po.TR:
  10271. break;
  10272. default:
  10273. fl(e, t)
  10274. }
  10275. }
  10276. function Il(e, t) {
  10277. switch (t.tagID) {
  10278. case Po.TH:
  10279. case Po.TD:
  10280. e.openElements.clearBackToTableRowContext(), e._insertElement(t, vo.HTML), e.insertionMode = Rc.IN_CELL, e.activeFormattingElements.insertMarker();
  10281. break;
  10282. case Po.CAPTION:
  10283. case Po.COL:
  10284. case Po.COLGROUP:
  10285. case Po.TBODY:
  10286. case Po.TFOOT:
  10287. case Po.THEAD:
  10288. case Po.TR:
  10289. e.openElements.hasInTableScope(Po.TR) && (e.openElements.clearBackToTableRowContext(), e.openElements.pop(), e.insertionMode = Rc.IN_TABLE_BODY, Nl(e, t));
  10290. break;
  10291. default:
  10292. pl(e, t)
  10293. }
  10294. }
  10295. function Sl(e, t) {
  10296. switch (t.tagID) {
  10297. case Po.TR:
  10298. e.openElements.hasInTableScope(Po.TR) && (e.openElements.clearBackToTableRowContext(), e.openElements.pop(), e.insertionMode = Rc.IN_TABLE_BODY);
  10299. break;
  10300. case Po.TABLE:
  10301. e.openElements.hasInTableScope(Po.TR) && (e.openElements.clearBackToTableRowContext(), e.openElements.pop(), e.insertionMode = Rc.IN_TABLE_BODY, Cl(e, t));
  10302. break;
  10303. case Po.TBODY:
  10304. case Po.TFOOT:
  10305. case Po.THEAD:
  10306. (e.openElements.hasInTableScope(t.tagID) || e.openElements.hasInTableScope(Po.TR)) && (e.openElements.clearBackToTableRowContext(), e.openElements.pop(), e.insertionMode = Rc.IN_TABLE_BODY, Cl(e, t));
  10307. break;
  10308. case Po.BODY:
  10309. case Po.CAPTION:
  10310. case Po.COL:
  10311. case Po.COLGROUP:
  10312. case Po.HTML:
  10313. case Po.TD:
  10314. case Po.TH:
  10315. break;
  10316. default:
  10317. fl(e, t)
  10318. }
  10319. }
  10320. function bl(e, t) {
  10321. switch (t.tagID) {
  10322. case Po.HTML:
  10323. ol(e, t);
  10324. break;
  10325. case Po.OPTION:
  10326. e.openElements.currentTagId === Po.OPTION && e.openElements.pop(), e._insertElement(t, vo.HTML);
  10327. break;
  10328. case Po.OPTGROUP:
  10329. e.openElements.currentTagId === Po.OPTION && e.openElements.pop(), e.openElements.currentTagId === Po.OPTGROUP && e.openElements.pop(), e._insertElement(t, vo.HTML);
  10330. break;
  10331. case Po.INPUT:
  10332. case Po.KEYGEN:
  10333. case Po.TEXTAREA:
  10334. case Po.SELECT:
  10335. e.openElements.hasInSelectScope(Po.SELECT) && (e.openElements.popUntilTagNamePopped(Po.SELECT), e._resetInsertionMode(), t.tagID !== Po.SELECT && e._processStartTag(t));
  10336. break;
  10337. case Po.SCRIPT:
  10338. case Po.TEMPLATE:
  10339. Xc(e, t)
  10340. }
  10341. }
  10342. function Ol(e, t) {
  10343. switch (t.tagID) {
  10344. case Po.OPTGROUP:
  10345. e.openElements.stackTop > 0 && e.openElements.currentTagId === Po.OPTION && e.openElements.tagIDs[e.openElements.stackTop - 1] === Po.OPTGROUP && e.openElements.pop(), e.openElements.currentTagId === Po.OPTGROUP && e.openElements.pop();
  10346. break;
  10347. case Po.OPTION:
  10348. e.openElements.currentTagId === Po.OPTION && e.openElements.pop();
  10349. break;
  10350. case Po.SELECT:
  10351. e.openElements.hasInSelectScope(Po.SELECT) && (e.openElements.popUntilTagNamePopped(Po.SELECT), e._resetInsertionMode());
  10352. break;
  10353. case Po.TEMPLATE:
  10354. $c(e, t)
  10355. }
  10356. }
  10357. function yl(e, t) {
  10358. e.openElements.tmplCount > 0 ? (e.openElements.popUntilTagNamePopped(Po.TEMPLATE), e.activeFormattingElements.clearToLastMarker(), e.tmplInsertionModeStack.shift(), e._resetInsertionMode(), e.onEof(t)) : jc(e, t)
  10359. }
  10360. function Ll(e, t) {
  10361. var n;
  10362. if (t.tagID === Po.HTML) {
  10363. if (e.fragmentContext || (e.insertionMode = Rc.AFTER_AFTER_BODY), e.options.sourceCodeLocationInfo && e.openElements.tagIDs[0] === Po.HTML) {
  10364. e._setEndLocation(e.openElements.items[0], t);
  10365. const r = e.openElements.items[1];
  10366. r && !(null === (n = e.treeAdapter.getNodeSourceCodeLocation(r)) || void 0 === n ? void 0 : n.endTag) && e._setEndLocation(r, t)
  10367. }
  10368. } else kl(e, t)
  10369. }
  10370. function kl(e, t) {
  10371. e.insertionMode = Rc.IN_BODY, el(e, t)
  10372. }
  10373. function vl(e, t) {
  10374. e.insertionMode = Rc.IN_BODY, el(e, t)
  10375. }
  10376. function Dl(e) {
  10377. for (; e.treeAdapter.getNamespaceURI(e.openElements.current) !== vo.HTML && !e._isIntegrationPoint(e.openElements.currentTagId, e.openElements.current);) e.openElements.pop()
  10378. }
  10379. var Rl = Ke((function(e, t) {
  10380. Object.defineProperty(t, "__esModule", {
  10381. value: !0
  10382. }), t.escapeText = t.escapeAttribute = t.escapeUTF8 = t.escape = t.encodeXML = t.getCodePoint = t.xmlReplacer = void 0, t.xmlReplacer = /["&'<>$\x80-\uFFFF]/g;
  10383. var n = new Map([
  10384. [34, "&quot;"],
  10385. [38, "&amp;"],
  10386. [39, "&apos;"],
  10387. [60, "&lt;"],
  10388. [62, "&gt;"]
  10389. ]);
  10390. function r(e) {
  10391. for (var r, i = "", s = 0; null !== (r = t.xmlReplacer.exec(e));) {
  10392. var a = r.index,
  10393. o = e.charCodeAt(a),
  10394. c = n.get(o);
  10395. void 0 !== c ? (i += e.substring(s, a) + c, s = a + 1) : (i += "".concat(e.substring(s, a), "&#x").concat((0, t.getCodePoint)(e, a).toString(16), ";"), s = t.xmlReplacer.lastIndex += Number(55296 == (64512 & o)))
  10396. }
  10397. return i + e.substr(s)
  10398. }
  10399. function i(e, t) {
  10400. return function(n) {
  10401. for (var r, i = 0, s = ""; r = e.exec(n);) i !== r.index && (s += n.substring(i, r.index)), s += t.get(r[0].charCodeAt(0)), i = r.index + 1;
  10402. return s + n.substring(i)
  10403. }
  10404. }
  10405. t.getCodePoint = null != String.prototype.codePointAt ? function(e, t) {
  10406. return e.codePointAt(t)
  10407. } : function(e, t) {
  10408. return 55296 == (64512 & e.charCodeAt(t)) ? 1024 * (e.charCodeAt(t) - 55296) + e.charCodeAt(t + 1) - 56320 + 65536 : e.charCodeAt(t)
  10409. }, t.encodeXML = r, t.escape = r, t.escapeUTF8 = i(/[&<>'"]/g, n), t.escapeAttribute = i(/["&\u00A0]/g, new Map([
  10410. [34, "&quot;"],
  10411. [38, "&amp;"],
  10412. [160, "&nbsp;"]
  10413. ])), t.escapeText = i(/[&<>\u00A0]/g, new Map([
  10414. [38, "&amp;"],
  10415. [60, "&lt;"],
  10416. [62, "&gt;"],
  10417. [160, "&nbsp;"]
  10418. ]))
  10419. }));
  10420. qe(Rl);
  10421. var Ml = Rl.escapeText,
  10422. Pl = Rl.escapeAttribute;
  10423. Rl.escapeUTF8, Rl.escape, Rl.encodeXML, Rl.getCodePoint, Rl.xmlReplacer;
  10424. const xl = new Set([Mo.AREA, Mo.BASE, Mo.BASEFONT, Mo.BGSOUND, Mo.BR, Mo.COL, Mo.EMBED, Mo.FRAME, Mo.HR, Mo.IMG, Mo.INPUT, Mo.KEYGEN, Mo.LINK, Mo.META, Mo.PARAM, Mo.SOURCE, Mo.TRACK, Mo.WBR]);
  10425. const wl = {
  10426. treeAdapter: Ec,
  10427. scriptingEnabled: !0
  10428. };
  10429. function Bl(e, t) {
  10430. return Fl(e, {...wl, ...t
  10431. })
  10432. }
  10433. function Fl(e, t) {
  10434. return t.treeAdapter.isElementNode(e) ? function(e, t) {
  10435. const n = t.treeAdapter.getTagName(e);
  10436. return `<${n}${function(e,{treeAdapter:t}){let n="";for(const r of t.getAttrList(e)){if(n+=" ",r.namespace)switch(r.namespace){case vo.XML:n+=`
  10437. xml: $ {
  10438. r.name
  10439. }
  10440. `;break;case vo.XMLNS:"xmlns"!==r.name&&(n+="xmlns:"),n+=r.name;break;case vo.XLINK:n+=`
  10441. xlink: $ {
  10442. r.name
  10443. }
  10444. `;break;default:n+=`
  10445. $ {
  10446. r.prefix
  10447. }: $ {
  10448. r.name
  10449. }
  10450. `}else n+=r.name;n+=` = "${Pl(r.value)}"
  10451. `}return n}(e,t)}>${function(e,t){return t.treeAdapter.isElementNode(e)&&t.treeAdapter.getNamespaceURI(e)===vo.HTML&&xl.has(t.treeAdapter.getTagName(e))}(e,t)?"":`
  10452. $ {
  10453. function(e, t) {
  10454. let n = "";
  10455. const r = t.treeAdapter.isElementNode(e) && t.treeAdapter.getTagName(e) === Mo.TEMPLATE && t.treeAdapter.getNamespaceURI(e) === vo.HTML ? t.treeAdapter.getTemplateContent(e) : e, i = t.treeAdapter.getChildNodes(r);
  10456. if (i) for (const e of i) n += Fl(e, t);
  10457. return n
  10458. }(e, t)
  10459. } < /${n}>`}`}(e,t):t.treeAdapter.isTextNode(e)?function(e,t){const{treeAdapter:n}=t,r=n.getTextNodeContent(e),i=n.getParentNode(e),s=i&&n.isElementNode(i)&&n.getTagName(i);return s&&n.getNamespaceURI(i)===vo.HTML&&(a=s,o=t.scriptingEnabled,Yo.has(a)||o&&a===Mo.NOSCRIPT)?r:Ml(r);var a,o}(e,t):t.treeAdapter.isCommentNode(e)?function(e,{treeAdapter:t}){return`\x3c!--${t.getCommentNodeContent(e)}--\x3e`}(e,t):t.treeAdapter.isDocumentTypeNode(e)?function(e,{treeAdapter:t}){return`<!DOCTYPE ${t.getDocumentTypeNodeName(e)}>`}(e,t):""}function Ul(e){return new m(e)}function Hl(e){const t=e.includes('"')?"'":'"';return t+e+t}const Gl={isCommentNode:O,isElementNode:I,isTextNode:b,createDocument(){const e=new N([]);return e["x-mode"]=Ro.NO_QUIRKS,e},createDocumentFragment:()=>new N([]),createElement(e,t,n){const r=Object.create(null),i=Object.create(null),s=Object.create(null);for(let e=0;e<n.length;e++){const t=n[e].name;r[t]=n[e].value,i[t]=n[e].namespace,s[t]=n[e].prefix}const a=new C(e,r,[]);return a.namespace=t,a["x-attribsNamespace"]=i,a["x-attribsPrefix"]=s,a},createCommentNode:e=>new T(e),appendChild(e,t){const n=e.children[e.children.length-1];n&&(n.next=t,t.prev=n),e.children.push(t),t.parent=e},insertBefore(e,t,n){const r=e.children.indexOf(n),{prev:i}=n;i&&(i.next=t,t.prev=i),n.prev=t,t.next=n,e.children.splice(r,0,t),t.parent=e},setTemplateContent(e,t){Gl.appendChild(e,t)},getTemplateContent:e=>e.children[0],setDocumentType(e,t,n,r){const i=function(e,t,n){let r="!DOCTYPE ";return e&&(r+=e),t?r+=` PUBLIC ${Hl(t)}`:n&&(r+=" SYSTEM"),n&&(r+=` ${Hl(n)}`),r}(t,n,r);let s=e.children.find((e=>y(e)&&"!doctype"===e.name));s?s.data=null!=i?i:null:(s=new _("!doctype",i),Gl.appendChild(e,s)),s["x-name"]=null!=t?t:void 0,s["x-publicId"]=null!=n?n:void 0,s["x-systemId"]=null!=r?r:void 0},setDocumentMode(e,t){e["x-mode"]=t},getDocumentMode:e=>e["x-mode"],detachNode(e){if(e.parent){const t=e.parent.children.indexOf(e),{prev:n,next:r}=e;e.prev=null,e.next=null,n&&(n.next=r),r&&(r.prev=n),e.parent.children.splice(t,1),e.parent=null}},insertText(e,t){const n=e.children[e.children.length-1];n&&b(n)?n.data+=t:Gl.appendChild(e,Ul(t))},insertTextBefore(e,t,n){const r=e.children[e.children.indexOf(n)-1];r&&b(r)?r.data+=t:Gl.insertBefore(e,Ul(t),n)},adoptAttributes(e,t){for(let n=0;n<t.length;n++){const r=t[n].name;void 0===e.attribs[r]&&(e.attribs[r]=t[n].value,e["x-attribsNamespace"][r]=t[n].namespace,e["x-attribsPrefix"][r]=t[n].prefix)}},getFirstChild:e=>e.children[0],getChildNodes:e=>e.children,getParentNode:e=>e.parent,getAttrList:e=>e.attributes,getTagName:e=>e.name,getNamespaceURI:e=>e.namespace,getTextNodeContent:e=>e.data,getCommentNodeContent:e=>e.data,getDocumentTypeNodeName(e){var t;return null!==(t=e["x-name"])&&void 0!==t?t:""},getDocumentTypeNodePublicId(e){var t;return null!==(t=e["x-publicId"])&&void 0!==t?t:""},getDocumentTypeNodeSystemId(e){var t;return null!==(t=e["x-systemId"])&&void 0!==t?t:""},isDocumentTypeNode:e=>y(e)&&"!doctype"===e.name,setNodeSourceCodeLocation(e,t){t&&(e.startIndex=t.startOffset,e.endIndex=t.endOffset),e.sourceCodeLocation=t},getNodeSourceCodeLocation:e=>e.sourceCodeLocation,updateNodeSourceCodeLocation(e,t){null!=t.endOffset&&(e.endIndex=t.endOffset),e.sourceCodeLocation={...e.sourceCodeLocation,...t}}};var Yl=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,s=t.length;i<s;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};function ql(e,t,n,r){var i={scriptingEnabled:"boolean"!=typeof t.scriptingEnabled||t.scriptingEnabled,treeAdapter:Gl,sourceCodeLocationInfo:t.sourceCodeLocationInfo};return n?function(e,t){return wc.parse(e,t)}(e,i):function(e,t,n){"string"==typeof e&&(n=t,t=e,e=null);const r=wc.getFragmentParser(e,n);return r.tokenizer.write(t,!0),r.getFragment()}(r,e,i)}var Kl,jl,Vl,Wl={treeAdapter:Gl};function Ql(e){return e===Kl.Space||e===Kl.NewLine||e===Kl.Tab||e===Kl.FormFeed||e===Kl.CarriageReturn}function Xl(e){return e===Kl.Slash||e===Kl.Gt||Ql(e)}function $l(e){return e>=Kl.Zero&&e<=Kl.Nine}!function(e){e[e.Tab=9]="Tab",e[e.NewLine=10]="NewLine",e[e.FormFeed=12]="FormFeed",e[e.CarriageReturn=13]="CarriageReturn",e[e.Space=32]="Space",e[e.ExclamationMark=33]="ExclamationMark",e[e.Num=35]="Num",e[e.Amp=38]="Amp",e[e.SingleQuote=39]="SingleQuote",e[e.DoubleQuote=34]="DoubleQuote",e[e.Dash=45]="Dash",e[e.Slash=47]="Slash",e[e.Zero=48]="Zero",e[e.Nine=57]="Nine",e[e.Semi=59]="Semi",e[e.Lt=60]="Lt",e[e.Eq=61]="Eq",e[e.Gt=62]="Gt",e[e.Questionmark=63]="Questionmark",e[e.UpperA=65]="UpperA",e[e.LowerA=97]="LowerA",e[e.UpperF=70]="UpperF",e[e.LowerF=102]="LowerF",e[e.UpperZ=90]="UpperZ",e[e.LowerZ=122]="LowerZ",e[e.LowerX=120]="LowerX",e[e.OpeningSquareBracket=91]="OpeningSquareBracket"}(Kl||(Kl={})),function(e){e[e.Text=1]="Text",e[e.BeforeTagName=2]="BeforeTagName",e[e.InTagName=3]="InTagName",e[e.InSelfClosingTag=4]="InSelfClosingTag",e[e.BeforeClosingTagName=5]="BeforeClosingTagName",e[e.InClosingTagName=6]="InClosingTagName",e[e.AfterClosingTagName=7]="AfterClosingTagName",e[e.BeforeAttributeName=8]="BeforeAttributeName",e[e.InAttributeName=9]="InAttributeName",e[e.AfterAttributeName=10]="AfterAttributeName",e[e.BeforeAttributeValue=11]="BeforeAttributeValue",e[e.InAttributeValueDq=12]="InAttributeValueDq",e[e.InAttributeValueSq=13]="InAttributeValueSq",e[e.InAttributeValueNq=14]="InAttributeValueNq",e[e.BeforeDeclaration=15]="BeforeDeclaration",e[e.InDeclaration=16]="InDeclaration",e[e.InProcessingInstruction=17]="InProcessingInstruction",e[e.BeforeComment=18]="BeforeComment",e[e.CDATASequence=19]="CDATASequence",e[e.InSpecialComment=20]="InSpecialComment",e[e.InCommentLike=21]="InCommentLike",e[e.BeforeSpecialS=22]="BeforeSpecialS",e[e.SpecialStartSequence=23]="SpecialStartSequence",e[e.InSpecialTag=24]="InSpecialTag",e[e.BeforeEntity=25]="BeforeEntity",e[e.BeforeNumericEntity=26]="BeforeNumericEntity",e[e.InNamedEntity=27]="InNamedEntity",e[e.InNumericEntity=28]="InNumericEntity",e[e.InHexEntity=29]="InHexEntity"}(jl||(jl={})),function(e){e[e.NoValue=0]="NoValue",e[e.Unquoted=1]="Unquoted",e[e.Single=2]="Single",e[e.Double=3]="Double"}(Vl||(Vl={}));const zl={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101])};class Jl{constructor({xmlMode:e=!1,decodeEntities:t=!0},n){this.cbs=n,this.state=jl.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=jl.Text,this.isSpecial=!1,this.running=!0,this.offset=0,this.sequenceIndex=0,this.trieIndex=0,this.trieCurrent=0,this.entityResult=0,this.entityExcess=0,this.xmlMode=e,this.decodeEntities=t,this.entityTrie=e?xo:wo}reset(){this.state=jl.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=jl.Text,this.currentSequence=void 0,this.running=!0,this.offset=0}write(e){this.offset+=this.buffer.length,this.buffer=e,this.parse()}end(){this.running&&this.finish()}pause(){this.running=!1}resume(){this.running=!0,this.index<this.buffer.length+this.offset&&this.parse()}getIndex(){return this.index}getSectionStart(){return this.sectionStart}stateText(e){e===Kl.Lt||!this.decodeEntities&&this.fastForwardTo(Kl.Lt)?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=jl.BeforeTagName,this.sectionStart=this.index):this.decodeEntities&&e===Kl.Amp&&(this.state=jl.BeforeEntity)}stateSpecialStartSequence(e){const t=this.sequenceIndex===this.currentSequence.length;if(t?Xl(e):(32|e)===this.currentSequence[this.sequenceIndex]){if(!t)return void this.sequenceIndex++}else this.isSpecial=!1;this.sequenceIndex=0,this.state=jl.InTagName,this.stateInTagName(e)}stateInSpecialTag(e){if(this.sequenceIndex===this.currentSequence.length){if(e===Kl.Gt||Ql(e)){const t=this.index-this.currentSequence.length;if(this.sectionStart<t){const e=this.index;this.index=t,this.cbs.ontext(this.sectionStart,t),this.index=e}return this.isSpecial=!1,this.sectionStart=t+2,void this.stateInClosingTagName(e)}this.sequenceIndex=0}(32|e)===this.currentSequence[this.sequenceIndex]?this.sequenceIndex+=1:0===this.sequenceIndex?this.currentSequence===zl.TitleEnd?this.decodeEntities&&e===Kl.Amp&&(this.state=jl.BeforeEntity):this.fastForwardTo(Kl.Lt)&&(this.sequenceIndex=1):this.sequenceIndex=Number(e===Kl.Lt)}stateCDATASequence(e){e===zl.Cdata[this.sequenceIndex]?++this.sequenceIndex===zl.Cdata.length&&(this.state=jl.InCommentLike,this.currentSequence=zl.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.sequenceIndex=0,this.state=jl.InDeclaration,this.stateInDeclaration(e))}fastForwardTo(e){for(;++this.index<this.buffer.length+this.offset;)if(this.buffer.charCodeAt(this.index-this.offset)===e)return!0;return this.index=this.buffer.length+this.offset-1,!1}stateInCommentLike(e){e===this.currentSequence[this.sequenceIndex]?++this.sequenceIndex===this.currentSequence.length&&(this.currentSequence===zl.CdataEnd?this.cbs.oncdata(this.sectionStart,this.index,2):this.cbs.oncomment(this.sectionStart,this.index,2),this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=jl.Text):0===this.sequenceIndex?this.fastForwardTo(this.currentSequence[0])&&(this.sequenceIndex=1):e!==this.currentSequence[this.sequenceIndex-1]&&(this.sequenceIndex=0)}isTagStartChar(e){return this.xmlMode?!Xl(e):function(e){return e>=Kl.LowerA&&e<=Kl.LowerZ||e>=Kl.UpperA&&e<=Kl.UpperZ}(e)}startSpecial(e,t){this.isSpecial=!0,this.currentSequence=e,this.sequenceIndex=t,this.state=jl.SpecialStartSequence}stateBeforeTagName(e){if(e===Kl.ExclamationMark)this.state=jl.BeforeDeclaration,this.sectionStart=this.index+1;else if(e===Kl.Questionmark)this.state=jl.InProcessingInstruction,this.sectionStart=this.index+1;else if(this.isTagStartChar(e)){const t=32|e;this.sectionStart=this.index,this.xmlMode||t!==zl.TitleEnd[2]?this.state=this.xmlMode||t!==zl.ScriptEnd[2]?jl.InTagName:jl.BeforeSpecialS:this.startSpecial(zl.TitleEnd,3)}else e===Kl.Slash?this.state=jl.BeforeClosingTagName:(this.state=jl.Text,this.stateText(e))}stateInTagName(e){Xl(e)&&(this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=jl.BeforeAttributeName,this.stateBeforeAttributeName(e))}stateBeforeClosingTagName(e){Ql(e)||(e===Kl.Gt?this.state=jl.Text:(this.state=this.isTagStartChar(e)?jl.InClosingTagName:jl.InSpecialComment,this.sectionStart=this.index))}stateInClosingTagName(e){(e===Kl.Gt||Ql(e))&&(this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=jl.AfterClosingTagName,this.stateAfterClosingTagName(e))}stateAfterClosingTagName(e){(e===Kl.Gt||this.fastForwardTo(Kl.Gt))&&(this.state=jl.Text,this.sectionStart=this.index+1)}stateBeforeAttributeName(e){e===Kl.Gt?(this.cbs.onopentagend(this.index),this.isSpecial?(this.state=jl.InSpecialTag,this.sequenceIndex=0):this.state=jl.Text,this.baseState=this.state,this.sectionStart=this.index+1):e===Kl.Slash?this.state=jl.InSelfClosingTag:Ql(e)||(this.state=jl.InAttributeName,this.sectionStart=this.index)}stateInSelfClosingTag(e){e===Kl.Gt?(this.cbs.onselfclosingtag(this.index),this.state=jl.Text,this.baseState=jl.Text,this.sectionStart=this.index+1,this.isSpecial=!1):Ql(e)||(this.state=jl.BeforeAttributeName,this.stateBeforeAttributeName(e))}stateInAttributeName(e){(e===Kl.Eq||Xl(e))&&(this.cbs.onattribname(this.sectionStart,this.index),this.sectionStart=-1,this.state=jl.AfterAttributeName,this.stateAfterAttributeName(e))}stateAfterAttributeName(e){e===Kl.Eq?this.state=jl.BeforeAttributeValue:e===Kl.Slash||e===Kl.Gt?(this.cbs.onattribend(Vl.NoValue,this.index),this.state=jl.BeforeAttributeName,this.stateBeforeAttributeName(e)):Ql(e)||(this.cbs.onattribend(Vl.NoValue,this.index),this.state=jl.InAttributeName,this.sectionStart=this.index)}stateBeforeAttributeValue(e){e===Kl.DoubleQuote?(this.state=jl.InAttributeValueDq,this.sectionStart=this.index+1):e===Kl.SingleQuote?(this.state=jl.InAttributeValueSq,this.sectionStart=this.index+1):Ql(e)||(this.sectionStart=this.index,this.state=jl.InAttributeValueNq,this.stateInAttributeValueNoQuotes(e))}handleInAttributeValue(e,t){e===t||!this.decodeEntities&&this.fastForwardTo(t)?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(t===Kl.DoubleQuote?Vl.Double:Vl.Single,this.index),this.state=jl.BeforeAttributeName):this.decodeEntities&&e===Kl.Amp&&(this.baseState=this.state,this.state=jl.BeforeEntity)}stateInAttributeValueDoubleQuotes(e){this.handleInAttributeValue(e,Kl.DoubleQuote)}stateInAttributeValueSingleQuotes(e){this.handleInAttributeValue(e,Kl.SingleQuote)}stateInAttributeValueNoQuotes(e){Ql(e)||e===Kl.Gt?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(Vl.Unquoted,this.index),this.state=jl.BeforeAttributeName,this.stateBeforeAttributeName(e)):this.decodeEntities&&e===Kl.Amp&&(this.baseState=this.state,this.state=jl.BeforeEntity)}stateBeforeDeclaration(e){e===Kl.OpeningSquareBracket?(this.state=jl.CDATASequence,this.sequenceIndex=0):this.state=e===Kl.Dash?jl.BeforeComment:jl.InDeclaration}stateInDeclaration(e){(e===Kl.Gt||this.fastForwardTo(Kl.Gt))&&(this.cbs.ondeclaration(this.sectionStart,this.index),this.state=jl.Text,this.sectionStart=this.index+1)}stateInProcessingInstruction(e){(e===Kl.Gt||this.fastForwardTo(Kl.Gt))&&(this.cbs.onprocessinginstruction(this.sectionStart,this.index),this.state=jl.Text,this.sectionStart=this.index+1)}stateBeforeComment(e){e===Kl.Dash?(this.state=jl.InCommentLike,this.currentSequence=zl.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1):this.state=jl.InDeclaration}stateInSpecialComment(e){(e===Kl.Gt||this.fastForwardTo(Kl.Gt))&&(this.cbs.oncomment(this.sectionStart,this.index,0),this.state=jl.Text,this.sectionStart=this.index+1)}stateBeforeSpecialS(e){const t=32|e;t===zl.ScriptEnd[3]?this.startSpecial(zl.ScriptEnd,4):t===zl.StyleEnd[3]?this.startSpecial(zl.StyleEnd,4):(this.state=jl.InTagName,this.stateInTagName(e))}stateBeforeEntity(e){this.entityExcess=1,this.entityResult=0,e===Kl.Num?this.state=jl.BeforeNumericEntity:e===Kl.Amp||(this.trieIndex=0,this.trieCurrent=this.entityTrie[0],this.state=jl.InNamedEntity,this.stateInNamedEntity(e))}stateInNamedEntity(e){if(this.entityExcess+=1,this.trieIndex=Oo(this.entityTrie,this.trieCurrent,this.trieIndex+1,e),this.trieIndex<0)return this.emitNamedEntity(),void this.index--;this.trieCurrent=this.entityTrie[this.trieIndex];const t=this.trieCurrent&yo.VALUE_LENGTH;if(t){const n=(t>>14)-1;if(this.allowLegacyEntity()||e===Kl.Semi){const e=this.index-this.entityExcess+1;e>this.sectionStart&&this.emitPartial(this.sectionStart,e),this.entityResult=this.trieIndex,this.trieIndex+=n,this.entityExcess=0,this.sectionStart=this.index+1,0===n&&this.emitNamedEntity()}else this.trieIndex+=n}}emitNamedEntity(){if(this.state=this.baseState,0===this.entityResult)return;switch((this.entityTrie[this.entityResult]&yo.VALUE_LENGTH)>>14){case 1:this.emitCodePoint(this.entityTrie[this.entityResult]&~yo.VALUE_LENGTH);break;case 2:this.emitCodePoint(this.entityTrie[this.entityResult+1]);break;case 3:this.emitCodePoint(this.entityTrie[this.entityResult+1]),this.emitCodePoint(this.entityTrie[this.entityResult+2])}}stateBeforeNumericEntity(e){(32|e)===Kl.LowerX?(this.entityExcess++,this.state=jl.InHexEntity):(this.state=jl.InNumericEntity,this.stateInNumericEntity(e))}emitNumericEntity(e){const t=this.index-this.entityExcess-1;t+2+Number(this.state===jl.InHexEntity)!==this.index&&(t>this.sectionStart&&this.emitPartial(this.sectionStart,t),this.sectionStart=this.index+Number(e),this.emitCodePoint(ko(this.entityResult))),this.state=this.baseState}stateInNumericEntity(e){e===Kl.Semi?this.emitNumericEntity(!0):$l(e)?(this.entityResult=10*this.entityResult+(e-Kl.Zero),this.entityExcess++):(this.allowLegacyEntity()?this.emitNumericEntity(!1):this.state=this.baseState,this.index--)}stateInHexEntity(e){e===Kl.Semi?this.emitNumericEntity(!0):$l(e)?(this.entityResult=16*this.entityResult+(e-Kl.Zero),this.entityExcess++):!function(e){return e>=Kl.UpperA&&e<=Kl.UpperF||e>=Kl.LowerA&&e<=Kl.LowerF}(e)?(this.allowLegacyEntity()?this.emitNumericEntity(!1):this.state=this.baseState,this.index--):(this.entityResult=16*this.entityResult+((32|e)-Kl.LowerA+10),this.entityExcess++)}allowLegacyEntity(){return!this.xmlMode&&(this.baseState===jl.Text||this.baseState===jl.InSpecialTag)}cleanup(){this.running&&this.sectionStart!==this.index&&(this.state===jl.Text||this.state===jl.InSpecialTag&&0===this.sequenceIndex?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):this.state!==jl.InAttributeValueDq&&this.state!==jl.InAttributeValueSq&&this.state!==jl.InAttributeValueNq||(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))}shouldContinue(){return this.index<this.buffer.length+this.offset&&this.running}parse(){for(;this.shouldContinue();){const e=this.buffer.charCodeAt(this.index-this.offset);this.state===jl.Text?this.stateText(e):this.state===jl.SpecialStartSequence?this.stateSpecialStartSequence(e):this.state===jl.InSpecialTag?this.stateInSpecialTag(e):this.state===jl.CDATASequence?this.stateCDATASequence(e):this.state===jl.InAttributeValueDq?this.stateInAttributeValueDoubleQuotes(e):this.state===jl.InAttributeName?this.stateInAttributeName(e):this.state===jl.InCommentLike?this.stateInCommentLike(e):this.state===jl.InSpecialComment?this.stateInSpecialComment(e):this.state===jl.BeforeAttributeName?this.stateBeforeAttributeName(e):this.state===jl.InTagName?this.stateInTagName(e):this.state===jl.InClosingTagName?this.stateInClosingTagName(e):this.state===jl.BeforeTagName?this.stateBeforeTagName(e):this.state===jl.AfterAttributeName?this.stateAfterAttributeName(e):this.state===jl.InAttributeValueSq?this.stateInAttributeValueSingleQuotes(e):this.state===jl.BeforeAttributeValue?this.stateBeforeAttributeValue(e):this.state===jl.BeforeClosingTagName?this.stateBeforeClosingTagName(e):this.state===jl.AfterClosingTagName?this.stateAfterClosingTagName(e):this.state===jl.BeforeSpecialS?this.stateBeforeSpecialS(e):this.state===jl.InAttributeValueNq?this.stateInAttributeValueNoQuotes(e):this.state===jl.InSelfClosingTag?this.stateInSelfClosingTag(e):this.state===jl.InDeclaration?this.stateInDeclaration(e):this.state===jl.BeforeDeclaration?this.stateBeforeDeclaration(e):this.state===jl.BeforeComment?this.stateBeforeComment(e):this.state===jl.InProcessingInstruction?this.stateInProcessingInstruction(e):this.state===jl.InNamedEntity?this.stateInNamedEntity(e):this.state===jl.BeforeEntity?this.stateBeforeEntity(e):this.state===jl.InHexEntity?this.stateInHexEntity(e):this.state===jl.InNumericEntity?this.stateInNumericEntity(e):this.stateBeforeNumericEntity(e),this.index++}this.cleanup()}finish(){this.state===jl.InNamedEntity&&this.emitNamedEntity(),this.sectionStart<this.index&&this.handleTrailingData(),this.cbs.onend()}handleTrailingData(){const e=this.buffer.length+this.offset;this.state===jl.InCommentLike?this.currentSequence===zl.CdataEnd?this.cbs.oncdata(this.sectionStart,e,0):this.cbs.oncomment(this.sectionStart,e,0):this.state===jl.InNumericEntity&&this.allowLegacyEntity()||this.state===jl.InHexEntity&&this.allowLegacyEntity()?this.emitNumericEntity(!1):this.state===jl.InTagName||this.state===jl.BeforeAttributeName||this.state===jl.BeforeAttributeValue||this.state===jl.AfterAttributeName||this.state===jl.InAttributeName||this.state===jl.InAttributeValueSq||this.state===jl.InAttributeValueDq||this.state===jl.InAttributeValueNq||this.state===jl.InClosingTagName||this.cbs.ontext(this.sectionStart,e)}emitPartial(e,t){this.baseState!==jl.Text&&this.baseState!==jl.InSpecialTag?this.cbs.onattribdata(e,t):this.cbs.ontext(e,t)}emitCodePoint(e){this.baseState!==jl.Text&&this.baseState!==jl.InSpecialTag?this.cbs.onattribentity(e):this.cbs.ontextentity(e)}}const Zl=new Set(["input","option","optgroup","select","button","datalist","textarea"]),eh=new Set(["p"]),th=new Set(["thead","tbody"]),nh=new Set(["dd","dt"]),rh=new Set(["rt","rp"]),ih=new Map([["tr",new Set(["tr","th","td"])],["th",new Set(["th"])],["td",new Set(["thead","th","td"])],["body",new Set(["head","link","script"])],["li",new Set(["li"])],["p",eh],["h1",eh],["h2",eh],["h3",eh],["h4",eh],["h5",eh],["h6",eh],["select",Zl],["input",Zl],["output",Zl],["button",Zl],["datalist",Zl],["textarea",Zl],["option",new Set(["option"])],["optgroup",new Set(["optgroup","option"])],["dd",nh],["dt",nh],["address",eh],["article",eh],["aside",eh],["blockquote",eh],["details",eh],["div",eh],["dl",eh],["fieldset",eh],["figcaption",eh],["figure",eh],["footer",eh],["form",eh],["header",eh],["hr",eh],["main",eh],["nav",eh],["ol",eh],["pre",eh],["section",eh],["table",eh],["ul",eh],["rt",rh],["rp",rh],["tbody",th],["tfoot",th]]),sh=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]),ah=new Set(["math","svg"]),oh=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignobject","desc","title"]),ch=/\s | \ //;class lh{constructor(e,t={}){var n,r,i,s,a;this.options=t,this.startIndex=0,this.endIndex=0,this.openTagStart=0,this.tagname="",this.attribname="",this.attribvalue="",this.attribs=null,this.stack=[],this.foreignContext=[],this.buffers=[],this.bufferOffset=0,this.writeIndex=0,this.ended=!1,this.cbs=null!=e?e:{},this.lowerCaseTagNames=null!==(n=t.lowerCaseTags)&&void 0!==n?n:!t.xmlMode,this.lowerCaseAttributeNames=null!==(r=t.lowerCaseAttributeNames)&&void 0!==r?r:!t.xmlMode,this.tokenizer=new(null!==(i=t.Tokenizer)&&void 0!==i?i:Jl)(this.options,this),null===(a=(s=this.cbs).onparserinit)||void 0===a||a.call(s,this)}ontext(e,t){var n,r;const i=this.getSlice(e,t);this.endIndex=t-1,null===(r=(n=this.cbs).ontext)||void 0===r||r.call(n,i),this.startIndex=t}ontextentity(e){var t,n;const r=this.tokenizer.getSectionStart();this.endIndex=r-1,null===(n=(t=this.cbs).ontext)||void 0===n||n.call(t,Lo(e)),this.startIndex=r}isVoidElement(e){return!this.options.xmlMode&&sh.has(e)}onopentagname(e,t){this.endIndex=t;let n=this.getSlice(e,t);this.lowerCaseTagNames&&(n=n.toLowerCase()),this.emitOpenTag(n)}emitOpenTag(e){var t,n,r,i;this.openTagStart=this.startIndex,this.tagname=e;const s=!this.options.xmlMode&&ih.get(e);if(s)for(;this.stack.length>0&&s.has(this.stack[this.stack.length-1]);){const e=this.stack.pop();null===(n=(t=this.cbs).onclosetag)||void 0===n||n.call(t,e,!0)}this.isVoidElement(e)||(this.stack.push(e),ah.has(e)?this.foreignContext.push(!0):oh.has(e)&&this.foreignContext.push(!1)),null===(i=(r=this.cbs).onopentagname)||void 0===i||i.call(r,e),this.cbs.onopentag&&(this.attribs={})}endOpenTag(e){var t,n;this.startIndex=this.openTagStart,this.attribs&&(null===(n=(t=this.cbs).onopentag)||void 0===n||n.call(t,this.tagname,this.attribs,e),this.attribs=null),this.cbs.onclosetag&&this.isVoidElement(this.tagname)&&this.cbs.onclosetag(this.tagname,!0),this.tagname=""}onopentagend(e){this.endIndex=e,this.endOpenTag(!1),this.startIndex=e+1}onclosetag(e,t){var n,r,i,s,a,o;this.endIndex=t;let c=this.getSlice(e,t);if(this.lowerCaseTagNames&&(c=c.toLowerCase()),(ah.has(c)||oh.has(c))&&this.foreignContext.pop(),this.isVoidElement(c))this.options.xmlMode||"br"!==c||(null===(r=(n=this.cbs).onopentagname)||void 0===r||r.call(n,"br"),null===(s=(i=this.cbs).onopentag)||void 0===s||s.call(i,"br",{},!0),null===(o=(a=this.cbs).onclosetag)||void 0===o||o.call(a,"br",!1));else{const e=this.stack.lastIndexOf(c);if(-1!==e)if(this.cbs.onclosetag){let t=this.stack.length-e;for(;t--;)this.cbs.onclosetag(this.stack.pop(),0!==t)}else this.stack.length=e;else this.options.xmlMode||"p"!==c||(this.emitOpenTag("p"),this.closeCurrentTag(!0))}this.startIndex=t+1}onselfclosingtag(e){this.endIndex=e,this.options.xmlMode||this.options.recognizeSelfClosing||this.foreignContext[this.foreignContext.length-1]?(this.closeCurrentTag(!1),this.startIndex=e+1):this.onopentagend(e)}closeCurrentTag(e){var t,n;const r=this.tagname;this.endOpenTag(e),this.stack[this.stack.length-1]===r&&(null===(n=(t=this.cbs).onclosetag)||void 0===n||n.call(t,r,!e),this.stack.pop())}onattribname(e,t){this.startIndex=e;const n=this.getSlice(e,t);this.attribname=this.lowerCaseAttributeNames?n.toLowerCase():n}onattribdata(e,t){this.attribvalue+=this.getSlice(e,t)}onattribentity(e){this.attribvalue+=Lo(e)}onattribend(e,t){var n,r;this.endIndex=t,null===(r=(n=this.cbs).onattribute)||void 0===r||r.call(n,this.attribname,this.attribvalue,e===Vl.Double?'"':e===Vl.Single?"'":e===Vl.NoValue?void 0:null),this.attribs&&!Object.prototype.hasOwnProperty.call(this.attribs,this.attribname)&&(this.attribs[this.attribname]=this.attribvalue),this.attribvalue=""}getInstructionName(e){const t=e.search(ch);let n=t<0?e:e.substr(0,t);return this.lowerCaseTagNames&&(n=n.toLowerCase()),n}ondeclaration(e,t){this.endIndex=t;const n=this.getSlice(e,t);if(this.cbs.onprocessinginstruction){const e=this.getInstructionName(n);this.cbs.onprocessinginstruction(`!${e}`,`!${n}`)}this.startIndex=t+1}onprocessinginstruction(e,t){this.endIndex=t;const n=this.getSlice(e,t);if(this.cbs.onprocessinginstruction){const e=this.getInstructionName(n);this.cbs.onprocessinginstruction(`?${e}`,`?${n}`)}this.startIndex=t+1}oncomment(e,t,n){var r,i,s,a;this.endIndex=t,null===(i=(r=this.cbs).oncomment)||void 0===i||i.call(r,this.getSlice(e,t-n)),null===(a=(s=this.cbs).oncommentend)||void 0===a||a.call(s),this.startIndex=t+1}oncdata(e,t,n){var r,i,s,a,o,c,l,h,u,p;this.endIndex=t;const f=this.getSlice(e,t-n);this.options.xmlMode||this.options.recognizeCDATA?(null===(i=(r=this.cbs).oncdatastart)||void 0===i||i.call(r),null===(a=(s=this.cbs).ontext)||void 0===a||a.call(s,f),null===(c=(o=this.cbs).oncdataend)||void 0===c||c.call(o)):(null===(h=(l=this.cbs).oncomment)||void 0===h||h.call(l,`[CDATA[${f}]]`),null===(p=(u=this.cbs).oncommentend)||void 0===p||p.call(u)),this.startIndex=t+1}onend(){var e,t;if(this.cbs.onclosetag){this.endIndex=this.startIndex;for(let e=this.stack.length;e>0;this.cbs.onclosetag(this.stack[--e],!0));}null===(t=(e=this.cbs).onend)||void 0===t||t.call(e)}reset(){var e,t,n,r;null===(t=(e=this.cbs).onreset)||void 0===t||t.call(e),this.tokenizer.reset(),this.tagname="",this.attribname="",this.attribs=null,this.stack.length=0,this.startIndex=0,this.endIndex=0,null===(r=(n=this.cbs).onparserinit)||void 0===r||r.call(n,this),this.buffers.length=0,this.bufferOffset=0,this.writeIndex=0,this.ended=!1}parseComplete(e){this.reset(),this.end(e)}getSlice(e,t){for(;e-this.bufferOffset>=this.buffers[0].length;)this.shiftBuffer();let n=this.buffers[0].slice(e-this.bufferOffset,t-this.bufferOffset);for(;t-this.bufferOffset>this.buffers[0].length;)this.shiftBuffer(),n+=this.buffers[0].slice(0,t-this.bufferOffset);return n}shiftBuffer(){this.bufferOffset+=this.buffers[0].length,this.writeIndex--,this.buffers.shift()}write(e){var t,n;this.ended?null===(n=(t=this.cbs).onerror)||void 0===n||n.call(t,new Error(".write() after done!")):(this.buffers.push(e),this.tokenizer.running&&(this.tokenizer.write(e),this.writeIndex++))}end(e){var t,n;this.ended?null===(n=(t=this.cbs).onerror)||void 0===n||n.call(t,Error(".end() after done!")):(e&&this.write(e),this.ended=!0,this.tokenizer.end())}pause(){this.tokenizer.pause()}resume(){for(this.tokenizer.resume();this.tokenizer.running&&this.writeIndex<this.buffers.length;)this.tokenizer.write(this.buffers[this.writeIndex++]);this.ended&&this.tokenizer.end()}parseChunk(e){this.write(e)}done(e){this.end(e)}}var hh=function(e){return function(t,n,r,i){if("undefined"!=typeof Buffer&&Buffer.isBuffer(t)&&(t=t.toString()),"string"==typeof t)return e(t,n,r,i);var s=t;if(!Array.isArray(s)&&L(s))return s;var a=new N([]);return Ba(s,a),a}}((function(e,t,n,r){return t.xmlMode||t._useHtmlParser2?function(e,t){const n=new M(void 0,t);return new lh(n,t).end(e),n.root}(e,t):ql(e,t,n,r)})),uh=function(e,t){return function r(s,a,o){if(void 0===o&&(o=!0),null==s)throw new Error("cheerio.load() expects a string");var c=no(no({},n),i(a)),l=e(s,c,o,null),h=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return to(r,n),r.prototype._make=function(e,t){var n=u(e,t);return n.prevObject=this,n},r.prototype._parse=function(t,n,r,i){return e(t,n,r,i)},r.prototype._render=function(e){return t(e,this.options)},r}(Za);function u(t,n,r,s){if(void 0===r&&(r=l),t&&wi(t))return t;var a=no(no({},c),i(s)),o="string"==typeof r?[e(r,a,!1,null)]:"length"in r?r:[r],u=wi(o)?o:new h(o,null,a);if(u._root=u,!t)return new h(void 0,u,a);var p,f="string"==typeof t&&Ui(t)?e(t,a,!1,null).children:(p=t).name||"root"===p.type||"text"===p.type||"comment"===p.type?[t]:Array.isArray(t)?t:void 0,d=new h(f,u,a);if(f)return d;if("string"!=typeof t)throw new Error("Unexpected type of selector");var E=t,m=n?"string"==typeof n?Ui(n)?new h([e(n,a,!1,null)],u,a):(E="".concat(n," ").concat(E),u):wi(n)?n:new h(Array.isArray(n)?n:[n],u,a):u;return m?m.find(E):d}return Object.assign(u,xi,{load:r,_root:l,_options:c,fn:h.prototype,prototype:h.prototype}),u}}(hh,(function(e,t){return t.xmlMode||t._useHtmlParser2?V(e,t):function(e){for(var t,n=("length"in e?e:[e]),r=0;r<n.length;r+=1)L(s=n[r])&&(t=Array.prototype.splice).call.apply(t,Yl([n,r,1],s.children,!1));var i="";for(r=0;r<n.length;r+=1){var s;i+=Bl(s=n[r],Wl)}return i}(e)}));function ph(e,t){return He({path:e,json:t})}function fh(e){return He(e)}function dh(e,t){return Ii(e,t)}var Eh=uh([]),mh=Di,Th=Ri,_h=ki,Ah=vi;export{mh as contains,Eh as default,Oi as html,dh as jinja2,ph as jp,fh as jpo,uh as load,Th as merge,_h as parseHTML,Ah as root,Li as text,yi as xml};