index.js 398 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904
  1. /*!
  2. Stencil Mock Doc v4.20.0 | MIT Licensed | https://stenciljs.com
  3. */
  4. // src/runtime/runtime-constants.ts
  5. var CONTENT_REF_ID = "r";
  6. var ORG_LOCATION_ID = "o";
  7. var SLOT_NODE_ID = "s";
  8. var TEXT_NODE_ID = "t";
  9. var XLINK_NS = "http://www.w3.org/1999/xlink";
  10. // src/mock-doc/attribute.ts
  11. var attrHandler = {
  12. get(obj, prop) {
  13. if (prop in obj) {
  14. return obj[prop];
  15. }
  16. if (typeof prop !== "symbol" && !isNaN(prop)) {
  17. return obj.__items[prop];
  18. }
  19. return void 0;
  20. }
  21. };
  22. var createAttributeProxy = (caseInsensitive) => new Proxy(new MockAttributeMap(caseInsensitive), attrHandler);
  23. var MockAttributeMap = class {
  24. constructor(caseInsensitive = false) {
  25. this.caseInsensitive = caseInsensitive;
  26. this.__items = [];
  27. }
  28. get length() {
  29. return this.__items.length;
  30. }
  31. item(index) {
  32. return this.__items[index] || null;
  33. }
  34. setNamedItem(attr) {
  35. attr.namespaceURI = null;
  36. this.setNamedItemNS(attr);
  37. }
  38. setNamedItemNS(attr) {
  39. if (attr != null && attr.value != null) {
  40. attr.value = String(attr.value);
  41. }
  42. const existingAttr = this.__items.find((a) => a.name === attr.name && a.namespaceURI === attr.namespaceURI);
  43. if (existingAttr != null) {
  44. existingAttr.value = attr.value;
  45. } else {
  46. this.__items.push(attr);
  47. }
  48. }
  49. getNamedItem(attrName) {
  50. if (this.caseInsensitive) {
  51. attrName = attrName.toLowerCase();
  52. }
  53. return this.getNamedItemNS(null, attrName);
  54. }
  55. getNamedItemNS(namespaceURI, attrName) {
  56. namespaceURI = getNamespaceURI(namespaceURI);
  57. return this.__items.find((attr) => attr.name === attrName && getNamespaceURI(attr.namespaceURI) === namespaceURI) || null;
  58. }
  59. removeNamedItem(attr) {
  60. this.removeNamedItemNS(attr);
  61. }
  62. removeNamedItemNS(attr) {
  63. for (let i = 0, ii = this.__items.length; i < ii; i++) {
  64. if (this.__items[i].name === attr.name && this.__items[i].namespaceURI === attr.namespaceURI) {
  65. this.__items.splice(i, 1);
  66. break;
  67. }
  68. }
  69. }
  70. [Symbol.iterator]() {
  71. let i = 0;
  72. return {
  73. next: () => ({
  74. done: i === this.length,
  75. value: this.item(i++)
  76. })
  77. };
  78. }
  79. get [Symbol.toStringTag]() {
  80. return "MockAttributeMap";
  81. }
  82. };
  83. function getNamespaceURI(namespaceURI) {
  84. return namespaceURI === XLINK_NS ? null : namespaceURI;
  85. }
  86. function cloneAttributes(srcAttrs, sortByName = false) {
  87. const dstAttrs = new MockAttributeMap(srcAttrs.caseInsensitive);
  88. if (srcAttrs != null) {
  89. const attrLen = srcAttrs.length;
  90. if (sortByName && attrLen > 1) {
  91. const sortedAttrs = [];
  92. for (let i = 0; i < attrLen; i++) {
  93. const srcAttr = srcAttrs.item(i);
  94. const dstAttr = new MockAttr(srcAttr.name, srcAttr.value, srcAttr.namespaceURI);
  95. sortedAttrs.push(dstAttr);
  96. }
  97. sortedAttrs.sort(sortAttributes).forEach((attr) => {
  98. dstAttrs.setNamedItemNS(attr);
  99. });
  100. } else {
  101. for (let i = 0; i < attrLen; i++) {
  102. const srcAttr = srcAttrs.item(i);
  103. const dstAttr = new MockAttr(srcAttr.name, srcAttr.value, srcAttr.namespaceURI);
  104. dstAttrs.setNamedItemNS(dstAttr);
  105. }
  106. }
  107. }
  108. return dstAttrs;
  109. }
  110. function sortAttributes(a, b) {
  111. if (a.name < b.name) return -1;
  112. if (a.name > b.name) return 1;
  113. return 0;
  114. }
  115. var MockAttr = class {
  116. constructor(attrName, attrValue, namespaceURI = null) {
  117. this._name = attrName;
  118. this._value = String(attrValue);
  119. this._namespaceURI = namespaceURI;
  120. }
  121. get name() {
  122. return this._name;
  123. }
  124. set name(value) {
  125. this._name = value;
  126. }
  127. get value() {
  128. return this._value;
  129. }
  130. set value(value) {
  131. this._value = String(value);
  132. }
  133. get nodeName() {
  134. return this._name;
  135. }
  136. set nodeName(value) {
  137. this._name = value;
  138. }
  139. get nodeValue() {
  140. return this._value;
  141. }
  142. set nodeValue(value) {
  143. this._value = String(value);
  144. }
  145. get namespaceURI() {
  146. return this._namespaceURI;
  147. }
  148. set namespaceURI(namespaceURI) {
  149. this._namespaceURI = namespaceURI;
  150. }
  151. };
  152. // src/mock-doc/constants.ts
  153. var NODE_TYPES = /* @__PURE__ */ ((NODE_TYPES2) => {
  154. NODE_TYPES2[NODE_TYPES2["ELEMENT_NODE"] = 1] = "ELEMENT_NODE";
  155. NODE_TYPES2[NODE_TYPES2["ATTRIBUTE_NODE"] = 2] = "ATTRIBUTE_NODE";
  156. NODE_TYPES2[NODE_TYPES2["TEXT_NODE"] = 3] = "TEXT_NODE";
  157. NODE_TYPES2[NODE_TYPES2["CDATA_SECTION_NODE"] = 4] = "CDATA_SECTION_NODE";
  158. NODE_TYPES2[NODE_TYPES2["ENTITY_REFERENCE_NODE"] = 5] = "ENTITY_REFERENCE_NODE";
  159. NODE_TYPES2[NODE_TYPES2["ENTITY_NODE"] = 6] = "ENTITY_NODE";
  160. NODE_TYPES2[NODE_TYPES2["PROCESSING_INSTRUCTION_NODE"] = 7] = "PROCESSING_INSTRUCTION_NODE";
  161. NODE_TYPES2[NODE_TYPES2["COMMENT_NODE"] = 8] = "COMMENT_NODE";
  162. NODE_TYPES2[NODE_TYPES2["DOCUMENT_NODE"] = 9] = "DOCUMENT_NODE";
  163. NODE_TYPES2[NODE_TYPES2["DOCUMENT_TYPE_NODE"] = 10] = "DOCUMENT_TYPE_NODE";
  164. NODE_TYPES2[NODE_TYPES2["DOCUMENT_FRAGMENT_NODE"] = 11] = "DOCUMENT_FRAGMENT_NODE";
  165. NODE_TYPES2[NODE_TYPES2["NOTATION_NODE"] = 12] = "NOTATION_NODE";
  166. return NODE_TYPES2;
  167. })(NODE_TYPES || {});
  168. // src/mock-doc/class-list.ts
  169. var MockClassList = class {
  170. constructor(elm) {
  171. this.elm = elm;
  172. }
  173. add(...classNames) {
  174. const clsNames = getItems(this.elm);
  175. let updated = false;
  176. classNames.forEach((className) => {
  177. className = String(className);
  178. validateClass(className);
  179. if (clsNames.includes(className) === false) {
  180. clsNames.push(className);
  181. updated = true;
  182. }
  183. });
  184. if (updated) {
  185. this.elm.setAttributeNS(null, "class", clsNames.join(" "));
  186. }
  187. }
  188. remove(...classNames) {
  189. const clsNames = getItems(this.elm);
  190. let updated = false;
  191. classNames.forEach((className) => {
  192. className = String(className);
  193. validateClass(className);
  194. const index = clsNames.indexOf(className);
  195. if (index > -1) {
  196. clsNames.splice(index, 1);
  197. updated = true;
  198. }
  199. });
  200. if (updated) {
  201. this.elm.setAttributeNS(null, "class", clsNames.filter((c) => c.length > 0).join(" "));
  202. }
  203. }
  204. contains(className) {
  205. className = String(className);
  206. return getItems(this.elm).includes(className);
  207. }
  208. toggle(className) {
  209. className = String(className);
  210. if (this.contains(className) === true) {
  211. this.remove(className);
  212. } else {
  213. this.add(className);
  214. }
  215. }
  216. get length() {
  217. return getItems(this.elm).length;
  218. }
  219. item(index) {
  220. return getItems(this.elm)[index];
  221. }
  222. toString() {
  223. return getItems(this.elm).join(" ");
  224. }
  225. };
  226. function validateClass(className) {
  227. if (className === "") {
  228. throw new Error("The token provided must not be empty.");
  229. }
  230. if (/\s/.test(className)) {
  231. throw new Error(
  232. `The token provided ('${className}') contains HTML space characters, which are not valid in tokens.`
  233. );
  234. }
  235. }
  236. function getItems(elm) {
  237. const className = elm.getAttribute("class");
  238. if (typeof className === "string" && className.length > 0) {
  239. return className.trim().split(" ").filter((c) => c.length > 0);
  240. }
  241. return [];
  242. }
  243. // src/mock-doc/css-style-declaration.ts
  244. var MockCSSStyleDeclaration = class {
  245. constructor() {
  246. this._styles = /* @__PURE__ */ new Map();
  247. }
  248. setProperty(prop, value) {
  249. prop = jsCaseToCssCase(prop);
  250. if (value == null || value === "") {
  251. this._styles.delete(prop);
  252. } else {
  253. this._styles.set(prop, String(value));
  254. }
  255. }
  256. getPropertyValue(prop) {
  257. prop = jsCaseToCssCase(prop);
  258. return String(this._styles.get(prop) || "");
  259. }
  260. removeProperty(prop) {
  261. prop = jsCaseToCssCase(prop);
  262. this._styles.delete(prop);
  263. }
  264. get length() {
  265. return this._styles.size;
  266. }
  267. get cssText() {
  268. const cssText = [];
  269. this._styles.forEach((value, prop) => {
  270. cssText.push(`${prop}: ${value};`);
  271. });
  272. return cssText.join(" ").trim();
  273. }
  274. set cssText(cssText) {
  275. if (cssText == null || cssText === "") {
  276. this._styles.clear();
  277. return;
  278. }
  279. cssText.split(";").forEach((rule) => {
  280. rule = rule.trim();
  281. if (rule.length > 0) {
  282. const splt = rule.split(":");
  283. if (splt.length > 1) {
  284. const prop = splt[0].trim();
  285. const value = splt.slice(1).join(":").trim();
  286. if (prop !== "" && value !== "") {
  287. this._styles.set(jsCaseToCssCase(prop), value);
  288. }
  289. }
  290. }
  291. });
  292. }
  293. };
  294. function createCSSStyleDeclaration() {
  295. return new Proxy(new MockCSSStyleDeclaration(), cssProxyHandler);
  296. }
  297. var cssProxyHandler = {
  298. get(cssStyle, prop) {
  299. if (prop in cssStyle) {
  300. return cssStyle[prop];
  301. }
  302. prop = cssCaseToJsCase(prop);
  303. return cssStyle.getPropertyValue(prop);
  304. },
  305. set(cssStyle, prop, value) {
  306. if (prop in cssStyle) {
  307. cssStyle[prop] = value;
  308. } else {
  309. cssStyle.setProperty(prop, value);
  310. }
  311. return true;
  312. }
  313. };
  314. function cssCaseToJsCase(str) {
  315. if (str.length > 1 && str.includes("-") === true) {
  316. str = str.toLowerCase().split("-").map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1)).join("");
  317. str = str.slice(0, 1).toLowerCase() + str.slice(1);
  318. }
  319. return str;
  320. }
  321. function jsCaseToCssCase(str) {
  322. if (str.length > 1 && str.includes("-") === false && /[A-Z]/.test(str) === true) {
  323. str = str.replace(/([A-Z])/g, (g) => " " + g[0]).trim().replace(/ /g, "-").toLowerCase();
  324. }
  325. return str;
  326. }
  327. // src/mock-doc/custom-element-registry.ts
  328. var MockCustomElementRegistry = class {
  329. constructor(win) {
  330. this.win = win;
  331. }
  332. define(tagName, cstr, options) {
  333. if (tagName.toLowerCase() !== tagName) {
  334. throw new Error(
  335. `Failed to execute 'define' on 'CustomElementRegistry': "${tagName}" is not a valid custom element name`
  336. );
  337. }
  338. if (this.__registry == null) {
  339. this.__registry = /* @__PURE__ */ new Map();
  340. }
  341. this.__registry.set(tagName, { cstr, options });
  342. if (this.__whenDefined != null) {
  343. const whenDefinedResolveFns = this.__whenDefined.get(tagName);
  344. if (whenDefinedResolveFns != null) {
  345. whenDefinedResolveFns.forEach((whenDefinedResolveFn) => {
  346. whenDefinedResolveFn();
  347. });
  348. whenDefinedResolveFns.length = 0;
  349. this.__whenDefined.delete(tagName);
  350. }
  351. }
  352. const doc = this.win.document;
  353. if (doc != null) {
  354. const hosts = doc.querySelectorAll(tagName);
  355. hosts.forEach((host) => {
  356. if (upgradedElements.has(host) === false) {
  357. tempDisableCallbacks.add(doc);
  358. const upgradedCmp = createCustomElement(this, doc, tagName);
  359. for (let i = 0; i < host.childNodes.length; i++) {
  360. const childNode = host.childNodes[i];
  361. childNode.remove();
  362. upgradedCmp.appendChild(childNode);
  363. }
  364. tempDisableCallbacks.delete(doc);
  365. if (proxyElements.has(host)) {
  366. proxyElements.set(host, upgradedCmp);
  367. }
  368. }
  369. fireConnectedCallback(host);
  370. });
  371. }
  372. }
  373. get(tagName) {
  374. if (this.__registry != null) {
  375. const def = this.__registry.get(tagName.toLowerCase());
  376. if (def != null) {
  377. return def.cstr;
  378. }
  379. }
  380. return void 0;
  381. }
  382. getName(cstr) {
  383. for (const [tagName, def] of this.__registry.entries()) {
  384. if (def.cstr === cstr) {
  385. return tagName;
  386. }
  387. }
  388. return void 0;
  389. }
  390. upgrade(_rootNode) {
  391. }
  392. clear() {
  393. if (this.__registry != null) {
  394. this.__registry.clear();
  395. }
  396. if (this.__whenDefined != null) {
  397. this.__whenDefined.clear();
  398. }
  399. }
  400. whenDefined(tagName) {
  401. tagName = tagName.toLowerCase();
  402. if (this.__registry != null && this.__registry.has(tagName) === true) {
  403. return Promise.resolve(this.__registry.get(tagName).cstr);
  404. }
  405. return new Promise((resolve) => {
  406. if (this.__whenDefined == null) {
  407. this.__whenDefined = /* @__PURE__ */ new Map();
  408. }
  409. let whenDefinedResolveFns = this.__whenDefined.get(tagName);
  410. if (whenDefinedResolveFns == null) {
  411. whenDefinedResolveFns = [];
  412. this.__whenDefined.set(tagName, whenDefinedResolveFns);
  413. }
  414. whenDefinedResolveFns.push(resolve);
  415. });
  416. }
  417. };
  418. function createCustomElement(customElements, ownerDocument, tagName) {
  419. const Cstr = customElements.get(tagName);
  420. if (Cstr != null) {
  421. const cmp = new Cstr(ownerDocument);
  422. cmp.nodeName = tagName.toUpperCase();
  423. upgradedElements.add(cmp);
  424. return cmp;
  425. }
  426. const host = new Proxy(
  427. {},
  428. {
  429. get(obj, prop) {
  430. const elm2 = proxyElements.get(host);
  431. if (elm2 != null) {
  432. return elm2[prop];
  433. }
  434. return obj[prop];
  435. },
  436. set(obj, prop, val) {
  437. const elm2 = proxyElements.get(host);
  438. if (elm2 != null) {
  439. elm2[prop] = val;
  440. } else {
  441. obj[prop] = val;
  442. }
  443. return true;
  444. },
  445. has(obj, prop) {
  446. const elm2 = proxyElements.get(host);
  447. if (prop in elm2) {
  448. return true;
  449. }
  450. if (prop in obj) {
  451. return true;
  452. }
  453. return false;
  454. }
  455. }
  456. );
  457. const elm = new MockHTMLElement(ownerDocument, tagName);
  458. proxyElements.set(host, elm);
  459. return host;
  460. }
  461. var proxyElements = /* @__PURE__ */ new WeakMap();
  462. var upgradedElements = /* @__PURE__ */ new WeakSet();
  463. function connectNode(ownerDocument, node) {
  464. node.ownerDocument = ownerDocument;
  465. if (node.nodeType === 1 /* ELEMENT_NODE */) {
  466. if (ownerDocument != null && node.nodeName.includes("-")) {
  467. const win = ownerDocument.defaultView;
  468. if (win != null && typeof node.connectedCallback === "function" && node.isConnected) {
  469. fireConnectedCallback(node);
  470. }
  471. const shadowRoot = node.shadowRoot;
  472. if (shadowRoot != null) {
  473. shadowRoot.childNodes.forEach((childNode) => {
  474. connectNode(ownerDocument, childNode);
  475. });
  476. }
  477. }
  478. node.childNodes.forEach((childNode) => {
  479. connectNode(ownerDocument, childNode);
  480. });
  481. } else {
  482. node.childNodes.forEach((childNode) => {
  483. childNode.ownerDocument = ownerDocument;
  484. });
  485. }
  486. }
  487. function fireConnectedCallback(node) {
  488. if (typeof node.connectedCallback === "function") {
  489. if (tempDisableCallbacks.has(node.ownerDocument) === false) {
  490. try {
  491. node.connectedCallback();
  492. } catch (e2) {
  493. console.error(e2);
  494. }
  495. }
  496. }
  497. }
  498. function disconnectNode(node) {
  499. if (node.nodeType === 1 /* ELEMENT_NODE */) {
  500. if (node.nodeName.includes("-") === true && typeof node.disconnectedCallback === "function") {
  501. if (tempDisableCallbacks.has(node.ownerDocument) === false) {
  502. try {
  503. node.disconnectedCallback();
  504. } catch (e2) {
  505. console.error(e2);
  506. }
  507. }
  508. }
  509. node.childNodes.forEach(disconnectNode);
  510. }
  511. }
  512. function attributeChanged(node, attrName, oldValue, newValue) {
  513. attrName = attrName.toLowerCase();
  514. const observedAttributes = node.constructor.observedAttributes;
  515. if (Array.isArray(observedAttributes) === true && observedAttributes.some((obs) => obs.toLowerCase() === attrName) === true) {
  516. try {
  517. node.attributeChangedCallback(attrName, oldValue, newValue);
  518. } catch (e2) {
  519. console.error(e2);
  520. }
  521. }
  522. }
  523. function checkAttributeChanged(node) {
  524. return node.nodeName.includes("-") === true && typeof node.attributeChangedCallback === "function";
  525. }
  526. var tempDisableCallbacks = /* @__PURE__ */ new Set();
  527. // src/mock-doc/dataset.ts
  528. function dataset(elm) {
  529. const ds = {};
  530. const attributes = elm.attributes;
  531. const attrLen = attributes.length;
  532. for (let i = 0; i < attrLen; i++) {
  533. const attr = attributes.item(i);
  534. const nodeName = attr.nodeName;
  535. if (nodeName.startsWith("data-")) {
  536. ds[dashToPascalCase(nodeName)] = attr.nodeValue;
  537. }
  538. }
  539. return new Proxy(ds, {
  540. get(_obj, camelCaseProp) {
  541. return ds[camelCaseProp];
  542. },
  543. set(_obj, camelCaseProp, value) {
  544. const dataAttr = toDataAttribute(camelCaseProp);
  545. elm.setAttribute(dataAttr, value);
  546. return true;
  547. }
  548. });
  549. }
  550. function toDataAttribute(str) {
  551. return "data-" + String(str).replace(/([A-Z0-9])/g, (g) => " " + g[0]).trim().replace(/ /g, "-").toLowerCase();
  552. }
  553. function dashToPascalCase(str) {
  554. str = String(str).slice(5);
  555. return str.split("-").map((segment, index) => {
  556. if (index === 0) {
  557. return segment.charAt(0).toLowerCase() + segment.slice(1);
  558. }
  559. return segment.charAt(0).toUpperCase() + segment.slice(1);
  560. }).join("");
  561. }
  562. // src/mock-doc/event.ts
  563. var MockEvent = class {
  564. constructor(type, eventInitDict) {
  565. this.bubbles = false;
  566. this.cancelBubble = false;
  567. this.cancelable = false;
  568. this.composed = false;
  569. this.currentTarget = null;
  570. this.defaultPrevented = false;
  571. this.srcElement = null;
  572. this.target = null;
  573. if (typeof type !== "string") {
  574. throw new Error(`Event type required`);
  575. }
  576. this.type = type;
  577. this.timeStamp = Date.now();
  578. if (eventInitDict != null) {
  579. Object.assign(this, eventInitDict);
  580. }
  581. }
  582. preventDefault() {
  583. this.defaultPrevented = true;
  584. }
  585. stopPropagation() {
  586. this.cancelBubble = true;
  587. }
  588. stopImmediatePropagation() {
  589. this.cancelBubble = true;
  590. }
  591. /**
  592. * @ref https://developer.mozilla.org/en-US/docs/Web/API/Event/composedPath
  593. * @returns a composed path of the event
  594. */
  595. composedPath() {
  596. const composedPath = [];
  597. let currentElement = this.target;
  598. while (currentElement) {
  599. composedPath.push(currentElement);
  600. if (!currentElement.parentElement && currentElement.nodeName === "#document" /* DOCUMENT_NODE */) {
  601. composedPath.push(currentElement.defaultView);
  602. break;
  603. }
  604. if (currentElement.parentElement == null && currentElement.tagName === "HTML") {
  605. currentElement = currentElement.ownerDocument;
  606. } else {
  607. currentElement = currentElement.parentElement;
  608. }
  609. }
  610. return composedPath;
  611. }
  612. };
  613. var MockCustomEvent = class extends MockEvent {
  614. constructor(type, customEventInitDic) {
  615. super(type);
  616. this.detail = null;
  617. if (customEventInitDic != null) {
  618. Object.assign(this, customEventInitDic);
  619. }
  620. }
  621. };
  622. var MockKeyboardEvent = class extends MockEvent {
  623. constructor(type, keyboardEventInitDic) {
  624. super(type);
  625. this.code = "";
  626. this.key = "";
  627. this.altKey = false;
  628. this.ctrlKey = false;
  629. this.metaKey = false;
  630. this.shiftKey = false;
  631. this.location = 0;
  632. this.repeat = false;
  633. if (keyboardEventInitDic != null) {
  634. Object.assign(this, keyboardEventInitDic);
  635. }
  636. }
  637. };
  638. var MockMouseEvent = class extends MockEvent {
  639. constructor(type, mouseEventInitDic) {
  640. super(type);
  641. this.screenX = 0;
  642. this.screenY = 0;
  643. this.clientX = 0;
  644. this.clientY = 0;
  645. this.ctrlKey = false;
  646. this.shiftKey = false;
  647. this.altKey = false;
  648. this.metaKey = false;
  649. this.button = 0;
  650. this.buttons = 0;
  651. this.relatedTarget = null;
  652. if (mouseEventInitDic != null) {
  653. Object.assign(this, mouseEventInitDic);
  654. }
  655. }
  656. };
  657. var MockUIEvent = class extends MockEvent {
  658. constructor(type, uiEventInitDic) {
  659. super(type);
  660. this.detail = null;
  661. this.view = null;
  662. if (uiEventInitDic != null) {
  663. Object.assign(this, uiEventInitDic);
  664. }
  665. }
  666. };
  667. var MockFocusEvent = class extends MockUIEvent {
  668. constructor(type, focusEventInitDic) {
  669. super(type);
  670. this.relatedTarget = null;
  671. if (focusEventInitDic != null) {
  672. Object.assign(this, focusEventInitDic);
  673. }
  674. }
  675. };
  676. var MockEventListener = class {
  677. constructor(type, handler) {
  678. this.type = type;
  679. this.handler = handler;
  680. }
  681. };
  682. function addEventListener(elm, type, handler) {
  683. const target = elm;
  684. if (target.__listeners == null) {
  685. target.__listeners = [];
  686. }
  687. target.__listeners.push(new MockEventListener(type, handler));
  688. }
  689. function removeEventListener(elm, type, handler) {
  690. const target = elm;
  691. if (target != null && Array.isArray(target.__listeners) === true) {
  692. const elmListener = target.__listeners.find((e2) => e2.type === type && e2.handler === handler);
  693. if (elmListener != null) {
  694. const index = target.__listeners.indexOf(elmListener);
  695. target.__listeners.splice(index, 1);
  696. }
  697. }
  698. }
  699. function resetEventListeners(target) {
  700. if (target != null && target.__listeners != null) {
  701. target.__listeners = null;
  702. }
  703. }
  704. function triggerEventListener(elm, ev) {
  705. if (elm == null || ev.cancelBubble === true) {
  706. return;
  707. }
  708. const target = elm;
  709. ev.currentTarget = elm;
  710. if (Array.isArray(target.__listeners) === true) {
  711. const listeners = target.__listeners.filter((e2) => e2.type === ev.type);
  712. listeners.forEach((listener) => {
  713. try {
  714. listener.handler.call(target, ev);
  715. } catch (err) {
  716. console.error(err);
  717. }
  718. });
  719. }
  720. if (ev.bubbles === false) {
  721. return;
  722. }
  723. if (elm.nodeName === "#document" /* DOCUMENT_NODE */) {
  724. triggerEventListener(elm.defaultView, ev);
  725. } else if (elm.parentElement == null && elm.tagName === "HTML") {
  726. triggerEventListener(elm.ownerDocument, ev);
  727. } else {
  728. triggerEventListener(elm.parentElement, ev);
  729. }
  730. }
  731. function dispatchEvent(currentTarget, ev) {
  732. ev.target = currentTarget;
  733. triggerEventListener(currentTarget, ev);
  734. return true;
  735. }
  736. // scripts/build/parse5-7_1_2-bundle-cache.min.js
  737. var e = function(e2) {
  738. const t = /* @__PURE__ */ 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]), s = "\uFFFD";
  739. var a;
  740. !function(e3) {
  741. e3[e3.EOF = -1] = "EOF", e3[e3.NULL = 0] = "NULL", e3[e3.TABULATION = 9] = "TABULATION", e3[e3.CARRIAGE_RETURN = 13] = "CARRIAGE_RETURN", e3[e3.LINE_FEED = 10] = "LINE_FEED", e3[e3.FORM_FEED = 12] = "FORM_FEED", e3[e3.SPACE = 32] = "SPACE", e3[e3.EXCLAMATION_MARK = 33] = "EXCLAMATION_MARK", e3[e3.QUOTATION_MARK = 34] = "QUOTATION_MARK", e3[e3.NUMBER_SIGN = 35] = "NUMBER_SIGN", e3[e3.AMPERSAND = 38] = "AMPERSAND", e3[e3.APOSTROPHE = 39] = "APOSTROPHE", e3[e3.HYPHEN_MINUS = 45] = "HYPHEN_MINUS", e3[e3.SOLIDUS = 47] = "SOLIDUS", e3[e3.DIGIT_0 = 48] = "DIGIT_0", e3[e3.DIGIT_9 = 57] = "DIGIT_9", e3[e3.SEMICOLON = 59] = "SEMICOLON", e3[e3.LESS_THAN_SIGN = 60] = "LESS_THAN_SIGN", e3[e3.EQUALS_SIGN = 61] = "EQUALS_SIGN", e3[e3.GREATER_THAN_SIGN = 62] = "GREATER_THAN_SIGN", e3[e3.QUESTION_MARK = 63] = "QUESTION_MARK", e3[e3.LATIN_CAPITAL_A = 65] = "LATIN_CAPITAL_A", e3[e3.LATIN_CAPITAL_F = 70] = "LATIN_CAPITAL_F", e3[e3.LATIN_CAPITAL_X = 88] = "LATIN_CAPITAL_X", e3[e3.LATIN_CAPITAL_Z = 90] = "LATIN_CAPITAL_Z", e3[e3.RIGHT_SQUARE_BRACKET = 93] = "RIGHT_SQUARE_BRACKET", e3[e3.GRAVE_ACCENT = 96] = "GRAVE_ACCENT", e3[e3.LATIN_SMALL_A = 97] = "LATIN_SMALL_A", e3[e3.LATIN_SMALL_F = 102] = "LATIN_SMALL_F", e3[e3.LATIN_SMALL_X = 120] = "LATIN_SMALL_X", e3[e3.LATIN_SMALL_Z = 122] = "LATIN_SMALL_Z", e3[e3.REPLACEMENT_CHARACTER = 65533] = "REPLACEMENT_CHARACTER";
  742. }(a = a || (a = {}));
  743. const r = "[CDATA[", n = "doctype", i = "script";
  744. function o(e3) {
  745. return e3 >= 55296 && e3 <= 57343;
  746. }
  747. function c(e3) {
  748. return 32 !== e3 && 10 !== e3 && 13 !== e3 && 9 !== e3 && 12 !== e3 && e3 >= 1 && e3 <= 31 || e3 >= 127 && e3 <= 159;
  749. }
  750. function E(e3) {
  751. return e3 >= 64976 && e3 <= 65007 || t.has(e3);
  752. }
  753. var T, h;
  754. !function(e3) {
  755. e3.controlCharacterInInputStream = "control-character-in-input-stream", e3.noncharacterInInputStream = "noncharacter-in-input-stream", e3.surrogateInInputStream = "surrogate-in-input-stream", e3.nonVoidHtmlElementStartTagWithTrailingSolidus = "non-void-html-element-start-tag-with-trailing-solidus", e3.endTagWithAttributes = "end-tag-with-attributes", e3.endTagWithTrailingSolidus = "end-tag-with-trailing-solidus", e3.unexpectedSolidusInTag = "unexpected-solidus-in-tag", e3.unexpectedNullCharacter = "unexpected-null-character", e3.unexpectedQuestionMarkInsteadOfTagName = "unexpected-question-mark-instead-of-tag-name", e3.invalidFirstCharacterOfTagName = "invalid-first-character-of-tag-name", e3.unexpectedEqualsSignBeforeAttributeName = "unexpected-equals-sign-before-attribute-name", e3.missingEndTagName = "missing-end-tag-name", e3.unexpectedCharacterInAttributeName = "unexpected-character-in-attribute-name", e3.unknownNamedCharacterReference = "unknown-named-character-reference", e3.missingSemicolonAfterCharacterReference = "missing-semicolon-after-character-reference", e3.unexpectedCharacterAfterDoctypeSystemIdentifier = "unexpected-character-after-doctype-system-identifier", e3.unexpectedCharacterInUnquotedAttributeValue = "unexpected-character-in-unquoted-attribute-value", e3.eofBeforeTagName = "eof-before-tag-name", e3.eofInTag = "eof-in-tag", e3.missingAttributeValue = "missing-attribute-value", e3.missingWhitespaceBetweenAttributes = "missing-whitespace-between-attributes", e3.missingWhitespaceAfterDoctypePublicKeyword = "missing-whitespace-after-doctype-public-keyword", e3.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers = "missing-whitespace-between-doctype-public-and-system-identifiers", e3.missingWhitespaceAfterDoctypeSystemKeyword = "missing-whitespace-after-doctype-system-keyword", e3.missingQuoteBeforeDoctypePublicIdentifier = "missing-quote-before-doctype-public-identifier", e3.missingQuoteBeforeDoctypeSystemIdentifier = "missing-quote-before-doctype-system-identifier", e3.missingDoctypePublicIdentifier = "missing-doctype-public-identifier", e3.missingDoctypeSystemIdentifier = "missing-doctype-system-identifier", e3.abruptDoctypePublicIdentifier = "abrupt-doctype-public-identifier", e3.abruptDoctypeSystemIdentifier = "abrupt-doctype-system-identifier", e3.cdataInHtmlContent = "cdata-in-html-content", e3.incorrectlyOpenedComment = "incorrectly-opened-comment", e3.eofInScriptHtmlCommentLikeText = "eof-in-script-html-comment-like-text", e3.eofInDoctype = "eof-in-doctype", e3.nestedComment = "nested-comment", e3.abruptClosingOfEmptyComment = "abrupt-closing-of-empty-comment", e3.eofInComment = "eof-in-comment", e3.incorrectlyClosedComment = "incorrectly-closed-comment", e3.eofInCdata = "eof-in-cdata", e3.absenceOfDigitsInNumericCharacterReference = "absence-of-digits-in-numeric-character-reference", e3.nullCharacterReference = "null-character-reference", e3.surrogateCharacterReference = "surrogate-character-reference", e3.characterReferenceOutsideUnicodeRange = "character-reference-outside-unicode-range", e3.controlCharacterReference = "control-character-reference", e3.noncharacterCharacterReference = "noncharacter-character-reference", e3.missingWhitespaceBeforeDoctypeName = "missing-whitespace-before-doctype-name", e3.missingDoctypeName = "missing-doctype-name", e3.invalidCharacterSequenceAfterDoctypeName = "invalid-character-sequence-after-doctype-name", e3.duplicateAttribute = "duplicate-attribute", e3.nonConformingDoctype = "non-conforming-doctype", e3.missingDoctype = "missing-doctype", e3.misplacedDoctype = "misplaced-doctype", e3.endTagWithoutMatchingOpenElement = "end-tag-without-matching-open-element", e3.closingOfElementWithOpenChildElements = "closing-of-element-with-open-child-elements", e3.disallowedContentInNoscriptInHead = "disallowed-content-in-noscript-in-head", e3.openElementsLeftAfterEof = "open-elements-left-after-eof", e3.abandonedHeadElementChild = "abandoned-head-element-child", e3.misplacedStartTagForHeadElement = "misplaced-start-tag-for-head-element", e3.nestedNoscriptInHead = "nested-noscript-in-head", e3.eofInElementThatCanContainOnlyText = "eof-in-element-that-can-contain-only-text";
  756. }(T = T || (T = {}));
  757. class _ {
  758. constructor(e3) {
  759. this.handler = e3, this.html = "", this.pos = -1, this.lastGapPos = -2, this.gapStack = [], this.skipNextNewLine = false, this.lastChunkWritten = false, this.endOfChunkHit = false, this.bufferWaterline = 65536, this.isEol = false, this.lineStartPos = 0, this.droppedBufferSize = 0, this.line = 1, this.lastErrOffset = -1;
  760. }
  761. get col() {
  762. return this.pos - this.lineStartPos + Number(this.lastGapPos !== this.pos);
  763. }
  764. get offset() {
  765. return this.droppedBufferSize + this.pos;
  766. }
  767. getError(e3) {
  768. const { line: t2, col: s2, offset: a2 } = this;
  769. return { code: e3, startLine: t2, endLine: t2, startCol: s2, endCol: s2, startOffset: a2, endOffset: a2 };
  770. }
  771. _err(e3) {
  772. this.handler.onParseError && this.lastErrOffset !== this.offset && (this.lastErrOffset = this.offset, this.handler.onParseError(this.getError(e3)));
  773. }
  774. _addGap() {
  775. this.gapStack.push(this.lastGapPos), this.lastGapPos = this.pos;
  776. }
  777. _processSurrogate(e3) {
  778. if (this.pos !== this.html.length - 1) {
  779. const t2 = this.html.charCodeAt(this.pos + 1);
  780. if (function(e4) {
  781. return e4 >= 56320 && e4 <= 57343;
  782. }(t2)) return this.pos++, this._addGap(), 1024 * (e3 - 55296) + 9216 + t2;
  783. } else if (!this.lastChunkWritten) return this.endOfChunkHit = true, a.EOF;
  784. return this._err(T.surrogateInInputStream), e3;
  785. }
  786. willDropParsedChunk() {
  787. return this.pos > this.bufferWaterline;
  788. }
  789. dropParsedChunk() {
  790. 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);
  791. }
  792. write(e3, t2) {
  793. this.html.length > 0 ? this.html += e3 : this.html = e3, this.endOfChunkHit = false, this.lastChunkWritten = t2;
  794. }
  795. insertHtmlAtCurrentPos(e3) {
  796. this.html = this.html.substring(0, this.pos + 1) + e3 + this.html.substring(this.pos + 1), this.endOfChunkHit = false;
  797. }
  798. startsWith(e3, t2) {
  799. if (this.pos + e3.length > this.html.length) return this.endOfChunkHit = !this.lastChunkWritten, false;
  800. if (t2) return this.html.startsWith(e3, this.pos);
  801. for (let t3 = 0; t3 < e3.length; t3++) if ((32 | this.html.charCodeAt(this.pos + t3)) !== e3.charCodeAt(t3)) return false;
  802. return true;
  803. }
  804. peek(e3) {
  805. const t2 = this.pos + e3;
  806. if (t2 >= this.html.length) return this.endOfChunkHit = !this.lastChunkWritten, a.EOF;
  807. const s2 = this.html.charCodeAt(t2);
  808. return s2 === a.CARRIAGE_RETURN ? a.LINE_FEED : s2;
  809. }
  810. advance() {
  811. if (this.pos++, this.isEol && (this.isEol = false, this.line++, this.lineStartPos = this.pos), this.pos >= this.html.length) return this.endOfChunkHit = !this.lastChunkWritten, a.EOF;
  812. let e3 = this.html.charCodeAt(this.pos);
  813. return e3 === a.CARRIAGE_RETURN ? (this.isEol = true, this.skipNextNewLine = true, a.LINE_FEED) : e3 === a.LINE_FEED && (this.isEol = true, this.skipNextNewLine) ? (this.line--, this.skipNextNewLine = false, this._addGap(), this.advance()) : (this.skipNextNewLine = false, o(e3) && (e3 = this._processSurrogate(e3)), null === this.handler.onParseError || e3 > 31 && e3 < 127 || e3 === a.LINE_FEED || e3 === a.CARRIAGE_RETURN || e3 > 159 && e3 < 64976 || this._checkForProblematicCharacters(e3), e3);
  814. }
  815. _checkForProblematicCharacters(e3) {
  816. c(e3) ? this._err(T.controlCharacterInInputStream) : E(e3) && this._err(T.noncharacterInInputStream);
  817. }
  818. retreat(e3) {
  819. for (this.pos -= e3; this.pos < this.lastGapPos; ) this.lastGapPos = this.gapStack.pop(), this.pos--;
  820. this.isEol = false;
  821. }
  822. }
  823. function A(e3, t2) {
  824. for (let s2 = e3.attrs.length - 1; s2 >= 0; s2--) if (e3.attrs[s2].name === t2) return e3.attrs[s2].value;
  825. return null;
  826. }
  827. !function(e3) {
  828. e3[e3.CHARACTER = 0] = "CHARACTER", e3[e3.NULL_CHARACTER = 1] = "NULL_CHARACTER", e3[e3.WHITESPACE_CHARACTER = 2] = "WHITESPACE_CHARACTER", e3[e3.START_TAG = 3] = "START_TAG", e3[e3.END_TAG = 4] = "END_TAG", e3[e3.COMMENT = 5] = "COMMENT", e3[e3.DOCTYPE = 6] = "DOCTYPE", e3[e3.EOF = 7] = "EOF", e3[e3.HIBERNATION = 8] = "HIBERNATION";
  829. }(h = h || (h = {}));
  830. var l = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {}, m = {}, d = {};
  831. Object.defineProperty(d, "__esModule", { value: true }), d.default = new Uint16Array('\u1D41<\xD5\u0131\u028A\u049D\u057B\u05D0\u0675\u06DE\u07A2\u07D6\u080F\u0A4A\u0A91\u0DA1\u0E6D\u0F09\u0F26\u10CA\u1228\u12E1\u1415\u149D\u14C3\u14DF\u1525\0\0\0\0\0\0\u156B\u16CD\u198D\u1C12\u1DDD\u1F7E\u2060\u21B0\u228D\u23C0\u23FB\u2442\u2824\u2912\u2D08\u2E48\u2FCE\u3016\u32BA\u3639\u37AC\u38FE\u3A28\u3A71\u3AE0\u3B2E\u0800EMabcfglmnoprstu\\bfms\x7F\x84\x8B\x90\x95\x98\xA6\xB3\xB9\xC8\xCFlig\u803B\xC6\u40C6P\u803B&\u4026cute\u803B\xC1\u40C1reve;\u4102\u0100iyx}rc\u803B\xC2\u40C2;\u4410r;\uC000\u{1D504}rave\u803B\xC0\u40C0pha;\u4391acr;\u4100d;\u6A53\u0100gp\x9D\xA1on;\u4104f;\uC000\u{1D538}plyFunction;\u6061ing\u803B\xC5\u40C5\u0100cs\xBE\xC3r;\uC000\u{1D49C}ign;\u6254ilde\u803B\xC3\u40C3ml\u803B\xC4\u40C4\u0400aceforsu\xE5\xFB\xFE\u0117\u011C\u0122\u0127\u012A\u0100cr\xEA\xF2kslash;\u6216\u0176\xF6\xF8;\u6AE7ed;\u6306y;\u4411\u0180crt\u0105\u010B\u0114ause;\u6235noullis;\u612Ca;\u4392r;\uC000\u{1D505}pf;\uC000\u{1D539}eve;\u42D8c\xF2\u0113mpeq;\u624E\u0700HOacdefhilorsu\u014D\u0151\u0156\u0180\u019E\u01A2\u01B5\u01B7\u01BA\u01DC\u0215\u0273\u0278\u027Ecy;\u4427PY\u803B\xA9\u40A9\u0180cpy\u015D\u0162\u017Aute;\u4106\u0100;i\u0167\u0168\u62D2talDifferentialD;\u6145leys;\u612D\u0200aeio\u0189\u018E\u0194\u0198ron;\u410Cdil\u803B\xC7\u40C7rc;\u4108nint;\u6230ot;\u410A\u0100dn\u01A7\u01ADilla;\u40B8terDot;\u40B7\xF2\u017Fi;\u43A7rcle\u0200DMPT\u01C7\u01CB\u01D1\u01D6ot;\u6299inus;\u6296lus;\u6295imes;\u6297o\u0100cs\u01E2\u01F8kwiseContourIntegral;\u6232eCurly\u0100DQ\u0203\u020FoubleQuote;\u601Duote;\u6019\u0200lnpu\u021E\u0228\u0247\u0255on\u0100;e\u0225\u0226\u6237;\u6A74\u0180git\u022F\u0236\u023Aruent;\u6261nt;\u622FourIntegral;\u622E\u0100fr\u024C\u024E;\u6102oduct;\u6210nterClockwiseContourIntegral;\u6233oss;\u6A2Fcr;\uC000\u{1D49E}p\u0100;C\u0284\u0285\u62D3ap;\u624D\u0580DJSZacefios\u02A0\u02AC\u02B0\u02B4\u02B8\u02CB\u02D7\u02E1\u02E6\u0333\u048D\u0100;o\u0179\u02A5trahd;\u6911cy;\u4402cy;\u4405cy;\u440F\u0180grs\u02BF\u02C4\u02C7ger;\u6021r;\u61A1hv;\u6AE4\u0100ay\u02D0\u02D5ron;\u410E;\u4414l\u0100;t\u02DD\u02DE\u6207a;\u4394r;\uC000\u{1D507}\u0100af\u02EB\u0327\u0100cm\u02F0\u0322ritical\u0200ADGT\u0300\u0306\u0316\u031Ccute;\u40B4o\u0174\u030B\u030D;\u42D9bleAcute;\u42DDrave;\u4060ilde;\u42DCond;\u62C4ferentialD;\u6146\u0470\u033D\0\0\0\u0342\u0354\0\u0405f;\uC000\u{1D53B}\u0180;DE\u0348\u0349\u034D\u40A8ot;\u60DCqual;\u6250ble\u0300CDLRUV\u0363\u0372\u0382\u03CF\u03E2\u03F8ontourIntegra\xEC\u0239o\u0274\u0379\0\0\u037B\xBB\u0349nArrow;\u61D3\u0100eo\u0387\u03A4ft\u0180ART\u0390\u0396\u03A1rrow;\u61D0ightArrow;\u61D4e\xE5\u02CAng\u0100LR\u03AB\u03C4eft\u0100AR\u03B3\u03B9rrow;\u67F8ightArrow;\u67FAightArrow;\u67F9ight\u0100AT\u03D8\u03DErrow;\u61D2ee;\u62A8p\u0241\u03E9\0\0\u03EFrrow;\u61D1ownArrow;\u61D5erticalBar;\u6225n\u0300ABLRTa\u0412\u042A\u0430\u045E\u047F\u037Crrow\u0180;BU\u041D\u041E\u0422\u6193ar;\u6913pArrow;\u61F5reve;\u4311eft\u02D2\u043A\0\u0446\0\u0450ightVector;\u6950eeVector;\u695Eector\u0100;B\u0459\u045A\u61BDar;\u6956ight\u01D4\u0467\0\u0471eeVector;\u695Fector\u0100;B\u047A\u047B\u61C1ar;\u6957ee\u0100;A\u0486\u0487\u62A4rrow;\u61A7\u0100ct\u0492\u0497r;\uC000\u{1D49F}rok;\u4110\u0800NTacdfglmopqstux\u04BD\u04C0\u04C4\u04CB\u04DE\u04E2\u04E7\u04EE\u04F5\u0521\u052F\u0536\u0552\u055D\u0560\u0565G;\u414AH\u803B\xD0\u40D0cute\u803B\xC9\u40C9\u0180aiy\u04D2\u04D7\u04DCron;\u411Arc\u803B\xCA\u40CA;\u442Dot;\u4116r;\uC000\u{1D508}rave\u803B\xC8\u40C8ement;\u6208\u0100ap\u04FA\u04FEcr;\u4112ty\u0253\u0506\0\0\u0512mallSquare;\u65FBerySmallSquare;\u65AB\u0100gp\u0526\u052Aon;\u4118f;\uC000\u{1D53C}silon;\u4395u\u0100ai\u053C\u0549l\u0100;T\u0542\u0543\u6A75ilde;\u6242librium;\u61CC\u0100ci\u0557\u055Ar;\u6130m;\u6A73a;\u4397ml\u803B\xCB\u40CB\u0100ip\u056A\u056Fsts;\u6203onentialE;\u6147\u0280cfios\u0585\u0588\u058D\u05B2\u05CCy;\u4424r;\uC000\u{1D509}lled\u0253\u0597\0\0\u05A3mallSquare;\u65FCerySmallSquare;\u65AA\u0370\u05BA\0\u05BF\0\0\u05C4f;\uC000\u{1D53D}All;\u6200riertrf;\u6131c\xF2\u05CB\u0600JTabcdfgorst\u05E8\u05EC\u05EF\u05FA\u0600\u0612\u0616\u061B\u061D\u0623\u066C\u0672cy;\u4403\u803B>\u403Emma\u0100;d\u05F7\u05F8\u4393;\u43DCreve;\u411E\u0180eiy\u0607\u060C\u0610dil;\u4122rc;\u411C;\u4413ot;\u4120r;\uC000\u{1D50A};\u62D9pf;\uC000\u{1D53E}eater\u0300EFGLST\u0635\u0644\u064E\u0656\u065B\u0666qual\u0100;L\u063E\u063F\u6265ess;\u62DBullEqual;\u6267reater;\u6AA2ess;\u6277lantEqual;\u6A7Eilde;\u6273cr;\uC000\u{1D4A2};\u626B\u0400Aacfiosu\u0685\u068B\u0696\u069B\u069E\u06AA\u06BE\u06CARDcy;\u442A\u0100ct\u0690\u0694ek;\u42C7;\u405Eirc;\u4124r;\u610ClbertSpace;\u610B\u01F0\u06AF\0\u06B2f;\u610DizontalLine;\u6500\u0100ct\u06C3\u06C5\xF2\u06A9rok;\u4126mp\u0144\u06D0\u06D8ownHum\xF0\u012Fqual;\u624F\u0700EJOacdfgmnostu\u06FA\u06FE\u0703\u0707\u070E\u071A\u071E\u0721\u0728\u0744\u0778\u078B\u078F\u0795cy;\u4415lig;\u4132cy;\u4401cute\u803B\xCD\u40CD\u0100iy\u0713\u0718rc\u803B\xCE\u40CE;\u4418ot;\u4130r;\u6111rave\u803B\xCC\u40CC\u0180;ap\u0720\u072F\u073F\u0100cg\u0734\u0737r;\u412AinaryI;\u6148lie\xF3\u03DD\u01F4\u0749\0\u0762\u0100;e\u074D\u074E\u622C\u0100gr\u0753\u0758ral;\u622Bsection;\u62C2isible\u0100CT\u076C\u0772omma;\u6063imes;\u6062\u0180gpt\u077F\u0783\u0788on;\u412Ef;\uC000\u{1D540}a;\u4399cr;\u6110ilde;\u4128\u01EB\u079A\0\u079Ecy;\u4406l\u803B\xCF\u40CF\u0280cfosu\u07AC\u07B7\u07BC\u07C2\u07D0\u0100iy\u07B1\u07B5rc;\u4134;\u4419r;\uC000\u{1D50D}pf;\uC000\u{1D541}\u01E3\u07C7\0\u07CCr;\uC000\u{1D4A5}rcy;\u4408kcy;\u4404\u0380HJacfos\u07E4\u07E8\u07EC\u07F1\u07FD\u0802\u0808cy;\u4425cy;\u440Cppa;\u439A\u0100ey\u07F6\u07FBdil;\u4136;\u441Ar;\uC000\u{1D50E}pf;\uC000\u{1D542}cr;\uC000\u{1D4A6}\u0580JTaceflmost\u0825\u0829\u082C\u0850\u0863\u09B3\u09B8\u09C7\u09CD\u0A37\u0A47cy;\u4409\u803B<\u403C\u0280cmnpr\u0837\u083C\u0841\u0844\u084Dute;\u4139bda;\u439Bg;\u67EAlacetrf;\u6112r;\u619E\u0180aey\u0857\u085C\u0861ron;\u413Ddil;\u413B;\u441B\u0100fs\u0868\u0970t\u0500ACDFRTUVar\u087E\u08A9\u08B1\u08E0\u08E6\u08FC\u092F\u095B\u0390\u096A\u0100nr\u0883\u088FgleBracket;\u67E8row\u0180;BR\u0899\u089A\u089E\u6190ar;\u61E4ightArrow;\u61C6eiling;\u6308o\u01F5\u08B7\0\u08C3bleBracket;\u67E6n\u01D4\u08C8\0\u08D2eeVector;\u6961ector\u0100;B\u08DB\u08DC\u61C3ar;\u6959loor;\u630Aight\u0100AV\u08EF\u08F5rrow;\u6194ector;\u694E\u0100er\u0901\u0917e\u0180;AV\u0909\u090A\u0910\u62A3rrow;\u61A4ector;\u695Aiangle\u0180;BE\u0924\u0925\u0929\u62B2ar;\u69CFqual;\u62B4p\u0180DTV\u0937\u0942\u094CownVector;\u6951eeVector;\u6960ector\u0100;B\u0956\u0957\u61BFar;\u6958ector\u0100;B\u0965\u0966\u61BCar;\u6952ight\xE1\u039Cs\u0300EFGLST\u097E\u098B\u0995\u099D\u09A2\u09ADqualGreater;\u62DAullEqual;\u6266reater;\u6276ess;\u6AA1lantEqual;\u6A7Dilde;\u6272r;\uC000\u{1D50F}\u0100;e\u09BD\u09BE\u62D8ftarrow;\u61DAidot;\u413F\u0180npw\u09D4\u0A16\u0A1Bg\u0200LRlr\u09DE\u09F7\u0A02\u0A10eft\u0100AR\u09E6\u09ECrrow;\u67F5ightArrow;\u67F7ightArrow;\u67F6eft\u0100ar\u03B3\u0A0Aight\xE1\u03BFight\xE1\u03CAf;\uC000\u{1D543}er\u0100LR\u0A22\u0A2CeftArrow;\u6199ightArrow;\u6198\u0180cht\u0A3E\u0A40\u0A42\xF2\u084C;\u61B0rok;\u4141;\u626A\u0400acefiosu\u0A5A\u0A5D\u0A60\u0A77\u0A7C\u0A85\u0A8B\u0A8Ep;\u6905y;\u441C\u0100dl\u0A65\u0A6FiumSpace;\u605Flintrf;\u6133r;\uC000\u{1D510}nusPlus;\u6213pf;\uC000\u{1D544}c\xF2\u0A76;\u439C\u0480Jacefostu\u0AA3\u0AA7\u0AAD\u0AC0\u0B14\u0B19\u0D91\u0D97\u0D9Ecy;\u440Acute;\u4143\u0180aey\u0AB4\u0AB9\u0ABEron;\u4147dil;\u4145;\u441D\u0180gsw\u0AC7\u0AF0\u0B0Eative\u0180MTV\u0AD3\u0ADF\u0AE8ediumSpace;\u600Bhi\u0100cn\u0AE6\u0AD8\xEB\u0AD9eryThi\xEE\u0AD9ted\u0100GL\u0AF8\u0B06reaterGreate\xF2\u0673essLes\xF3\u0A48Line;\u400Ar;\uC000\u{1D511}\u0200Bnpt\u0B22\u0B28\u0B37\u0B3Areak;\u6060BreakingSpace;\u40A0f;\u6115\u0680;CDEGHLNPRSTV\u0B55\u0B56\u0B6A\u0B7C\u0BA1\u0BEB\u0C04\u0C5E\u0C84\u0CA6\u0CD8\u0D61\u0D85\u6AEC\u0100ou\u0B5B\u0B64ngruent;\u6262pCap;\u626DoubleVerticalBar;\u6226\u0180lqx\u0B83\u0B8A\u0B9Bement;\u6209ual\u0100;T\u0B92\u0B93\u6260ilde;\uC000\u2242\u0338ists;\u6204reater\u0380;EFGLST\u0BB6\u0BB7\u0BBD\u0BC9\u0BD3\u0BD8\u0BE5\u626Fqual;\u6271ullEqual;\uC000\u2267\u0338reater;\uC000\u226B\u0338ess;\u6279lantEqual;\uC000\u2A7E\u0338ilde;\u6275ump\u0144\u0BF2\u0BFDownHump;\uC000\u224E\u0338qual;\uC000\u224F\u0338e\u0100fs\u0C0A\u0C27tTriangle\u0180;BE\u0C1A\u0C1B\u0C21\u62EAar;\uC000\u29CF\u0338qual;\u62ECs\u0300;EGLST\u0C35\u0C36\u0C3C\u0C44\u0C4B\u0C58\u626Equal;\u6270reater;\u6278ess;\uC000\u226A\u0338lantEqual;\uC000\u2A7D\u0338ilde;\u6274ested\u0100GL\u0C68\u0C79reaterGreater;\uC000\u2AA2\u0338essLess;\uC000\u2AA1\u0338recedes\u0180;ES\u0C92\u0C93\u0C9B\u6280qual;\uC000\u2AAF\u0338lantEqual;\u62E0\u0100ei\u0CAB\u0CB9verseElement;\u620CghtTriangle\u0180;BE\u0CCB\u0CCC\u0CD2\u62EBar;\uC000\u29D0\u0338qual;\u62ED\u0100qu\u0CDD\u0D0CuareSu\u0100bp\u0CE8\u0CF9set\u0100;E\u0CF0\u0CF3\uC000\u228F\u0338qual;\u62E2erset\u0100;E\u0D03\u0D06\uC000\u2290\u0338qual;\u62E3\u0180bcp\u0D13\u0D24\u0D4Eset\u0100;E\u0D1B\u0D1E\uC000\u2282\u20D2qual;\u6288ceeds\u0200;EST\u0D32\u0D33\u0D3B\u0D46\u6281qual;\uC000\u2AB0\u0338lantEqual;\u62E1ilde;\uC000\u227F\u0338erset\u0100;E\u0D58\u0D5B\uC000\u2283\u20D2qual;\u6289ilde\u0200;EFT\u0D6E\u0D6F\u0D75\u0D7F\u6241qual;\u6244ullEqual;\u6247ilde;\u6249erticalBar;\u6224cr;\uC000\u{1D4A9}ilde\u803B\xD1\u40D1;\u439D\u0700Eacdfgmoprstuv\u0DBD\u0DC2\u0DC9\u0DD5\u0DDB\u0DE0\u0DE7\u0DFC\u0E02\u0E20\u0E22\u0E32\u0E3F\u0E44lig;\u4152cute\u803B\xD3\u40D3\u0100iy\u0DCE\u0DD3rc\u803B\xD4\u40D4;\u441Eblac;\u4150r;\uC000\u{1D512}rave\u803B\xD2\u40D2\u0180aei\u0DEE\u0DF2\u0DF6cr;\u414Cga;\u43A9cron;\u439Fpf;\uC000\u{1D546}enCurly\u0100DQ\u0E0E\u0E1AoubleQuote;\u601Cuote;\u6018;\u6A54\u0100cl\u0E27\u0E2Cr;\uC000\u{1D4AA}ash\u803B\xD8\u40D8i\u016C\u0E37\u0E3Cde\u803B\xD5\u40D5es;\u6A37ml\u803B\xD6\u40D6er\u0100BP\u0E4B\u0E60\u0100ar\u0E50\u0E53r;\u603Eac\u0100ek\u0E5A\u0E5C;\u63DEet;\u63B4arenthesis;\u63DC\u0480acfhilors\u0E7F\u0E87\u0E8A\u0E8F\u0E92\u0E94\u0E9D\u0EB0\u0EFCrtialD;\u6202y;\u441Fr;\uC000\u{1D513}i;\u43A6;\u43A0usMinus;\u40B1\u0100ip\u0EA2\u0EADncareplan\xE5\u069Df;\u6119\u0200;eio\u0EB9\u0EBA\u0EE0\u0EE4\u6ABBcedes\u0200;EST\u0EC8\u0EC9\u0ECF\u0EDA\u627Aqual;\u6AAFlantEqual;\u627Cilde;\u627Eme;\u6033\u0100dp\u0EE9\u0EEEuct;\u620Fortion\u0100;a\u0225\u0EF9l;\u621D\u0100ci\u0F01\u0F06r;\uC000\u{1D4AB};\u43A8\u0200Ufos\u0F11\u0F16\u0F1B\u0F1FOT\u803B"\u4022r;\uC000\u{1D514}pf;\u611Acr;\uC000\u{1D4AC}\u0600BEacefhiorsu\u0F3E\u0F43\u0F47\u0F60\u0F73\u0FA7\u0FAA\u0FAD\u1096\u10A9\u10B4\u10BEarr;\u6910G\u803B\xAE\u40AE\u0180cnr\u0F4E\u0F53\u0F56ute;\u4154g;\u67EBr\u0100;t\u0F5C\u0F5D\u61A0l;\u6916\u0180aey\u0F67\u0F6C\u0F71ron;\u4158dil;\u4156;\u4420\u0100;v\u0F78\u0F79\u611Cerse\u0100EU\u0F82\u0F99\u0100lq\u0F87\u0F8Eement;\u620Builibrium;\u61CBpEquilibrium;\u696Fr\xBB\u0F79o;\u43A1ght\u0400ACDFTUVa\u0FC1\u0FEB\u0FF3\u1022\u1028\u105B\u1087\u03D8\u0100nr\u0FC6\u0FD2gleBracket;\u67E9row\u0180;BL\u0FDC\u0FDD\u0FE1\u6192ar;\u61E5eftArrow;\u61C4eiling;\u6309o\u01F5\u0FF9\0\u1005bleBracket;\u67E7n\u01D4\u100A\0\u1014eeVector;\u695Dector\u0100;B\u101D\u101E\u61C2ar;\u6955loor;\u630B\u0100er\u102D\u1043e\u0180;AV\u1035\u1036\u103C\u62A2rrow;\u61A6ector;\u695Biangle\u0180;BE\u1050\u1051\u1055\u62B3ar;\u69D0qual;\u62B5p\u0180DTV\u1063\u106E\u1078ownVector;\u694FeeVector;\u695Cector\u0100;B\u1082\u1083\u61BEar;\u6954ector\u0100;B\u1091\u1092\u61C0ar;\u6953\u0100pu\u109B\u109Ef;\u611DndImplies;\u6970ightarrow;\u61DB\u0100ch\u10B9\u10BCr;\u611B;\u61B1leDelayed;\u69F4\u0680HOacfhimoqstu\u10E4\u10F1\u10F7\u10FD\u1119\u111E\u1151\u1156\u1161\u1167\u11B5\u11BB\u11BF\u0100Cc\u10E9\u10EEHcy;\u4429y;\u4428FTcy;\u442Ccute;\u415A\u0280;aeiy\u1108\u1109\u110E\u1113\u1117\u6ABCron;\u4160dil;\u415Erc;\u415C;\u4421r;\uC000\u{1D516}ort\u0200DLRU\u112A\u1134\u113E\u1149ownArrow\xBB\u041EeftArrow\xBB\u089AightArrow\xBB\u0FDDpArrow;\u6191gma;\u43A3allCircle;\u6218pf;\uC000\u{1D54A}\u0272\u116D\0\0\u1170t;\u621Aare\u0200;ISU\u117B\u117C\u1189\u11AF\u65A1ntersection;\u6293u\u0100bp\u118F\u119Eset\u0100;E\u1197\u1198\u628Fqual;\u6291erset\u0100;E\u11A8\u11A9\u6290qual;\u6292nion;\u6294cr;\uC000\u{1D4AE}ar;\u62C6\u0200bcmp\u11C8\u11DB\u1209\u120B\u0100;s\u11CD\u11CE\u62D0et\u0100;E\u11CD\u11D5qual;\u6286\u0100ch\u11E0\u1205eeds\u0200;EST\u11ED\u11EE\u11F4\u11FF\u627Bqual;\u6AB0lantEqual;\u627Dilde;\u627FTh\xE1\u0F8C;\u6211\u0180;es\u1212\u1213\u1223\u62D1rset\u0100;E\u121C\u121D\u6283qual;\u6287et\xBB\u1213\u0580HRSacfhiors\u123E\u1244\u1249\u1255\u125E\u1271\u1276\u129F\u12C2\u12C8\u12D1ORN\u803B\xDE\u40DEADE;\u6122\u0100Hc\u124E\u1252cy;\u440By;\u4426\u0100bu\u125A\u125C;\u4009;\u43A4\u0180aey\u1265\u126A\u126Fron;\u4164dil;\u4162;\u4422r;\uC000\u{1D517}\u0100ei\u127B\u1289\u01F2\u1280\0\u1287efore;\u6234a;\u4398\u0100cn\u128E\u1298kSpace;\uC000\u205F\u200ASpace;\u6009lde\u0200;EFT\u12AB\u12AC\u12B2\u12BC\u623Cqual;\u6243ullEqual;\u6245ilde;\u6248pf;\uC000\u{1D54B}ipleDot;\u60DB\u0100ct\u12D6\u12DBr;\uC000\u{1D4AF}rok;\u4166\u0AE1\u12F7\u130E\u131A\u1326\0\u132C\u1331\0\0\0\0\0\u1338\u133D\u1377\u1385\0\u13FF\u1404\u140A\u1410\u0100cr\u12FB\u1301ute\u803B\xDA\u40DAr\u0100;o\u1307\u1308\u619Fcir;\u6949r\u01E3\u1313\0\u1316y;\u440Eve;\u416C\u0100iy\u131E\u1323rc\u803B\xDB\u40DB;\u4423blac;\u4170r;\uC000\u{1D518}rave\u803B\xD9\u40D9acr;\u416A\u0100di\u1341\u1369er\u0100BP\u1348\u135D\u0100ar\u134D\u1350r;\u405Fac\u0100ek\u1357\u1359;\u63DFet;\u63B5arenthesis;\u63DDon\u0100;P\u1370\u1371\u62C3lus;\u628E\u0100gp\u137B\u137Fon;\u4172f;\uC000\u{1D54C}\u0400ADETadps\u1395\u13AE\u13B8\u13C4\u03E8\u13D2\u13D7\u13F3rrow\u0180;BD\u1150\u13A0\u13A4ar;\u6912ownArrow;\u61C5ownArrow;\u6195quilibrium;\u696Eee\u0100;A\u13CB\u13CC\u62A5rrow;\u61A5own\xE1\u03F3er\u0100LR\u13DE\u13E8eftArrow;\u6196ightArrow;\u6197i\u0100;l\u13F9\u13FA\u43D2on;\u43A5ing;\u416Ecr;\uC000\u{1D4B0}ilde;\u4168ml\u803B\xDC\u40DC\u0480Dbcdefosv\u1427\u142C\u1430\u1433\u143E\u1485\u148A\u1490\u1496ash;\u62ABar;\u6AEBy;\u4412ash\u0100;l\u143B\u143C\u62A9;\u6AE6\u0100er\u1443\u1445;\u62C1\u0180bty\u144C\u1450\u147Aar;\u6016\u0100;i\u144F\u1455cal\u0200BLST\u1461\u1465\u146A\u1474ar;\u6223ine;\u407Ceparator;\u6758ilde;\u6240ThinSpace;\u600Ar;\uC000\u{1D519}pf;\uC000\u{1D54D}cr;\uC000\u{1D4B1}dash;\u62AA\u0280cefos\u14A7\u14AC\u14B1\u14B6\u14BCirc;\u4174dge;\u62C0r;\uC000\u{1D51A}pf;\uC000\u{1D54E}cr;\uC000\u{1D4B2}\u0200fios\u14CB\u14D0\u14D2\u14D8r;\uC000\u{1D51B};\u439Epf;\uC000\u{1D54F}cr;\uC000\u{1D4B3}\u0480AIUacfosu\u14F1\u14F5\u14F9\u14FD\u1504\u150F\u1514\u151A\u1520cy;\u442Fcy;\u4407cy;\u442Ecute\u803B\xDD\u40DD\u0100iy\u1509\u150Drc;\u4176;\u442Br;\uC000\u{1D51C}pf;\uC000\u{1D550}cr;\uC000\u{1D4B4}ml;\u4178\u0400Hacdefos\u1535\u1539\u153F\u154B\u154F\u155D\u1560\u1564cy;\u4416cute;\u4179\u0100ay\u1544\u1549ron;\u417D;\u4417ot;\u417B\u01F2\u1554\0\u155BoWidt\xE8\u0AD9a;\u4396r;\u6128pf;\u6124cr;\uC000\u{1D4B5}\u0BE1\u1583\u158A\u1590\0\u15B0\u15B6\u15BF\0\0\0\0\u15C6\u15DB\u15EB\u165F\u166D\0\u1695\u169B\u16B2\u16B9\0\u16BEcute\u803B\xE1\u40E1reve;\u4103\u0300;Ediuy\u159C\u159D\u15A1\u15A3\u15A8\u15AD\u623E;\uC000\u223E\u0333;\u623Frc\u803B\xE2\u40E2te\u80BB\xB4\u0306;\u4430lig\u803B\xE6\u40E6\u0100;r\xB2\u15BA;\uC000\u{1D51E}rave\u803B\xE0\u40E0\u0100ep\u15CA\u15D6\u0100fp\u15CF\u15D4sym;\u6135\xE8\u15D3ha;\u43B1\u0100ap\u15DFc\u0100cl\u15E4\u15E7r;\u4101g;\u6A3F\u0264\u15F0\0\0\u160A\u0280;adsv\u15FA\u15FB\u15FF\u1601\u1607\u6227nd;\u6A55;\u6A5Clope;\u6A58;\u6A5A\u0380;elmrsz\u1618\u1619\u161B\u161E\u163F\u164F\u1659\u6220;\u69A4e\xBB\u1619sd\u0100;a\u1625\u1626\u6221\u0461\u1630\u1632\u1634\u1636\u1638\u163A\u163C\u163E;\u69A8;\u69A9;\u69AA;\u69AB;\u69AC;\u69AD;\u69AE;\u69AFt\u0100;v\u1645\u1646\u621Fb\u0100;d\u164C\u164D\u62BE;\u699D\u0100pt\u1654\u1657h;\u6222\xBB\xB9arr;\u637C\u0100gp\u1663\u1667on;\u4105f;\uC000\u{1D552}\u0380;Eaeiop\u12C1\u167B\u167D\u1682\u1684\u1687\u168A;\u6A70cir;\u6A6F;\u624Ad;\u624Bs;\u4027rox\u0100;e\u12C1\u1692\xF1\u1683ing\u803B\xE5\u40E5\u0180cty\u16A1\u16A6\u16A8r;\uC000\u{1D4B6};\u402Amp\u0100;e\u12C1\u16AF\xF1\u0288ilde\u803B\xE3\u40E3ml\u803B\xE4\u40E4\u0100ci\u16C2\u16C8onin\xF4\u0272nt;\u6A11\u0800Nabcdefiklnoprsu\u16ED\u16F1\u1730\u173C\u1743\u1748\u1778\u177D\u17E0\u17E6\u1839\u1850\u170D\u193D\u1948\u1970ot;\u6AED\u0100cr\u16F6\u171Ek\u0200ceps\u1700\u1705\u170D\u1713ong;\u624Cpsilon;\u43F6rime;\u6035im\u0100;e\u171A\u171B\u623Dq;\u62CD\u0176\u1722\u1726ee;\u62BDed\u0100;g\u172C\u172D\u6305e\xBB\u172Drk\u0100;t\u135C\u1737brk;\u63B6\u0100oy\u1701\u1741;\u4431quo;\u601E\u0280cmprt\u1753\u175B\u1761\u1764\u1768aus\u0100;e\u010A\u0109ptyv;\u69B0s\xE9\u170Cno\xF5\u0113\u0180ahw\u176F\u1771\u1773;\u43B2;\u6136een;\u626Cr;\uC000\u{1D51F}g\u0380costuvw\u178D\u179D\u17B3\u17C1\u17D5\u17DB\u17DE\u0180aiu\u1794\u1796\u179A\xF0\u0760rc;\u65EFp\xBB\u1371\u0180dpt\u17A4\u17A8\u17ADot;\u6A00lus;\u6A01imes;\u6A02\u0271\u17B9\0\0\u17BEcup;\u6A06ar;\u6605riangle\u0100du\u17CD\u17D2own;\u65BDp;\u65B3plus;\u6A04e\xE5\u1444\xE5\u14ADarow;\u690D\u0180ako\u17ED\u1826\u1835\u0100cn\u17F2\u1823k\u0180lst\u17FA\u05AB\u1802ozenge;\u69EBriangle\u0200;dlr\u1812\u1813\u1818\u181D\u65B4own;\u65BEeft;\u65C2ight;\u65B8k;\u6423\u01B1\u182B\0\u1833\u01B2\u182F\0\u1831;\u6592;\u65914;\u6593ck;\u6588\u0100eo\u183E\u184D\u0100;q\u1843\u1846\uC000=\u20E5uiv;\uC000\u2261\u20E5t;\u6310\u0200ptwx\u1859\u185E\u1867\u186Cf;\uC000\u{1D553}\u0100;t\u13CB\u1863om\xBB\u13CCtie;\u62C8\u0600DHUVbdhmptuv\u1885\u1896\u18AA\u18BB\u18D7\u18DB\u18EC\u18FF\u1905\u190A\u1910\u1921\u0200LRlr\u188E\u1890\u1892\u1894;\u6557;\u6554;\u6556;\u6553\u0280;DUdu\u18A1\u18A2\u18A4\u18A6\u18A8\u6550;\u6566;\u6569;\u6564;\u6567\u0200LRlr\u18B3\u18B5\u18B7\u18B9;\u655D;\u655A;\u655C;\u6559\u0380;HLRhlr\u18CA\u18CB\u18CD\u18CF\u18D1\u18D3\u18D5\u6551;\u656C;\u6563;\u6560;\u656B;\u6562;\u655Fox;\u69C9\u0200LRlr\u18E4\u18E6\u18E8\u18EA;\u6555;\u6552;\u6510;\u650C\u0280;DUdu\u06BD\u18F7\u18F9\u18FB\u18FD;\u6565;\u6568;\u652C;\u6534inus;\u629Flus;\u629Eimes;\u62A0\u0200LRlr\u1919\u191B\u191D\u191F;\u655B;\u6558;\u6518;\u6514\u0380;HLRhlr\u1930\u1931\u1933\u1935\u1937\u1939\u193B\u6502;\u656A;\u6561;\u655E;\u653C;\u6524;\u651C\u0100ev\u0123\u1942bar\u803B\xA6\u40A6\u0200ceio\u1951\u1956\u195A\u1960r;\uC000\u{1D4B7}mi;\u604Fm\u0100;e\u171A\u171Cl\u0180;bh\u1968\u1969\u196B\u405C;\u69C5sub;\u67C8\u016C\u1974\u197El\u0100;e\u1979\u197A\u6022t\xBB\u197Ap\u0180;Ee\u012F\u1985\u1987;\u6AAE\u0100;q\u06DC\u06DB\u0CE1\u19A7\0\u19E8\u1A11\u1A15\u1A32\0\u1A37\u1A50\0\0\u1AB4\0\0\u1AC1\0\0\u1B21\u1B2E\u1B4D\u1B52\0\u1BFD\0\u1C0C\u0180cpr\u19AD\u19B2\u19DDute;\u4107\u0300;abcds\u19BF\u19C0\u19C4\u19CA\u19D5\u19D9\u6229nd;\u6A44rcup;\u6A49\u0100au\u19CF\u19D2p;\u6A4Bp;\u6A47ot;\u6A40;\uC000\u2229\uFE00\u0100eo\u19E2\u19E5t;\u6041\xEE\u0693\u0200aeiu\u19F0\u19FB\u1A01\u1A05\u01F0\u19F5\0\u19F8s;\u6A4Don;\u410Ddil\u803B\xE7\u40E7rc;\u4109ps\u0100;s\u1A0C\u1A0D\u6A4Cm;\u6A50ot;\u410B\u0180dmn\u1A1B\u1A20\u1A26il\u80BB\xB8\u01ADptyv;\u69B2t\u8100\xA2;e\u1A2D\u1A2E\u40A2r\xE4\u01B2r;\uC000\u{1D520}\u0180cei\u1A3D\u1A40\u1A4Dy;\u4447ck\u0100;m\u1A47\u1A48\u6713ark\xBB\u1A48;\u43C7r\u0380;Ecefms\u1A5F\u1A60\u1A62\u1A6B\u1AA4\u1AAA\u1AAE\u65CB;\u69C3\u0180;el\u1A69\u1A6A\u1A6D\u42C6q;\u6257e\u0261\u1A74\0\0\u1A88rrow\u0100lr\u1A7C\u1A81eft;\u61BAight;\u61BB\u0280RSacd\u1A92\u1A94\u1A96\u1A9A\u1A9F\xBB\u0F47;\u64C8st;\u629Birc;\u629Aash;\u629Dnint;\u6A10id;\u6AEFcir;\u69C2ubs\u0100;u\u1ABB\u1ABC\u6663it\xBB\u1ABC\u02EC\u1AC7\u1AD4\u1AFA\0\u1B0Aon\u0100;e\u1ACD\u1ACE\u403A\u0100;q\xC7\xC6\u026D\u1AD9\0\0\u1AE2a\u0100;t\u1ADE\u1ADF\u402C;\u4040\u0180;fl\u1AE8\u1AE9\u1AEB\u6201\xEE\u1160e\u0100mx\u1AF1\u1AF6ent\xBB\u1AE9e\xF3\u024D\u01E7\u1AFE\0\u1B07\u0100;d\u12BB\u1B02ot;\u6A6Dn\xF4\u0246\u0180fry\u1B10\u1B14\u1B17;\uC000\u{1D554}o\xE4\u0254\u8100\xA9;s\u0155\u1B1Dr;\u6117\u0100ao\u1B25\u1B29rr;\u61B5ss;\u6717\u0100cu\u1B32\u1B37r;\uC000\u{1D4B8}\u0100bp\u1B3C\u1B44\u0100;e\u1B41\u1B42\u6ACF;\u6AD1\u0100;e\u1B49\u1B4A\u6AD0;\u6AD2dot;\u62EF\u0380delprvw\u1B60\u1B6C\u1B77\u1B82\u1BAC\u1BD4\u1BF9arr\u0100lr\u1B68\u1B6A;\u6938;\u6935\u0270\u1B72\0\0\u1B75r;\u62DEc;\u62DFarr\u0100;p\u1B7F\u1B80\u61B6;\u693D\u0300;bcdos\u1B8F\u1B90\u1B96\u1BA1\u1BA5\u1BA8\u622Arcap;\u6A48\u0100au\u1B9B\u1B9Ep;\u6A46p;\u6A4Aot;\u628Dr;\u6A45;\uC000\u222A\uFE00\u0200alrv\u1BB5\u1BBF\u1BDE\u1BE3rr\u0100;m\u1BBC\u1BBD\u61B7;\u693Cy\u0180evw\u1BC7\u1BD4\u1BD8q\u0270\u1BCE\0\0\u1BD2re\xE3\u1B73u\xE3\u1B75ee;\u62CEedge;\u62CFen\u803B\xA4\u40A4earrow\u0100lr\u1BEE\u1BF3eft\xBB\u1B80ight\xBB\u1BBDe\xE4\u1BDD\u0100ci\u1C01\u1C07onin\xF4\u01F7nt;\u6231lcty;\u632D\u0980AHabcdefhijlorstuwz\u1C38\u1C3B\u1C3F\u1C5D\u1C69\u1C75\u1C8A\u1C9E\u1CAC\u1CB7\u1CFB\u1CFF\u1D0D\u1D7B\u1D91\u1DAB\u1DBB\u1DC6\u1DCDr\xF2\u0381ar;\u6965\u0200glrs\u1C48\u1C4D\u1C52\u1C54ger;\u6020eth;\u6138\xF2\u1133h\u0100;v\u1C5A\u1C5B\u6010\xBB\u090A\u016B\u1C61\u1C67arow;\u690Fa\xE3\u0315\u0100ay\u1C6E\u1C73ron;\u410F;\u4434\u0180;ao\u0332\u1C7C\u1C84\u0100gr\u02BF\u1C81r;\u61CAtseq;\u6A77\u0180glm\u1C91\u1C94\u1C98\u803B\xB0\u40B0ta;\u43B4ptyv;\u69B1\u0100ir\u1CA3\u1CA8sht;\u697F;\uC000\u{1D521}ar\u0100lr\u1CB3\u1CB5\xBB\u08DC\xBB\u101E\u0280aegsv\u1CC2\u0378\u1CD6\u1CDC\u1CE0m\u0180;os\u0326\u1CCA\u1CD4nd\u0100;s\u0326\u1CD1uit;\u6666amma;\u43DDin;\u62F2\u0180;io\u1CE7\u1CE8\u1CF8\u40F7de\u8100\xF7;o\u1CE7\u1CF0ntimes;\u62C7n\xF8\u1CF7cy;\u4452c\u026F\u1D06\0\0\u1D0Arn;\u631Eop;\u630D\u0280lptuw\u1D18\u1D1D\u1D22\u1D49\u1D55lar;\u4024f;\uC000\u{1D555}\u0280;emps\u030B\u1D2D\u1D37\u1D3D\u1D42q\u0100;d\u0352\u1D33ot;\u6251inus;\u6238lus;\u6214quare;\u62A1blebarwedg\xE5\xFAn\u0180adh\u112E\u1D5D\u1D67ownarrow\xF3\u1C83arpoon\u0100lr\u1D72\u1D76ef\xF4\u1CB4igh\xF4\u1CB6\u0162\u1D7F\u1D85karo\xF7\u0F42\u026F\u1D8A\0\0\u1D8Ern;\u631Fop;\u630C\u0180cot\u1D98\u1DA3\u1DA6\u0100ry\u1D9D\u1DA1;\uC000\u{1D4B9};\u4455l;\u69F6rok;\u4111\u0100dr\u1DB0\u1DB4ot;\u62F1i\u0100;f\u1DBA\u1816\u65BF\u0100ah\u1DC0\u1DC3r\xF2\u0429a\xF2\u0FA6angle;\u69A6\u0100ci\u1DD2\u1DD5y;\u445Fgrarr;\u67FF\u0900Dacdefglmnopqrstux\u1E01\u1E09\u1E19\u1E38\u0578\u1E3C\u1E49\u1E61\u1E7E\u1EA5\u1EAF\u1EBD\u1EE1\u1F2A\u1F37\u1F44\u1F4E\u1F5A\u0100Do\u1E06\u1D34o\xF4\u1C89\u0100cs\u1E0E\u1E14ute\u803B\xE9\u40E9ter;\u6A6E\u0200aioy\u1E22\u1E27\u1E31\u1E36ron;\u411Br\u0100;c\u1E2D\u1E2E\u6256\u803B\xEA\u40EAlon;\u6255;\u444Dot;\u4117\u0100Dr\u1E41\u1E45ot;\u6252;\uC000\u{1D522}\u0180;rs\u1E50\u1E51\u1E57\u6A9Aave\u803B\xE8\u40E8\u0100;d\u1E5C\u1E5D\u6A96ot;\u6A98\u0200;ils\u1E6A\u1E6B\u1E72\u1E74\u6A99nters;\u63E7;\u6113\u0100;d\u1E79\u1E7A\u6A95ot;\u6A97\u0180aps\u1E85\u1E89\u1E97cr;\u4113ty\u0180;sv\u1E92\u1E93\u1E95\u6205et\xBB\u1E93p\u01001;\u1E9D\u1EA4\u0133\u1EA1\u1EA3;\u6004;\u6005\u6003\u0100gs\u1EAA\u1EAC;\u414Bp;\u6002\u0100gp\u1EB4\u1EB8on;\u4119f;\uC000\u{1D556}\u0180als\u1EC4\u1ECE\u1ED2r\u0100;s\u1ECA\u1ECB\u62D5l;\u69E3us;\u6A71i\u0180;lv\u1EDA\u1EDB\u1EDF\u43B5on\xBB\u1EDB;\u43F5\u0200csuv\u1EEA\u1EF3\u1F0B\u1F23\u0100io\u1EEF\u1E31rc\xBB\u1E2E\u0269\u1EF9\0\0\u1EFB\xED\u0548ant\u0100gl\u1F02\u1F06tr\xBB\u1E5Dess\xBB\u1E7A\u0180aei\u1F12\u1F16\u1F1Als;\u403Dst;\u625Fv\u0100;D\u0235\u1F20D;\u6A78parsl;\u69E5\u0100Da\u1F2F\u1F33ot;\u6253rr;\u6971\u0180cdi\u1F3E\u1F41\u1EF8r;\u612Fo\xF4\u0352\u0100ah\u1F49\u1F4B;\u43B7\u803B\xF0\u40F0\u0100mr\u1F53\u1F57l\u803B\xEB\u40EBo;\u60AC\u0180cip\u1F61\u1F64\u1F67l;\u4021s\xF4\u056E\u0100eo\u1F6C\u1F74ctatio\xEE\u0559nential\xE5\u0579\u09E1\u1F92\0\u1F9E\0\u1FA1\u1FA7\0\0\u1FC6\u1FCC\0\u1FD3\0\u1FE6\u1FEA\u2000\0\u2008\u205Allingdotse\xF1\u1E44y;\u4444male;\u6640\u0180ilr\u1FAD\u1FB3\u1FC1lig;\u8000\uFB03\u0269\u1FB9\0\0\u1FBDg;\u8000\uFB00ig;\u8000\uFB04;\uC000\u{1D523}lig;\u8000\uFB01lig;\uC000fj\u0180alt\u1FD9\u1FDC\u1FE1t;\u666Dig;\u8000\uFB02ns;\u65B1of;\u4192\u01F0\u1FEE\0\u1FF3f;\uC000\u{1D557}\u0100ak\u05BF\u1FF7\u0100;v\u1FFC\u1FFD\u62D4;\u6AD9artint;\u6A0D\u0100ao\u200C\u2055\u0100cs\u2011\u2052\u03B1\u201A\u2030\u2038\u2045\u2048\0\u2050\u03B2\u2022\u2025\u2027\u202A\u202C\0\u202E\u803B\xBD\u40BD;\u6153\u803B\xBC\u40BC;\u6155;\u6159;\u615B\u01B3\u2034\0\u2036;\u6154;\u6156\u02B4\u203E\u2041\0\0\u2043\u803B\xBE\u40BE;\u6157;\u615C5;\u6158\u01B6\u204C\0\u204E;\u615A;\u615D8;\u615El;\u6044wn;\u6322cr;\uC000\u{1D4BB}\u0880Eabcdefgijlnorstv\u2082\u2089\u209F\u20A5\u20B0\u20B4\u20F0\u20F5\u20FA\u20FF\u2103\u2112\u2138\u0317\u213E\u2152\u219E\u0100;l\u064D\u2087;\u6A8C\u0180cmp\u2090\u2095\u209Dute;\u41F5ma\u0100;d\u209C\u1CDA\u43B3;\u6A86reve;\u411F\u0100iy\u20AA\u20AErc;\u411D;\u4433ot;\u4121\u0200;lqs\u063E\u0642\u20BD\u20C9\u0180;qs\u063E\u064C\u20C4lan\xF4\u0665\u0200;cdl\u0665\u20D2\u20D5\u20E5c;\u6AA9ot\u0100;o\u20DC\u20DD\u6A80\u0100;l\u20E2\u20E3\u6A82;\u6A84\u0100;e\u20EA\u20ED\uC000\u22DB\uFE00s;\u6A94r;\uC000\u{1D524}\u0100;g\u0673\u061Bmel;\u6137cy;\u4453\u0200;Eaj\u065A\u210C\u210E\u2110;\u6A92;\u6AA5;\u6AA4\u0200Eaes\u211B\u211D\u2129\u2134;\u6269p\u0100;p\u2123\u2124\u6A8Arox\xBB\u2124\u0100;q\u212E\u212F\u6A88\u0100;q\u212E\u211Bim;\u62E7pf;\uC000\u{1D558}\u0100ci\u2143\u2146r;\u610Am\u0180;el\u066B\u214E\u2150;\u6A8E;\u6A90\u8300>;cdlqr\u05EE\u2160\u216A\u216E\u2173\u2179\u0100ci\u2165\u2167;\u6AA7r;\u6A7Aot;\u62D7Par;\u6995uest;\u6A7C\u0280adels\u2184\u216A\u2190\u0656\u219B\u01F0\u2189\0\u218Epro\xF8\u209Er;\u6978q\u0100lq\u063F\u2196les\xF3\u2088i\xED\u066B\u0100en\u21A3\u21ADrtneqq;\uC000\u2269\uFE00\xC5\u21AA\u0500Aabcefkosy\u21C4\u21C7\u21F1\u21F5\u21FA\u2218\u221D\u222F\u2268\u227Dr\xF2\u03A0\u0200ilmr\u21D0\u21D4\u21D7\u21DBrs\xF0\u1484f\xBB\u2024il\xF4\u06A9\u0100dr\u21E0\u21E4cy;\u444A\u0180;cw\u08F4\u21EB\u21EFir;\u6948;\u61ADar;\u610Firc;\u4125\u0180alr\u2201\u220E\u2213rts\u0100;u\u2209\u220A\u6665it\xBB\u220Alip;\u6026con;\u62B9r;\uC000\u{1D525}s\u0100ew\u2223\u2229arow;\u6925arow;\u6926\u0280amopr\u223A\u223E\u2243\u225E\u2263rr;\u61FFtht;\u623Bk\u0100lr\u2249\u2253eftarrow;\u61A9ightarrow;\u61AAf;\uC000\u{1D559}bar;\u6015\u0180clt\u226F\u2274\u2278r;\uC000\u{1D4BD}as\xE8\u21F4rok;\u4127\u0100bp\u2282\u2287ull;\u6043hen\xBB\u1C5B\u0AE1\u22A3\0\u22AA\0\u22B8\u22C5\u22CE\0\u22D5\u22F3\0\0\u22F8\u2322\u2367\u2362\u237F\0\u2386\u23AA\u23B4cute\u803B\xED\u40ED\u0180;iy\u0771\u22B0\u22B5rc\u803B\xEE\u40EE;\u4438\u0100cx\u22BC\u22BFy;\u4435cl\u803B\xA1\u40A1\u0100fr\u039F\u22C9;\uC000\u{1D526}rave\u803B\xEC\u40EC\u0200;ino\u073E\u22DD\u22E9\u22EE\u0100in\u22E2\u22E6nt;\u6A0Ct;\u622Dfin;\u69DCta;\u6129lig;\u4133\u0180aop\u22FE\u231A\u231D\u0180cgt\u2305\u2308\u2317r;\u412B\u0180elp\u071F\u230F\u2313in\xE5\u078Ear\xF4\u0720h;\u4131f;\u62B7ed;\u41B5\u0280;cfot\u04F4\u232C\u2331\u233D\u2341are;\u6105in\u0100;t\u2338\u2339\u621Eie;\u69DDdo\xF4\u2319\u0280;celp\u0757\u234C\u2350\u235B\u2361al;\u62BA\u0100gr\u2355\u2359er\xF3\u1563\xE3\u234Darhk;\u6A17rod;\u6A3C\u0200cgpt\u236F\u2372\u2376\u237By;\u4451on;\u412Ff;\uC000\u{1D55A}a;\u43B9uest\u803B\xBF\u40BF\u0100ci\u238A\u238Fr;\uC000\u{1D4BE}n\u0280;Edsv\u04F4\u239B\u239D\u23A1\u04F3;\u62F9ot;\u62F5\u0100;v\u23A6\u23A7\u62F4;\u62F3\u0100;i\u0777\u23AElde;\u4129\u01EB\u23B8\0\u23BCcy;\u4456l\u803B\xEF\u40EF\u0300cfmosu\u23CC\u23D7\u23DC\u23E1\u23E7\u23F5\u0100iy\u23D1\u23D5rc;\u4135;\u4439r;\uC000\u{1D527}ath;\u4237pf;\uC000\u{1D55B}\u01E3\u23EC\0\u23F1r;\uC000\u{1D4BF}rcy;\u4458kcy;\u4454\u0400acfghjos\u240B\u2416\u2422\u2427\u242D\u2431\u2435\u243Bppa\u0100;v\u2413\u2414\u43BA;\u43F0\u0100ey\u241B\u2420dil;\u4137;\u443Ar;\uC000\u{1D528}reen;\u4138cy;\u4445cy;\u445Cpf;\uC000\u{1D55C}cr;\uC000\u{1D4C0}\u0B80ABEHabcdefghjlmnoprstuv\u2470\u2481\u2486\u248D\u2491\u250E\u253D\u255A\u2580\u264E\u265E\u2665\u2679\u267D\u269A\u26B2\u26D8\u275D\u2768\u278B\u27C0\u2801\u2812\u0180art\u2477\u247A\u247Cr\xF2\u09C6\xF2\u0395ail;\u691Barr;\u690E\u0100;g\u0994\u248B;\u6A8Bar;\u6962\u0963\u24A5\0\u24AA\0\u24B1\0\0\0\0\0\u24B5\u24BA\0\u24C6\u24C8\u24CD\0\u24F9ute;\u413Amptyv;\u69B4ra\xEE\u084Cbda;\u43BBg\u0180;dl\u088E\u24C1\u24C3;\u6991\xE5\u088E;\u6A85uo\u803B\xAB\u40ABr\u0400;bfhlpst\u0899\u24DE\u24E6\u24E9\u24EB\u24EE\u24F1\u24F5\u0100;f\u089D\u24E3s;\u691Fs;\u691D\xEB\u2252p;\u61ABl;\u6939im;\u6973l;\u61A2\u0180;ae\u24FF\u2500\u2504\u6AABil;\u6919\u0100;s\u2509\u250A\u6AAD;\uC000\u2AAD\uFE00\u0180abr\u2515\u2519\u251Drr;\u690Crk;\u6772\u0100ak\u2522\u252Cc\u0100ek\u2528\u252A;\u407B;\u405B\u0100es\u2531\u2533;\u698Bl\u0100du\u2539\u253B;\u698F;\u698D\u0200aeuy\u2546\u254B\u2556\u2558ron;\u413E\u0100di\u2550\u2554il;\u413C\xEC\u08B0\xE2\u2529;\u443B\u0200cqrs\u2563\u2566\u256D\u257Da;\u6936uo\u0100;r\u0E19\u1746\u0100du\u2572\u2577har;\u6967shar;\u694Bh;\u61B2\u0280;fgqs\u258B\u258C\u0989\u25F3\u25FF\u6264t\u0280ahlrt\u2598\u25A4\u25B7\u25C2\u25E8rrow\u0100;t\u0899\u25A1a\xE9\u24F6arpoon\u0100du\u25AF\u25B4own\xBB\u045Ap\xBB\u0966eftarrows;\u61C7ight\u0180ahs\u25CD\u25D6\u25DErrow\u0100;s\u08F4\u08A7arpoon\xF3\u0F98quigarro\xF7\u21F0hreetimes;\u62CB\u0180;qs\u258B\u0993\u25FAlan\xF4\u09AC\u0280;cdgs\u09AC\u260A\u260D\u261D\u2628c;\u6AA8ot\u0100;o\u2614\u2615\u6A7F\u0100;r\u261A\u261B\u6A81;\u6A83\u0100;e\u2622\u2625\uC000\u22DA\uFE00s;\u6A93\u0280adegs\u2633\u2639\u263D\u2649\u264Bppro\xF8\u24C6ot;\u62D6q\u0100gq\u2643\u2645\xF4\u0989gt\xF2\u248C\xF4\u099Bi\xED\u09B2\u0180ilr\u2655\u08E1\u265Asht;\u697C;\uC000\u{1D529}\u0100;E\u099C\u2663;\u6A91\u0161\u2669\u2676r\u0100du\u25B2\u266E\u0100;l\u0965\u2673;\u696Alk;\u6584cy;\u4459\u0280;acht\u0A48\u2688\u268B\u2691\u2696r\xF2\u25C1orne\xF2\u1D08ard;\u696Bri;\u65FA\u0100io\u269F\u26A4dot;\u4140ust\u0100;a\u26AC\u26AD\u63B0che\xBB\u26AD\u0200Eaes\u26BB\u26BD\u26C9\u26D4;\u6268p\u0100;p\u26C3\u26C4\u6A89rox\xBB\u26C4\u0100;q\u26CE\u26CF\u6A87\u0100;q\u26CE\u26BBim;\u62E6\u0400abnoptwz\u26E9\u26F4\u26F7\u271A\u272F\u2741\u2747\u2750\u0100nr\u26EE\u26F1g;\u67ECr;\u61FDr\xEB\u08C1g\u0180lmr\u26FF\u270D\u2714eft\u0100ar\u09E6\u2707ight\xE1\u09F2apsto;\u67FCight\xE1\u09FDparrow\u0100lr\u2725\u2729ef\xF4\u24EDight;\u61AC\u0180afl\u2736\u2739\u273Dr;\u6985;\uC000\u{1D55D}us;\u6A2Dimes;\u6A34\u0161\u274B\u274Fst;\u6217\xE1\u134E\u0180;ef\u2757\u2758\u1800\u65CAnge\xBB\u2758ar\u0100;l\u2764\u2765\u4028t;\u6993\u0280achmt\u2773\u2776\u277C\u2785\u2787r\xF2\u08A8orne\xF2\u1D8Car\u0100;d\u0F98\u2783;\u696D;\u600Eri;\u62BF\u0300achiqt\u2798\u279D\u0A40\u27A2\u27AE\u27BBquo;\u6039r;\uC000\u{1D4C1}m\u0180;eg\u09B2\u27AA\u27AC;\u6A8D;\u6A8F\u0100bu\u252A\u27B3o\u0100;r\u0E1F\u27B9;\u601Arok;\u4142\u8400<;cdhilqr\u082B\u27D2\u2639\u27DC\u27E0\u27E5\u27EA\u27F0\u0100ci\u27D7\u27D9;\u6AA6r;\u6A79re\xE5\u25F2mes;\u62C9arr;\u6976uest;\u6A7B\u0100Pi\u27F5\u27F9ar;\u6996\u0180;ef\u2800\u092D\u181B\u65C3r\u0100du\u2807\u280Dshar;\u694Ahar;\u6966\u0100en\u2817\u2821rtneqq;\uC000\u2268\uFE00\xC5\u281E\u0700Dacdefhilnopsu\u2840\u2845\u2882\u288E\u2893\u28A0\u28A5\u28A8\u28DA\u28E2\u28E4\u0A83\u28F3\u2902Dot;\u623A\u0200clpr\u284E\u2852\u2863\u287Dr\u803B\xAF\u40AF\u0100et\u2857\u2859;\u6642\u0100;e\u285E\u285F\u6720se\xBB\u285F\u0100;s\u103B\u2868to\u0200;dlu\u103B\u2873\u2877\u287Bow\xEE\u048Cef\xF4\u090F\xF0\u13D1ker;\u65AE\u0100oy\u2887\u288Cmma;\u6A29;\u443Cash;\u6014asuredangle\xBB\u1626r;\uC000\u{1D52A}o;\u6127\u0180cdn\u28AF\u28B4\u28C9ro\u803B\xB5\u40B5\u0200;acd\u1464\u28BD\u28C0\u28C4s\xF4\u16A7ir;\u6AF0ot\u80BB\xB7\u01B5us\u0180;bd\u28D2\u1903\u28D3\u6212\u0100;u\u1D3C\u28D8;\u6A2A\u0163\u28DE\u28E1p;\u6ADB\xF2\u2212\xF0\u0A81\u0100dp\u28E9\u28EEels;\u62A7f;\uC000\u{1D55E}\u0100ct\u28F8\u28FDr;\uC000\u{1D4C2}pos\xBB\u159D\u0180;lm\u2909\u290A\u290D\u43BCtimap;\u62B8\u0C00GLRVabcdefghijlmoprstuvw\u2942\u2953\u297E\u2989\u2998\u29DA\u29E9\u2A15\u2A1A\u2A58\u2A5D\u2A83\u2A95\u2AA4\u2AA8\u2B04\u2B07\u2B44\u2B7F\u2BAE\u2C34\u2C67\u2C7C\u2CE9\u0100gt\u2947\u294B;\uC000\u22D9\u0338\u0100;v\u2950\u0BCF\uC000\u226B\u20D2\u0180elt\u295A\u2972\u2976ft\u0100ar\u2961\u2967rrow;\u61CDightarrow;\u61CE;\uC000\u22D8\u0338\u0100;v\u297B\u0C47\uC000\u226A\u20D2ightarrow;\u61CF\u0100Dd\u298E\u2993ash;\u62AFash;\u62AE\u0280bcnpt\u29A3\u29A7\u29AC\u29B1\u29CCla\xBB\u02DEute;\u4144g;\uC000\u2220\u20D2\u0280;Eiop\u0D84\u29BC\u29C0\u29C5\u29C8;\uC000\u2A70\u0338d;\uC000\u224B\u0338s;\u4149ro\xF8\u0D84ur\u0100;a\u29D3\u29D4\u666El\u0100;s\u29D3\u0B38\u01F3\u29DF\0\u29E3p\u80BB\xA0\u0B37mp\u0100;e\u0BF9\u0C00\u0280aeouy\u29F4\u29FE\u2A03\u2A10\u2A13\u01F0\u29F9\0\u29FB;\u6A43on;\u4148dil;\u4146ng\u0100;d\u0D7E\u2A0Aot;\uC000\u2A6D\u0338p;\u6A42;\u443Dash;\u6013\u0380;Aadqsx\u0B92\u2A29\u2A2D\u2A3B\u2A41\u2A45\u2A50rr;\u61D7r\u0100hr\u2A33\u2A36k;\u6924\u0100;o\u13F2\u13F0ot;\uC000\u2250\u0338ui\xF6\u0B63\u0100ei\u2A4A\u2A4Ear;\u6928\xED\u0B98ist\u0100;s\u0BA0\u0B9Fr;\uC000\u{1D52B}\u0200Eest\u0BC5\u2A66\u2A79\u2A7C\u0180;qs\u0BBC\u2A6D\u0BE1\u0180;qs\u0BBC\u0BC5\u2A74lan\xF4\u0BE2i\xED\u0BEA\u0100;r\u0BB6\u2A81\xBB\u0BB7\u0180Aap\u2A8A\u2A8D\u2A91r\xF2\u2971rr;\u61AEar;\u6AF2\u0180;sv\u0F8D\u2A9C\u0F8C\u0100;d\u2AA1\u2AA2\u62FC;\u62FAcy;\u445A\u0380AEadest\u2AB7\u2ABA\u2ABE\u2AC2\u2AC5\u2AF6\u2AF9r\xF2\u2966;\uC000\u2266\u0338rr;\u619Ar;\u6025\u0200;fqs\u0C3B\u2ACE\u2AE3\u2AEFt\u0100ar\u2AD4\u2AD9rro\xF7\u2AC1ightarro\xF7\u2A90\u0180;qs\u0C3B\u2ABA\u2AEAlan\xF4\u0C55\u0100;s\u0C55\u2AF4\xBB\u0C36i\xED\u0C5D\u0100;r\u0C35\u2AFEi\u0100;e\u0C1A\u0C25i\xE4\u0D90\u0100pt\u2B0C\u2B11f;\uC000\u{1D55F}\u8180\xAC;in\u2B19\u2B1A\u2B36\u40ACn\u0200;Edv\u0B89\u2B24\u2B28\u2B2E;\uC000\u22F9\u0338ot;\uC000\u22F5\u0338\u01E1\u0B89\u2B33\u2B35;\u62F7;\u62F6i\u0100;v\u0CB8\u2B3C\u01E1\u0CB8\u2B41\u2B43;\u62FE;\u62FD\u0180aor\u2B4B\u2B63\u2B69r\u0200;ast\u0B7B\u2B55\u2B5A\u2B5Flle\xEC\u0B7Bl;\uC000\u2AFD\u20E5;\uC000\u2202\u0338lint;\u6A14\u0180;ce\u0C92\u2B70\u2B73u\xE5\u0CA5\u0100;c\u0C98\u2B78\u0100;e\u0C92\u2B7D\xF1\u0C98\u0200Aait\u2B88\u2B8B\u2B9D\u2BA7r\xF2\u2988rr\u0180;cw\u2B94\u2B95\u2B99\u619B;\uC000\u2933\u0338;\uC000\u219D\u0338ghtarrow\xBB\u2B95ri\u0100;e\u0CCB\u0CD6\u0380chimpqu\u2BBD\u2BCD\u2BD9\u2B04\u0B78\u2BE4\u2BEF\u0200;cer\u0D32\u2BC6\u0D37\u2BC9u\xE5\u0D45;\uC000\u{1D4C3}ort\u026D\u2B05\0\0\u2BD6ar\xE1\u2B56m\u0100;e\u0D6E\u2BDF\u0100;q\u0D74\u0D73su\u0100bp\u2BEB\u2BED\xE5\u0CF8\xE5\u0D0B\u0180bcp\u2BF6\u2C11\u2C19\u0200;Ees\u2BFF\u2C00\u0D22\u2C04\u6284;\uC000\u2AC5\u0338et\u0100;e\u0D1B\u2C0Bq\u0100;q\u0D23\u2C00c\u0100;e\u0D32\u2C17\xF1\u0D38\u0200;Ees\u2C22\u2C23\u0D5F\u2C27\u6285;\uC000\u2AC6\u0338et\u0100;e\u0D58\u2C2Eq\u0100;q\u0D60\u2C23\u0200gilr\u2C3D\u2C3F\u2C45\u2C47\xEC\u0BD7lde\u803B\xF1\u40F1\xE7\u0C43iangle\u0100lr\u2C52\u2C5Ceft\u0100;e\u0C1A\u2C5A\xF1\u0C26ight\u0100;e\u0CCB\u2C65\xF1\u0CD7\u0100;m\u2C6C\u2C6D\u43BD\u0180;es\u2C74\u2C75\u2C79\u4023ro;\u6116p;\u6007\u0480DHadgilrs\u2C8F\u2C94\u2C99\u2C9E\u2CA3\u2CB0\u2CB6\u2CD3\u2CE3ash;\u62ADarr;\u6904p;\uC000\u224D\u20D2ash;\u62AC\u0100et\u2CA8\u2CAC;\uC000\u2265\u20D2;\uC000>\u20D2nfin;\u69DE\u0180Aet\u2CBD\u2CC1\u2CC5rr;\u6902;\uC000\u2264\u20D2\u0100;r\u2CCA\u2CCD\uC000<\u20D2ie;\uC000\u22B4\u20D2\u0100At\u2CD8\u2CDCrr;\u6903rie;\uC000\u22B5\u20D2im;\uC000\u223C\u20D2\u0180Aan\u2CF0\u2CF4\u2D02rr;\u61D6r\u0100hr\u2CFA\u2CFDk;\u6923\u0100;o\u13E7\u13E5ear;\u6927\u1253\u1A95\0\0\0\0\0\0\0\0\0\0\0\0\0\u2D2D\0\u2D38\u2D48\u2D60\u2D65\u2D72\u2D84\u1B07\0\0\u2D8D\u2DAB\0\u2DC8\u2DCE\0\u2DDC\u2E19\u2E2B\u2E3E\u2E43\u0100cs\u2D31\u1A97ute\u803B\xF3\u40F3\u0100iy\u2D3C\u2D45r\u0100;c\u1A9E\u2D42\u803B\xF4\u40F4;\u443E\u0280abios\u1AA0\u2D52\u2D57\u01C8\u2D5Alac;\u4151v;\u6A38old;\u69BClig;\u4153\u0100cr\u2D69\u2D6Dir;\u69BF;\uC000\u{1D52C}\u036F\u2D79\0\0\u2D7C\0\u2D82n;\u42DBave\u803B\xF2\u40F2;\u69C1\u0100bm\u2D88\u0DF4ar;\u69B5\u0200acit\u2D95\u2D98\u2DA5\u2DA8r\xF2\u1A80\u0100ir\u2D9D\u2DA0r;\u69BEoss;\u69BBn\xE5\u0E52;\u69C0\u0180aei\u2DB1\u2DB5\u2DB9cr;\u414Dga;\u43C9\u0180cdn\u2DC0\u2DC5\u01CDron;\u43BF;\u69B6pf;\uC000\u{1D560}\u0180ael\u2DD4\u2DD7\u01D2r;\u69B7rp;\u69B9\u0380;adiosv\u2DEA\u2DEB\u2DEE\u2E08\u2E0D\u2E10\u2E16\u6228r\xF2\u1A86\u0200;efm\u2DF7\u2DF8\u2E02\u2E05\u6A5Dr\u0100;o\u2DFE\u2DFF\u6134f\xBB\u2DFF\u803B\xAA\u40AA\u803B\xBA\u40BAgof;\u62B6r;\u6A56lope;\u6A57;\u6A5B\u0180clo\u2E1F\u2E21\u2E27\xF2\u2E01ash\u803B\xF8\u40F8l;\u6298i\u016C\u2E2F\u2E34de\u803B\xF5\u40F5es\u0100;a\u01DB\u2E3As;\u6A36ml\u803B\xF6\u40F6bar;\u633D\u0AE1\u2E5E\0\u2E7D\0\u2E80\u2E9D\0\u2EA2\u2EB9\0\0\u2ECB\u0E9C\0\u2F13\0\0\u2F2B\u2FBC\0\u2FC8r\u0200;ast\u0403\u2E67\u2E72\u0E85\u8100\xB6;l\u2E6D\u2E6E\u40B6le\xEC\u0403\u0269\u2E78\0\0\u2E7Bm;\u6AF3;\u6AFDy;\u443Fr\u0280cimpt\u2E8B\u2E8F\u2E93\u1865\u2E97nt;\u4025od;\u402Eil;\u6030enk;\u6031r;\uC000\u{1D52D}\u0180imo\u2EA8\u2EB0\u2EB4\u0100;v\u2EAD\u2EAE\u43C6;\u43D5ma\xF4\u0A76ne;\u660E\u0180;tv\u2EBF\u2EC0\u2EC8\u43C0chfork\xBB\u1FFD;\u43D6\u0100au\u2ECF\u2EDFn\u0100ck\u2ED5\u2EDDk\u0100;h\u21F4\u2EDB;\u610E\xF6\u21F4s\u0480;abcdemst\u2EF3\u2EF4\u1908\u2EF9\u2EFD\u2F04\u2F06\u2F0A\u2F0E\u402Bcir;\u6A23ir;\u6A22\u0100ou\u1D40\u2F02;\u6A25;\u6A72n\u80BB\xB1\u0E9Dim;\u6A26wo;\u6A27\u0180ipu\u2F19\u2F20\u2F25ntint;\u6A15f;\uC000\u{1D561}nd\u803B\xA3\u40A3\u0500;Eaceinosu\u0EC8\u2F3F\u2F41\u2F44\u2F47\u2F81\u2F89\u2F92\u2F7E\u2FB6;\u6AB3p;\u6AB7u\xE5\u0ED9\u0100;c\u0ECE\u2F4C\u0300;acens\u0EC8\u2F59\u2F5F\u2F66\u2F68\u2F7Eppro\xF8\u2F43urlye\xF1\u0ED9\xF1\u0ECE\u0180aes\u2F6F\u2F76\u2F7Approx;\u6AB9qq;\u6AB5im;\u62E8i\xED\u0EDFme\u0100;s\u2F88\u0EAE\u6032\u0180Eas\u2F78\u2F90\u2F7A\xF0\u2F75\u0180dfp\u0EEC\u2F99\u2FAF\u0180als\u2FA0\u2FA5\u2FAAlar;\u632Eine;\u6312urf;\u6313\u0100;t\u0EFB\u2FB4\xEF\u0EFBrel;\u62B0\u0100ci\u2FC0\u2FC5r;\uC000\u{1D4C5};\u43C8ncsp;\u6008\u0300fiopsu\u2FDA\u22E2\u2FDF\u2FE5\u2FEB\u2FF1r;\uC000\u{1D52E}pf;\uC000\u{1D562}rime;\u6057cr;\uC000\u{1D4C6}\u0180aeo\u2FF8\u3009\u3013t\u0100ei\u2FFE\u3005rnion\xF3\u06B0nt;\u6A16st\u0100;e\u3010\u3011\u403F\xF1\u1F19\xF4\u0F14\u0A80ABHabcdefhilmnoprstux\u3040\u3051\u3055\u3059\u30E0\u310E\u312B\u3147\u3162\u3172\u318E\u3206\u3215\u3224\u3229\u3258\u326E\u3272\u3290\u32B0\u32B7\u0180art\u3047\u304A\u304Cr\xF2\u10B3\xF2\u03DDail;\u691Car\xF2\u1C65ar;\u6964\u0380cdenqrt\u3068\u3075\u3078\u307F\u308F\u3094\u30CC\u0100eu\u306D\u3071;\uC000\u223D\u0331te;\u4155i\xE3\u116Emptyv;\u69B3g\u0200;del\u0FD1\u3089\u308B\u308D;\u6992;\u69A5\xE5\u0FD1uo\u803B\xBB\u40BBr\u0580;abcfhlpstw\u0FDC\u30AC\u30AF\u30B7\u30B9\u30BC\u30BE\u30C0\u30C3\u30C7\u30CAp;\u6975\u0100;f\u0FE0\u30B4s;\u6920;\u6933s;\u691E\xEB\u225D\xF0\u272El;\u6945im;\u6974l;\u61A3;\u619D\u0100ai\u30D1\u30D5il;\u691Ao\u0100;n\u30DB\u30DC\u6236al\xF3\u0F1E\u0180abr\u30E7\u30EA\u30EEr\xF2\u17E5rk;\u6773\u0100ak\u30F3\u30FDc\u0100ek\u30F9\u30FB;\u407D;\u405D\u0100es\u3102\u3104;\u698Cl\u0100du\u310A\u310C;\u698E;\u6990\u0200aeuy\u3117\u311C\u3127\u3129ron;\u4159\u0100di\u3121\u3125il;\u4157\xEC\u0FF2\xE2\u30FA;\u4440\u0200clqs\u3134\u3137\u313D\u3144a;\u6937dhar;\u6969uo\u0100;r\u020E\u020Dh;\u61B3\u0180acg\u314E\u315F\u0F44l\u0200;ips\u0F78\u3158\u315B\u109Cn\xE5\u10BBar\xF4\u0FA9t;\u65AD\u0180ilr\u3169\u1023\u316Esht;\u697D;\uC000\u{1D52F}\u0100ao\u3177\u3186r\u0100du\u317D\u317F\xBB\u047B\u0100;l\u1091\u3184;\u696C\u0100;v\u318B\u318C\u43C1;\u43F1\u0180gns\u3195\u31F9\u31FCht\u0300ahlrst\u31A4\u31B0\u31C2\u31D8\u31E4\u31EErrow\u0100;t\u0FDC\u31ADa\xE9\u30C8arpoon\u0100du\u31BB\u31BFow\xEE\u317Ep\xBB\u1092eft\u0100ah\u31CA\u31D0rrow\xF3\u0FEAarpoon\xF3\u0551ightarrows;\u61C9quigarro\xF7\u30CBhreetimes;\u62CCg;\u42DAingdotse\xF1\u1F32\u0180ahm\u320D\u3210\u3213r\xF2\u0FEAa\xF2\u0551;\u600Foust\u0100;a\u321E\u321F\u63B1che\xBB\u321Fmid;\u6AEE\u0200abpt\u3232\u323D\u3240\u3252\u0100nr\u3237\u323Ag;\u67EDr;\u61FEr\xEB\u1003\u0180afl\u3247\u324A\u324Er;\u6986;\uC000\u{1D563}us;\u6A2Eimes;\u6A35\u0100ap\u325D\u3267r\u0100;g\u3263\u3264\u4029t;\u6994olint;\u6A12ar\xF2\u31E3\u0200achq\u327B\u3280\u10BC\u3285quo;\u603Ar;\uC000\u{1D4C7}\u0100bu\u30FB\u328Ao\u0100;r\u0214\u0213\u0180hir\u3297\u329B\u32A0re\xE5\u31F8mes;\u62CAi\u0200;efl\u32AA\u1059\u1821\u32AB\u65B9tri;\u69CEluhar;\u6968;\u611E\u0D61\u32D5\u32DB\u32DF\u332C\u3338\u3371\0\u337A\u33A4\0\0\u33EC\u33F0\0\u3428\u3448\u345A\u34AD\u34B1\u34CA\u34F1\0\u3616\0\0\u3633cute;\u415Bqu\xEF\u27BA\u0500;Eaceinpsy\u11ED\u32F3\u32F5\u32FF\u3302\u330B\u330F\u331F\u3326\u3329;\u6AB4\u01F0\u32FA\0\u32FC;\u6AB8on;\u4161u\xE5\u11FE\u0100;d\u11F3\u3307il;\u415Frc;\u415D\u0180Eas\u3316\u3318\u331B;\u6AB6p;\u6ABAim;\u62E9olint;\u6A13i\xED\u1204;\u4441ot\u0180;be\u3334\u1D47\u3335\u62C5;\u6A66\u0380Aacmstx\u3346\u334A\u3357\u335B\u335E\u3363\u336Drr;\u61D8r\u0100hr\u3350\u3352\xEB\u2228\u0100;o\u0A36\u0A34t\u803B\xA7\u40A7i;\u403Bwar;\u6929m\u0100in\u3369\xF0nu\xF3\xF1t;\u6736r\u0100;o\u3376\u2055\uC000\u{1D530}\u0200acoy\u3382\u3386\u3391\u33A0rp;\u666F\u0100hy\u338B\u338Fcy;\u4449;\u4448rt\u026D\u3399\0\0\u339Ci\xE4\u1464ara\xEC\u2E6F\u803B\xAD\u40AD\u0100gm\u33A8\u33B4ma\u0180;fv\u33B1\u33B2\u33B2\u43C3;\u43C2\u0400;deglnpr\u12AB\u33C5\u33C9\u33CE\u33D6\u33DE\u33E1\u33E6ot;\u6A6A\u0100;q\u12B1\u12B0\u0100;E\u33D3\u33D4\u6A9E;\u6AA0\u0100;E\u33DB\u33DC\u6A9D;\u6A9Fe;\u6246lus;\u6A24arr;\u6972ar\xF2\u113D\u0200aeit\u33F8\u3408\u340F\u3417\u0100ls\u33FD\u3404lsetm\xE9\u336Ahp;\u6A33parsl;\u69E4\u0100dl\u1463\u3414e;\u6323\u0100;e\u341C\u341D\u6AAA\u0100;s\u3422\u3423\u6AAC;\uC000\u2AAC\uFE00\u0180flp\u342E\u3433\u3442tcy;\u444C\u0100;b\u3438\u3439\u402F\u0100;a\u343E\u343F\u69C4r;\u633Ff;\uC000\u{1D564}a\u0100dr\u344D\u0402es\u0100;u\u3454\u3455\u6660it\xBB\u3455\u0180csu\u3460\u3479\u349F\u0100au\u3465\u346Fp\u0100;s\u1188\u346B;\uC000\u2293\uFE00p\u0100;s\u11B4\u3475;\uC000\u2294\uFE00u\u0100bp\u347F\u348F\u0180;es\u1197\u119C\u3486et\u0100;e\u1197\u348D\xF1\u119D\u0180;es\u11A8\u11AD\u3496et\u0100;e\u11A8\u349D\xF1\u11AE\u0180;af\u117B\u34A6\u05B0r\u0165\u34AB\u05B1\xBB\u117Car\xF2\u1148\u0200cemt\u34B9\u34BE\u34C2\u34C5r;\uC000\u{1D4C8}tm\xEE\xF1i\xEC\u3415ar\xE6\u11BE\u0100ar\u34CE\u34D5r\u0100;f\u34D4\u17BF\u6606\u0100an\u34DA\u34EDight\u0100ep\u34E3\u34EApsilo\xEE\u1EE0h\xE9\u2EAFs\xBB\u2852\u0280bcmnp\u34FB\u355E\u1209\u358B\u358E\u0480;Edemnprs\u350E\u350F\u3511\u3515\u351E\u3523\u352C\u3531\u3536\u6282;\u6AC5ot;\u6ABD\u0100;d\u11DA\u351Aot;\u6AC3ult;\u6AC1\u0100Ee\u3528\u352A;\u6ACB;\u628Alus;\u6ABFarr;\u6979\u0180eiu\u353D\u3552\u3555t\u0180;en\u350E\u3545\u354Bq\u0100;q\u11DA\u350Feq\u0100;q\u352B\u3528m;\u6AC7\u0100bp\u355A\u355C;\u6AD5;\u6AD3c\u0300;acens\u11ED\u356C\u3572\u3579\u357B\u3326ppro\xF8\u32FAurlye\xF1\u11FE\xF1\u11F3\u0180aes\u3582\u3588\u331Bppro\xF8\u331Aq\xF1\u3317g;\u666A\u0680123;Edehlmnps\u35A9\u35AC\u35AF\u121C\u35B2\u35B4\u35C0\u35C9\u35D5\u35DA\u35DF\u35E8\u35ED\u803B\xB9\u40B9\u803B\xB2\u40B2\u803B\xB3\u40B3;\u6AC6\u0100os\u35B9\u35BCt;\u6ABEub;\u6AD8\u0100;d\u1222\u35C5ot;\u6AC4s\u0100ou\u35CF\u35D2l;\u67C9b;\u6AD7arr;\u697Bult;\u6AC2\u0100Ee\u35E4\u35E6;\u6ACC;\u628Blus;\u6AC0\u0180eiu\u35F4\u3609\u360Ct\u0180;en\u121C\u35FC\u3602q\u0100;q\u1222\u35B2eq\u0100;q\u35E7\u35E4m;\u6AC8\u0100bp\u3611\u3613;\u6AD4;\u6AD6\u0180Aan\u361C\u3620\u362Drr;\u61D9r\u0100hr\u3626\u3628\xEB\u222E\u0100;o\u0A2B\u0A29war;\u692Alig\u803B\xDF\u40DF\u0BE1\u3651\u365D\u3660\u12CE\u3673\u3679\0\u367E\u36C2\0\0\0\0\0\u36DB\u3703\0\u3709\u376C\0\0\0\u3787\u0272\u3656\0\0\u365Bget;\u6316;\u43C4r\xEB\u0E5F\u0180aey\u3666\u366B\u3670ron;\u4165dil;\u4163;\u4442lrec;\u6315r;\uC000\u{1D531}\u0200eiko\u3686\u369D\u36B5\u36BC\u01F2\u368B\0\u3691e\u01004f\u1284\u1281a\u0180;sv\u3698\u3699\u369B\u43B8ym;\u43D1\u0100cn\u36A2\u36B2k\u0100as\u36A8\u36AEppro\xF8\u12C1im\xBB\u12ACs\xF0\u129E\u0100as\u36BA\u36AE\xF0\u12C1rn\u803B\xFE\u40FE\u01EC\u031F\u36C6\u22E7es\u8180\xD7;bd\u36CF\u36D0\u36D8\u40D7\u0100;a\u190F\u36D5r;\u6A31;\u6A30\u0180eps\u36E1\u36E3\u3700\xE1\u2A4D\u0200;bcf\u0486\u36EC\u36F0\u36F4ot;\u6336ir;\u6AF1\u0100;o\u36F9\u36FC\uC000\u{1D565}rk;\u6ADA\xE1\u3362rime;\u6034\u0180aip\u370F\u3712\u3764d\xE5\u1248\u0380adempst\u3721\u374D\u3740\u3751\u3757\u375C\u375Fngle\u0280;dlqr\u3730\u3731\u3736\u3740\u3742\u65B5own\xBB\u1DBBeft\u0100;e\u2800\u373E\xF1\u092E;\u625Cight\u0100;e\u32AA\u374B\xF1\u105Aot;\u65ECinus;\u6A3Alus;\u6A39b;\u69CDime;\u6A3Bezium;\u63E2\u0180cht\u3772\u377D\u3781\u0100ry\u3777\u377B;\uC000\u{1D4C9};\u4446cy;\u445Brok;\u4167\u0100io\u378B\u378Ex\xF4\u1777head\u0100lr\u3797\u37A0eftarro\xF7\u084Fightarrow\xBB\u0F5D\u0900AHabcdfghlmoprstuw\u37D0\u37D3\u37D7\u37E4\u37F0\u37FC\u380E\u381C\u3823\u3834\u3851\u385D\u386B\u38A9\u38CC\u38D2\u38EA\u38F6r\xF2\u03EDar;\u6963\u0100cr\u37DC\u37E2ute\u803B\xFA\u40FA\xF2\u1150r\u01E3\u37EA\0\u37EDy;\u445Eve;\u416D\u0100iy\u37F5\u37FArc\u803B\xFB\u40FB;\u4443\u0180abh\u3803\u3806\u380Br\xF2\u13ADlac;\u4171a\xF2\u13C3\u0100ir\u3813\u3818sht;\u697E;\uC000\u{1D532}rave\u803B\xF9\u40F9\u0161\u3827\u3831r\u0100lr\u382C\u382E\xBB\u0957\xBB\u1083lk;\u6580\u0100ct\u3839\u384D\u026F\u383F\0\0\u384Arn\u0100;e\u3845\u3846\u631Cr\xBB\u3846op;\u630Fri;\u65F8\u0100al\u3856\u385Acr;\u416B\u80BB\xA8\u0349\u0100gp\u3862\u3866on;\u4173f;\uC000\u{1D566}\u0300adhlsu\u114B\u3878\u387D\u1372\u3891\u38A0own\xE1\u13B3arpoon\u0100lr\u3888\u388Cef\xF4\u382Digh\xF4\u382Fi\u0180;hl\u3899\u389A\u389C\u43C5\xBB\u13FAon\xBB\u389Aparrows;\u61C8\u0180cit\u38B0\u38C4\u38C8\u026F\u38B6\0\0\u38C1rn\u0100;e\u38BC\u38BD\u631Dr\xBB\u38BDop;\u630Eng;\u416Fri;\u65F9cr;\uC000\u{1D4CA}\u0180dir\u38D9\u38DD\u38E2ot;\u62F0lde;\u4169i\u0100;f\u3730\u38E8\xBB\u1813\u0100am\u38EF\u38F2r\xF2\u38A8l\u803B\xFC\u40FCangle;\u69A7\u0780ABDacdeflnoprsz\u391C\u391F\u3929\u392D\u39B5\u39B8\u39BD\u39DF\u39E4\u39E8\u39F3\u39F9\u39FD\u3A01\u3A20r\xF2\u03F7ar\u0100;v\u3926\u3927\u6AE8;\u6AE9as\xE8\u03E1\u0100nr\u3932\u3937grt;\u699C\u0380eknprst\u34E3\u3946\u394B\u3952\u395D\u3964\u3996app\xE1\u2415othin\xE7\u1E96\u0180hir\u34EB\u2EC8\u3959op\xF4\u2FB5\u0100;h\u13B7\u3962\xEF\u318D\u0100iu\u3969\u396Dgm\xE1\u33B3\u0100bp\u3972\u3984setneq\u0100;q\u397D\u3980\uC000\u228A\uFE00;\uC000\u2ACB\uFE00setneq\u0100;q\u398F\u3992\uC000\u228B\uFE00;\uC000\u2ACC\uFE00\u0100hr\u399B\u399Fet\xE1\u369Ciangle\u0100lr\u39AA\u39AFeft\xBB\u0925ight\xBB\u1051y;\u4432ash\xBB\u1036\u0180elr\u39C4\u39D2\u39D7\u0180;be\u2DEA\u39CB\u39CFar;\u62BBq;\u625Alip;\u62EE\u0100bt\u39DC\u1468a\xF2\u1469r;\uC000\u{1D533}tr\xE9\u39AEsu\u0100bp\u39EF\u39F1\xBB\u0D1C\xBB\u0D59pf;\uC000\u{1D567}ro\xF0\u0EFBtr\xE9\u39B4\u0100cu\u3A06\u3A0Br;\uC000\u{1D4CB}\u0100bp\u3A10\u3A18n\u0100Ee\u3980\u3A16\xBB\u397En\u0100Ee\u3992\u3A1E\xBB\u3990igzag;\u699A\u0380cefoprs\u3A36\u3A3B\u3A56\u3A5B\u3A54\u3A61\u3A6Airc;\u4175\u0100di\u3A40\u3A51\u0100bg\u3A45\u3A49ar;\u6A5Fe\u0100;q\u15FA\u3A4F;\u6259erp;\u6118r;\uC000\u{1D534}pf;\uC000\u{1D568}\u0100;e\u1479\u3A66at\xE8\u1479cr;\uC000\u{1D4CC}\u0AE3\u178E\u3A87\0\u3A8B\0\u3A90\u3A9B\0\0\u3A9D\u3AA8\u3AAB\u3AAF\0\0\u3AC3\u3ACE\0\u3AD8\u17DC\u17DFtr\xE9\u17D1r;\uC000\u{1D535}\u0100Aa\u3A94\u3A97r\xF2\u03C3r\xF2\u09F6;\u43BE\u0100Aa\u3AA1\u3AA4r\xF2\u03B8r\xF2\u09EBa\xF0\u2713is;\u62FB\u0180dpt\u17A4\u3AB5\u3ABE\u0100fl\u3ABA\u17A9;\uC000\u{1D569}im\xE5\u17B2\u0100Aa\u3AC7\u3ACAr\xF2\u03CEr\xF2\u0A01\u0100cq\u3AD2\u17B8r;\uC000\u{1D4CD}\u0100pt\u17D6\u3ADCr\xE9\u17D4\u0400acefiosu\u3AF0\u3AFD\u3B08\u3B0C\u3B11\u3B15\u3B1B\u3B21c\u0100uy\u3AF6\u3AFBte\u803B\xFD\u40FD;\u444F\u0100iy\u3B02\u3B06rc;\u4177;\u444Bn\u803B\xA5\u40A5r;\uC000\u{1D536}cy;\u4457pf;\uC000\u{1D56A}cr;\uC000\u{1D4CE}\u0100cm\u3B26\u3B29y;\u444El\u803B\xFF\u40FF\u0500acdefhiosw\u3B42\u3B48\u3B54\u3B58\u3B64\u3B69\u3B6D\u3B74\u3B7A\u3B80cute;\u417A\u0100ay\u3B4D\u3B52ron;\u417E;\u4437ot;\u417C\u0100et\u3B5D\u3B61tr\xE6\u155Fa;\u43B6r;\uC000\u{1D537}cy;\u4436grarr;\u61DDpf;\uC000\u{1D56B}cr;\uC000\u{1D4CF}\u0100jn\u3B85\u3B87;\u600Dj;\u600C'.split("").map(function(e3) {
  832. return e3.charCodeAt(0);
  833. }));
  834. var p = {};
  835. Object.defineProperty(p, "__esModule", { value: true }), p.default = new Uint16Array("\u0200aglq \x1B\u026D\0\0p;\u4026os;\u4027t;\u403Et;\u403Cuot;\u4022".split("").map(function(e3) {
  836. return e3.charCodeAt(0);
  837. }));
  838. var u, N, I, C, S, D = {};
  839. !function(e3) {
  840. var t2;
  841. Object.defineProperty(e3, "__esModule", { value: true }), e3.replaceCodePoint = e3.fromCodePoint = void 0;
  842. var s2 = /* @__PURE__ */ new Map([[0, 65533], [128, 8364], [130, 8218], [131, 402], [132, 8222], [133, 8230], [134, 8224], [135, 8225], [136, 710], [137, 8240], [138, 352], [139, 8249], [140, 338], [142, 381], [145, 8216], [146, 8217], [147, 8220], [148, 8221], [149, 8226], [150, 8211], [151, 8212], [152, 732], [153, 8482], [154, 353], [155, 8250], [156, 339], [158, 382], [159, 376]]);
  843. function a2(e4) {
  844. var t3;
  845. return e4 >= 55296 && e4 <= 57343 || e4 > 1114111 ? 65533 : null !== (t3 = s2.get(e4)) && void 0 !== t3 ? t3 : e4;
  846. }
  847. e3.fromCodePoint = null !== (t2 = String.fromCodePoint) && void 0 !== t2 ? t2 : function(e4) {
  848. var t3 = "";
  849. return e4 > 65535 && (e4 -= 65536, t3 += String.fromCharCode(e4 >>> 10 & 1023 | 55296), e4 = 56320 | 1023 & e4), t3 + String.fromCharCode(e4);
  850. }, e3.replaceCodePoint = a2, e3.default = function(t3) {
  851. return (0, e3.fromCodePoint)(a2(t3));
  852. };
  853. }(D), function(e3) {
  854. var t2 = l && l.__createBinding || (Object.create ? function(e4, t3, s3, a3) {
  855. void 0 === a3 && (a3 = s3);
  856. var r3 = Object.getOwnPropertyDescriptor(t3, s3);
  857. r3 && !("get" in r3 ? !t3.__esModule : r3.writable || r3.configurable) || (r3 = { enumerable: true, get: function() {
  858. return t3[s3];
  859. } }), Object.defineProperty(e4, a3, r3);
  860. } : function(e4, t3, s3, a3) {
  861. void 0 === a3 && (a3 = s3), e4[a3] = t3[s3];
  862. }), s2 = l && l.__setModuleDefault || (Object.create ? function(e4, t3) {
  863. Object.defineProperty(e4, "default", { enumerable: true, value: t3 });
  864. } : function(e4, t3) {
  865. e4.default = t3;
  866. }), a2 = l && l.__importStar || function(e4) {
  867. if (e4 && e4.__esModule) return e4;
  868. var a3 = {};
  869. if (null != e4) for (var r3 in e4) "default" !== r3 && Object.prototype.hasOwnProperty.call(e4, r3) && t2(a3, e4, r3);
  870. return s2(a3, e4), a3;
  871. }, r2 = l && l.__importDefault || function(e4) {
  872. return e4 && e4.__esModule ? e4 : { default: e4 };
  873. };
  874. Object.defineProperty(e3, "__esModule", { value: true }), e3.decodeXML = e3.decodeHTMLStrict = e3.decodeHTMLAttribute = e3.decodeHTML = e3.determineBranch = e3.EntityDecoder = e3.DecodingMode = e3.BinTrieFlags = e3.fromCodePoint = e3.replaceCodePoint = e3.decodeCodePoint = e3.xmlDecodeTree = e3.htmlDecodeTree = void 0;
  875. var n2 = r2(d);
  876. e3.htmlDecodeTree = n2.default;
  877. var i2 = r2(p);
  878. e3.xmlDecodeTree = i2.default;
  879. var o2 = a2(D);
  880. e3.decodeCodePoint = o2.default;
  881. var c2, E2, T2, h2, _2 = D;
  882. function A2(e4) {
  883. return e4 >= c2.ZERO && e4 <= c2.NINE;
  884. }
  885. Object.defineProperty(e3, "replaceCodePoint", { enumerable: true, get: function() {
  886. return _2.replaceCodePoint;
  887. } }), Object.defineProperty(e3, "fromCodePoint", { enumerable: true, get: function() {
  888. return _2.fromCodePoint;
  889. } }), function(e4) {
  890. e4[e4.NUM = 35] = "NUM", e4[e4.SEMI = 59] = "SEMI", e4[e4.EQUALS = 61] = "EQUALS", e4[e4.ZERO = 48] = "ZERO", e4[e4.NINE = 57] = "NINE", e4[e4.LOWER_A = 97] = "LOWER_A", e4[e4.LOWER_F = 102] = "LOWER_F", e4[e4.LOWER_X = 120] = "LOWER_X", e4[e4.LOWER_Z = 122] = "LOWER_Z", e4[e4.UPPER_A = 65] = "UPPER_A", e4[e4.UPPER_F = 70] = "UPPER_F", e4[e4.UPPER_Z = 90] = "UPPER_Z";
  891. }(c2 || (c2 = {})), function(e4) {
  892. e4[e4.VALUE_LENGTH = 49152] = "VALUE_LENGTH", e4[e4.BRANCH_LENGTH = 16256] = "BRANCH_LENGTH", e4[e4.JUMP_TABLE = 127] = "JUMP_TABLE";
  893. }(E2 = e3.BinTrieFlags || (e3.BinTrieFlags = {})), function(e4) {
  894. e4[e4.EntityStart = 0] = "EntityStart", e4[e4.NumericStart = 1] = "NumericStart", e4[e4.NumericDecimal = 2] = "NumericDecimal", e4[e4.NumericHex = 3] = "NumericHex", e4[e4.NamedEntity = 4] = "NamedEntity";
  895. }(T2 || (T2 = {})), function(e4) {
  896. e4[e4.Legacy = 0] = "Legacy", e4[e4.Strict = 1] = "Strict", e4[e4.Attribute = 2] = "Attribute";
  897. }(h2 = e3.DecodingMode || (e3.DecodingMode = {}));
  898. var m2 = function() {
  899. function e4(e5, t3, s3) {
  900. this.decodeTree = e5, this.emitCodePoint = t3, this.errors = s3, this.state = T2.EntityStart, this.consumed = 1, this.result = 0, this.treeIndex = 0, this.excess = 1, this.decodeMode = h2.Strict;
  901. }
  902. return e4.prototype.startEntity = function(e5) {
  903. this.decodeMode = e5, this.state = T2.EntityStart, this.result = 0, this.treeIndex = 0, this.excess = 1, this.consumed = 1;
  904. }, e4.prototype.write = function(e5, t3) {
  905. switch (this.state) {
  906. case T2.EntityStart:
  907. return e5.charCodeAt(t3) === c2.NUM ? (this.state = T2.NumericStart, this.consumed += 1, this.stateNumericStart(e5, t3 + 1)) : (this.state = T2.NamedEntity, this.stateNamedEntity(e5, t3));
  908. case T2.NumericStart:
  909. return this.stateNumericStart(e5, t3);
  910. case T2.NumericDecimal:
  911. return this.stateNumericDecimal(e5, t3);
  912. case T2.NumericHex:
  913. return this.stateNumericHex(e5, t3);
  914. case T2.NamedEntity:
  915. return this.stateNamedEntity(e5, t3);
  916. }
  917. }, e4.prototype.stateNumericStart = function(e5, t3) {
  918. return t3 >= e5.length ? -1 : (32 | e5.charCodeAt(t3)) === c2.LOWER_X ? (this.state = T2.NumericHex, this.consumed += 1, this.stateNumericHex(e5, t3 + 1)) : (this.state = T2.NumericDecimal, this.stateNumericDecimal(e5, t3));
  919. }, e4.prototype.addToNumericResult = function(e5, t3, s3, a3) {
  920. if (t3 !== s3) {
  921. var r3 = s3 - t3;
  922. this.result = this.result * Math.pow(a3, r3) + parseInt(e5.substr(t3, r3), a3), this.consumed += r3;
  923. }
  924. }, e4.prototype.stateNumericHex = function(e5, t3) {
  925. for (var s3, a3 = t3; t3 < e5.length; ) {
  926. var r3 = e5.charCodeAt(t3);
  927. if (!(A2(r3) || (s3 = r3, s3 >= c2.UPPER_A && s3 <= c2.UPPER_F || s3 >= c2.LOWER_A && s3 <= c2.LOWER_F))) return this.addToNumericResult(e5, a3, t3, 16), this.emitNumericEntity(r3, 3);
  928. t3 += 1;
  929. }
  930. return this.addToNumericResult(e5, a3, t3, 16), -1;
  931. }, e4.prototype.stateNumericDecimal = function(e5, t3) {
  932. for (var s3 = t3; t3 < e5.length; ) {
  933. var a3 = e5.charCodeAt(t3);
  934. if (!A2(a3)) return this.addToNumericResult(e5, s3, t3, 10), this.emitNumericEntity(a3, 2);
  935. t3 += 1;
  936. }
  937. return this.addToNumericResult(e5, s3, t3, 10), -1;
  938. }, e4.prototype.emitNumericEntity = function(e5, t3) {
  939. var s3;
  940. if (this.consumed <= t3) return null === (s3 = this.errors) || void 0 === s3 || s3.absenceOfDigitsInNumericCharacterReference(this.consumed), 0;
  941. if (e5 === c2.SEMI) this.consumed += 1;
  942. else if (this.decodeMode === h2.Strict) return 0;
  943. return this.emitCodePoint((0, o2.replaceCodePoint)(this.result), this.consumed), this.errors && (e5 !== c2.SEMI && this.errors.missingSemicolonAfterCharacterReference(), this.errors.validateNumericCharacterReference(this.result)), this.consumed;
  944. }, e4.prototype.stateNamedEntity = function(e5, t3) {
  945. for (var s3 = this.decodeTree, a3 = s3[this.treeIndex], r3 = (a3 & E2.VALUE_LENGTH) >> 14; t3 < e5.length; t3++, this.excess++) {
  946. var n3 = e5.charCodeAt(t3);
  947. if (this.treeIndex = N2(s3, a3, this.treeIndex + Math.max(1, r3), n3), this.treeIndex < 0) return 0 === this.result || this.decodeMode === h2.Attribute && (0 === r3 || ((i3 = n3) === c2.EQUALS || function(e6) {
  948. return e6 >= c2.UPPER_A && e6 <= c2.UPPER_Z || e6 >= c2.LOWER_A && e6 <= c2.LOWER_Z || A2(e6);
  949. }(i3))) ? 0 : this.emitNotTerminatedNamedEntity();
  950. if (0 != (r3 = ((a3 = s3[this.treeIndex]) & E2.VALUE_LENGTH) >> 14)) {
  951. if (n3 === c2.SEMI) return this.emitNamedEntityData(this.treeIndex, r3, this.consumed + this.excess);
  952. this.decodeMode !== h2.Strict && (this.result = this.treeIndex, this.consumed += this.excess, this.excess = 0);
  953. }
  954. }
  955. var i3;
  956. return -1;
  957. }, e4.prototype.emitNotTerminatedNamedEntity = function() {
  958. var e5, t3 = this.result, s3 = (this.decodeTree[t3] & E2.VALUE_LENGTH) >> 14;
  959. return this.emitNamedEntityData(t3, s3, this.consumed), null === (e5 = this.errors) || void 0 === e5 || e5.missingSemicolonAfterCharacterReference(), this.consumed;
  960. }, e4.prototype.emitNamedEntityData = function(e5, t3, s3) {
  961. var a3 = this.decodeTree;
  962. return this.emitCodePoint(1 === t3 ? a3[e5] & ~E2.VALUE_LENGTH : a3[e5 + 1], s3), 3 === t3 && this.emitCodePoint(a3[e5 + 2], s3), s3;
  963. }, e4.prototype.end = function() {
  964. var e5;
  965. switch (this.state) {
  966. case T2.NamedEntity:
  967. return 0 === this.result || this.decodeMode === h2.Attribute && this.result !== this.treeIndex ? 0 : this.emitNotTerminatedNamedEntity();
  968. case T2.NumericDecimal:
  969. return this.emitNumericEntity(0, 2);
  970. case T2.NumericHex:
  971. return this.emitNumericEntity(0, 3);
  972. case T2.NumericStart:
  973. return null === (e5 = this.errors) || void 0 === e5 || e5.absenceOfDigitsInNumericCharacterReference(this.consumed), 0;
  974. case T2.EntityStart:
  975. return 0;
  976. }
  977. }, e4;
  978. }();
  979. function u2(e4) {
  980. var t3 = "", s3 = new m2(e4, function(e5) {
  981. return t3 += (0, o2.fromCodePoint)(e5);
  982. });
  983. return function(e5, a3) {
  984. for (var r3 = 0, n3 = 0; (n3 = e5.indexOf("&", n3)) >= 0; ) {
  985. t3 += e5.slice(r3, n3), s3.startEntity(a3);
  986. var i3 = s3.write(e5, n3 + 1);
  987. if (i3 < 0) {
  988. r3 = n3 + s3.end();
  989. break;
  990. }
  991. r3 = n3 + i3, n3 = 0 === i3 ? r3 + 1 : r3;
  992. }
  993. var o3 = t3 + e5.slice(r3);
  994. return t3 = "", o3;
  995. };
  996. }
  997. function N2(e4, t3, s3, a3) {
  998. var r3 = (t3 & E2.BRANCH_LENGTH) >> 7, n3 = t3 & E2.JUMP_TABLE;
  999. if (0 === r3) return 0 !== n3 && a3 === n3 ? s3 : -1;
  1000. if (n3) {
  1001. var i3 = a3 - n3;
  1002. return i3 < 0 || i3 >= r3 ? -1 : e4[s3 + i3] - 1;
  1003. }
  1004. for (var o3 = s3, c3 = o3 + r3 - 1; o3 <= c3; ) {
  1005. var T3 = o3 + c3 >>> 1, h3 = e4[T3];
  1006. if (h3 < a3) o3 = T3 + 1;
  1007. else {
  1008. if (!(h3 > a3)) return e4[T3 + r3];
  1009. c3 = T3 - 1;
  1010. }
  1011. }
  1012. return -1;
  1013. }
  1014. e3.EntityDecoder = m2, e3.determineBranch = N2;
  1015. var I2 = u2(n2.default), C2 = u2(i2.default);
  1016. e3.decodeHTML = function(e4, t3) {
  1017. return void 0 === t3 && (t3 = h2.Legacy), I2(e4, t3);
  1018. }, e3.decodeHTMLAttribute = function(e4) {
  1019. return I2(e4, h2.Attribute);
  1020. }, e3.decodeHTMLStrict = function(e4) {
  1021. return I2(e4, h2.Strict);
  1022. }, e3.decodeXML = function(e4) {
  1023. return C2(e4, h2.Strict);
  1024. };
  1025. }(m), function(e3) {
  1026. e3.HTML = "http://www.w3.org/1999/xhtml", e3.MATHML = "http://www.w3.org/1998/Math/MathML", e3.SVG = "http://www.w3.org/2000/svg", e3.XLINK = "http://www.w3.org/1999/xlink", e3.XML = "http://www.w3.org/XML/1998/namespace", e3.XMLNS = "http://www.w3.org/2000/xmlns/";
  1027. }(u = u || (u = {})), function(e3) {
  1028. e3.TYPE = "type", e3.ACTION = "action", e3.ENCODING = "encoding", e3.PROMPT = "prompt", e3.NAME = "name", e3.COLOR = "color", e3.FACE = "face", e3.SIZE = "size";
  1029. }(N = N || (N = {})), function(e3) {
  1030. e3.NO_QUIRKS = "no-quirks", e3.QUIRKS = "quirks", e3.LIMITED_QUIRKS = "limited-quirks";
  1031. }(I = I || (I = {})), function(e3) {
  1032. e3.A = "a", e3.ADDRESS = "address", e3.ANNOTATION_XML = "annotation-xml", e3.APPLET = "applet", e3.AREA = "area", e3.ARTICLE = "article", e3.ASIDE = "aside", e3.B = "b", e3.BASE = "base", e3.BASEFONT = "basefont", e3.BGSOUND = "bgsound", e3.BIG = "big", e3.BLOCKQUOTE = "blockquote", e3.BODY = "body", e3.BR = "br", e3.BUTTON = "button", e3.CAPTION = "caption", e3.CENTER = "center", e3.CODE = "code", e3.COL = "col", e3.COLGROUP = "colgroup", e3.DD = "dd", e3.DESC = "desc", e3.DETAILS = "details", e3.DIALOG = "dialog", e3.DIR = "dir", e3.DIV = "div", e3.DL = "dl", e3.DT = "dt", e3.EM = "em", e3.EMBED = "embed", e3.FIELDSET = "fieldset", e3.FIGCAPTION = "figcaption", e3.FIGURE = "figure", e3.FONT = "font", e3.FOOTER = "footer", e3.FOREIGN_OBJECT = "foreignObject", e3.FORM = "form", e3.FRAME = "frame", e3.FRAMESET = "frameset", e3.H1 = "h1", e3.H2 = "h2", e3.H3 = "h3", e3.H4 = "h4", e3.H5 = "h5", e3.H6 = "h6", e3.HEAD = "head", e3.HEADER = "header", e3.HGROUP = "hgroup", e3.HR = "hr", e3.HTML = "html", e3.I = "i", e3.IMG = "img", e3.IMAGE = "image", e3.INPUT = "input", e3.IFRAME = "iframe", e3.KEYGEN = "keygen", e3.LABEL = "label", e3.LI = "li", e3.LINK = "link", e3.LISTING = "listing", e3.MAIN = "main", e3.MALIGNMARK = "malignmark", e3.MARQUEE = "marquee", e3.MATH = "math", e3.MENU = "menu", e3.META = "meta", e3.MGLYPH = "mglyph", e3.MI = "mi", e3.MO = "mo", e3.MN = "mn", e3.MS = "ms", e3.MTEXT = "mtext", e3.NAV = "nav", e3.NOBR = "nobr", e3.NOFRAMES = "noframes", e3.NOEMBED = "noembed", e3.NOSCRIPT = "noscript", e3.OBJECT = "object", e3.OL = "ol", e3.OPTGROUP = "optgroup", e3.OPTION = "option", e3.P = "p", e3.PARAM = "param", e3.PLAINTEXT = "plaintext", e3.PRE = "pre", e3.RB = "rb", e3.RP = "rp", e3.RT = "rt", e3.RTC = "rtc", e3.RUBY = "ruby", e3.S = "s", e3.SCRIPT = "script", e3.SECTION = "section", e3.SELECT = "select", e3.SOURCE = "source", e3.SMALL = "small", e3.SPAN = "span", e3.STRIKE = "strike", e3.STRONG = "strong", e3.STYLE = "style", e3.SUB = "sub", e3.SUMMARY = "summary", e3.SUP = "sup", e3.TABLE = "table", e3.TBODY = "tbody", e3.TEMPLATE = "template", e3.TEXTAREA = "textarea", e3.TFOOT = "tfoot", e3.TD = "td", e3.TH = "th", e3.THEAD = "thead", e3.TITLE = "title", e3.TR = "tr", e3.TRACK = "track", e3.TT = "tt", e3.U = "u", e3.UL = "ul", e3.SVG = "svg", e3.VAR = "var", e3.WBR = "wbr", e3.XMP = "xmp";
  1033. }(C = C || (C = {})), function(e3) {
  1034. e3[e3.UNKNOWN = 0] = "UNKNOWN", e3[e3.A = 1] = "A", e3[e3.ADDRESS = 2] = "ADDRESS", e3[e3.ANNOTATION_XML = 3] = "ANNOTATION_XML", e3[e3.APPLET = 4] = "APPLET", e3[e3.AREA = 5] = "AREA", e3[e3.ARTICLE = 6] = "ARTICLE", e3[e3.ASIDE = 7] = "ASIDE", e3[e3.B = 8] = "B", e3[e3.BASE = 9] = "BASE", e3[e3.BASEFONT = 10] = "BASEFONT", e3[e3.BGSOUND = 11] = "BGSOUND", e3[e3.BIG = 12] = "BIG", e3[e3.BLOCKQUOTE = 13] = "BLOCKQUOTE", e3[e3.BODY = 14] = "BODY", e3[e3.BR = 15] = "BR", e3[e3.BUTTON = 16] = "BUTTON", e3[e3.CAPTION = 17] = "CAPTION", e3[e3.CENTER = 18] = "CENTER", e3[e3.CODE = 19] = "CODE", e3[e3.COL = 20] = "COL", e3[e3.COLGROUP = 21] = "COLGROUP", e3[e3.DD = 22] = "DD", e3[e3.DESC = 23] = "DESC", e3[e3.DETAILS = 24] = "DETAILS", e3[e3.DIALOG = 25] = "DIALOG", e3[e3.DIR = 26] = "DIR", e3[e3.DIV = 27] = "DIV", e3[e3.DL = 28] = "DL", e3[e3.DT = 29] = "DT", e3[e3.EM = 30] = "EM", e3[e3.EMBED = 31] = "EMBED", e3[e3.FIELDSET = 32] = "FIELDSET", e3[e3.FIGCAPTION = 33] = "FIGCAPTION", e3[e3.FIGURE = 34] = "FIGURE", e3[e3.FONT = 35] = "FONT", e3[e3.FOOTER = 36] = "FOOTER", e3[e3.FOREIGN_OBJECT = 37] = "FOREIGN_OBJECT", e3[e3.FORM = 38] = "FORM", e3[e3.FRAME = 39] = "FRAME", e3[e3.FRAMESET = 40] = "FRAMESET", e3[e3.H1 = 41] = "H1", e3[e3.H2 = 42] = "H2", e3[e3.H3 = 43] = "H3", e3[e3.H4 = 44] = "H4", e3[e3.H5 = 45] = "H5", e3[e3.H6 = 46] = "H6", e3[e3.HEAD = 47] = "HEAD", e3[e3.HEADER = 48] = "HEADER", e3[e3.HGROUP = 49] = "HGROUP", e3[e3.HR = 50] = "HR", e3[e3.HTML = 51] = "HTML", e3[e3.I = 52] = "I", e3[e3.IMG = 53] = "IMG", e3[e3.IMAGE = 54] = "IMAGE", e3[e3.INPUT = 55] = "INPUT", e3[e3.IFRAME = 56] = "IFRAME", e3[e3.KEYGEN = 57] = "KEYGEN", e3[e3.LABEL = 58] = "LABEL", e3[e3.LI = 59] = "LI", e3[e3.LINK = 60] = "LINK", e3[e3.LISTING = 61] = "LISTING", e3[e3.MAIN = 62] = "MAIN", e3[e3.MALIGNMARK = 63] = "MALIGNMARK", e3[e3.MARQUEE = 64] = "MARQUEE", e3[e3.MATH = 65] = "MATH", e3[e3.MENU = 66] = "MENU", e3[e3.META = 67] = "META", e3[e3.MGLYPH = 68] = "MGLYPH", e3[e3.MI = 69] = "MI", e3[e3.MO = 70] = "MO", e3[e3.MN = 71] = "MN", e3[e3.MS = 72] = "MS", e3[e3.MTEXT = 73] = "MTEXT", e3[e3.NAV = 74] = "NAV", e3[e3.NOBR = 75] = "NOBR", e3[e3.NOFRAMES = 76] = "NOFRAMES", e3[e3.NOEMBED = 77] = "NOEMBED", e3[e3.NOSCRIPT = 78] = "NOSCRIPT", e3[e3.OBJECT = 79] = "OBJECT", e3[e3.OL = 80] = "OL", e3[e3.OPTGROUP = 81] = "OPTGROUP", e3[e3.OPTION = 82] = "OPTION", e3[e3.P = 83] = "P", e3[e3.PARAM = 84] = "PARAM", e3[e3.PLAINTEXT = 85] = "PLAINTEXT", e3[e3.PRE = 86] = "PRE", e3[e3.RB = 87] = "RB", e3[e3.RP = 88] = "RP", e3[e3.RT = 89] = "RT", e3[e3.RTC = 90] = "RTC", e3[e3.RUBY = 91] = "RUBY", e3[e3.S = 92] = "S", e3[e3.SCRIPT = 93] = "SCRIPT", e3[e3.SECTION = 94] = "SECTION", e3[e3.SELECT = 95] = "SELECT", e3[e3.SOURCE = 96] = "SOURCE", e3[e3.SMALL = 97] = "SMALL", e3[e3.SPAN = 98] = "SPAN", e3[e3.STRIKE = 99] = "STRIKE", e3[e3.STRONG = 100] = "STRONG", e3[e3.STYLE = 101] = "STYLE", e3[e3.SUB = 102] = "SUB", e3[e3.SUMMARY = 103] = "SUMMARY", e3[e3.SUP = 104] = "SUP", e3[e3.TABLE = 105] = "TABLE", e3[e3.TBODY = 106] = "TBODY", e3[e3.TEMPLATE = 107] = "TEMPLATE", e3[e3.TEXTAREA = 108] = "TEXTAREA", e3[e3.TFOOT = 109] = "TFOOT", e3[e3.TD = 110] = "TD", e3[e3.TH = 111] = "TH", e3[e3.THEAD = 112] = "THEAD", e3[e3.TITLE = 113] = "TITLE", e3[e3.TR = 114] = "TR", e3[e3.TRACK = 115] = "TRACK", e3[e3.TT = 116] = "TT", e3[e3.U = 117] = "U", e3[e3.UL = 118] = "UL", e3[e3.SVG = 119] = "SVG", e3[e3.VAR = 120] = "VAR", e3[e3.WBR = 121] = "WBR", e3[e3.XMP = 122] = "XMP";
  1035. }(S = S || (S = {}));
  1036. const R = /* @__PURE__ */ new Map([[C.A, S.A], [C.ADDRESS, S.ADDRESS], [C.ANNOTATION_XML, S.ANNOTATION_XML], [C.APPLET, S.APPLET], [C.AREA, S.AREA], [C.ARTICLE, S.ARTICLE], [C.ASIDE, S.ASIDE], [C.B, S.B], [C.BASE, S.BASE], [C.BASEFONT, S.BASEFONT], [C.BGSOUND, S.BGSOUND], [C.BIG, S.BIG], [C.BLOCKQUOTE, S.BLOCKQUOTE], [C.BODY, S.BODY], [C.BR, S.BR], [C.BUTTON, S.BUTTON], [C.CAPTION, S.CAPTION], [C.CENTER, S.CENTER], [C.CODE, S.CODE], [C.COL, S.COL], [C.COLGROUP, S.COLGROUP], [C.DD, S.DD], [C.DESC, S.DESC], [C.DETAILS, S.DETAILS], [C.DIALOG, S.DIALOG], [C.DIR, S.DIR], [C.DIV, S.DIV], [C.DL, S.DL], [C.DT, S.DT], [C.EM, S.EM], [C.EMBED, S.EMBED], [C.FIELDSET, S.FIELDSET], [C.FIGCAPTION, S.FIGCAPTION], [C.FIGURE, S.FIGURE], [C.FONT, S.FONT], [C.FOOTER, S.FOOTER], [C.FOREIGN_OBJECT, S.FOREIGN_OBJECT], [C.FORM, S.FORM], [C.FRAME, S.FRAME], [C.FRAMESET, S.FRAMESET], [C.H1, S.H1], [C.H2, S.H2], [C.H3, S.H3], [C.H4, S.H4], [C.H5, S.H5], [C.H6, S.H6], [C.HEAD, S.HEAD], [C.HEADER, S.HEADER], [C.HGROUP, S.HGROUP], [C.HR, S.HR], [C.HTML, S.HTML], [C.I, S.I], [C.IMG, S.IMG], [C.IMAGE, S.IMAGE], [C.INPUT, S.INPUT], [C.IFRAME, S.IFRAME], [C.KEYGEN, S.KEYGEN], [C.LABEL, S.LABEL], [C.LI, S.LI], [C.LINK, S.LINK], [C.LISTING, S.LISTING], [C.MAIN, S.MAIN], [C.MALIGNMARK, S.MALIGNMARK], [C.MARQUEE, S.MARQUEE], [C.MATH, S.MATH], [C.MENU, S.MENU], [C.META, S.META], [C.MGLYPH, S.MGLYPH], [C.MI, S.MI], [C.MO, S.MO], [C.MN, S.MN], [C.MS, S.MS], [C.MTEXT, S.MTEXT], [C.NAV, S.NAV], [C.NOBR, S.NOBR], [C.NOFRAMES, S.NOFRAMES], [C.NOEMBED, S.NOEMBED], [C.NOSCRIPT, S.NOSCRIPT], [C.OBJECT, S.OBJECT], [C.OL, S.OL], [C.OPTGROUP, S.OPTGROUP], [C.OPTION, S.OPTION], [C.P, S.P], [C.PARAM, S.PARAM], [C.PLAINTEXT, S.PLAINTEXT], [C.PRE, S.PRE], [C.RB, S.RB], [C.RP, S.RP], [C.RT, S.RT], [C.RTC, S.RTC], [C.RUBY, S.RUBY], [C.S, S.S], [C.SCRIPT, S.SCRIPT], [C.SECTION, S.SECTION], [C.SELECT, S.SELECT], [C.SOURCE, S.SOURCE], [C.SMALL, S.SMALL], [C.SPAN, S.SPAN], [C.STRIKE, S.STRIKE], [C.STRONG, S.STRONG], [C.STYLE, S.STYLE], [C.SUB, S.SUB], [C.SUMMARY, S.SUMMARY], [C.SUP, S.SUP], [C.TABLE, S.TABLE], [C.TBODY, S.TBODY], [C.TEMPLATE, S.TEMPLATE], [C.TEXTAREA, S.TEXTAREA], [C.TFOOT, S.TFOOT], [C.TD, S.TD], [C.TH, S.TH], [C.THEAD, S.THEAD], [C.TITLE, S.TITLE], [C.TR, S.TR], [C.TRACK, S.TRACK], [C.TT, S.TT], [C.U, S.U], [C.UL, S.UL], [C.SVG, S.SVG], [C.VAR, S.VAR], [C.WBR, S.WBR], [C.XMP, S.XMP]]);
  1037. function O(e3) {
  1038. var t2;
  1039. return null !== (t2 = R.get(e3)) && void 0 !== t2 ? t2 : S.UNKNOWN;
  1040. }
  1041. const f = S, L = { [u.HTML]: /* @__PURE__ */ new Set([f.ADDRESS, f.APPLET, f.AREA, f.ARTICLE, f.ASIDE, f.BASE, f.BASEFONT, f.BGSOUND, f.BLOCKQUOTE, f.BODY, f.BR, f.BUTTON, f.CAPTION, f.CENTER, f.COL, f.COLGROUP, f.DD, f.DETAILS, f.DIR, f.DIV, f.DL, f.DT, f.EMBED, f.FIELDSET, f.FIGCAPTION, f.FIGURE, f.FOOTER, f.FORM, f.FRAME, f.FRAMESET, f.H1, f.H2, f.H3, f.H4, f.H5, f.H6, f.HEAD, f.HEADER, f.HGROUP, f.HR, f.HTML, f.IFRAME, f.IMG, f.INPUT, f.LI, f.LINK, f.LISTING, f.MAIN, f.MARQUEE, f.MENU, f.META, f.NAV, f.NOEMBED, f.NOFRAMES, f.NOSCRIPT, f.OBJECT, f.OL, f.P, f.PARAM, f.PLAINTEXT, f.PRE, f.SCRIPT, f.SECTION, f.SELECT, f.SOURCE, f.STYLE, f.SUMMARY, f.TABLE, f.TBODY, f.TD, f.TEMPLATE, f.TEXTAREA, f.TFOOT, f.TH, f.THEAD, f.TITLE, f.TR, f.TRACK, f.UL, f.WBR, f.XMP]), [u.MATHML]: /* @__PURE__ */ new Set([f.MI, f.MO, f.MN, f.MS, f.MTEXT, f.ANNOTATION_XML]), [u.SVG]: /* @__PURE__ */ new Set([f.TITLE, f.FOREIGN_OBJECT, f.DESC]), [u.XLINK]: /* @__PURE__ */ new Set(), [u.XML]: /* @__PURE__ */ new Set(), [u.XMLNS]: /* @__PURE__ */ new Set() };
  1042. function M(e3) {
  1043. return e3 === f.H1 || e3 === f.H2 || e3 === f.H3 || e3 === f.H4 || e3 === f.H5 || e3 === f.H6;
  1044. }
  1045. /* @__PURE__ */ new Set([C.STYLE, C.SCRIPT, C.XMP, C.IFRAME, C.NOEMBED, C.NOFRAMES, C.PLAINTEXT]);
  1046. const g = /* @__PURE__ */ new Map([[128, 8364], [130, 8218], [131, 402], [132, 8222], [133, 8230], [134, 8224], [135, 8225], [136, 710], [137, 8240], [138, 352], [139, 8249], [140, 338], [142, 381], [145, 8216], [146, 8217], [147, 8220], [148, 8221], [149, 8226], [150, 8211], [151, 8212], [152, 732], [153, 8482], [154, 353], [155, 8250], [156, 339], [158, 382], [159, 376]]);
  1047. var P;
  1048. !function(e3) {
  1049. e3[e3.DATA = 0] = "DATA", e3[e3.RCDATA = 1] = "RCDATA", e3[e3.RAWTEXT = 2] = "RAWTEXT", e3[e3.SCRIPT_DATA = 3] = "SCRIPT_DATA", e3[e3.PLAINTEXT = 4] = "PLAINTEXT", e3[e3.TAG_OPEN = 5] = "TAG_OPEN", e3[e3.END_TAG_OPEN = 6] = "END_TAG_OPEN", e3[e3.TAG_NAME = 7] = "TAG_NAME", e3[e3.RCDATA_LESS_THAN_SIGN = 8] = "RCDATA_LESS_THAN_SIGN", e3[e3.RCDATA_END_TAG_OPEN = 9] = "RCDATA_END_TAG_OPEN", e3[e3.RCDATA_END_TAG_NAME = 10] = "RCDATA_END_TAG_NAME", e3[e3.RAWTEXT_LESS_THAN_SIGN = 11] = "RAWTEXT_LESS_THAN_SIGN", e3[e3.RAWTEXT_END_TAG_OPEN = 12] = "RAWTEXT_END_TAG_OPEN", e3[e3.RAWTEXT_END_TAG_NAME = 13] = "RAWTEXT_END_TAG_NAME", e3[e3.SCRIPT_DATA_LESS_THAN_SIGN = 14] = "SCRIPT_DATA_LESS_THAN_SIGN", e3[e3.SCRIPT_DATA_END_TAG_OPEN = 15] = "SCRIPT_DATA_END_TAG_OPEN", e3[e3.SCRIPT_DATA_END_TAG_NAME = 16] = "SCRIPT_DATA_END_TAG_NAME", e3[e3.SCRIPT_DATA_ESCAPE_START = 17] = "SCRIPT_DATA_ESCAPE_START", e3[e3.SCRIPT_DATA_ESCAPE_START_DASH = 18] = "SCRIPT_DATA_ESCAPE_START_DASH", e3[e3.SCRIPT_DATA_ESCAPED = 19] = "SCRIPT_DATA_ESCAPED", e3[e3.SCRIPT_DATA_ESCAPED_DASH = 20] = "SCRIPT_DATA_ESCAPED_DASH", e3[e3.SCRIPT_DATA_ESCAPED_DASH_DASH = 21] = "SCRIPT_DATA_ESCAPED_DASH_DASH", e3[e3.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN = 22] = "SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN", e3[e3.SCRIPT_DATA_ESCAPED_END_TAG_OPEN = 23] = "SCRIPT_DATA_ESCAPED_END_TAG_OPEN", e3[e3.SCRIPT_DATA_ESCAPED_END_TAG_NAME = 24] = "SCRIPT_DATA_ESCAPED_END_TAG_NAME", e3[e3.SCRIPT_DATA_DOUBLE_ESCAPE_START = 25] = "SCRIPT_DATA_DOUBLE_ESCAPE_START", e3[e3.SCRIPT_DATA_DOUBLE_ESCAPED = 26] = "SCRIPT_DATA_DOUBLE_ESCAPED", e3[e3.SCRIPT_DATA_DOUBLE_ESCAPED_DASH = 27] = "SCRIPT_DATA_DOUBLE_ESCAPED_DASH", e3[e3.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH = 28] = "SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH", e3[e3.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN = 29] = "SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN", e3[e3.SCRIPT_DATA_DOUBLE_ESCAPE_END = 30] = "SCRIPT_DATA_DOUBLE_ESCAPE_END", e3[e3.BEFORE_ATTRIBUTE_NAME = 31] = "BEFORE_ATTRIBUTE_NAME", e3[e3.ATTRIBUTE_NAME = 32] = "ATTRIBUTE_NAME", e3[e3.AFTER_ATTRIBUTE_NAME = 33] = "AFTER_ATTRIBUTE_NAME", e3[e3.BEFORE_ATTRIBUTE_VALUE = 34] = "BEFORE_ATTRIBUTE_VALUE", e3[e3.ATTRIBUTE_VALUE_DOUBLE_QUOTED = 35] = "ATTRIBUTE_VALUE_DOUBLE_QUOTED", e3[e3.ATTRIBUTE_VALUE_SINGLE_QUOTED = 36] = "ATTRIBUTE_VALUE_SINGLE_QUOTED", e3[e3.ATTRIBUTE_VALUE_UNQUOTED = 37] = "ATTRIBUTE_VALUE_UNQUOTED", e3[e3.AFTER_ATTRIBUTE_VALUE_QUOTED = 38] = "AFTER_ATTRIBUTE_VALUE_QUOTED", e3[e3.SELF_CLOSING_START_TAG = 39] = "SELF_CLOSING_START_TAG", e3[e3.BOGUS_COMMENT = 40] = "BOGUS_COMMENT", e3[e3.MARKUP_DECLARATION_OPEN = 41] = "MARKUP_DECLARATION_OPEN", e3[e3.COMMENT_START = 42] = "COMMENT_START", e3[e3.COMMENT_START_DASH = 43] = "COMMENT_START_DASH", e3[e3.COMMENT = 44] = "COMMENT", e3[e3.COMMENT_LESS_THAN_SIGN = 45] = "COMMENT_LESS_THAN_SIGN", e3[e3.COMMENT_LESS_THAN_SIGN_BANG = 46] = "COMMENT_LESS_THAN_SIGN_BANG", e3[e3.COMMENT_LESS_THAN_SIGN_BANG_DASH = 47] = "COMMENT_LESS_THAN_SIGN_BANG_DASH", e3[e3.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH = 48] = "COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH", e3[e3.COMMENT_END_DASH = 49] = "COMMENT_END_DASH", e3[e3.COMMENT_END = 50] = "COMMENT_END", e3[e3.COMMENT_END_BANG = 51] = "COMMENT_END_BANG", e3[e3.DOCTYPE = 52] = "DOCTYPE", e3[e3.BEFORE_DOCTYPE_NAME = 53] = "BEFORE_DOCTYPE_NAME", e3[e3.DOCTYPE_NAME = 54] = "DOCTYPE_NAME", e3[e3.AFTER_DOCTYPE_NAME = 55] = "AFTER_DOCTYPE_NAME", e3[e3.AFTER_DOCTYPE_PUBLIC_KEYWORD = 56] = "AFTER_DOCTYPE_PUBLIC_KEYWORD", e3[e3.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER = 57] = "BEFORE_DOCTYPE_PUBLIC_IDENTIFIER", e3[e3.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED = 58] = "DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED", e3[e3.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED = 59] = "DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED", e3[e3.AFTER_DOCTYPE_PUBLIC_IDENTIFIER = 60] = "AFTER_DOCTYPE_PUBLIC_IDENTIFIER", e3[e3.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS = 61] = "BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS", e3[e3.AFTER_DOCTYPE_SYSTEM_KEYWORD = 62] = "AFTER_DOCTYPE_SYSTEM_KEYWORD", e3[e3.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER = 63] = "BEFORE_DOCTYPE_SYSTEM_IDENTIFIER", e3[e3.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED = 64] = "DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED", e3[e3.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED = 65] = "DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED", e3[e3.AFTER_DOCTYPE_SYSTEM_IDENTIFIER = 66] = "AFTER_DOCTYPE_SYSTEM_IDENTIFIER", e3[e3.BOGUS_DOCTYPE = 67] = "BOGUS_DOCTYPE", e3[e3.CDATA_SECTION = 68] = "CDATA_SECTION", e3[e3.CDATA_SECTION_BRACKET = 69] = "CDATA_SECTION_BRACKET", e3[e3.CDATA_SECTION_END = 70] = "CDATA_SECTION_END", e3[e3.CHARACTER_REFERENCE = 71] = "CHARACTER_REFERENCE", e3[e3.NAMED_CHARACTER_REFERENCE = 72] = "NAMED_CHARACTER_REFERENCE", e3[e3.AMBIGUOUS_AMPERSAND = 73] = "AMBIGUOUS_AMPERSAND", e3[e3.NUMERIC_CHARACTER_REFERENCE = 74] = "NUMERIC_CHARACTER_REFERENCE", e3[e3.HEXADEMICAL_CHARACTER_REFERENCE_START = 75] = "HEXADEMICAL_CHARACTER_REFERENCE_START", e3[e3.HEXADEMICAL_CHARACTER_REFERENCE = 76] = "HEXADEMICAL_CHARACTER_REFERENCE", e3[e3.DECIMAL_CHARACTER_REFERENCE = 77] = "DECIMAL_CHARACTER_REFERENCE", e3[e3.NUMERIC_CHARACTER_REFERENCE_END = 78] = "NUMERIC_CHARACTER_REFERENCE_END";
  1050. }(P || (P = {}));
  1051. const k = { DATA: P.DATA, RCDATA: P.RCDATA, RAWTEXT: P.RAWTEXT, SCRIPT_DATA: P.SCRIPT_DATA, PLAINTEXT: P.PLAINTEXT, CDATA_SECTION: P.CDATA_SECTION };
  1052. function b(e3) {
  1053. return e3 >= a.DIGIT_0 && e3 <= a.DIGIT_9;
  1054. }
  1055. function B(e3) {
  1056. return e3 >= a.LATIN_CAPITAL_A && e3 <= a.LATIN_CAPITAL_Z;
  1057. }
  1058. function H(e3) {
  1059. return function(e4) {
  1060. return e4 >= a.LATIN_SMALL_A && e4 <= a.LATIN_SMALL_Z;
  1061. }(e3) || B(e3);
  1062. }
  1063. function F(e3) {
  1064. return H(e3) || b(e3);
  1065. }
  1066. function U(e3) {
  1067. return e3 >= a.LATIN_CAPITAL_A && e3 <= a.LATIN_CAPITAL_F;
  1068. }
  1069. function y(e3) {
  1070. return e3 >= a.LATIN_SMALL_A && e3 <= a.LATIN_SMALL_F;
  1071. }
  1072. function G(e3) {
  1073. return e3 + 32;
  1074. }
  1075. function w(e3) {
  1076. return e3 === a.SPACE || e3 === a.LINE_FEED || e3 === a.TABULATION || e3 === a.FORM_FEED;
  1077. }
  1078. function x(e3) {
  1079. return w(e3) || e3 === a.SOLIDUS || e3 === a.GREATER_THAN_SIGN;
  1080. }
  1081. class Y {
  1082. constructor(e3, t2) {
  1083. this.options = e3, this.handler = t2, this.paused = false, this.inLoop = false, this.inForeignNode = false, this.lastStartTagName = "", this.active = false, this.state = P.DATA, this.returnState = P.DATA, this.charRefCode = -1, this.consumedAfterSnapshot = -1, this.currentCharacterToken = null, this.currentToken = null, this.currentAttr = { name: "", value: "" }, this.preprocessor = new _(t2), this.currentLocation = this.getCurrentLocation(-1);
  1084. }
  1085. _err(e3) {
  1086. var t2, s2;
  1087. null === (s2 = (t2 = this.handler).onParseError) || void 0 === s2 || s2.call(t2, this.preprocessor.getError(e3));
  1088. }
  1089. getCurrentLocation(e3) {
  1090. return this.options.sourceCodeLocationInfo ? { startLine: this.preprocessor.line, startCol: this.preprocessor.col - e3, startOffset: this.preprocessor.offset - e3, endLine: -1, endCol: -1, endOffset: -1 } : null;
  1091. }
  1092. _runParsingLoop() {
  1093. if (!this.inLoop) {
  1094. for (this.inLoop = true; this.active && !this.paused; ) {
  1095. this.consumedAfterSnapshot = 0;
  1096. const e3 = this._consume();
  1097. this._ensureHibernation() || this._callState(e3);
  1098. }
  1099. this.inLoop = false;
  1100. }
  1101. }
  1102. pause() {
  1103. this.paused = true;
  1104. }
  1105. resume(e3) {
  1106. if (!this.paused) throw new Error("Parser was already resumed");
  1107. this.paused = false, this.inLoop || (this._runParsingLoop(), this.paused || null == e3 || e3());
  1108. }
  1109. write(e3, t2, s2) {
  1110. this.active = true, this.preprocessor.write(e3, t2), this._runParsingLoop(), this.paused || null == s2 || s2();
  1111. }
  1112. insertHtmlAtCurrentPos(e3) {
  1113. this.active = true, this.preprocessor.insertHtmlAtCurrentPos(e3), this._runParsingLoop();
  1114. }
  1115. _ensureHibernation() {
  1116. return !!this.preprocessor.endOfChunkHit && (this._unconsume(this.consumedAfterSnapshot), this.active = false, true);
  1117. }
  1118. _consume() {
  1119. return this.consumedAfterSnapshot++, this.preprocessor.advance();
  1120. }
  1121. _unconsume(e3) {
  1122. this.consumedAfterSnapshot -= e3, this.preprocessor.retreat(e3);
  1123. }
  1124. _reconsumeInState(e3, t2) {
  1125. this.state = e3, this._callState(t2);
  1126. }
  1127. _advanceBy(e3) {
  1128. this.consumedAfterSnapshot += e3;
  1129. for (let t2 = 0; t2 < e3; t2++) this.preprocessor.advance();
  1130. }
  1131. _consumeSequenceIfMatch(e3, t2) {
  1132. return !!this.preprocessor.startsWith(e3, t2) && (this._advanceBy(e3.length - 1), true);
  1133. }
  1134. _createStartTagToken() {
  1135. this.currentToken = { type: h.START_TAG, tagName: "", tagID: S.UNKNOWN, selfClosing: false, ackSelfClosing: false, attrs: [], location: this.getCurrentLocation(1) };
  1136. }
  1137. _createEndTagToken() {
  1138. this.currentToken = { type: h.END_TAG, tagName: "", tagID: S.UNKNOWN, selfClosing: false, ackSelfClosing: false, attrs: [], location: this.getCurrentLocation(2) };
  1139. }
  1140. _createCommentToken(e3) {
  1141. this.currentToken = { type: h.COMMENT, data: "", location: this.getCurrentLocation(e3) };
  1142. }
  1143. _createDoctypeToken(e3) {
  1144. this.currentToken = { type: h.DOCTYPE, name: e3, forceQuirks: false, publicId: null, systemId: null, location: this.currentLocation };
  1145. }
  1146. _createCharacterToken(e3, t2) {
  1147. this.currentCharacterToken = { type: e3, chars: t2, location: this.currentLocation };
  1148. }
  1149. _createAttr(e3) {
  1150. this.currentAttr = { name: e3, value: "" }, this.currentLocation = this.getCurrentLocation(0);
  1151. }
  1152. _leaveAttrName() {
  1153. var e3, t2;
  1154. const s2 = this.currentToken;
  1155. null === A(s2, this.currentAttr.name) ? (s2.attrs.push(this.currentAttr), s2.location && this.currentLocation && ((null !== (e3 = (t2 = s2.location).attrs) && void 0 !== e3 ? e3 : t2.attrs = /* @__PURE__ */ Object.create(null))[this.currentAttr.name] = this.currentLocation, this._leaveAttrValue())) : this._err(T.duplicateAttribute);
  1156. }
  1157. _leaveAttrValue() {
  1158. this.currentLocation && (this.currentLocation.endLine = this.preprocessor.line, this.currentLocation.endCol = this.preprocessor.col, this.currentLocation.endOffset = this.preprocessor.offset);
  1159. }
  1160. prepareToken(e3) {
  1161. this._emitCurrentCharacterToken(e3.location), this.currentToken = null, e3.location && (e3.location.endLine = this.preprocessor.line, e3.location.endCol = this.preprocessor.col + 1, e3.location.endOffset = this.preprocessor.offset + 1), this.currentLocation = this.getCurrentLocation(-1);
  1162. }
  1163. emitCurrentTagToken() {
  1164. const e3 = this.currentToken;
  1165. this.prepareToken(e3), e3.tagID = O(e3.tagName), e3.type === h.START_TAG ? (this.lastStartTagName = e3.tagName, this.handler.onStartTag(e3)) : (e3.attrs.length > 0 && this._err(T.endTagWithAttributes), e3.selfClosing && this._err(T.endTagWithTrailingSolidus), this.handler.onEndTag(e3)), this.preprocessor.dropParsedChunk();
  1166. }
  1167. emitCurrentComment(e3) {
  1168. this.prepareToken(e3), this.handler.onComment(e3), this.preprocessor.dropParsedChunk();
  1169. }
  1170. emitCurrentDoctype(e3) {
  1171. this.prepareToken(e3), this.handler.onDoctype(e3), this.preprocessor.dropParsedChunk();
  1172. }
  1173. _emitCurrentCharacterToken(e3) {
  1174. if (this.currentCharacterToken) {
  1175. switch (e3 && this.currentCharacterToken.location && (this.currentCharacterToken.location.endLine = e3.startLine, this.currentCharacterToken.location.endCol = e3.startCol, this.currentCharacterToken.location.endOffset = e3.startOffset), this.currentCharacterToken.type) {
  1176. case h.CHARACTER:
  1177. this.handler.onCharacter(this.currentCharacterToken);
  1178. break;
  1179. case h.NULL_CHARACTER:
  1180. this.handler.onNullCharacter(this.currentCharacterToken);
  1181. break;
  1182. case h.WHITESPACE_CHARACTER:
  1183. this.handler.onWhitespaceCharacter(this.currentCharacterToken);
  1184. }
  1185. this.currentCharacterToken = null;
  1186. }
  1187. }
  1188. _emitEOFToken() {
  1189. const e3 = this.getCurrentLocation(0);
  1190. e3 && (e3.endLine = e3.startLine, e3.endCol = e3.startCol, e3.endOffset = e3.startOffset), this._emitCurrentCharacterToken(e3), this.handler.onEof({ type: h.EOF, location: e3 }), this.active = false;
  1191. }
  1192. _appendCharToCurrentCharacterToken(e3, t2) {
  1193. if (this.currentCharacterToken) {
  1194. if (this.currentCharacterToken.type === e3) return void (this.currentCharacterToken.chars += t2);
  1195. this.currentLocation = this.getCurrentLocation(0), this._emitCurrentCharacterToken(this.currentLocation), this.preprocessor.dropParsedChunk();
  1196. }
  1197. this._createCharacterToken(e3, t2);
  1198. }
  1199. _emitCodePoint(e3) {
  1200. const t2 = w(e3) ? h.WHITESPACE_CHARACTER : e3 === a.NULL ? h.NULL_CHARACTER : h.CHARACTER;
  1201. this._appendCharToCurrentCharacterToken(t2, String.fromCodePoint(e3));
  1202. }
  1203. _emitChars(e3) {
  1204. this._appendCharToCurrentCharacterToken(h.CHARACTER, e3);
  1205. }
  1206. _matchNamedCharacterReference(e3) {
  1207. let t2 = null, s2 = 0, r2 = false;
  1208. for (let i2 = 0, o2 = m.htmlDecodeTree[0]; i2 >= 0 && (i2 = m.determineBranch(m.htmlDecodeTree, o2, i2 + 1, e3), !(i2 < 0)); e3 = this._consume()) {
  1209. s2 += 1, o2 = m.htmlDecodeTree[i2];
  1210. const c2 = o2 & m.BinTrieFlags.VALUE_LENGTH;
  1211. if (c2) {
  1212. const o3 = (c2 >> 14) - 1;
  1213. if (e3 !== a.SEMICOLON && this._isCharacterReferenceInAttribute() && ((n2 = this.preprocessor.peek(1)) === a.EQUALS_SIGN || F(n2)) ? (t2 = [a.AMPERSAND], i2 += o3) : (t2 = 0 === o3 ? [m.htmlDecodeTree[i2] & ~m.BinTrieFlags.VALUE_LENGTH] : 1 === o3 ? [m.htmlDecodeTree[++i2]] : [m.htmlDecodeTree[++i2], m.htmlDecodeTree[++i2]], s2 = 0, r2 = e3 !== a.SEMICOLON), 0 === o3) {
  1214. this._consume();
  1215. break;
  1216. }
  1217. }
  1218. }
  1219. var n2;
  1220. return this._unconsume(s2), r2 && !this.preprocessor.endOfChunkHit && this._err(T.missingSemicolonAfterCharacterReference), this._unconsume(1), t2;
  1221. }
  1222. _isCharacterReferenceInAttribute() {
  1223. return this.returnState === P.ATTRIBUTE_VALUE_DOUBLE_QUOTED || this.returnState === P.ATTRIBUTE_VALUE_SINGLE_QUOTED || this.returnState === P.ATTRIBUTE_VALUE_UNQUOTED;
  1224. }
  1225. _flushCodePointConsumedAsCharacterReference(e3) {
  1226. this._isCharacterReferenceInAttribute() ? this.currentAttr.value += String.fromCodePoint(e3) : this._emitCodePoint(e3);
  1227. }
  1228. _callState(e3) {
  1229. switch (this.state) {
  1230. case P.DATA:
  1231. this._stateData(e3);
  1232. break;
  1233. case P.RCDATA:
  1234. this._stateRcdata(e3);
  1235. break;
  1236. case P.RAWTEXT:
  1237. this._stateRawtext(e3);
  1238. break;
  1239. case P.SCRIPT_DATA:
  1240. this._stateScriptData(e3);
  1241. break;
  1242. case P.PLAINTEXT:
  1243. this._statePlaintext(e3);
  1244. break;
  1245. case P.TAG_OPEN:
  1246. this._stateTagOpen(e3);
  1247. break;
  1248. case P.END_TAG_OPEN:
  1249. this._stateEndTagOpen(e3);
  1250. break;
  1251. case P.TAG_NAME:
  1252. this._stateTagName(e3);
  1253. break;
  1254. case P.RCDATA_LESS_THAN_SIGN:
  1255. this._stateRcdataLessThanSign(e3);
  1256. break;
  1257. case P.RCDATA_END_TAG_OPEN:
  1258. this._stateRcdataEndTagOpen(e3);
  1259. break;
  1260. case P.RCDATA_END_TAG_NAME:
  1261. this._stateRcdataEndTagName(e3);
  1262. break;
  1263. case P.RAWTEXT_LESS_THAN_SIGN:
  1264. this._stateRawtextLessThanSign(e3);
  1265. break;
  1266. case P.RAWTEXT_END_TAG_OPEN:
  1267. this._stateRawtextEndTagOpen(e3);
  1268. break;
  1269. case P.RAWTEXT_END_TAG_NAME:
  1270. this._stateRawtextEndTagName(e3);
  1271. break;
  1272. case P.SCRIPT_DATA_LESS_THAN_SIGN:
  1273. this._stateScriptDataLessThanSign(e3);
  1274. break;
  1275. case P.SCRIPT_DATA_END_TAG_OPEN:
  1276. this._stateScriptDataEndTagOpen(e3);
  1277. break;
  1278. case P.SCRIPT_DATA_END_TAG_NAME:
  1279. this._stateScriptDataEndTagName(e3);
  1280. break;
  1281. case P.SCRIPT_DATA_ESCAPE_START:
  1282. this._stateScriptDataEscapeStart(e3);
  1283. break;
  1284. case P.SCRIPT_DATA_ESCAPE_START_DASH:
  1285. this._stateScriptDataEscapeStartDash(e3);
  1286. break;
  1287. case P.SCRIPT_DATA_ESCAPED:
  1288. this._stateScriptDataEscaped(e3);
  1289. break;
  1290. case P.SCRIPT_DATA_ESCAPED_DASH:
  1291. this._stateScriptDataEscapedDash(e3);
  1292. break;
  1293. case P.SCRIPT_DATA_ESCAPED_DASH_DASH:
  1294. this._stateScriptDataEscapedDashDash(e3);
  1295. break;
  1296. case P.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:
  1297. this._stateScriptDataEscapedLessThanSign(e3);
  1298. break;
  1299. case P.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:
  1300. this._stateScriptDataEscapedEndTagOpen(e3);
  1301. break;
  1302. case P.SCRIPT_DATA_ESCAPED_END_TAG_NAME:
  1303. this._stateScriptDataEscapedEndTagName(e3);
  1304. break;
  1305. case P.SCRIPT_DATA_DOUBLE_ESCAPE_START:
  1306. this._stateScriptDataDoubleEscapeStart(e3);
  1307. break;
  1308. case P.SCRIPT_DATA_DOUBLE_ESCAPED:
  1309. this._stateScriptDataDoubleEscaped(e3);
  1310. break;
  1311. case P.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:
  1312. this._stateScriptDataDoubleEscapedDash(e3);
  1313. break;
  1314. case P.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:
  1315. this._stateScriptDataDoubleEscapedDashDash(e3);
  1316. break;
  1317. case P.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:
  1318. this._stateScriptDataDoubleEscapedLessThanSign(e3);
  1319. break;
  1320. case P.SCRIPT_DATA_DOUBLE_ESCAPE_END:
  1321. this._stateScriptDataDoubleEscapeEnd(e3);
  1322. break;
  1323. case P.BEFORE_ATTRIBUTE_NAME:
  1324. this._stateBeforeAttributeName(e3);
  1325. break;
  1326. case P.ATTRIBUTE_NAME:
  1327. this._stateAttributeName(e3);
  1328. break;
  1329. case P.AFTER_ATTRIBUTE_NAME:
  1330. this._stateAfterAttributeName(e3);
  1331. break;
  1332. case P.BEFORE_ATTRIBUTE_VALUE:
  1333. this._stateBeforeAttributeValue(e3);
  1334. break;
  1335. case P.ATTRIBUTE_VALUE_DOUBLE_QUOTED:
  1336. this._stateAttributeValueDoubleQuoted(e3);
  1337. break;
  1338. case P.ATTRIBUTE_VALUE_SINGLE_QUOTED:
  1339. this._stateAttributeValueSingleQuoted(e3);
  1340. break;
  1341. case P.ATTRIBUTE_VALUE_UNQUOTED:
  1342. this._stateAttributeValueUnquoted(e3);
  1343. break;
  1344. case P.AFTER_ATTRIBUTE_VALUE_QUOTED:
  1345. this._stateAfterAttributeValueQuoted(e3);
  1346. break;
  1347. case P.SELF_CLOSING_START_TAG:
  1348. this._stateSelfClosingStartTag(e3);
  1349. break;
  1350. case P.BOGUS_COMMENT:
  1351. this._stateBogusComment(e3);
  1352. break;
  1353. case P.MARKUP_DECLARATION_OPEN:
  1354. this._stateMarkupDeclarationOpen(e3);
  1355. break;
  1356. case P.COMMENT_START:
  1357. this._stateCommentStart(e3);
  1358. break;
  1359. case P.COMMENT_START_DASH:
  1360. this._stateCommentStartDash(e3);
  1361. break;
  1362. case P.COMMENT:
  1363. this._stateComment(e3);
  1364. break;
  1365. case P.COMMENT_LESS_THAN_SIGN:
  1366. this._stateCommentLessThanSign(e3);
  1367. break;
  1368. case P.COMMENT_LESS_THAN_SIGN_BANG:
  1369. this._stateCommentLessThanSignBang(e3);
  1370. break;
  1371. case P.COMMENT_LESS_THAN_SIGN_BANG_DASH:
  1372. this._stateCommentLessThanSignBangDash(e3);
  1373. break;
  1374. case P.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:
  1375. this._stateCommentLessThanSignBangDashDash(e3);
  1376. break;
  1377. case P.COMMENT_END_DASH:
  1378. this._stateCommentEndDash(e3);
  1379. break;
  1380. case P.COMMENT_END:
  1381. this._stateCommentEnd(e3);
  1382. break;
  1383. case P.COMMENT_END_BANG:
  1384. this._stateCommentEndBang(e3);
  1385. break;
  1386. case P.DOCTYPE:
  1387. this._stateDoctype(e3);
  1388. break;
  1389. case P.BEFORE_DOCTYPE_NAME:
  1390. this._stateBeforeDoctypeName(e3);
  1391. break;
  1392. case P.DOCTYPE_NAME:
  1393. this._stateDoctypeName(e3);
  1394. break;
  1395. case P.AFTER_DOCTYPE_NAME:
  1396. this._stateAfterDoctypeName(e3);
  1397. break;
  1398. case P.AFTER_DOCTYPE_PUBLIC_KEYWORD:
  1399. this._stateAfterDoctypePublicKeyword(e3);
  1400. break;
  1401. case P.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:
  1402. this._stateBeforeDoctypePublicIdentifier(e3);
  1403. break;
  1404. case P.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:
  1405. this._stateDoctypePublicIdentifierDoubleQuoted(e3);
  1406. break;
  1407. case P.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:
  1408. this._stateDoctypePublicIdentifierSingleQuoted(e3);
  1409. break;
  1410. case P.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:
  1411. this._stateAfterDoctypePublicIdentifier(e3);
  1412. break;
  1413. case P.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:
  1414. this._stateBetweenDoctypePublicAndSystemIdentifiers(e3);
  1415. break;
  1416. case P.AFTER_DOCTYPE_SYSTEM_KEYWORD:
  1417. this._stateAfterDoctypeSystemKeyword(e3);
  1418. break;
  1419. case P.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:
  1420. this._stateBeforeDoctypeSystemIdentifier(e3);
  1421. break;
  1422. case P.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:
  1423. this._stateDoctypeSystemIdentifierDoubleQuoted(e3);
  1424. break;
  1425. case P.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:
  1426. this._stateDoctypeSystemIdentifierSingleQuoted(e3);
  1427. break;
  1428. case P.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:
  1429. this._stateAfterDoctypeSystemIdentifier(e3);
  1430. break;
  1431. case P.BOGUS_DOCTYPE:
  1432. this._stateBogusDoctype(e3);
  1433. break;
  1434. case P.CDATA_SECTION:
  1435. this._stateCdataSection(e3);
  1436. break;
  1437. case P.CDATA_SECTION_BRACKET:
  1438. this._stateCdataSectionBracket(e3);
  1439. break;
  1440. case P.CDATA_SECTION_END:
  1441. this._stateCdataSectionEnd(e3);
  1442. break;
  1443. case P.CHARACTER_REFERENCE:
  1444. this._stateCharacterReference(e3);
  1445. break;
  1446. case P.NAMED_CHARACTER_REFERENCE:
  1447. this._stateNamedCharacterReference(e3);
  1448. break;
  1449. case P.AMBIGUOUS_AMPERSAND:
  1450. this._stateAmbiguousAmpersand(e3);
  1451. break;
  1452. case P.NUMERIC_CHARACTER_REFERENCE:
  1453. this._stateNumericCharacterReference(e3);
  1454. break;
  1455. case P.HEXADEMICAL_CHARACTER_REFERENCE_START:
  1456. this._stateHexademicalCharacterReferenceStart(e3);
  1457. break;
  1458. case P.HEXADEMICAL_CHARACTER_REFERENCE:
  1459. this._stateHexademicalCharacterReference(e3);
  1460. break;
  1461. case P.DECIMAL_CHARACTER_REFERENCE:
  1462. this._stateDecimalCharacterReference(e3);
  1463. break;
  1464. case P.NUMERIC_CHARACTER_REFERENCE_END:
  1465. this._stateNumericCharacterReferenceEnd(e3);
  1466. break;
  1467. default:
  1468. throw new Error("Unknown state");
  1469. }
  1470. }
  1471. _stateData(e3) {
  1472. switch (e3) {
  1473. case a.LESS_THAN_SIGN:
  1474. this.state = P.TAG_OPEN;
  1475. break;
  1476. case a.AMPERSAND:
  1477. this.returnState = P.DATA, this.state = P.CHARACTER_REFERENCE;
  1478. break;
  1479. case a.NULL:
  1480. this._err(T.unexpectedNullCharacter), this._emitCodePoint(e3);
  1481. break;
  1482. case a.EOF:
  1483. this._emitEOFToken();
  1484. break;
  1485. default:
  1486. this._emitCodePoint(e3);
  1487. }
  1488. }
  1489. _stateRcdata(e3) {
  1490. switch (e3) {
  1491. case a.AMPERSAND:
  1492. this.returnState = P.RCDATA, this.state = P.CHARACTER_REFERENCE;
  1493. break;
  1494. case a.LESS_THAN_SIGN:
  1495. this.state = P.RCDATA_LESS_THAN_SIGN;
  1496. break;
  1497. case a.NULL:
  1498. this._err(T.unexpectedNullCharacter), this._emitChars(s);
  1499. break;
  1500. case a.EOF:
  1501. this._emitEOFToken();
  1502. break;
  1503. default:
  1504. this._emitCodePoint(e3);
  1505. }
  1506. }
  1507. _stateRawtext(e3) {
  1508. switch (e3) {
  1509. case a.LESS_THAN_SIGN:
  1510. this.state = P.RAWTEXT_LESS_THAN_SIGN;
  1511. break;
  1512. case a.NULL:
  1513. this._err(T.unexpectedNullCharacter), this._emitChars(s);
  1514. break;
  1515. case a.EOF:
  1516. this._emitEOFToken();
  1517. break;
  1518. default:
  1519. this._emitCodePoint(e3);
  1520. }
  1521. }
  1522. _stateScriptData(e3) {
  1523. switch (e3) {
  1524. case a.LESS_THAN_SIGN:
  1525. this.state = P.SCRIPT_DATA_LESS_THAN_SIGN;
  1526. break;
  1527. case a.NULL:
  1528. this._err(T.unexpectedNullCharacter), this._emitChars(s);
  1529. break;
  1530. case a.EOF:
  1531. this._emitEOFToken();
  1532. break;
  1533. default:
  1534. this._emitCodePoint(e3);
  1535. }
  1536. }
  1537. _statePlaintext(e3) {
  1538. switch (e3) {
  1539. case a.NULL:
  1540. this._err(T.unexpectedNullCharacter), this._emitChars(s);
  1541. break;
  1542. case a.EOF:
  1543. this._emitEOFToken();
  1544. break;
  1545. default:
  1546. this._emitCodePoint(e3);
  1547. }
  1548. }
  1549. _stateTagOpen(e3) {
  1550. if (H(e3)) this._createStartTagToken(), this.state = P.TAG_NAME, this._stateTagName(e3);
  1551. else switch (e3) {
  1552. case a.EXCLAMATION_MARK:
  1553. this.state = P.MARKUP_DECLARATION_OPEN;
  1554. break;
  1555. case a.SOLIDUS:
  1556. this.state = P.END_TAG_OPEN;
  1557. break;
  1558. case a.QUESTION_MARK:
  1559. this._err(T.unexpectedQuestionMarkInsteadOfTagName), this._createCommentToken(1), this.state = P.BOGUS_COMMENT, this._stateBogusComment(e3);
  1560. break;
  1561. case a.EOF:
  1562. this._err(T.eofBeforeTagName), this._emitChars("<"), this._emitEOFToken();
  1563. break;
  1564. default:
  1565. this._err(T.invalidFirstCharacterOfTagName), this._emitChars("<"), this.state = P.DATA, this._stateData(e3);
  1566. }
  1567. }
  1568. _stateEndTagOpen(e3) {
  1569. if (H(e3)) this._createEndTagToken(), this.state = P.TAG_NAME, this._stateTagName(e3);
  1570. else switch (e3) {
  1571. case a.GREATER_THAN_SIGN:
  1572. this._err(T.missingEndTagName), this.state = P.DATA;
  1573. break;
  1574. case a.EOF:
  1575. this._err(T.eofBeforeTagName), this._emitChars("</"), this._emitEOFToken();
  1576. break;
  1577. default:
  1578. this._err(T.invalidFirstCharacterOfTagName), this._createCommentToken(2), this.state = P.BOGUS_COMMENT, this._stateBogusComment(e3);
  1579. }
  1580. }
  1581. _stateTagName(e3) {
  1582. const t2 = this.currentToken;
  1583. switch (e3) {
  1584. case a.SPACE:
  1585. case a.LINE_FEED:
  1586. case a.TABULATION:
  1587. case a.FORM_FEED:
  1588. this.state = P.BEFORE_ATTRIBUTE_NAME;
  1589. break;
  1590. case a.SOLIDUS:
  1591. this.state = P.SELF_CLOSING_START_TAG;
  1592. break;
  1593. case a.GREATER_THAN_SIGN:
  1594. this.state = P.DATA, this.emitCurrentTagToken();
  1595. break;
  1596. case a.NULL:
  1597. this._err(T.unexpectedNullCharacter), t2.tagName += s;
  1598. break;
  1599. case a.EOF:
  1600. this._err(T.eofInTag), this._emitEOFToken();
  1601. break;
  1602. default:
  1603. t2.tagName += String.fromCodePoint(B(e3) ? G(e3) : e3);
  1604. }
  1605. }
  1606. _stateRcdataLessThanSign(e3) {
  1607. e3 === a.SOLIDUS ? this.state = P.RCDATA_END_TAG_OPEN : (this._emitChars("<"), this.state = P.RCDATA, this._stateRcdata(e3));
  1608. }
  1609. _stateRcdataEndTagOpen(e3) {
  1610. H(e3) ? (this.state = P.RCDATA_END_TAG_NAME, this._stateRcdataEndTagName(e3)) : (this._emitChars("</"), this.state = P.RCDATA, this._stateRcdata(e3));
  1611. }
  1612. handleSpecialEndTag(e3) {
  1613. if (!this.preprocessor.startsWith(this.lastStartTagName, false)) return !this._ensureHibernation();
  1614. switch (this._createEndTagToken(), this.currentToken.tagName = this.lastStartTagName, this.preprocessor.peek(this.lastStartTagName.length)) {
  1615. case a.SPACE:
  1616. case a.LINE_FEED:
  1617. case a.TABULATION:
  1618. case a.FORM_FEED:
  1619. return this._advanceBy(this.lastStartTagName.length), this.state = P.BEFORE_ATTRIBUTE_NAME, false;
  1620. case a.SOLIDUS:
  1621. return this._advanceBy(this.lastStartTagName.length), this.state = P.SELF_CLOSING_START_TAG, false;
  1622. case a.GREATER_THAN_SIGN:
  1623. return this._advanceBy(this.lastStartTagName.length), this.emitCurrentTagToken(), this.state = P.DATA, false;
  1624. default:
  1625. return !this._ensureHibernation();
  1626. }
  1627. }
  1628. _stateRcdataEndTagName(e3) {
  1629. this.handleSpecialEndTag(e3) && (this._emitChars("</"), this.state = P.RCDATA, this._stateRcdata(e3));
  1630. }
  1631. _stateRawtextLessThanSign(e3) {
  1632. e3 === a.SOLIDUS ? this.state = P.RAWTEXT_END_TAG_OPEN : (this._emitChars("<"), this.state = P.RAWTEXT, this._stateRawtext(e3));
  1633. }
  1634. _stateRawtextEndTagOpen(e3) {
  1635. H(e3) ? (this.state = P.RAWTEXT_END_TAG_NAME, this._stateRawtextEndTagName(e3)) : (this._emitChars("</"), this.state = P.RAWTEXT, this._stateRawtext(e3));
  1636. }
  1637. _stateRawtextEndTagName(e3) {
  1638. this.handleSpecialEndTag(e3) && (this._emitChars("</"), this.state = P.RAWTEXT, this._stateRawtext(e3));
  1639. }
  1640. _stateScriptDataLessThanSign(e3) {
  1641. switch (e3) {
  1642. case a.SOLIDUS:
  1643. this.state = P.SCRIPT_DATA_END_TAG_OPEN;
  1644. break;
  1645. case a.EXCLAMATION_MARK:
  1646. this.state = P.SCRIPT_DATA_ESCAPE_START, this._emitChars("<!");
  1647. break;
  1648. default:
  1649. this._emitChars("<"), this.state = P.SCRIPT_DATA, this._stateScriptData(e3);
  1650. }
  1651. }
  1652. _stateScriptDataEndTagOpen(e3) {
  1653. H(e3) ? (this.state = P.SCRIPT_DATA_END_TAG_NAME, this._stateScriptDataEndTagName(e3)) : (this._emitChars("</"), this.state = P.SCRIPT_DATA, this._stateScriptData(e3));
  1654. }
  1655. _stateScriptDataEndTagName(e3) {
  1656. this.handleSpecialEndTag(e3) && (this._emitChars("</"), this.state = P.SCRIPT_DATA, this._stateScriptData(e3));
  1657. }
  1658. _stateScriptDataEscapeStart(e3) {
  1659. e3 === a.HYPHEN_MINUS ? (this.state = P.SCRIPT_DATA_ESCAPE_START_DASH, this._emitChars("-")) : (this.state = P.SCRIPT_DATA, this._stateScriptData(e3));
  1660. }
  1661. _stateScriptDataEscapeStartDash(e3) {
  1662. e3 === a.HYPHEN_MINUS ? (this.state = P.SCRIPT_DATA_ESCAPED_DASH_DASH, this._emitChars("-")) : (this.state = P.SCRIPT_DATA, this._stateScriptData(e3));
  1663. }
  1664. _stateScriptDataEscaped(e3) {
  1665. switch (e3) {
  1666. case a.HYPHEN_MINUS:
  1667. this.state = P.SCRIPT_DATA_ESCAPED_DASH, this._emitChars("-");
  1668. break;
  1669. case a.LESS_THAN_SIGN:
  1670. this.state = P.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;
  1671. break;
  1672. case a.NULL:
  1673. this._err(T.unexpectedNullCharacter), this._emitChars(s);
  1674. break;
  1675. case a.EOF:
  1676. this._err(T.eofInScriptHtmlCommentLikeText), this._emitEOFToken();
  1677. break;
  1678. default:
  1679. this._emitCodePoint(e3);
  1680. }
  1681. }
  1682. _stateScriptDataEscapedDash(e3) {
  1683. switch (e3) {
  1684. case a.HYPHEN_MINUS:
  1685. this.state = P.SCRIPT_DATA_ESCAPED_DASH_DASH, this._emitChars("-");
  1686. break;
  1687. case a.LESS_THAN_SIGN:
  1688. this.state = P.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;
  1689. break;
  1690. case a.NULL:
  1691. this._err(T.unexpectedNullCharacter), this.state = P.SCRIPT_DATA_ESCAPED, this._emitChars(s);
  1692. break;
  1693. case a.EOF:
  1694. this._err(T.eofInScriptHtmlCommentLikeText), this._emitEOFToken();
  1695. break;
  1696. default:
  1697. this.state = P.SCRIPT_DATA_ESCAPED, this._emitCodePoint(e3);
  1698. }
  1699. }
  1700. _stateScriptDataEscapedDashDash(e3) {
  1701. switch (e3) {
  1702. case a.HYPHEN_MINUS:
  1703. this._emitChars("-");
  1704. break;
  1705. case a.LESS_THAN_SIGN:
  1706. this.state = P.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;
  1707. break;
  1708. case a.GREATER_THAN_SIGN:
  1709. this.state = P.SCRIPT_DATA, this._emitChars(">");
  1710. break;
  1711. case a.NULL:
  1712. this._err(T.unexpectedNullCharacter), this.state = P.SCRIPT_DATA_ESCAPED, this._emitChars(s);
  1713. break;
  1714. case a.EOF:
  1715. this._err(T.eofInScriptHtmlCommentLikeText), this._emitEOFToken();
  1716. break;
  1717. default:
  1718. this.state = P.SCRIPT_DATA_ESCAPED, this._emitCodePoint(e3);
  1719. }
  1720. }
  1721. _stateScriptDataEscapedLessThanSign(e3) {
  1722. e3 === a.SOLIDUS ? this.state = P.SCRIPT_DATA_ESCAPED_END_TAG_OPEN : H(e3) ? (this._emitChars("<"), this.state = P.SCRIPT_DATA_DOUBLE_ESCAPE_START, this._stateScriptDataDoubleEscapeStart(e3)) : (this._emitChars("<"), this.state = P.SCRIPT_DATA_ESCAPED, this._stateScriptDataEscaped(e3));
  1723. }
  1724. _stateScriptDataEscapedEndTagOpen(e3) {
  1725. H(e3) ? (this.state = P.SCRIPT_DATA_ESCAPED_END_TAG_NAME, this._stateScriptDataEscapedEndTagName(e3)) : (this._emitChars("</"), this.state = P.SCRIPT_DATA_ESCAPED, this._stateScriptDataEscaped(e3));
  1726. }
  1727. _stateScriptDataEscapedEndTagName(e3) {
  1728. this.handleSpecialEndTag(e3) && (this._emitChars("</"), this.state = P.SCRIPT_DATA_ESCAPED, this._stateScriptDataEscaped(e3));
  1729. }
  1730. _stateScriptDataDoubleEscapeStart(e3) {
  1731. if (this.preprocessor.startsWith(i, false) && x(this.preprocessor.peek(6))) {
  1732. this._emitCodePoint(e3);
  1733. for (let e4 = 0; e4 < 6; e4++) this._emitCodePoint(this._consume());
  1734. this.state = P.SCRIPT_DATA_DOUBLE_ESCAPED;
  1735. } else this._ensureHibernation() || (this.state = P.SCRIPT_DATA_ESCAPED, this._stateScriptDataEscaped(e3));
  1736. }
  1737. _stateScriptDataDoubleEscaped(e3) {
  1738. switch (e3) {
  1739. case a.HYPHEN_MINUS:
  1740. this.state = P.SCRIPT_DATA_DOUBLE_ESCAPED_DASH, this._emitChars("-");
  1741. break;
  1742. case a.LESS_THAN_SIGN:
  1743. this.state = P.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN, this._emitChars("<");
  1744. break;
  1745. case a.NULL:
  1746. this._err(T.unexpectedNullCharacter), this._emitChars(s);
  1747. break;
  1748. case a.EOF:
  1749. this._err(T.eofInScriptHtmlCommentLikeText), this._emitEOFToken();
  1750. break;
  1751. default:
  1752. this._emitCodePoint(e3);
  1753. }
  1754. }
  1755. _stateScriptDataDoubleEscapedDash(e3) {
  1756. switch (e3) {
  1757. case a.HYPHEN_MINUS:
  1758. this.state = P.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH, this._emitChars("-");
  1759. break;
  1760. case a.LESS_THAN_SIGN:
  1761. this.state = P.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN, this._emitChars("<");
  1762. break;
  1763. case a.NULL:
  1764. this._err(T.unexpectedNullCharacter), this.state = P.SCRIPT_DATA_DOUBLE_ESCAPED, this._emitChars(s);
  1765. break;
  1766. case a.EOF:
  1767. this._err(T.eofInScriptHtmlCommentLikeText), this._emitEOFToken();
  1768. break;
  1769. default:
  1770. this.state = P.SCRIPT_DATA_DOUBLE_ESCAPED, this._emitCodePoint(e3);
  1771. }
  1772. }
  1773. _stateScriptDataDoubleEscapedDashDash(e3) {
  1774. switch (e3) {
  1775. case a.HYPHEN_MINUS:
  1776. this._emitChars("-");
  1777. break;
  1778. case a.LESS_THAN_SIGN:
  1779. this.state = P.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN, this._emitChars("<");
  1780. break;
  1781. case a.GREATER_THAN_SIGN:
  1782. this.state = P.SCRIPT_DATA, this._emitChars(">");
  1783. break;
  1784. case a.NULL:
  1785. this._err(T.unexpectedNullCharacter), this.state = P.SCRIPT_DATA_DOUBLE_ESCAPED, this._emitChars(s);
  1786. break;
  1787. case a.EOF:
  1788. this._err(T.eofInScriptHtmlCommentLikeText), this._emitEOFToken();
  1789. break;
  1790. default:
  1791. this.state = P.SCRIPT_DATA_DOUBLE_ESCAPED, this._emitCodePoint(e3);
  1792. }
  1793. }
  1794. _stateScriptDataDoubleEscapedLessThanSign(e3) {
  1795. e3 === a.SOLIDUS ? (this.state = P.SCRIPT_DATA_DOUBLE_ESCAPE_END, this._emitChars("/")) : (this.state = P.SCRIPT_DATA_DOUBLE_ESCAPED, this._stateScriptDataDoubleEscaped(e3));
  1796. }
  1797. _stateScriptDataDoubleEscapeEnd(e3) {
  1798. if (this.preprocessor.startsWith(i, false) && x(this.preprocessor.peek(6))) {
  1799. this._emitCodePoint(e3);
  1800. for (let e4 = 0; e4 < 6; e4++) this._emitCodePoint(this._consume());
  1801. this.state = P.SCRIPT_DATA_ESCAPED;
  1802. } else this._ensureHibernation() || (this.state = P.SCRIPT_DATA_DOUBLE_ESCAPED, this._stateScriptDataDoubleEscaped(e3));
  1803. }
  1804. _stateBeforeAttributeName(e3) {
  1805. switch (e3) {
  1806. case a.SPACE:
  1807. case a.LINE_FEED:
  1808. case a.TABULATION:
  1809. case a.FORM_FEED:
  1810. break;
  1811. case a.SOLIDUS:
  1812. case a.GREATER_THAN_SIGN:
  1813. case a.EOF:
  1814. this.state = P.AFTER_ATTRIBUTE_NAME, this._stateAfterAttributeName(e3);
  1815. break;
  1816. case a.EQUALS_SIGN:
  1817. this._err(T.unexpectedEqualsSignBeforeAttributeName), this._createAttr("="), this.state = P.ATTRIBUTE_NAME;
  1818. break;
  1819. default:
  1820. this._createAttr(""), this.state = P.ATTRIBUTE_NAME, this._stateAttributeName(e3);
  1821. }
  1822. }
  1823. _stateAttributeName(e3) {
  1824. switch (e3) {
  1825. case a.SPACE:
  1826. case a.LINE_FEED:
  1827. case a.TABULATION:
  1828. case a.FORM_FEED:
  1829. case a.SOLIDUS:
  1830. case a.GREATER_THAN_SIGN:
  1831. case a.EOF:
  1832. this._leaveAttrName(), this.state = P.AFTER_ATTRIBUTE_NAME, this._stateAfterAttributeName(e3);
  1833. break;
  1834. case a.EQUALS_SIGN:
  1835. this._leaveAttrName(), this.state = P.BEFORE_ATTRIBUTE_VALUE;
  1836. break;
  1837. case a.QUOTATION_MARK:
  1838. case a.APOSTROPHE:
  1839. case a.LESS_THAN_SIGN:
  1840. this._err(T.unexpectedCharacterInAttributeName), this.currentAttr.name += String.fromCodePoint(e3);
  1841. break;
  1842. case a.NULL:
  1843. this._err(T.unexpectedNullCharacter), this.currentAttr.name += s;
  1844. break;
  1845. default:
  1846. this.currentAttr.name += String.fromCodePoint(B(e3) ? G(e3) : e3);
  1847. }
  1848. }
  1849. _stateAfterAttributeName(e3) {
  1850. switch (e3) {
  1851. case a.SPACE:
  1852. case a.LINE_FEED:
  1853. case a.TABULATION:
  1854. case a.FORM_FEED:
  1855. break;
  1856. case a.SOLIDUS:
  1857. this.state = P.SELF_CLOSING_START_TAG;
  1858. break;
  1859. case a.EQUALS_SIGN:
  1860. this.state = P.BEFORE_ATTRIBUTE_VALUE;
  1861. break;
  1862. case a.GREATER_THAN_SIGN:
  1863. this.state = P.DATA, this.emitCurrentTagToken();
  1864. break;
  1865. case a.EOF:
  1866. this._err(T.eofInTag), this._emitEOFToken();
  1867. break;
  1868. default:
  1869. this._createAttr(""), this.state = P.ATTRIBUTE_NAME, this._stateAttributeName(e3);
  1870. }
  1871. }
  1872. _stateBeforeAttributeValue(e3) {
  1873. switch (e3) {
  1874. case a.SPACE:
  1875. case a.LINE_FEED:
  1876. case a.TABULATION:
  1877. case a.FORM_FEED:
  1878. break;
  1879. case a.QUOTATION_MARK:
  1880. this.state = P.ATTRIBUTE_VALUE_DOUBLE_QUOTED;
  1881. break;
  1882. case a.APOSTROPHE:
  1883. this.state = P.ATTRIBUTE_VALUE_SINGLE_QUOTED;
  1884. break;
  1885. case a.GREATER_THAN_SIGN:
  1886. this._err(T.missingAttributeValue), this.state = P.DATA, this.emitCurrentTagToken();
  1887. break;
  1888. default:
  1889. this.state = P.ATTRIBUTE_VALUE_UNQUOTED, this._stateAttributeValueUnquoted(e3);
  1890. }
  1891. }
  1892. _stateAttributeValueDoubleQuoted(e3) {
  1893. switch (e3) {
  1894. case a.QUOTATION_MARK:
  1895. this.state = P.AFTER_ATTRIBUTE_VALUE_QUOTED;
  1896. break;
  1897. case a.AMPERSAND:
  1898. this.returnState = P.ATTRIBUTE_VALUE_DOUBLE_QUOTED, this.state = P.CHARACTER_REFERENCE;
  1899. break;
  1900. case a.NULL:
  1901. this._err(T.unexpectedNullCharacter), this.currentAttr.value += s;
  1902. break;
  1903. case a.EOF:
  1904. this._err(T.eofInTag), this._emitEOFToken();
  1905. break;
  1906. default:
  1907. this.currentAttr.value += String.fromCodePoint(e3);
  1908. }
  1909. }
  1910. _stateAttributeValueSingleQuoted(e3) {
  1911. switch (e3) {
  1912. case a.APOSTROPHE:
  1913. this.state = P.AFTER_ATTRIBUTE_VALUE_QUOTED;
  1914. break;
  1915. case a.AMPERSAND:
  1916. this.returnState = P.ATTRIBUTE_VALUE_SINGLE_QUOTED, this.state = P.CHARACTER_REFERENCE;
  1917. break;
  1918. case a.NULL:
  1919. this._err(T.unexpectedNullCharacter), this.currentAttr.value += s;
  1920. break;
  1921. case a.EOF:
  1922. this._err(T.eofInTag), this._emitEOFToken();
  1923. break;
  1924. default:
  1925. this.currentAttr.value += String.fromCodePoint(e3);
  1926. }
  1927. }
  1928. _stateAttributeValueUnquoted(e3) {
  1929. switch (e3) {
  1930. case a.SPACE:
  1931. case a.LINE_FEED:
  1932. case a.TABULATION:
  1933. case a.FORM_FEED:
  1934. this._leaveAttrValue(), this.state = P.BEFORE_ATTRIBUTE_NAME;
  1935. break;
  1936. case a.AMPERSAND:
  1937. this.returnState = P.ATTRIBUTE_VALUE_UNQUOTED, this.state = P.CHARACTER_REFERENCE;
  1938. break;
  1939. case a.GREATER_THAN_SIGN:
  1940. this._leaveAttrValue(), this.state = P.DATA, this.emitCurrentTagToken();
  1941. break;
  1942. case a.NULL:
  1943. this._err(T.unexpectedNullCharacter), this.currentAttr.value += s;
  1944. break;
  1945. case a.QUOTATION_MARK:
  1946. case a.APOSTROPHE:
  1947. case a.LESS_THAN_SIGN:
  1948. case a.EQUALS_SIGN:
  1949. case a.GRAVE_ACCENT:
  1950. this._err(T.unexpectedCharacterInUnquotedAttributeValue), this.currentAttr.value += String.fromCodePoint(e3);
  1951. break;
  1952. case a.EOF:
  1953. this._err(T.eofInTag), this._emitEOFToken();
  1954. break;
  1955. default:
  1956. this.currentAttr.value += String.fromCodePoint(e3);
  1957. }
  1958. }
  1959. _stateAfterAttributeValueQuoted(e3) {
  1960. switch (e3) {
  1961. case a.SPACE:
  1962. case a.LINE_FEED:
  1963. case a.TABULATION:
  1964. case a.FORM_FEED:
  1965. this._leaveAttrValue(), this.state = P.BEFORE_ATTRIBUTE_NAME;
  1966. break;
  1967. case a.SOLIDUS:
  1968. this._leaveAttrValue(), this.state = P.SELF_CLOSING_START_TAG;
  1969. break;
  1970. case a.GREATER_THAN_SIGN:
  1971. this._leaveAttrValue(), this.state = P.DATA, this.emitCurrentTagToken();
  1972. break;
  1973. case a.EOF:
  1974. this._err(T.eofInTag), this._emitEOFToken();
  1975. break;
  1976. default:
  1977. this._err(T.missingWhitespaceBetweenAttributes), this.state = P.BEFORE_ATTRIBUTE_NAME, this._stateBeforeAttributeName(e3);
  1978. }
  1979. }
  1980. _stateSelfClosingStartTag(e3) {
  1981. switch (e3) {
  1982. case a.GREATER_THAN_SIGN:
  1983. this.currentToken.selfClosing = true, this.state = P.DATA, this.emitCurrentTagToken();
  1984. break;
  1985. case a.EOF:
  1986. this._err(T.eofInTag), this._emitEOFToken();
  1987. break;
  1988. default:
  1989. this._err(T.unexpectedSolidusInTag), this.state = P.BEFORE_ATTRIBUTE_NAME, this._stateBeforeAttributeName(e3);
  1990. }
  1991. }
  1992. _stateBogusComment(e3) {
  1993. const t2 = this.currentToken;
  1994. switch (e3) {
  1995. case a.GREATER_THAN_SIGN:
  1996. this.state = P.DATA, this.emitCurrentComment(t2);
  1997. break;
  1998. case a.EOF:
  1999. this.emitCurrentComment(t2), this._emitEOFToken();
  2000. break;
  2001. case a.NULL:
  2002. this._err(T.unexpectedNullCharacter), t2.data += s;
  2003. break;
  2004. default:
  2005. t2.data += String.fromCodePoint(e3);
  2006. }
  2007. }
  2008. _stateMarkupDeclarationOpen(e3) {
  2009. this._consumeSequenceIfMatch("--", true) ? (this._createCommentToken(3), this.state = P.COMMENT_START) : this._consumeSequenceIfMatch(n, false) ? (this.currentLocation = this.getCurrentLocation(8), this.state = P.DOCTYPE) : this._consumeSequenceIfMatch(r, true) ? this.inForeignNode ? this.state = P.CDATA_SECTION : (this._err(T.cdataInHtmlContent), this._createCommentToken(8), this.currentToken.data = "[CDATA[", this.state = P.BOGUS_COMMENT) : this._ensureHibernation() || (this._err(T.incorrectlyOpenedComment), this._createCommentToken(2), this.state = P.BOGUS_COMMENT, this._stateBogusComment(e3));
  2010. }
  2011. _stateCommentStart(e3) {
  2012. switch (e3) {
  2013. case a.HYPHEN_MINUS:
  2014. this.state = P.COMMENT_START_DASH;
  2015. break;
  2016. case a.GREATER_THAN_SIGN: {
  2017. this._err(T.abruptClosingOfEmptyComment), this.state = P.DATA;
  2018. const e4 = this.currentToken;
  2019. this.emitCurrentComment(e4);
  2020. break;
  2021. }
  2022. default:
  2023. this.state = P.COMMENT, this._stateComment(e3);
  2024. }
  2025. }
  2026. _stateCommentStartDash(e3) {
  2027. const t2 = this.currentToken;
  2028. switch (e3) {
  2029. case a.HYPHEN_MINUS:
  2030. this.state = P.COMMENT_END;
  2031. break;
  2032. case a.GREATER_THAN_SIGN:
  2033. this._err(T.abruptClosingOfEmptyComment), this.state = P.DATA, this.emitCurrentComment(t2);
  2034. break;
  2035. case a.EOF:
  2036. this._err(T.eofInComment), this.emitCurrentComment(t2), this._emitEOFToken();
  2037. break;
  2038. default:
  2039. t2.data += "-", this.state = P.COMMENT, this._stateComment(e3);
  2040. }
  2041. }
  2042. _stateComment(e3) {
  2043. const t2 = this.currentToken;
  2044. switch (e3) {
  2045. case a.HYPHEN_MINUS:
  2046. this.state = P.COMMENT_END_DASH;
  2047. break;
  2048. case a.LESS_THAN_SIGN:
  2049. t2.data += "<", this.state = P.COMMENT_LESS_THAN_SIGN;
  2050. break;
  2051. case a.NULL:
  2052. this._err(T.unexpectedNullCharacter), t2.data += s;
  2053. break;
  2054. case a.EOF:
  2055. this._err(T.eofInComment), this.emitCurrentComment(t2), this._emitEOFToken();
  2056. break;
  2057. default:
  2058. t2.data += String.fromCodePoint(e3);
  2059. }
  2060. }
  2061. _stateCommentLessThanSign(e3) {
  2062. const t2 = this.currentToken;
  2063. switch (e3) {
  2064. case a.EXCLAMATION_MARK:
  2065. t2.data += "!", this.state = P.COMMENT_LESS_THAN_SIGN_BANG;
  2066. break;
  2067. case a.LESS_THAN_SIGN:
  2068. t2.data += "<";
  2069. break;
  2070. default:
  2071. this.state = P.COMMENT, this._stateComment(e3);
  2072. }
  2073. }
  2074. _stateCommentLessThanSignBang(e3) {
  2075. e3 === a.HYPHEN_MINUS ? this.state = P.COMMENT_LESS_THAN_SIGN_BANG_DASH : (this.state = P.COMMENT, this._stateComment(e3));
  2076. }
  2077. _stateCommentLessThanSignBangDash(e3) {
  2078. e3 === a.HYPHEN_MINUS ? this.state = P.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH : (this.state = P.COMMENT_END_DASH, this._stateCommentEndDash(e3));
  2079. }
  2080. _stateCommentLessThanSignBangDashDash(e3) {
  2081. e3 !== a.GREATER_THAN_SIGN && e3 !== a.EOF && this._err(T.nestedComment), this.state = P.COMMENT_END, this._stateCommentEnd(e3);
  2082. }
  2083. _stateCommentEndDash(e3) {
  2084. const t2 = this.currentToken;
  2085. switch (e3) {
  2086. case a.HYPHEN_MINUS:
  2087. this.state = P.COMMENT_END;
  2088. break;
  2089. case a.EOF:
  2090. this._err(T.eofInComment), this.emitCurrentComment(t2), this._emitEOFToken();
  2091. break;
  2092. default:
  2093. t2.data += "-", this.state = P.COMMENT, this._stateComment(e3);
  2094. }
  2095. }
  2096. _stateCommentEnd(e3) {
  2097. const t2 = this.currentToken;
  2098. switch (e3) {
  2099. case a.GREATER_THAN_SIGN:
  2100. this.state = P.DATA, this.emitCurrentComment(t2);
  2101. break;
  2102. case a.EXCLAMATION_MARK:
  2103. this.state = P.COMMENT_END_BANG;
  2104. break;
  2105. case a.HYPHEN_MINUS:
  2106. t2.data += "-";
  2107. break;
  2108. case a.EOF:
  2109. this._err(T.eofInComment), this.emitCurrentComment(t2), this._emitEOFToken();
  2110. break;
  2111. default:
  2112. t2.data += "--", this.state = P.COMMENT, this._stateComment(e3);
  2113. }
  2114. }
  2115. _stateCommentEndBang(e3) {
  2116. const t2 = this.currentToken;
  2117. switch (e3) {
  2118. case a.HYPHEN_MINUS:
  2119. t2.data += "--!", this.state = P.COMMENT_END_DASH;
  2120. break;
  2121. case a.GREATER_THAN_SIGN:
  2122. this._err(T.incorrectlyClosedComment), this.state = P.DATA, this.emitCurrentComment(t2);
  2123. break;
  2124. case a.EOF:
  2125. this._err(T.eofInComment), this.emitCurrentComment(t2), this._emitEOFToken();
  2126. break;
  2127. default:
  2128. t2.data += "--!", this.state = P.COMMENT, this._stateComment(e3);
  2129. }
  2130. }
  2131. _stateDoctype(e3) {
  2132. switch (e3) {
  2133. case a.SPACE:
  2134. case a.LINE_FEED:
  2135. case a.TABULATION:
  2136. case a.FORM_FEED:
  2137. this.state = P.BEFORE_DOCTYPE_NAME;
  2138. break;
  2139. case a.GREATER_THAN_SIGN:
  2140. this.state = P.BEFORE_DOCTYPE_NAME, this._stateBeforeDoctypeName(e3);
  2141. break;
  2142. case a.EOF: {
  2143. this._err(T.eofInDoctype), this._createDoctypeToken(null);
  2144. const e4 = this.currentToken;
  2145. e4.forceQuirks = true, this.emitCurrentDoctype(e4), this._emitEOFToken();
  2146. break;
  2147. }
  2148. default:
  2149. this._err(T.missingWhitespaceBeforeDoctypeName), this.state = P.BEFORE_DOCTYPE_NAME, this._stateBeforeDoctypeName(e3);
  2150. }
  2151. }
  2152. _stateBeforeDoctypeName(e3) {
  2153. if (B(e3)) this._createDoctypeToken(String.fromCharCode(G(e3))), this.state = P.DOCTYPE_NAME;
  2154. else switch (e3) {
  2155. case a.SPACE:
  2156. case a.LINE_FEED:
  2157. case a.TABULATION:
  2158. case a.FORM_FEED:
  2159. break;
  2160. case a.NULL:
  2161. this._err(T.unexpectedNullCharacter), this._createDoctypeToken(s), this.state = P.DOCTYPE_NAME;
  2162. break;
  2163. case a.GREATER_THAN_SIGN: {
  2164. this._err(T.missingDoctypeName), this._createDoctypeToken(null);
  2165. const e4 = this.currentToken;
  2166. e4.forceQuirks = true, this.emitCurrentDoctype(e4), this.state = P.DATA;
  2167. break;
  2168. }
  2169. case a.EOF: {
  2170. this._err(T.eofInDoctype), this._createDoctypeToken(null);
  2171. const e4 = this.currentToken;
  2172. e4.forceQuirks = true, this.emitCurrentDoctype(e4), this._emitEOFToken();
  2173. break;
  2174. }
  2175. default:
  2176. this._createDoctypeToken(String.fromCodePoint(e3)), this.state = P.DOCTYPE_NAME;
  2177. }
  2178. }
  2179. _stateDoctypeName(e3) {
  2180. const t2 = this.currentToken;
  2181. switch (e3) {
  2182. case a.SPACE:
  2183. case a.LINE_FEED:
  2184. case a.TABULATION:
  2185. case a.FORM_FEED:
  2186. this.state = P.AFTER_DOCTYPE_NAME;
  2187. break;
  2188. case a.GREATER_THAN_SIGN:
  2189. this.state = P.DATA, this.emitCurrentDoctype(t2);
  2190. break;
  2191. case a.NULL:
  2192. this._err(T.unexpectedNullCharacter), t2.name += s;
  2193. break;
  2194. case a.EOF:
  2195. this._err(T.eofInDoctype), t2.forceQuirks = true, this.emitCurrentDoctype(t2), this._emitEOFToken();
  2196. break;
  2197. default:
  2198. t2.name += String.fromCodePoint(B(e3) ? G(e3) : e3);
  2199. }
  2200. }
  2201. _stateAfterDoctypeName(e3) {
  2202. const t2 = this.currentToken;
  2203. switch (e3) {
  2204. case a.SPACE:
  2205. case a.LINE_FEED:
  2206. case a.TABULATION:
  2207. case a.FORM_FEED:
  2208. break;
  2209. case a.GREATER_THAN_SIGN:
  2210. this.state = P.DATA, this.emitCurrentDoctype(t2);
  2211. break;
  2212. case a.EOF:
  2213. this._err(T.eofInDoctype), t2.forceQuirks = true, this.emitCurrentDoctype(t2), this._emitEOFToken();
  2214. break;
  2215. default:
  2216. this._consumeSequenceIfMatch("public", false) ? this.state = P.AFTER_DOCTYPE_PUBLIC_KEYWORD : this._consumeSequenceIfMatch("system", false) ? this.state = P.AFTER_DOCTYPE_SYSTEM_KEYWORD : this._ensureHibernation() || (this._err(T.invalidCharacterSequenceAfterDoctypeName), t2.forceQuirks = true, this.state = P.BOGUS_DOCTYPE, this._stateBogusDoctype(e3));
  2217. }
  2218. }
  2219. _stateAfterDoctypePublicKeyword(e3) {
  2220. const t2 = this.currentToken;
  2221. switch (e3) {
  2222. case a.SPACE:
  2223. case a.LINE_FEED:
  2224. case a.TABULATION:
  2225. case a.FORM_FEED:
  2226. this.state = P.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;
  2227. break;
  2228. case a.QUOTATION_MARK:
  2229. this._err(T.missingWhitespaceAfterDoctypePublicKeyword), t2.publicId = "", this.state = P.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;
  2230. break;
  2231. case a.APOSTROPHE:
  2232. this._err(T.missingWhitespaceAfterDoctypePublicKeyword), t2.publicId = "", this.state = P.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;
  2233. break;
  2234. case a.GREATER_THAN_SIGN:
  2235. this._err(T.missingDoctypePublicIdentifier), t2.forceQuirks = true, this.state = P.DATA, this.emitCurrentDoctype(t2);
  2236. break;
  2237. case a.EOF:
  2238. this._err(T.eofInDoctype), t2.forceQuirks = true, this.emitCurrentDoctype(t2), this._emitEOFToken();
  2239. break;
  2240. default:
  2241. this._err(T.missingQuoteBeforeDoctypePublicIdentifier), t2.forceQuirks = true, this.state = P.BOGUS_DOCTYPE, this._stateBogusDoctype(e3);
  2242. }
  2243. }
  2244. _stateBeforeDoctypePublicIdentifier(e3) {
  2245. const t2 = this.currentToken;
  2246. switch (e3) {
  2247. case a.SPACE:
  2248. case a.LINE_FEED:
  2249. case a.TABULATION:
  2250. case a.FORM_FEED:
  2251. break;
  2252. case a.QUOTATION_MARK:
  2253. t2.publicId = "", this.state = P.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;
  2254. break;
  2255. case a.APOSTROPHE:
  2256. t2.publicId = "", this.state = P.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;
  2257. break;
  2258. case a.GREATER_THAN_SIGN:
  2259. this._err(T.missingDoctypePublicIdentifier), t2.forceQuirks = true, this.state = P.DATA, this.emitCurrentDoctype(t2);
  2260. break;
  2261. case a.EOF:
  2262. this._err(T.eofInDoctype), t2.forceQuirks = true, this.emitCurrentDoctype(t2), this._emitEOFToken();
  2263. break;
  2264. default:
  2265. this._err(T.missingQuoteBeforeDoctypePublicIdentifier), t2.forceQuirks = true, this.state = P.BOGUS_DOCTYPE, this._stateBogusDoctype(e3);
  2266. }
  2267. }
  2268. _stateDoctypePublicIdentifierDoubleQuoted(e3) {
  2269. const t2 = this.currentToken;
  2270. switch (e3) {
  2271. case a.QUOTATION_MARK:
  2272. this.state = P.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;
  2273. break;
  2274. case a.NULL:
  2275. this._err(T.unexpectedNullCharacter), t2.publicId += s;
  2276. break;
  2277. case a.GREATER_THAN_SIGN:
  2278. this._err(T.abruptDoctypePublicIdentifier), t2.forceQuirks = true, this.emitCurrentDoctype(t2), this.state = P.DATA;
  2279. break;
  2280. case a.EOF:
  2281. this._err(T.eofInDoctype), t2.forceQuirks = true, this.emitCurrentDoctype(t2), this._emitEOFToken();
  2282. break;
  2283. default:
  2284. t2.publicId += String.fromCodePoint(e3);
  2285. }
  2286. }
  2287. _stateDoctypePublicIdentifierSingleQuoted(e3) {
  2288. const t2 = this.currentToken;
  2289. switch (e3) {
  2290. case a.APOSTROPHE:
  2291. this.state = P.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;
  2292. break;
  2293. case a.NULL:
  2294. this._err(T.unexpectedNullCharacter), t2.publicId += s;
  2295. break;
  2296. case a.GREATER_THAN_SIGN:
  2297. this._err(T.abruptDoctypePublicIdentifier), t2.forceQuirks = true, this.emitCurrentDoctype(t2), this.state = P.DATA;
  2298. break;
  2299. case a.EOF:
  2300. this._err(T.eofInDoctype), t2.forceQuirks = true, this.emitCurrentDoctype(t2), this._emitEOFToken();
  2301. break;
  2302. default:
  2303. t2.publicId += String.fromCodePoint(e3);
  2304. }
  2305. }
  2306. _stateAfterDoctypePublicIdentifier(e3) {
  2307. const t2 = this.currentToken;
  2308. switch (e3) {
  2309. case a.SPACE:
  2310. case a.LINE_FEED:
  2311. case a.TABULATION:
  2312. case a.FORM_FEED:
  2313. this.state = P.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;
  2314. break;
  2315. case a.GREATER_THAN_SIGN:
  2316. this.state = P.DATA, this.emitCurrentDoctype(t2);
  2317. break;
  2318. case a.QUOTATION_MARK:
  2319. this._err(T.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers), t2.systemId = "", this.state = P.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;
  2320. break;
  2321. case a.APOSTROPHE:
  2322. this._err(T.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers), t2.systemId = "", this.state = P.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;
  2323. break;
  2324. case a.EOF:
  2325. this._err(T.eofInDoctype), t2.forceQuirks = true, this.emitCurrentDoctype(t2), this._emitEOFToken();
  2326. break;
  2327. default:
  2328. this._err(T.missingQuoteBeforeDoctypeSystemIdentifier), t2.forceQuirks = true, this.state = P.BOGUS_DOCTYPE, this._stateBogusDoctype(e3);
  2329. }
  2330. }
  2331. _stateBetweenDoctypePublicAndSystemIdentifiers(e3) {
  2332. const t2 = this.currentToken;
  2333. switch (e3) {
  2334. case a.SPACE:
  2335. case a.LINE_FEED:
  2336. case a.TABULATION:
  2337. case a.FORM_FEED:
  2338. break;
  2339. case a.GREATER_THAN_SIGN:
  2340. this.emitCurrentDoctype(t2), this.state = P.DATA;
  2341. break;
  2342. case a.QUOTATION_MARK:
  2343. t2.systemId = "", this.state = P.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;
  2344. break;
  2345. case a.APOSTROPHE:
  2346. t2.systemId = "", this.state = P.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;
  2347. break;
  2348. case a.EOF:
  2349. this._err(T.eofInDoctype), t2.forceQuirks = true, this.emitCurrentDoctype(t2), this._emitEOFToken();
  2350. break;
  2351. default:
  2352. this._err(T.missingQuoteBeforeDoctypeSystemIdentifier), t2.forceQuirks = true, this.state = P.BOGUS_DOCTYPE, this._stateBogusDoctype(e3);
  2353. }
  2354. }
  2355. _stateAfterDoctypeSystemKeyword(e3) {
  2356. const t2 = this.currentToken;
  2357. switch (e3) {
  2358. case a.SPACE:
  2359. case a.LINE_FEED:
  2360. case a.TABULATION:
  2361. case a.FORM_FEED:
  2362. this.state = P.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;
  2363. break;
  2364. case a.QUOTATION_MARK:
  2365. this._err(T.missingWhitespaceAfterDoctypeSystemKeyword), t2.systemId = "", this.state = P.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;
  2366. break;
  2367. case a.APOSTROPHE:
  2368. this._err(T.missingWhitespaceAfterDoctypeSystemKeyword), t2.systemId = "", this.state = P.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;
  2369. break;
  2370. case a.GREATER_THAN_SIGN:
  2371. this._err(T.missingDoctypeSystemIdentifier), t2.forceQuirks = true, this.state = P.DATA, this.emitCurrentDoctype(t2);
  2372. break;
  2373. case a.EOF:
  2374. this._err(T.eofInDoctype), t2.forceQuirks = true, this.emitCurrentDoctype(t2), this._emitEOFToken();
  2375. break;
  2376. default:
  2377. this._err(T.missingQuoteBeforeDoctypeSystemIdentifier), t2.forceQuirks = true, this.state = P.BOGUS_DOCTYPE, this._stateBogusDoctype(e3);
  2378. }
  2379. }
  2380. _stateBeforeDoctypeSystemIdentifier(e3) {
  2381. const t2 = this.currentToken;
  2382. switch (e3) {
  2383. case a.SPACE:
  2384. case a.LINE_FEED:
  2385. case a.TABULATION:
  2386. case a.FORM_FEED:
  2387. break;
  2388. case a.QUOTATION_MARK:
  2389. t2.systemId = "", this.state = P.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;
  2390. break;
  2391. case a.APOSTROPHE:
  2392. t2.systemId = "", this.state = P.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;
  2393. break;
  2394. case a.GREATER_THAN_SIGN:
  2395. this._err(T.missingDoctypeSystemIdentifier), t2.forceQuirks = true, this.state = P.DATA, this.emitCurrentDoctype(t2);
  2396. break;
  2397. case a.EOF:
  2398. this._err(T.eofInDoctype), t2.forceQuirks = true, this.emitCurrentDoctype(t2), this._emitEOFToken();
  2399. break;
  2400. default:
  2401. this._err(T.missingQuoteBeforeDoctypeSystemIdentifier), t2.forceQuirks = true, this.state = P.BOGUS_DOCTYPE, this._stateBogusDoctype(e3);
  2402. }
  2403. }
  2404. _stateDoctypeSystemIdentifierDoubleQuoted(e3) {
  2405. const t2 = this.currentToken;
  2406. switch (e3) {
  2407. case a.QUOTATION_MARK:
  2408. this.state = P.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;
  2409. break;
  2410. case a.NULL:
  2411. this._err(T.unexpectedNullCharacter), t2.systemId += s;
  2412. break;
  2413. case a.GREATER_THAN_SIGN:
  2414. this._err(T.abruptDoctypeSystemIdentifier), t2.forceQuirks = true, this.emitCurrentDoctype(t2), this.state = P.DATA;
  2415. break;
  2416. case a.EOF:
  2417. this._err(T.eofInDoctype), t2.forceQuirks = true, this.emitCurrentDoctype(t2), this._emitEOFToken();
  2418. break;
  2419. default:
  2420. t2.systemId += String.fromCodePoint(e3);
  2421. }
  2422. }
  2423. _stateDoctypeSystemIdentifierSingleQuoted(e3) {
  2424. const t2 = this.currentToken;
  2425. switch (e3) {
  2426. case a.APOSTROPHE:
  2427. this.state = P.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;
  2428. break;
  2429. case a.NULL:
  2430. this._err(T.unexpectedNullCharacter), t2.systemId += s;
  2431. break;
  2432. case a.GREATER_THAN_SIGN:
  2433. this._err(T.abruptDoctypeSystemIdentifier), t2.forceQuirks = true, this.emitCurrentDoctype(t2), this.state = P.DATA;
  2434. break;
  2435. case a.EOF:
  2436. this._err(T.eofInDoctype), t2.forceQuirks = true, this.emitCurrentDoctype(t2), this._emitEOFToken();
  2437. break;
  2438. default:
  2439. t2.systemId += String.fromCodePoint(e3);
  2440. }
  2441. }
  2442. _stateAfterDoctypeSystemIdentifier(e3) {
  2443. const t2 = this.currentToken;
  2444. switch (e3) {
  2445. case a.SPACE:
  2446. case a.LINE_FEED:
  2447. case a.TABULATION:
  2448. case a.FORM_FEED:
  2449. break;
  2450. case a.GREATER_THAN_SIGN:
  2451. this.emitCurrentDoctype(t2), this.state = P.DATA;
  2452. break;
  2453. case a.EOF:
  2454. this._err(T.eofInDoctype), t2.forceQuirks = true, this.emitCurrentDoctype(t2), this._emitEOFToken();
  2455. break;
  2456. default:
  2457. this._err(T.unexpectedCharacterAfterDoctypeSystemIdentifier), this.state = P.BOGUS_DOCTYPE, this._stateBogusDoctype(e3);
  2458. }
  2459. }
  2460. _stateBogusDoctype(e3) {
  2461. const t2 = this.currentToken;
  2462. switch (e3) {
  2463. case a.GREATER_THAN_SIGN:
  2464. this.emitCurrentDoctype(t2), this.state = P.DATA;
  2465. break;
  2466. case a.NULL:
  2467. this._err(T.unexpectedNullCharacter);
  2468. break;
  2469. case a.EOF:
  2470. this.emitCurrentDoctype(t2), this._emitEOFToken();
  2471. }
  2472. }
  2473. _stateCdataSection(e3) {
  2474. switch (e3) {
  2475. case a.RIGHT_SQUARE_BRACKET:
  2476. this.state = P.CDATA_SECTION_BRACKET;
  2477. break;
  2478. case a.EOF:
  2479. this._err(T.eofInCdata), this._emitEOFToken();
  2480. break;
  2481. default:
  2482. this._emitCodePoint(e3);
  2483. }
  2484. }
  2485. _stateCdataSectionBracket(e3) {
  2486. e3 === a.RIGHT_SQUARE_BRACKET ? this.state = P.CDATA_SECTION_END : (this._emitChars("]"), this.state = P.CDATA_SECTION, this._stateCdataSection(e3));
  2487. }
  2488. _stateCdataSectionEnd(e3) {
  2489. switch (e3) {
  2490. case a.GREATER_THAN_SIGN:
  2491. this.state = P.DATA;
  2492. break;
  2493. case a.RIGHT_SQUARE_BRACKET:
  2494. this._emitChars("]");
  2495. break;
  2496. default:
  2497. this._emitChars("]]"), this.state = P.CDATA_SECTION, this._stateCdataSection(e3);
  2498. }
  2499. }
  2500. _stateCharacterReference(e3) {
  2501. e3 === a.NUMBER_SIGN ? this.state = P.NUMERIC_CHARACTER_REFERENCE : F(e3) ? (this.state = P.NAMED_CHARACTER_REFERENCE, this._stateNamedCharacterReference(e3)) : (this._flushCodePointConsumedAsCharacterReference(a.AMPERSAND), this._reconsumeInState(this.returnState, e3));
  2502. }
  2503. _stateNamedCharacterReference(e3) {
  2504. const t2 = this._matchNamedCharacterReference(e3);
  2505. if (this._ensureHibernation()) ;
  2506. else if (t2) {
  2507. for (let e4 = 0; e4 < t2.length; e4++) this._flushCodePointConsumedAsCharacterReference(t2[e4]);
  2508. this.state = this.returnState;
  2509. } else this._flushCodePointConsumedAsCharacterReference(a.AMPERSAND), this.state = P.AMBIGUOUS_AMPERSAND;
  2510. }
  2511. _stateAmbiguousAmpersand(e3) {
  2512. F(e3) ? this._flushCodePointConsumedAsCharacterReference(e3) : (e3 === a.SEMICOLON && this._err(T.unknownNamedCharacterReference), this._reconsumeInState(this.returnState, e3));
  2513. }
  2514. _stateNumericCharacterReference(e3) {
  2515. this.charRefCode = 0, e3 === a.LATIN_SMALL_X || e3 === a.LATIN_CAPITAL_X ? this.state = P.HEXADEMICAL_CHARACTER_REFERENCE_START : b(e3) ? (this.state = P.DECIMAL_CHARACTER_REFERENCE, this._stateDecimalCharacterReference(e3)) : (this._err(T.absenceOfDigitsInNumericCharacterReference), this._flushCodePointConsumedAsCharacterReference(a.AMPERSAND), this._flushCodePointConsumedAsCharacterReference(a.NUMBER_SIGN), this._reconsumeInState(this.returnState, e3));
  2516. }
  2517. _stateHexademicalCharacterReferenceStart(e3) {
  2518. !function(e4) {
  2519. return b(e4) || U(e4) || y(e4);
  2520. }(e3) ? (this._err(T.absenceOfDigitsInNumericCharacterReference), this._flushCodePointConsumedAsCharacterReference(a.AMPERSAND), this._flushCodePointConsumedAsCharacterReference(a.NUMBER_SIGN), this._unconsume(2), this.state = this.returnState) : (this.state = P.HEXADEMICAL_CHARACTER_REFERENCE, this._stateHexademicalCharacterReference(e3));
  2521. }
  2522. _stateHexademicalCharacterReference(e3) {
  2523. U(e3) ? this.charRefCode = 16 * this.charRefCode + e3 - 55 : y(e3) ? this.charRefCode = 16 * this.charRefCode + e3 - 87 : b(e3) ? this.charRefCode = 16 * this.charRefCode + e3 - 48 : e3 === a.SEMICOLON ? this.state = P.NUMERIC_CHARACTER_REFERENCE_END : (this._err(T.missingSemicolonAfterCharacterReference), this.state = P.NUMERIC_CHARACTER_REFERENCE_END, this._stateNumericCharacterReferenceEnd(e3));
  2524. }
  2525. _stateDecimalCharacterReference(e3) {
  2526. b(e3) ? this.charRefCode = 10 * this.charRefCode + e3 - 48 : e3 === a.SEMICOLON ? this.state = P.NUMERIC_CHARACTER_REFERENCE_END : (this._err(T.missingSemicolonAfterCharacterReference), this.state = P.NUMERIC_CHARACTER_REFERENCE_END, this._stateNumericCharacterReferenceEnd(e3));
  2527. }
  2528. _stateNumericCharacterReferenceEnd(e3) {
  2529. if (this.charRefCode === a.NULL) this._err(T.nullCharacterReference), this.charRefCode = a.REPLACEMENT_CHARACTER;
  2530. else if (this.charRefCode > 1114111) this._err(T.characterReferenceOutsideUnicodeRange), this.charRefCode = a.REPLACEMENT_CHARACTER;
  2531. else if (o(this.charRefCode)) this._err(T.surrogateCharacterReference), this.charRefCode = a.REPLACEMENT_CHARACTER;
  2532. else if (E(this.charRefCode)) this._err(T.noncharacterCharacterReference);
  2533. else if (c(this.charRefCode) || this.charRefCode === a.CARRIAGE_RETURN) {
  2534. this._err(T.controlCharacterReference);
  2535. const e4 = g.get(this.charRefCode);
  2536. void 0 !== e4 && (this.charRefCode = e4);
  2537. }
  2538. this._flushCodePointConsumedAsCharacterReference(this.charRefCode), this._reconsumeInState(this.returnState, e3);
  2539. }
  2540. }
  2541. const v = /* @__PURE__ */ new Set([S.DD, S.DT, S.LI, S.OPTGROUP, S.OPTION, S.P, S.RB, S.RP, S.RT, S.RTC]), Q = /* @__PURE__ */ new Set([...v, S.CAPTION, S.COLGROUP, S.TBODY, S.TD, S.TFOOT, S.TH, S.THEAD, S.TR]), q = /* @__PURE__ */ new Map([[S.APPLET, u.HTML], [S.CAPTION, u.HTML], [S.HTML, u.HTML], [S.MARQUEE, u.HTML], [S.OBJECT, u.HTML], [S.TABLE, u.HTML], [S.TD, u.HTML], [S.TEMPLATE, u.HTML], [S.TH, u.HTML], [S.ANNOTATION_XML, u.MATHML], [S.MI, u.MATHML], [S.MN, u.MATHML], [S.MO, u.MATHML], [S.MS, u.MATHML], [S.MTEXT, u.MATHML], [S.DESC, u.SVG], [S.FOREIGN_OBJECT, u.SVG], [S.TITLE, u.SVG]]), W = [S.H1, S.H2, S.H3, S.H4, S.H5, S.H6], X = [S.TR, S.TEMPLATE, S.HTML], K = [S.TBODY, S.TFOOT, S.THEAD, S.TEMPLATE, S.HTML], V = [S.TABLE, S.TEMPLATE, S.HTML], z = [S.TD, S.TH];
  2542. class j {
  2543. get currentTmplContentOrNode() {
  2544. return this._isInTemplate() ? this.treeAdapter.getTemplateContent(this.current) : this.current;
  2545. }
  2546. constructor(e3, t2, s2) {
  2547. this.treeAdapter = t2, this.handler = s2, this.items = [], this.tagIDs = [], this.stackTop = -1, this.tmplCount = 0, this.currentTagId = S.UNKNOWN, this.current = e3;
  2548. }
  2549. _indexOf(e3) {
  2550. return this.items.lastIndexOf(e3, this.stackTop);
  2551. }
  2552. _isInTemplate() {
  2553. return this.currentTagId === S.TEMPLATE && this.treeAdapter.getNamespaceURI(this.current) === u.HTML;
  2554. }
  2555. _updateCurrentElement() {
  2556. this.current = this.items[this.stackTop], this.currentTagId = this.tagIDs[this.stackTop];
  2557. }
  2558. push(e3, t2) {
  2559. this.stackTop++, this.items[this.stackTop] = e3, this.current = e3, this.tagIDs[this.stackTop] = t2, this.currentTagId = t2, this._isInTemplate() && this.tmplCount++, this.handler.onItemPush(e3, t2, true);
  2560. }
  2561. pop() {
  2562. const e3 = this.current;
  2563. this.tmplCount > 0 && this._isInTemplate() && this.tmplCount--, this.stackTop--, this._updateCurrentElement(), this.handler.onItemPop(e3, true);
  2564. }
  2565. replace(e3, t2) {
  2566. const s2 = this._indexOf(e3);
  2567. this.items[s2] = t2, s2 === this.stackTop && (this.current = t2);
  2568. }
  2569. insertAfter(e3, t2, s2) {
  2570. const a2 = this._indexOf(e3) + 1;
  2571. this.items.splice(a2, 0, t2), this.tagIDs.splice(a2, 0, s2), this.stackTop++, a2 === this.stackTop && this._updateCurrentElement(), this.handler.onItemPush(this.current, this.currentTagId, a2 === this.stackTop);
  2572. }
  2573. popUntilTagNamePopped(e3) {
  2574. let t2 = this.stackTop + 1;
  2575. do {
  2576. t2 = this.tagIDs.lastIndexOf(e3, t2 - 1);
  2577. } while (t2 > 0 && this.treeAdapter.getNamespaceURI(this.items[t2]) !== u.HTML);
  2578. this.shortenToLength(t2 < 0 ? 0 : t2);
  2579. }
  2580. shortenToLength(e3) {
  2581. for (; this.stackTop >= e3; ) {
  2582. const t2 = this.current;
  2583. this.tmplCount > 0 && this._isInTemplate() && (this.tmplCount -= 1), this.stackTop--, this._updateCurrentElement(), this.handler.onItemPop(t2, this.stackTop < e3);
  2584. }
  2585. }
  2586. popUntilElementPopped(e3) {
  2587. const t2 = this._indexOf(e3);
  2588. this.shortenToLength(t2 < 0 ? 0 : t2);
  2589. }
  2590. popUntilPopped(e3, t2) {
  2591. const s2 = this._indexOfTagNames(e3, t2);
  2592. this.shortenToLength(s2 < 0 ? 0 : s2);
  2593. }
  2594. popUntilNumberedHeaderPopped() {
  2595. this.popUntilPopped(W, u.HTML);
  2596. }
  2597. popUntilTableCellPopped() {
  2598. this.popUntilPopped(z, u.HTML);
  2599. }
  2600. popAllUpToHtmlElement() {
  2601. this.tmplCount = 0, this.shortenToLength(1);
  2602. }
  2603. _indexOfTagNames(e3, t2) {
  2604. for (let s2 = this.stackTop; s2 >= 0; s2--) if (e3.includes(this.tagIDs[s2]) && this.treeAdapter.getNamespaceURI(this.items[s2]) === t2) return s2;
  2605. return -1;
  2606. }
  2607. clearBackTo(e3, t2) {
  2608. const s2 = this._indexOfTagNames(e3, t2);
  2609. this.shortenToLength(s2 + 1);
  2610. }
  2611. clearBackToTableContext() {
  2612. this.clearBackTo(V, u.HTML);
  2613. }
  2614. clearBackToTableBodyContext() {
  2615. this.clearBackTo(K, u.HTML);
  2616. }
  2617. clearBackToTableRowContext() {
  2618. this.clearBackTo(X, u.HTML);
  2619. }
  2620. remove(e3) {
  2621. const t2 = this._indexOf(e3);
  2622. t2 >= 0 && (t2 === this.stackTop ? this.pop() : (this.items.splice(t2, 1), this.tagIDs.splice(t2, 1), this.stackTop--, this._updateCurrentElement(), this.handler.onItemPop(e3, false)));
  2623. }
  2624. tryPeekProperlyNestedBodyElement() {
  2625. return this.stackTop >= 1 && this.tagIDs[1] === S.BODY ? this.items[1] : null;
  2626. }
  2627. contains(e3) {
  2628. return this._indexOf(e3) > -1;
  2629. }
  2630. getCommonAncestor(e3) {
  2631. const t2 = this._indexOf(e3) - 1;
  2632. return t2 >= 0 ? this.items[t2] : null;
  2633. }
  2634. isRootHtmlElementCurrent() {
  2635. return 0 === this.stackTop && this.tagIDs[0] === S.HTML;
  2636. }
  2637. hasInScope(e3) {
  2638. for (let t2 = this.stackTop; t2 >= 0; t2--) {
  2639. const s2 = this.tagIDs[t2], a2 = this.treeAdapter.getNamespaceURI(this.items[t2]);
  2640. if (s2 === e3 && a2 === u.HTML) return true;
  2641. if (q.get(s2) === a2) return false;
  2642. }
  2643. return true;
  2644. }
  2645. hasNumberedHeaderInScope() {
  2646. for (let e3 = this.stackTop; e3 >= 0; e3--) {
  2647. const t2 = this.tagIDs[e3], s2 = this.treeAdapter.getNamespaceURI(this.items[e3]);
  2648. if (M(t2) && s2 === u.HTML) return true;
  2649. if (q.get(t2) === s2) return false;
  2650. }
  2651. return true;
  2652. }
  2653. hasInListItemScope(e3) {
  2654. for (let t2 = this.stackTop; t2 >= 0; t2--) {
  2655. const s2 = this.tagIDs[t2], a2 = this.treeAdapter.getNamespaceURI(this.items[t2]);
  2656. if (s2 === e3 && a2 === u.HTML) return true;
  2657. if ((s2 === S.UL || s2 === S.OL) && a2 === u.HTML || q.get(s2) === a2) return false;
  2658. }
  2659. return true;
  2660. }
  2661. hasInButtonScope(e3) {
  2662. for (let t2 = this.stackTop; t2 >= 0; t2--) {
  2663. const s2 = this.tagIDs[t2], a2 = this.treeAdapter.getNamespaceURI(this.items[t2]);
  2664. if (s2 === e3 && a2 === u.HTML) return true;
  2665. if (s2 === S.BUTTON && a2 === u.HTML || q.get(s2) === a2) return false;
  2666. }
  2667. return true;
  2668. }
  2669. hasInTableScope(e3) {
  2670. for (let t2 = this.stackTop; t2 >= 0; t2--) {
  2671. const s2 = this.tagIDs[t2];
  2672. if (this.treeAdapter.getNamespaceURI(this.items[t2]) === u.HTML) {
  2673. if (s2 === e3) return true;
  2674. if (s2 === S.TABLE || s2 === S.TEMPLATE || s2 === S.HTML) return false;
  2675. }
  2676. }
  2677. return true;
  2678. }
  2679. hasTableBodyContextInTableScope() {
  2680. for (let e3 = this.stackTop; e3 >= 0; e3--) {
  2681. const t2 = this.tagIDs[e3];
  2682. if (this.treeAdapter.getNamespaceURI(this.items[e3]) === u.HTML) {
  2683. if (t2 === S.TBODY || t2 === S.THEAD || t2 === S.TFOOT) return true;
  2684. if (t2 === S.TABLE || t2 === S.HTML) return false;
  2685. }
  2686. }
  2687. return true;
  2688. }
  2689. hasInSelectScope(e3) {
  2690. for (let t2 = this.stackTop; t2 >= 0; t2--) {
  2691. const s2 = this.tagIDs[t2];
  2692. if (this.treeAdapter.getNamespaceURI(this.items[t2]) === u.HTML) {
  2693. if (s2 === e3) return true;
  2694. if (s2 !== S.OPTION && s2 !== S.OPTGROUP) return false;
  2695. }
  2696. }
  2697. return true;
  2698. }
  2699. generateImpliedEndTags() {
  2700. for (; v.has(this.currentTagId); ) this.pop();
  2701. }
  2702. generateImpliedEndTagsThoroughly() {
  2703. for (; Q.has(this.currentTagId); ) this.pop();
  2704. }
  2705. generateImpliedEndTagsWithExclusion(e3) {
  2706. for (; this.currentTagId !== e3 && Q.has(this.currentTagId); ) this.pop();
  2707. }
  2708. }
  2709. var J;
  2710. !function(e3) {
  2711. e3[e3.Marker = 0] = "Marker", e3[e3.Element = 1] = "Element";
  2712. }(J = J || (J = {}));
  2713. const Z = { type: J.Marker };
  2714. class $ {
  2715. constructor(e3) {
  2716. this.treeAdapter = e3, this.entries = [], this.bookmark = null;
  2717. }
  2718. _getNoahArkConditionCandidates(e3, t2) {
  2719. const s2 = [], a2 = t2.length, r2 = this.treeAdapter.getTagName(e3), n2 = this.treeAdapter.getNamespaceURI(e3);
  2720. for (let e4 = 0; e4 < this.entries.length; e4++) {
  2721. const t3 = this.entries[e4];
  2722. if (t3.type === J.Marker) break;
  2723. const { element: i2 } = t3;
  2724. if (this.treeAdapter.getTagName(i2) === r2 && this.treeAdapter.getNamespaceURI(i2) === n2) {
  2725. const t4 = this.treeAdapter.getAttrList(i2);
  2726. t4.length === a2 && s2.push({ idx: e4, attrs: t4 });
  2727. }
  2728. }
  2729. return s2;
  2730. }
  2731. _ensureNoahArkCondition(e3) {
  2732. if (this.entries.length < 3) return;
  2733. const t2 = this.treeAdapter.getAttrList(e3), s2 = this._getNoahArkConditionCandidates(e3, t2);
  2734. if (s2.length < 3) return;
  2735. const a2 = new Map(t2.map((e4) => [e4.name, e4.value]));
  2736. let r2 = 0;
  2737. for (let e4 = 0; e4 < s2.length; e4++) {
  2738. const t3 = s2[e4];
  2739. t3.attrs.every((e5) => a2.get(e5.name) === e5.value) && (r2 += 1, r2 >= 3 && this.entries.splice(t3.idx, 1));
  2740. }
  2741. }
  2742. insertMarker() {
  2743. this.entries.unshift(Z);
  2744. }
  2745. pushElement(e3, t2) {
  2746. this._ensureNoahArkCondition(e3), this.entries.unshift({ type: J.Element, element: e3, token: t2 });
  2747. }
  2748. insertElementAfterBookmark(e3, t2) {
  2749. const s2 = this.entries.indexOf(this.bookmark);
  2750. this.entries.splice(s2, 0, { type: J.Element, element: e3, token: t2 });
  2751. }
  2752. removeEntry(e3) {
  2753. const t2 = this.entries.indexOf(e3);
  2754. t2 >= 0 && this.entries.splice(t2, 1);
  2755. }
  2756. clearToLastMarker() {
  2757. const e3 = this.entries.indexOf(Z);
  2758. e3 >= 0 ? this.entries.splice(0, e3 + 1) : this.entries.length = 0;
  2759. }
  2760. getElementEntryInScopeWithTagName(e3) {
  2761. const t2 = this.entries.find((t3) => t3.type === J.Marker || this.treeAdapter.getTagName(t3.element) === e3);
  2762. return t2 && t2.type === J.Element ? t2 : null;
  2763. }
  2764. getElementEntry(e3) {
  2765. return this.entries.find((t2) => t2.type === J.Element && t2.element === e3);
  2766. }
  2767. }
  2768. function ee(e3) {
  2769. return { nodeName: "#text", value: e3, parentNode: null };
  2770. }
  2771. const te = { createDocument: () => ({ nodeName: "#document", mode: I.NO_QUIRKS, childNodes: [] }), createDocumentFragment: () => ({ nodeName: "#document-fragment", childNodes: [] }), createElement: (e3, t2, s2) => ({ nodeName: e3, tagName: e3, attrs: s2, namespaceURI: t2, childNodes: [], parentNode: null }), createCommentNode: (e3) => ({ nodeName: "#comment", data: e3, parentNode: null }), appendChild(e3, t2) {
  2772. e3.childNodes.push(t2), t2.parentNode = e3;
  2773. }, insertBefore(e3, t2, s2) {
  2774. const a2 = e3.childNodes.indexOf(s2);
  2775. e3.childNodes.splice(a2, 0, t2), t2.parentNode = e3;
  2776. }, setTemplateContent(e3, t2) {
  2777. e3.content = t2;
  2778. }, getTemplateContent: (e3) => e3.content, setDocumentType(e3, t2, s2, a2) {
  2779. const r2 = e3.childNodes.find((e4) => "#documentType" === e4.nodeName);
  2780. if (r2) r2.name = t2, r2.publicId = s2, r2.systemId = a2;
  2781. else {
  2782. const r3 = { nodeName: "#documentType", name: t2, publicId: s2, systemId: a2, parentNode: null };
  2783. te.appendChild(e3, r3);
  2784. }
  2785. }, setDocumentMode(e3, t2) {
  2786. e3.mode = t2;
  2787. }, getDocumentMode: (e3) => e3.mode, detachNode(e3) {
  2788. if (e3.parentNode) {
  2789. const t2 = e3.parentNode.childNodes.indexOf(e3);
  2790. e3.parentNode.childNodes.splice(t2, 1), e3.parentNode = null;
  2791. }
  2792. }, insertText(e3, t2) {
  2793. if (e3.childNodes.length > 0) {
  2794. const s2 = e3.childNodes[e3.childNodes.length - 1];
  2795. if (te.isTextNode(s2)) return void (s2.value += t2);
  2796. }
  2797. te.appendChild(e3, ee(t2));
  2798. }, insertTextBefore(e3, t2, s2) {
  2799. const a2 = e3.childNodes[e3.childNodes.indexOf(s2) - 1];
  2800. a2 && te.isTextNode(a2) ? a2.value += t2 : te.insertBefore(e3, ee(t2), s2);
  2801. }, adoptAttributes(e3, t2) {
  2802. const s2 = new Set(e3.attrs.map((e4) => e4.name));
  2803. for (let a2 = 0; a2 < t2.length; a2++) s2.has(t2[a2].name) || e3.attrs.push(t2[a2]);
  2804. }, getFirstChild: (e3) => e3.childNodes[0], getChildNodes: (e3) => e3.childNodes, getParentNode: (e3) => e3.parentNode, getAttrList: (e3) => e3.attrs, getTagName: (e3) => e3.tagName, getNamespaceURI: (e3) => e3.namespaceURI, getTextNodeContent: (e3) => e3.value, getCommentNodeContent: (e3) => e3.data, getDocumentTypeNodeName: (e3) => e3.name, getDocumentTypeNodePublicId: (e3) => e3.publicId, getDocumentTypeNodeSystemId: (e3) => e3.systemId, isTextNode: (e3) => "#text" === e3.nodeName, isCommentNode: (e3) => "#comment" === e3.nodeName, isDocumentTypeNode: (e3) => "#documentType" === e3.nodeName, isElementNode: (e3) => Object.prototype.hasOwnProperty.call(e3, "tagName"), setNodeSourceCodeLocation(e3, t2) {
  2805. e3.sourceCodeLocation = t2;
  2806. }, getNodeSourceCodeLocation: (e3) => e3.sourceCodeLocation, updateNodeSourceCodeLocation(e3, t2) {
  2807. e3.sourceCodeLocation = { ...e3.sourceCodeLocation, ...t2 };
  2808. } }, se = "html", ae = ["+//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//"], re = [...ae, "-//w3c//dtd html 4.01 frameset//", "-//w3c//dtd html 4.01 transitional//"], ne = /* @__PURE__ */ new Set(["-//w3o//dtd w3 html strict 3.0//en//", "-/w3c/dtd html 4.0 transitional/en", "html"]), ie = ["-//w3c//dtd xhtml 1.0 frameset//", "-//w3c//dtd xhtml 1.0 transitional//"], oe = [...ie, "-//w3c//dtd html 4.01 frameset//", "-//w3c//dtd html 4.01 transitional//"];
  2809. function ce(e3, t2) {
  2810. return t2.some((t3) => e3.startsWith(t3));
  2811. }
  2812. const Ee = "text/html", Te = "application/xhtml+xml", he = "definitionurl", _e = "definitionURL", Ae = 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((e3) => [e3.toLowerCase(), e3])), le = /* @__PURE__ */ new Map([["xlink:actuate", { prefix: "xlink", name: "actuate", namespace: u.XLINK }], ["xlink:arcrole", { prefix: "xlink", name: "arcrole", namespace: u.XLINK }], ["xlink:href", { prefix: "xlink", name: "href", namespace: u.XLINK }], ["xlink:role", { prefix: "xlink", name: "role", namespace: u.XLINK }], ["xlink:show", { prefix: "xlink", name: "show", namespace: u.XLINK }], ["xlink:title", { prefix: "xlink", name: "title", namespace: u.XLINK }], ["xlink:type", { prefix: "xlink", name: "type", namespace: u.XLINK }], ["xml:base", { prefix: "xml", name: "base", namespace: u.XML }], ["xml:lang", { prefix: "xml", name: "lang", namespace: u.XML }], ["xml:space", { prefix: "xml", name: "space", namespace: u.XML }], ["xmlns", { prefix: "", name: "xmlns", namespace: u.XMLNS }], ["xmlns:xlink", { prefix: "xmlns", name: "xlink", namespace: u.XMLNS }]]), me = 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((e3) => [e3.toLowerCase(), e3])), de = /* @__PURE__ */ new Set([S.B, S.BIG, S.BLOCKQUOTE, S.BODY, S.BR, S.CENTER, S.CODE, S.DD, S.DIV, S.DL, S.DT, S.EM, S.EMBED, S.H1, S.H2, S.H3, S.H4, S.H5, S.H6, S.HEAD, S.HR, S.I, S.IMG, S.LI, S.LISTING, S.MENU, S.META, S.NOBR, S.OL, S.P, S.PRE, S.RUBY, S.S, S.SMALL, S.SPAN, S.STRONG, S.STRIKE, S.SUB, S.SUP, S.TABLE, S.TT, S.U, S.UL, S.VAR]);
  2813. function pe(e3) {
  2814. for (let t2 = 0; t2 < e3.attrs.length; t2++) if (e3.attrs[t2].name === he) {
  2815. e3.attrs[t2].name = _e;
  2816. break;
  2817. }
  2818. }
  2819. function ue(e3) {
  2820. for (let t2 = 0; t2 < e3.attrs.length; t2++) {
  2821. const s2 = Ae.get(e3.attrs[t2].name);
  2822. null != s2 && (e3.attrs[t2].name = s2);
  2823. }
  2824. }
  2825. function Ne(e3) {
  2826. for (let t2 = 0; t2 < e3.attrs.length; t2++) {
  2827. const s2 = le.get(e3.attrs[t2].name);
  2828. s2 && (e3.attrs[t2].prefix = s2.prefix, e3.attrs[t2].name = s2.name, e3.attrs[t2].namespace = s2.namespace);
  2829. }
  2830. }
  2831. const Ie = "hidden", Ce = 8, Se = 3;
  2832. var De;
  2833. !function(e3) {
  2834. e3[e3.INITIAL = 0] = "INITIAL", e3[e3.BEFORE_HTML = 1] = "BEFORE_HTML", e3[e3.BEFORE_HEAD = 2] = "BEFORE_HEAD", e3[e3.IN_HEAD = 3] = "IN_HEAD", e3[e3.IN_HEAD_NO_SCRIPT = 4] = "IN_HEAD_NO_SCRIPT", e3[e3.AFTER_HEAD = 5] = "AFTER_HEAD", e3[e3.IN_BODY = 6] = "IN_BODY", e3[e3.TEXT = 7] = "TEXT", e3[e3.IN_TABLE = 8] = "IN_TABLE", e3[e3.IN_TABLE_TEXT = 9] = "IN_TABLE_TEXT", e3[e3.IN_CAPTION = 10] = "IN_CAPTION", e3[e3.IN_COLUMN_GROUP = 11] = "IN_COLUMN_GROUP", e3[e3.IN_TABLE_BODY = 12] = "IN_TABLE_BODY", e3[e3.IN_ROW = 13] = "IN_ROW", e3[e3.IN_CELL = 14] = "IN_CELL", e3[e3.IN_SELECT = 15] = "IN_SELECT", e3[e3.IN_SELECT_IN_TABLE = 16] = "IN_SELECT_IN_TABLE", e3[e3.IN_TEMPLATE = 17] = "IN_TEMPLATE", e3[e3.AFTER_BODY = 18] = "AFTER_BODY", e3[e3.IN_FRAMESET = 19] = "IN_FRAMESET", e3[e3.AFTER_FRAMESET = 20] = "AFTER_FRAMESET", e3[e3.AFTER_AFTER_BODY = 21] = "AFTER_AFTER_BODY", e3[e3.AFTER_AFTER_FRAMESET = 22] = "AFTER_AFTER_FRAMESET";
  2835. }(De || (De = {}));
  2836. const Re = { startLine: -1, startCol: -1, startOffset: -1, endLine: -1, endCol: -1, endOffset: -1 }, Oe = /* @__PURE__ */ new Set([S.TABLE, S.TBODY, S.TFOOT, S.THEAD, S.TR]), fe = { scriptingEnabled: true, sourceCodeLocationInfo: false, treeAdapter: te, onParseError: null };
  2837. class Le {
  2838. constructor(e3, t2, s2 = null, a2 = null) {
  2839. this.fragmentContext = s2, this.scriptHandler = a2, this.currentToken = null, this.stopped = false, this.insertionMode = De.INITIAL, this.originalInsertionMode = De.INITIAL, this.headElement = null, this.formElement = null, this.currentNotInHTML = false, this.tmplInsertionModeStack = [], this.pendingCharacterTokens = [], this.hasNonWhitespacePendingCharacterToken = false, this.framesetOk = true, this.skipNextNewLine = false, this.fosterParentingEnabled = false, this.options = { ...fe, ...e3 }, this.treeAdapter = this.options.treeAdapter, this.onParseError = this.options.onParseError, this.onParseError && (this.options.sourceCodeLocationInfo = true), this.document = null != t2 ? t2 : this.treeAdapter.createDocument(), this.tokenizer = new Y(this.options, this), this.activeFormattingElements = new $(this.treeAdapter), this.fragmentContextID = s2 ? O(this.treeAdapter.getTagName(s2)) : S.UNKNOWN, this._setContextModes(null != s2 ? s2 : this.document, this.fragmentContextID), this.openElements = new j(this.document, this.treeAdapter, this);
  2840. }
  2841. static parse(e3, t2) {
  2842. const s2 = new this(t2);
  2843. return s2.tokenizer.write(e3, true), s2.document;
  2844. }
  2845. static getFragmentParser(e3, t2) {
  2846. const s2 = { ...fe, ...t2 };
  2847. null != e3 || (e3 = s2.treeAdapter.createElement(C.TEMPLATE, u.HTML, []));
  2848. const a2 = s2.treeAdapter.createElement("documentmock", u.HTML, []), r2 = new this(s2, a2, e3);
  2849. return r2.fragmentContextID === S.TEMPLATE && r2.tmplInsertionModeStack.unshift(De.IN_TEMPLATE), r2._initTokenizerForFragmentParsing(), r2._insertFakeRootElement(), r2._resetInsertionMode(), r2._findFormInFragmentContext(), r2;
  2850. }
  2851. getFragment() {
  2852. const e3 = this.treeAdapter.getFirstChild(this.document), t2 = this.treeAdapter.createDocumentFragment();
  2853. return this._adoptNodes(e3, t2), t2;
  2854. }
  2855. _err(e3, t2, s2) {
  2856. var a2;
  2857. if (!this.onParseError) return;
  2858. const r2 = null !== (a2 = e3.location) && void 0 !== a2 ? a2 : Re, n2 = { code: t2, startLine: r2.startLine, startCol: r2.startCol, startOffset: r2.startOffset, endLine: s2 ? r2.startLine : r2.endLine, endCol: s2 ? r2.startCol : r2.endCol, endOffset: s2 ? r2.startOffset : r2.endOffset };
  2859. this.onParseError(n2);
  2860. }
  2861. onItemPush(e3, t2, s2) {
  2862. var a2, r2;
  2863. null === (r2 = (a2 = this.treeAdapter).onItemPush) || void 0 === r2 || r2.call(a2, e3), s2 && this.openElements.stackTop > 0 && this._setContextModes(e3, t2);
  2864. }
  2865. onItemPop(e3, t2) {
  2866. var s2, a2;
  2867. if (this.options.sourceCodeLocationInfo && this._setEndLocation(e3, this.currentToken), null === (a2 = (s2 = this.treeAdapter).onItemPop) || void 0 === a2 || a2.call(s2, e3, this.openElements.current), t2) {
  2868. let e4, t3;
  2869. 0 === this.openElements.stackTop && this.fragmentContext ? (e4 = this.fragmentContext, t3 = this.fragmentContextID) : { current: e4, currentTagId: t3 } = this.openElements, this._setContextModes(e4, t3);
  2870. }
  2871. }
  2872. _setContextModes(e3, t2) {
  2873. const s2 = e3 === this.document || this.treeAdapter.getNamespaceURI(e3) === u.HTML;
  2874. this.currentNotInHTML = !s2, this.tokenizer.inForeignNode = !s2 && !this._isIntegrationPoint(t2, e3);
  2875. }
  2876. _switchToTextParsing(e3, t2) {
  2877. this._insertElement(e3, u.HTML), this.tokenizer.state = t2, this.originalInsertionMode = this.insertionMode, this.insertionMode = De.TEXT;
  2878. }
  2879. switchToPlaintextParsing() {
  2880. this.insertionMode = De.TEXT, this.originalInsertionMode = De.IN_BODY, this.tokenizer.state = k.PLAINTEXT;
  2881. }
  2882. _getAdjustedCurrentElement() {
  2883. return 0 === this.openElements.stackTop && this.fragmentContext ? this.fragmentContext : this.openElements.current;
  2884. }
  2885. _findFormInFragmentContext() {
  2886. let e3 = this.fragmentContext;
  2887. for (; e3; ) {
  2888. if (this.treeAdapter.getTagName(e3) === C.FORM) {
  2889. this.formElement = e3;
  2890. break;
  2891. }
  2892. e3 = this.treeAdapter.getParentNode(e3);
  2893. }
  2894. }
  2895. _initTokenizerForFragmentParsing() {
  2896. if (this.fragmentContext && this.treeAdapter.getNamespaceURI(this.fragmentContext) === u.HTML) switch (this.fragmentContextID) {
  2897. case S.TITLE:
  2898. case S.TEXTAREA:
  2899. this.tokenizer.state = k.RCDATA;
  2900. break;
  2901. case S.STYLE:
  2902. case S.XMP:
  2903. case S.IFRAME:
  2904. case S.NOEMBED:
  2905. case S.NOFRAMES:
  2906. case S.NOSCRIPT:
  2907. this.tokenizer.state = k.RAWTEXT;
  2908. break;
  2909. case S.SCRIPT:
  2910. this.tokenizer.state = k.SCRIPT_DATA;
  2911. break;
  2912. case S.PLAINTEXT:
  2913. this.tokenizer.state = k.PLAINTEXT;
  2914. }
  2915. }
  2916. _setDocumentType(e3) {
  2917. const t2 = e3.name || "", s2 = e3.publicId || "", a2 = e3.systemId || "";
  2918. if (this.treeAdapter.setDocumentType(this.document, t2, s2, a2), e3.location) {
  2919. const t3 = this.treeAdapter.getChildNodes(this.document).find((e4) => this.treeAdapter.isDocumentTypeNode(e4));
  2920. t3 && this.treeAdapter.setNodeSourceCodeLocation(t3, e3.location);
  2921. }
  2922. }
  2923. _attachElementToTree(e3, t2) {
  2924. if (this.options.sourceCodeLocationInfo) {
  2925. const s2 = t2 && { ...t2, startTag: t2 };
  2926. this.treeAdapter.setNodeSourceCodeLocation(e3, s2);
  2927. }
  2928. if (this._shouldFosterParentOnInsertion()) this._fosterParentElement(e3);
  2929. else {
  2930. const t3 = this.openElements.currentTmplContentOrNode;
  2931. this.treeAdapter.appendChild(t3, e3);
  2932. }
  2933. }
  2934. _appendElement(e3, t2) {
  2935. const s2 = this.treeAdapter.createElement(e3.tagName, t2, e3.attrs);
  2936. this._attachElementToTree(s2, e3.location);
  2937. }
  2938. _insertElement(e3, t2) {
  2939. const s2 = this.treeAdapter.createElement(e3.tagName, t2, e3.attrs);
  2940. this._attachElementToTree(s2, e3.location), this.openElements.push(s2, e3.tagID);
  2941. }
  2942. _insertFakeElement(e3, t2) {
  2943. const s2 = this.treeAdapter.createElement(e3, u.HTML, []);
  2944. this._attachElementToTree(s2, null), this.openElements.push(s2, t2);
  2945. }
  2946. _insertTemplate(e3) {
  2947. const t2 = this.treeAdapter.createElement(e3.tagName, u.HTML, e3.attrs), s2 = this.treeAdapter.createDocumentFragment();
  2948. this.treeAdapter.setTemplateContent(t2, s2), this._attachElementToTree(t2, e3.location), this.openElements.push(t2, e3.tagID), this.options.sourceCodeLocationInfo && this.treeAdapter.setNodeSourceCodeLocation(s2, null);
  2949. }
  2950. _insertFakeRootElement() {
  2951. const e3 = this.treeAdapter.createElement(C.HTML, u.HTML, []);
  2952. this.options.sourceCodeLocationInfo && this.treeAdapter.setNodeSourceCodeLocation(e3, null), this.treeAdapter.appendChild(this.openElements.current, e3), this.openElements.push(e3, S.HTML);
  2953. }
  2954. _appendCommentNode(e3, t2) {
  2955. const s2 = this.treeAdapter.createCommentNode(e3.data);
  2956. this.treeAdapter.appendChild(t2, s2), this.options.sourceCodeLocationInfo && this.treeAdapter.setNodeSourceCodeLocation(s2, e3.location);
  2957. }
  2958. _insertCharacters(e3) {
  2959. let t2, s2;
  2960. if (this._shouldFosterParentOnInsertion() ? ({ parent: t2, beforeElement: s2 } = this._findFosterParentingLocation(), s2 ? this.treeAdapter.insertTextBefore(t2, e3.chars, s2) : this.treeAdapter.insertText(t2, e3.chars)) : (t2 = this.openElements.currentTmplContentOrNode, this.treeAdapter.insertText(t2, e3.chars)), !e3.location) return;
  2961. const a2 = this.treeAdapter.getChildNodes(t2), r2 = s2 ? a2.lastIndexOf(s2) : a2.length, n2 = a2[r2 - 1];
  2962. if (this.treeAdapter.getNodeSourceCodeLocation(n2)) {
  2963. const { endLine: t3, endCol: s3, endOffset: a3 } = e3.location;
  2964. this.treeAdapter.updateNodeSourceCodeLocation(n2, { endLine: t3, endCol: s3, endOffset: a3 });
  2965. } else this.options.sourceCodeLocationInfo && this.treeAdapter.setNodeSourceCodeLocation(n2, e3.location);
  2966. }
  2967. _adoptNodes(e3, t2) {
  2968. for (let s2 = this.treeAdapter.getFirstChild(e3); s2; s2 = this.treeAdapter.getFirstChild(e3)) this.treeAdapter.detachNode(s2), this.treeAdapter.appendChild(t2, s2);
  2969. }
  2970. _setEndLocation(e3, t2) {
  2971. if (this.treeAdapter.getNodeSourceCodeLocation(e3) && t2.location) {
  2972. const s2 = t2.location, a2 = this.treeAdapter.getTagName(e3), r2 = t2.type === h.END_TAG && a2 === t2.tagName ? { endTag: { ...s2 }, endLine: s2.endLine, endCol: s2.endCol, endOffset: s2.endOffset } : { endLine: s2.startLine, endCol: s2.startCol, endOffset: s2.startOffset };
  2973. this.treeAdapter.updateNodeSourceCodeLocation(e3, r2);
  2974. }
  2975. }
  2976. shouldProcessStartTagTokenInForeignContent(e3) {
  2977. if (!this.currentNotInHTML) return false;
  2978. let t2, s2;
  2979. return 0 === this.openElements.stackTop && this.fragmentContext ? (t2 = this.fragmentContext, s2 = this.fragmentContextID) : { current: t2, currentTagId: s2 } = this.openElements, (e3.tagID !== S.SVG || this.treeAdapter.getTagName(t2) !== C.ANNOTATION_XML || this.treeAdapter.getNamespaceURI(t2) !== u.MATHML) && (this.tokenizer.inForeignNode || (e3.tagID === S.MGLYPH || e3.tagID === S.MALIGNMARK) && !this._isIntegrationPoint(s2, t2, u.HTML));
  2980. }
  2981. _processToken(e3) {
  2982. switch (e3.type) {
  2983. case h.CHARACTER:
  2984. this.onCharacter(e3);
  2985. break;
  2986. case h.NULL_CHARACTER:
  2987. this.onNullCharacter(e3);
  2988. break;
  2989. case h.COMMENT:
  2990. this.onComment(e3);
  2991. break;
  2992. case h.DOCTYPE:
  2993. this.onDoctype(e3);
  2994. break;
  2995. case h.START_TAG:
  2996. this._processStartTag(e3);
  2997. break;
  2998. case h.END_TAG:
  2999. this.onEndTag(e3);
  3000. break;
  3001. case h.EOF:
  3002. this.onEof(e3);
  3003. break;
  3004. case h.WHITESPACE_CHARACTER:
  3005. this.onWhitespaceCharacter(e3);
  3006. }
  3007. }
  3008. _isIntegrationPoint(e3, t2, s2) {
  3009. return function(e4, t3, s3, a2) {
  3010. return (!a2 || a2 === u.HTML) && function(e5, t4, s4) {
  3011. if (t4 === u.MATHML && e5 === S.ANNOTATION_XML) {
  3012. for (let e6 = 0; e6 < s4.length; e6++) if (s4[e6].name === N.ENCODING) {
  3013. const t5 = s4[e6].value.toLowerCase();
  3014. return t5 === Ee || t5 === Te;
  3015. }
  3016. }
  3017. return t4 === u.SVG && (e5 === S.FOREIGN_OBJECT || e5 === S.DESC || e5 === S.TITLE);
  3018. }(e4, t3, s3) || (!a2 || a2 === u.MATHML) && function(e5, t4) {
  3019. return t4 === u.MATHML && (e5 === S.MI || e5 === S.MO || e5 === S.MN || e5 === S.MS || e5 === S.MTEXT);
  3020. }(e4, t3);
  3021. }(e3, this.treeAdapter.getNamespaceURI(t2), this.treeAdapter.getAttrList(t2), s2);
  3022. }
  3023. _reconstructActiveFormattingElements() {
  3024. const e3 = this.activeFormattingElements.entries.length;
  3025. if (e3) {
  3026. const t2 = this.activeFormattingElements.entries.findIndex((e4) => e4.type === J.Marker || this.openElements.contains(e4.element));
  3027. for (let s2 = t2 < 0 ? e3 - 1 : t2 - 1; s2 >= 0; s2--) {
  3028. const e4 = this.activeFormattingElements.entries[s2];
  3029. this._insertElement(e4.token, this.treeAdapter.getNamespaceURI(e4.element)), e4.element = this.openElements.current;
  3030. }
  3031. }
  3032. }
  3033. _closeTableCell() {
  3034. this.openElements.generateImpliedEndTags(), this.openElements.popUntilTableCellPopped(), this.activeFormattingElements.clearToLastMarker(), this.insertionMode = De.IN_ROW;
  3035. }
  3036. _closePElement() {
  3037. this.openElements.generateImpliedEndTagsWithExclusion(S.P), this.openElements.popUntilTagNamePopped(S.P);
  3038. }
  3039. _resetInsertionMode() {
  3040. for (let e3 = this.openElements.stackTop; e3 >= 0; e3--) switch (0 === e3 && this.fragmentContext ? this.fragmentContextID : this.openElements.tagIDs[e3]) {
  3041. case S.TR:
  3042. return void (this.insertionMode = De.IN_ROW);
  3043. case S.TBODY:
  3044. case S.THEAD:
  3045. case S.TFOOT:
  3046. return void (this.insertionMode = De.IN_TABLE_BODY);
  3047. case S.CAPTION:
  3048. return void (this.insertionMode = De.IN_CAPTION);
  3049. case S.COLGROUP:
  3050. return void (this.insertionMode = De.IN_COLUMN_GROUP);
  3051. case S.TABLE:
  3052. return void (this.insertionMode = De.IN_TABLE);
  3053. case S.BODY:
  3054. return void (this.insertionMode = De.IN_BODY);
  3055. case S.FRAMESET:
  3056. return void (this.insertionMode = De.IN_FRAMESET);
  3057. case S.SELECT:
  3058. return void this._resetInsertionModeForSelect(e3);
  3059. case S.TEMPLATE:
  3060. return void (this.insertionMode = this.tmplInsertionModeStack[0]);
  3061. case S.HTML:
  3062. return void (this.insertionMode = this.headElement ? De.AFTER_HEAD : De.BEFORE_HEAD);
  3063. case S.TD:
  3064. case S.TH:
  3065. if (e3 > 0) return void (this.insertionMode = De.IN_CELL);
  3066. break;
  3067. case S.HEAD:
  3068. if (e3 > 0) return void (this.insertionMode = De.IN_HEAD);
  3069. }
  3070. this.insertionMode = De.IN_BODY;
  3071. }
  3072. _resetInsertionModeForSelect(e3) {
  3073. if (e3 > 0) for (let t2 = e3 - 1; t2 > 0; t2--) {
  3074. const e4 = this.openElements.tagIDs[t2];
  3075. if (e4 === S.TEMPLATE) break;
  3076. if (e4 === S.TABLE) return void (this.insertionMode = De.IN_SELECT_IN_TABLE);
  3077. }
  3078. this.insertionMode = De.IN_SELECT;
  3079. }
  3080. _isElementCausesFosterParenting(e3) {
  3081. return Oe.has(e3);
  3082. }
  3083. _shouldFosterParentOnInsertion() {
  3084. return this.fosterParentingEnabled && this._isElementCausesFosterParenting(this.openElements.currentTagId);
  3085. }
  3086. _findFosterParentingLocation() {
  3087. for (let e3 = this.openElements.stackTop; e3 >= 0; e3--) {
  3088. const t2 = this.openElements.items[e3];
  3089. switch (this.openElements.tagIDs[e3]) {
  3090. case S.TEMPLATE:
  3091. if (this.treeAdapter.getNamespaceURI(t2) === u.HTML) return { parent: this.treeAdapter.getTemplateContent(t2), beforeElement: null };
  3092. break;
  3093. case S.TABLE: {
  3094. const s2 = this.treeAdapter.getParentNode(t2);
  3095. return s2 ? { parent: s2, beforeElement: t2 } : { parent: this.openElements.items[e3 - 1], beforeElement: null };
  3096. }
  3097. }
  3098. }
  3099. return { parent: this.openElements.items[0], beforeElement: null };
  3100. }
  3101. _fosterParentElement(e3) {
  3102. const t2 = this._findFosterParentingLocation();
  3103. t2.beforeElement ? this.treeAdapter.insertBefore(t2.parent, e3, t2.beforeElement) : this.treeAdapter.appendChild(t2.parent, e3);
  3104. }
  3105. _isSpecialElement(e3, t2) {
  3106. const s2 = this.treeAdapter.getNamespaceURI(e3);
  3107. return L[s2].has(t2);
  3108. }
  3109. onCharacter(e3) {
  3110. if (this.skipNextNewLine = false, this.tokenizer.inForeignNode) !function(e4, t2) {
  3111. e4._insertCharacters(t2), e4.framesetOk = false;
  3112. }(this, e3);
  3113. else switch (this.insertionMode) {
  3114. case De.INITIAL:
  3115. ye(this, e3);
  3116. break;
  3117. case De.BEFORE_HTML:
  3118. Ge(this, e3);
  3119. break;
  3120. case De.BEFORE_HEAD:
  3121. we(this, e3);
  3122. break;
  3123. case De.IN_HEAD:
  3124. ve(this, e3);
  3125. break;
  3126. case De.IN_HEAD_NO_SCRIPT:
  3127. Qe(this, e3);
  3128. break;
  3129. case De.AFTER_HEAD:
  3130. qe(this, e3);
  3131. break;
  3132. case De.IN_BODY:
  3133. case De.IN_CAPTION:
  3134. case De.IN_CELL:
  3135. case De.IN_TEMPLATE:
  3136. Ke(this, e3);
  3137. break;
  3138. case De.TEXT:
  3139. case De.IN_SELECT:
  3140. case De.IN_SELECT_IN_TABLE:
  3141. this._insertCharacters(e3);
  3142. break;
  3143. case De.IN_TABLE:
  3144. case De.IN_TABLE_BODY:
  3145. case De.IN_ROW:
  3146. st(this, e3);
  3147. break;
  3148. case De.IN_TABLE_TEXT:
  3149. ot(this, e3);
  3150. break;
  3151. case De.IN_COLUMN_GROUP:
  3152. ht(this, e3);
  3153. break;
  3154. case De.AFTER_BODY:
  3155. It(this, e3);
  3156. break;
  3157. case De.AFTER_AFTER_BODY:
  3158. Ct(this, e3);
  3159. }
  3160. }
  3161. onNullCharacter(e3) {
  3162. if (this.skipNextNewLine = false, this.tokenizer.inForeignNode) !function(e4, t2) {
  3163. t2.chars = s, e4._insertCharacters(t2);
  3164. }(this, e3);
  3165. else switch (this.insertionMode) {
  3166. case De.INITIAL:
  3167. ye(this, e3);
  3168. break;
  3169. case De.BEFORE_HTML:
  3170. Ge(this, e3);
  3171. break;
  3172. case De.BEFORE_HEAD:
  3173. we(this, e3);
  3174. break;
  3175. case De.IN_HEAD:
  3176. ve(this, e3);
  3177. break;
  3178. case De.IN_HEAD_NO_SCRIPT:
  3179. Qe(this, e3);
  3180. break;
  3181. case De.AFTER_HEAD:
  3182. qe(this, e3);
  3183. break;
  3184. case De.TEXT:
  3185. this._insertCharacters(e3);
  3186. break;
  3187. case De.IN_TABLE:
  3188. case De.IN_TABLE_BODY:
  3189. case De.IN_ROW:
  3190. st(this, e3);
  3191. break;
  3192. case De.IN_COLUMN_GROUP:
  3193. ht(this, e3);
  3194. break;
  3195. case De.AFTER_BODY:
  3196. It(this, e3);
  3197. break;
  3198. case De.AFTER_AFTER_BODY:
  3199. Ct(this, e3);
  3200. }
  3201. }
  3202. onComment(e3) {
  3203. if (this.skipNextNewLine = false, this.currentNotInHTML) Fe(this, e3);
  3204. else switch (this.insertionMode) {
  3205. case De.INITIAL:
  3206. case De.BEFORE_HTML:
  3207. case De.BEFORE_HEAD:
  3208. case De.IN_HEAD:
  3209. case De.IN_HEAD_NO_SCRIPT:
  3210. case De.AFTER_HEAD:
  3211. case De.IN_BODY:
  3212. case De.IN_TABLE:
  3213. case De.IN_CAPTION:
  3214. case De.IN_COLUMN_GROUP:
  3215. case De.IN_TABLE_BODY:
  3216. case De.IN_ROW:
  3217. case De.IN_CELL:
  3218. case De.IN_SELECT:
  3219. case De.IN_SELECT_IN_TABLE:
  3220. case De.IN_TEMPLATE:
  3221. case De.IN_FRAMESET:
  3222. case De.AFTER_FRAMESET:
  3223. Fe(this, e3);
  3224. break;
  3225. case De.IN_TABLE_TEXT:
  3226. ct(this, e3);
  3227. break;
  3228. case De.AFTER_BODY:
  3229. !function(e4, t2) {
  3230. e4._appendCommentNode(t2, e4.openElements.items[0]);
  3231. }(this, e3);
  3232. break;
  3233. case De.AFTER_AFTER_BODY:
  3234. case De.AFTER_AFTER_FRAMESET:
  3235. !function(e4, t2) {
  3236. e4._appendCommentNode(t2, e4.document);
  3237. }(this, e3);
  3238. }
  3239. }
  3240. onDoctype(e3) {
  3241. switch (this.skipNextNewLine = false, this.insertionMode) {
  3242. case De.INITIAL:
  3243. !function(e4, t2) {
  3244. e4._setDocumentType(t2);
  3245. const s2 = t2.forceQuirks ? I.QUIRKS : function(e5) {
  3246. if (e5.name !== se) return I.QUIRKS;
  3247. const { systemId: t3 } = e5;
  3248. if (t3 && "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd" === t3.toLowerCase()) return I.QUIRKS;
  3249. let { publicId: s3 } = e5;
  3250. if (null !== s3) {
  3251. if (s3 = s3.toLowerCase(), ne.has(s3)) return I.QUIRKS;
  3252. let e6 = null === t3 ? re : ae;
  3253. if (ce(s3, e6)) return I.QUIRKS;
  3254. if (e6 = null === t3 ? ie : oe, ce(s3, e6)) return I.LIMITED_QUIRKS;
  3255. }
  3256. return I.NO_QUIRKS;
  3257. }(t2);
  3258. (function(e5) {
  3259. return e5.name === se && null === e5.publicId && (null === e5.systemId || "about:legacy-compat" === e5.systemId);
  3260. })(t2) || e4._err(t2, T.nonConformingDoctype), e4.treeAdapter.setDocumentMode(e4.document, s2), e4.insertionMode = De.BEFORE_HTML;
  3261. }(this, e3);
  3262. break;
  3263. case De.BEFORE_HEAD:
  3264. case De.IN_HEAD:
  3265. case De.IN_HEAD_NO_SCRIPT:
  3266. case De.AFTER_HEAD:
  3267. this._err(e3, T.misplacedDoctype);
  3268. break;
  3269. case De.IN_TABLE_TEXT:
  3270. ct(this, e3);
  3271. }
  3272. }
  3273. onStartTag(e3) {
  3274. this.skipNextNewLine = false, this.currentToken = e3, this._processStartTag(e3), e3.selfClosing && !e3.ackSelfClosing && this._err(e3, T.nonVoidHtmlElementStartTagWithTrailingSolidus);
  3275. }
  3276. _processStartTag(e3) {
  3277. this.shouldProcessStartTagTokenInForeignContent(e3) ? function(e4, t2) {
  3278. if (function(e5) {
  3279. const t3 = e5.tagID;
  3280. return t3 === S.FONT && e5.attrs.some(({ name: e6 }) => e6 === N.COLOR || e6 === N.SIZE || e6 === N.FACE) || de.has(t3);
  3281. }(t2)) St(e4), e4._startTagOutsideForeignContent(t2);
  3282. else {
  3283. const s2 = e4._getAdjustedCurrentElement(), a2 = e4.treeAdapter.getNamespaceURI(s2);
  3284. a2 === u.MATHML ? pe(t2) : a2 === u.SVG && (function(e5) {
  3285. const t3 = me.get(e5.tagName);
  3286. null != t3 && (e5.tagName = t3, e5.tagID = O(e5.tagName));
  3287. }(t2), ue(t2)), Ne(t2), t2.selfClosing ? e4._appendElement(t2, a2) : e4._insertElement(t2, a2), t2.ackSelfClosing = true;
  3288. }
  3289. }(this, e3) : this._startTagOutsideForeignContent(e3);
  3290. }
  3291. _startTagOutsideForeignContent(e3) {
  3292. switch (this.insertionMode) {
  3293. case De.INITIAL:
  3294. ye(this, e3);
  3295. break;
  3296. case De.BEFORE_HTML:
  3297. !function(e4, t2) {
  3298. t2.tagID === S.HTML ? (e4._insertElement(t2, u.HTML), e4.insertionMode = De.BEFORE_HEAD) : Ge(e4, t2);
  3299. }(this, e3);
  3300. break;
  3301. case De.BEFORE_HEAD:
  3302. !function(e4, t2) {
  3303. switch (t2.tagID) {
  3304. case S.HTML:
  3305. Ze(e4, t2);
  3306. break;
  3307. case S.HEAD:
  3308. e4._insertElement(t2, u.HTML), e4.headElement = e4.openElements.current, e4.insertionMode = De.IN_HEAD;
  3309. break;
  3310. default:
  3311. we(e4, t2);
  3312. }
  3313. }(this, e3);
  3314. break;
  3315. case De.IN_HEAD:
  3316. xe(this, e3);
  3317. break;
  3318. case De.IN_HEAD_NO_SCRIPT:
  3319. !function(e4, t2) {
  3320. switch (t2.tagID) {
  3321. case S.HTML:
  3322. Ze(e4, t2);
  3323. break;
  3324. case S.BASEFONT:
  3325. case S.BGSOUND:
  3326. case S.HEAD:
  3327. case S.LINK:
  3328. case S.META:
  3329. case S.NOFRAMES:
  3330. case S.STYLE:
  3331. xe(e4, t2);
  3332. break;
  3333. case S.NOSCRIPT:
  3334. e4._err(t2, T.nestedNoscriptInHead);
  3335. break;
  3336. default:
  3337. Qe(e4, t2);
  3338. }
  3339. }(this, e3);
  3340. break;
  3341. case De.AFTER_HEAD:
  3342. !function(e4, t2) {
  3343. switch (t2.tagID) {
  3344. case S.HTML:
  3345. Ze(e4, t2);
  3346. break;
  3347. case S.BODY:
  3348. e4._insertElement(t2, u.HTML), e4.framesetOk = false, e4.insertionMode = De.IN_BODY;
  3349. break;
  3350. case S.FRAMESET:
  3351. e4._insertElement(t2, u.HTML), e4.insertionMode = De.IN_FRAMESET;
  3352. break;
  3353. case S.BASE:
  3354. case S.BASEFONT:
  3355. case S.BGSOUND:
  3356. case S.LINK:
  3357. case S.META:
  3358. case S.NOFRAMES:
  3359. case S.SCRIPT:
  3360. case S.STYLE:
  3361. case S.TEMPLATE:
  3362. case S.TITLE:
  3363. e4._err(t2, T.abandonedHeadElementChild), e4.openElements.push(e4.headElement, S.HEAD), xe(e4, t2), e4.openElements.remove(e4.headElement);
  3364. break;
  3365. case S.HEAD:
  3366. e4._err(t2, T.misplacedStartTagForHeadElement);
  3367. break;
  3368. default:
  3369. qe(e4, t2);
  3370. }
  3371. }(this, e3);
  3372. break;
  3373. case De.IN_BODY:
  3374. Ze(this, e3);
  3375. break;
  3376. case De.IN_TABLE:
  3377. at(this, e3);
  3378. break;
  3379. case De.IN_TABLE_TEXT:
  3380. ct(this, e3);
  3381. break;
  3382. case De.IN_CAPTION:
  3383. !function(e4, t2) {
  3384. const s2 = t2.tagID;
  3385. Et.has(s2) ? e4.openElements.hasInTableScope(S.CAPTION) && (e4.openElements.generateImpliedEndTags(), e4.openElements.popUntilTagNamePopped(S.CAPTION), e4.activeFormattingElements.clearToLastMarker(), e4.insertionMode = De.IN_TABLE, at(e4, t2)) : Ze(e4, t2);
  3386. }(this, e3);
  3387. break;
  3388. case De.IN_COLUMN_GROUP:
  3389. Tt(this, e3);
  3390. break;
  3391. case De.IN_TABLE_BODY:
  3392. _t(this, e3);
  3393. break;
  3394. case De.IN_ROW:
  3395. lt(this, e3);
  3396. break;
  3397. case De.IN_CELL:
  3398. !function(e4, t2) {
  3399. const s2 = t2.tagID;
  3400. Et.has(s2) ? (e4.openElements.hasInTableScope(S.TD) || e4.openElements.hasInTableScope(S.TH)) && (e4._closeTableCell(), lt(e4, t2)) : Ze(e4, t2);
  3401. }(this, e3);
  3402. break;
  3403. case De.IN_SELECT:
  3404. dt(this, e3);
  3405. break;
  3406. case De.IN_SELECT_IN_TABLE:
  3407. !function(e4, t2) {
  3408. const s2 = t2.tagID;
  3409. s2 === S.CAPTION || s2 === S.TABLE || s2 === S.TBODY || s2 === S.TFOOT || s2 === S.THEAD || s2 === S.TR || s2 === S.TD || s2 === S.TH ? (e4.openElements.popUntilTagNamePopped(S.SELECT), e4._resetInsertionMode(), e4._processStartTag(t2)) : dt(e4, t2);
  3410. }(this, e3);
  3411. break;
  3412. case De.IN_TEMPLATE:
  3413. !function(e4, t2) {
  3414. switch (t2.tagID) {
  3415. case S.BASE:
  3416. case S.BASEFONT:
  3417. case S.BGSOUND:
  3418. case S.LINK:
  3419. case S.META:
  3420. case S.NOFRAMES:
  3421. case S.SCRIPT:
  3422. case S.STYLE:
  3423. case S.TEMPLATE:
  3424. case S.TITLE:
  3425. xe(e4, t2);
  3426. break;
  3427. case S.CAPTION:
  3428. case S.COLGROUP:
  3429. case S.TBODY:
  3430. case S.TFOOT:
  3431. case S.THEAD:
  3432. e4.tmplInsertionModeStack[0] = De.IN_TABLE, e4.insertionMode = De.IN_TABLE, at(e4, t2);
  3433. break;
  3434. case S.COL:
  3435. e4.tmplInsertionModeStack[0] = De.IN_COLUMN_GROUP, e4.insertionMode = De.IN_COLUMN_GROUP, Tt(e4, t2);
  3436. break;
  3437. case S.TR:
  3438. e4.tmplInsertionModeStack[0] = De.IN_TABLE_BODY, e4.insertionMode = De.IN_TABLE_BODY, _t(e4, t2);
  3439. break;
  3440. case S.TD:
  3441. case S.TH:
  3442. e4.tmplInsertionModeStack[0] = De.IN_ROW, e4.insertionMode = De.IN_ROW, lt(e4, t2);
  3443. break;
  3444. default:
  3445. e4.tmplInsertionModeStack[0] = De.IN_BODY, e4.insertionMode = De.IN_BODY, Ze(e4, t2);
  3446. }
  3447. }(this, e3);
  3448. break;
  3449. case De.AFTER_BODY:
  3450. !function(e4, t2) {
  3451. t2.tagID === S.HTML ? Ze(e4, t2) : It(e4, t2);
  3452. }(this, e3);
  3453. break;
  3454. case De.IN_FRAMESET:
  3455. !function(e4, t2) {
  3456. switch (t2.tagID) {
  3457. case S.HTML:
  3458. Ze(e4, t2);
  3459. break;
  3460. case S.FRAMESET:
  3461. e4._insertElement(t2, u.HTML);
  3462. break;
  3463. case S.FRAME:
  3464. e4._appendElement(t2, u.HTML), t2.ackSelfClosing = true;
  3465. break;
  3466. case S.NOFRAMES:
  3467. xe(e4, t2);
  3468. }
  3469. }(this, e3);
  3470. break;
  3471. case De.AFTER_FRAMESET:
  3472. !function(e4, t2) {
  3473. switch (t2.tagID) {
  3474. case S.HTML:
  3475. Ze(e4, t2);
  3476. break;
  3477. case S.NOFRAMES:
  3478. xe(e4, t2);
  3479. }
  3480. }(this, e3);
  3481. break;
  3482. case De.AFTER_AFTER_BODY:
  3483. !function(e4, t2) {
  3484. t2.tagID === S.HTML ? Ze(e4, t2) : Ct(e4, t2);
  3485. }(this, e3);
  3486. break;
  3487. case De.AFTER_AFTER_FRAMESET:
  3488. !function(e4, t2) {
  3489. switch (t2.tagID) {
  3490. case S.HTML:
  3491. Ze(e4, t2);
  3492. break;
  3493. case S.NOFRAMES:
  3494. xe(e4, t2);
  3495. }
  3496. }(this, e3);
  3497. }
  3498. }
  3499. onEndTag(e3) {
  3500. this.skipNextNewLine = false, this.currentToken = e3, this.currentNotInHTML ? function(e4, t2) {
  3501. if (t2.tagID === S.P || t2.tagID === S.BR) return St(e4), void e4._endTagOutsideForeignContent(t2);
  3502. for (let s2 = e4.openElements.stackTop; s2 > 0; s2--) {
  3503. const a2 = e4.openElements.items[s2];
  3504. if (e4.treeAdapter.getNamespaceURI(a2) === u.HTML) {
  3505. e4._endTagOutsideForeignContent(t2);
  3506. break;
  3507. }
  3508. const r2 = e4.treeAdapter.getTagName(a2);
  3509. if (r2.toLowerCase() === t2.tagName) {
  3510. t2.tagName = r2, e4.openElements.shortenToLength(s2);
  3511. break;
  3512. }
  3513. }
  3514. }(this, e3) : this._endTagOutsideForeignContent(e3);
  3515. }
  3516. _endTagOutsideForeignContent(e3) {
  3517. switch (this.insertionMode) {
  3518. case De.INITIAL:
  3519. ye(this, e3);
  3520. break;
  3521. case De.BEFORE_HTML:
  3522. !function(e4, t2) {
  3523. const s2 = t2.tagID;
  3524. s2 !== S.HTML && s2 !== S.HEAD && s2 !== S.BODY && s2 !== S.BR || Ge(e4, t2);
  3525. }(this, e3);
  3526. break;
  3527. case De.BEFORE_HEAD:
  3528. !function(e4, t2) {
  3529. const s2 = t2.tagID;
  3530. s2 === S.HEAD || s2 === S.BODY || s2 === S.HTML || s2 === S.BR ? we(e4, t2) : e4._err(t2, T.endTagWithoutMatchingOpenElement);
  3531. }(this, e3);
  3532. break;
  3533. case De.IN_HEAD:
  3534. !function(e4, t2) {
  3535. switch (t2.tagID) {
  3536. case S.HEAD:
  3537. e4.openElements.pop(), e4.insertionMode = De.AFTER_HEAD;
  3538. break;
  3539. case S.BODY:
  3540. case S.BR:
  3541. case S.HTML:
  3542. ve(e4, t2);
  3543. break;
  3544. case S.TEMPLATE:
  3545. Ye(e4, t2);
  3546. break;
  3547. default:
  3548. e4._err(t2, T.endTagWithoutMatchingOpenElement);
  3549. }
  3550. }(this, e3);
  3551. break;
  3552. case De.IN_HEAD_NO_SCRIPT:
  3553. !function(e4, t2) {
  3554. switch (t2.tagID) {
  3555. case S.NOSCRIPT:
  3556. e4.openElements.pop(), e4.insertionMode = De.IN_HEAD;
  3557. break;
  3558. case S.BR:
  3559. Qe(e4, t2);
  3560. break;
  3561. default:
  3562. e4._err(t2, T.endTagWithoutMatchingOpenElement);
  3563. }
  3564. }(this, e3);
  3565. break;
  3566. case De.AFTER_HEAD:
  3567. !function(e4, t2) {
  3568. switch (t2.tagID) {
  3569. case S.BODY:
  3570. case S.HTML:
  3571. case S.BR:
  3572. qe(e4, t2);
  3573. break;
  3574. case S.TEMPLATE:
  3575. Ye(e4, t2);
  3576. break;
  3577. default:
  3578. e4._err(t2, T.endTagWithoutMatchingOpenElement);
  3579. }
  3580. }(this, e3);
  3581. break;
  3582. case De.IN_BODY:
  3583. et(this, e3);
  3584. break;
  3585. case De.TEXT:
  3586. !function(e4, t2) {
  3587. var s2;
  3588. t2.tagID === S.SCRIPT && (null === (s2 = e4.scriptHandler) || void 0 === s2 || s2.call(e4, e4.openElements.current)), e4.openElements.pop(), e4.insertionMode = e4.originalInsertionMode;
  3589. }(this, e3);
  3590. break;
  3591. case De.IN_TABLE:
  3592. rt(this, e3);
  3593. break;
  3594. case De.IN_TABLE_TEXT:
  3595. ct(this, e3);
  3596. break;
  3597. case De.IN_CAPTION:
  3598. !function(e4, t2) {
  3599. const s2 = t2.tagID;
  3600. switch (s2) {
  3601. case S.CAPTION:
  3602. case S.TABLE:
  3603. e4.openElements.hasInTableScope(S.CAPTION) && (e4.openElements.generateImpliedEndTags(), e4.openElements.popUntilTagNamePopped(S.CAPTION), e4.activeFormattingElements.clearToLastMarker(), e4.insertionMode = De.IN_TABLE, s2 === S.TABLE && rt(e4, t2));
  3604. break;
  3605. case S.BODY:
  3606. case S.COL:
  3607. case S.COLGROUP:
  3608. case S.HTML:
  3609. case S.TBODY:
  3610. case S.TD:
  3611. case S.TFOOT:
  3612. case S.TH:
  3613. case S.THEAD:
  3614. case S.TR:
  3615. break;
  3616. default:
  3617. et(e4, t2);
  3618. }
  3619. }(this, e3);
  3620. break;
  3621. case De.IN_COLUMN_GROUP:
  3622. !function(e4, t2) {
  3623. switch (t2.tagID) {
  3624. case S.COLGROUP:
  3625. e4.openElements.currentTagId === S.COLGROUP && (e4.openElements.pop(), e4.insertionMode = De.IN_TABLE);
  3626. break;
  3627. case S.TEMPLATE:
  3628. Ye(e4, t2);
  3629. break;
  3630. case S.COL:
  3631. break;
  3632. default:
  3633. ht(e4, t2);
  3634. }
  3635. }(this, e3);
  3636. break;
  3637. case De.IN_TABLE_BODY:
  3638. At(this, e3);
  3639. break;
  3640. case De.IN_ROW:
  3641. mt(this, e3);
  3642. break;
  3643. case De.IN_CELL:
  3644. !function(e4, t2) {
  3645. const s2 = t2.tagID;
  3646. switch (s2) {
  3647. case S.TD:
  3648. case S.TH:
  3649. e4.openElements.hasInTableScope(s2) && (e4.openElements.generateImpliedEndTags(), e4.openElements.popUntilTagNamePopped(s2), e4.activeFormattingElements.clearToLastMarker(), e4.insertionMode = De.IN_ROW);
  3650. break;
  3651. case S.TABLE:
  3652. case S.TBODY:
  3653. case S.TFOOT:
  3654. case S.THEAD:
  3655. case S.TR:
  3656. e4.openElements.hasInTableScope(s2) && (e4._closeTableCell(), mt(e4, t2));
  3657. break;
  3658. case S.BODY:
  3659. case S.CAPTION:
  3660. case S.COL:
  3661. case S.COLGROUP:
  3662. case S.HTML:
  3663. break;
  3664. default:
  3665. et(e4, t2);
  3666. }
  3667. }(this, e3);
  3668. break;
  3669. case De.IN_SELECT:
  3670. pt(this, e3);
  3671. break;
  3672. case De.IN_SELECT_IN_TABLE:
  3673. !function(e4, t2) {
  3674. const s2 = t2.tagID;
  3675. s2 === S.CAPTION || s2 === S.TABLE || s2 === S.TBODY || s2 === S.TFOOT || s2 === S.THEAD || s2 === S.TR || s2 === S.TD || s2 === S.TH ? e4.openElements.hasInTableScope(s2) && (e4.openElements.popUntilTagNamePopped(S.SELECT), e4._resetInsertionMode(), e4.onEndTag(t2)) : pt(e4, t2);
  3676. }(this, e3);
  3677. break;
  3678. case De.IN_TEMPLATE:
  3679. !function(e4, t2) {
  3680. t2.tagID === S.TEMPLATE && Ye(e4, t2);
  3681. }(this, e3);
  3682. break;
  3683. case De.AFTER_BODY:
  3684. Nt(this, e3);
  3685. break;
  3686. case De.IN_FRAMESET:
  3687. !function(e4, t2) {
  3688. t2.tagID !== S.FRAMESET || e4.openElements.isRootHtmlElementCurrent() || (e4.openElements.pop(), e4.fragmentContext || e4.openElements.currentTagId === S.FRAMESET || (e4.insertionMode = De.AFTER_FRAMESET));
  3689. }(this, e3);
  3690. break;
  3691. case De.AFTER_FRAMESET:
  3692. !function(e4, t2) {
  3693. t2.tagID === S.HTML && (e4.insertionMode = De.AFTER_AFTER_FRAMESET);
  3694. }(this, e3);
  3695. break;
  3696. case De.AFTER_AFTER_BODY:
  3697. Ct(this, e3);
  3698. }
  3699. }
  3700. onEof(e3) {
  3701. switch (this.insertionMode) {
  3702. case De.INITIAL:
  3703. ye(this, e3);
  3704. break;
  3705. case De.BEFORE_HTML:
  3706. Ge(this, e3);
  3707. break;
  3708. case De.BEFORE_HEAD:
  3709. we(this, e3);
  3710. break;
  3711. case De.IN_HEAD:
  3712. ve(this, e3);
  3713. break;
  3714. case De.IN_HEAD_NO_SCRIPT:
  3715. Qe(this, e3);
  3716. break;
  3717. case De.AFTER_HEAD:
  3718. qe(this, e3);
  3719. break;
  3720. case De.IN_BODY:
  3721. case De.IN_TABLE:
  3722. case De.IN_CAPTION:
  3723. case De.IN_COLUMN_GROUP:
  3724. case De.IN_TABLE_BODY:
  3725. case De.IN_ROW:
  3726. case De.IN_CELL:
  3727. case De.IN_SELECT:
  3728. case De.IN_SELECT_IN_TABLE:
  3729. tt(this, e3);
  3730. break;
  3731. case De.TEXT:
  3732. !function(e4, t2) {
  3733. e4._err(t2, T.eofInElementThatCanContainOnlyText), e4.openElements.pop(), e4.insertionMode = e4.originalInsertionMode, e4.onEof(t2);
  3734. }(this, e3);
  3735. break;
  3736. case De.IN_TABLE_TEXT:
  3737. ct(this, e3);
  3738. break;
  3739. case De.IN_TEMPLATE:
  3740. ut(this, e3);
  3741. break;
  3742. case De.AFTER_BODY:
  3743. case De.IN_FRAMESET:
  3744. case De.AFTER_FRAMESET:
  3745. case De.AFTER_AFTER_BODY:
  3746. case De.AFTER_AFTER_FRAMESET:
  3747. Ue(this, e3);
  3748. }
  3749. }
  3750. onWhitespaceCharacter(e3) {
  3751. if (this.skipNextNewLine && (this.skipNextNewLine = false, e3.chars.charCodeAt(0) === a.LINE_FEED)) {
  3752. if (1 === e3.chars.length) return;
  3753. e3.chars = e3.chars.substr(1);
  3754. }
  3755. if (this.tokenizer.inForeignNode) this._insertCharacters(e3);
  3756. else switch (this.insertionMode) {
  3757. case De.IN_HEAD:
  3758. case De.IN_HEAD_NO_SCRIPT:
  3759. case De.AFTER_HEAD:
  3760. case De.TEXT:
  3761. case De.IN_COLUMN_GROUP:
  3762. case De.IN_SELECT:
  3763. case De.IN_SELECT_IN_TABLE:
  3764. case De.IN_FRAMESET:
  3765. case De.AFTER_FRAMESET:
  3766. this._insertCharacters(e3);
  3767. break;
  3768. case De.IN_BODY:
  3769. case De.IN_CAPTION:
  3770. case De.IN_CELL:
  3771. case De.IN_TEMPLATE:
  3772. case De.AFTER_BODY:
  3773. case De.AFTER_AFTER_BODY:
  3774. case De.AFTER_AFTER_FRAMESET:
  3775. Xe(this, e3);
  3776. break;
  3777. case De.IN_TABLE:
  3778. case De.IN_TABLE_BODY:
  3779. case De.IN_ROW:
  3780. st(this, e3);
  3781. break;
  3782. case De.IN_TABLE_TEXT:
  3783. it(this, e3);
  3784. }
  3785. }
  3786. }
  3787. function Me(e3, t2) {
  3788. let s2 = e3.activeFormattingElements.getElementEntryInScopeWithTagName(t2.tagName);
  3789. return s2 ? e3.openElements.contains(s2.element) ? e3.openElements.hasInScope(t2.tagID) || (s2 = null) : (e3.activeFormattingElements.removeEntry(s2), s2 = null) : $e(e3, t2), s2;
  3790. }
  3791. function ge(e3, t2) {
  3792. let s2 = null, a2 = e3.openElements.stackTop;
  3793. for (; a2 >= 0; a2--) {
  3794. const r2 = e3.openElements.items[a2];
  3795. if (r2 === t2.element) break;
  3796. e3._isSpecialElement(r2, e3.openElements.tagIDs[a2]) && (s2 = r2);
  3797. }
  3798. return s2 || (e3.openElements.shortenToLength(a2 < 0 ? 0 : a2), e3.activeFormattingElements.removeEntry(t2)), s2;
  3799. }
  3800. function Pe(e3, t2, s2) {
  3801. let a2 = t2, r2 = e3.openElements.getCommonAncestor(t2);
  3802. for (let n2 = 0, i2 = r2; i2 !== s2; n2++, i2 = r2) {
  3803. r2 = e3.openElements.getCommonAncestor(i2);
  3804. const s3 = e3.activeFormattingElements.getElementEntry(i2), o2 = s3 && n2 >= Se;
  3805. !s3 || o2 ? (o2 && e3.activeFormattingElements.removeEntry(s3), e3.openElements.remove(i2)) : (i2 = ke(e3, s3), a2 === t2 && (e3.activeFormattingElements.bookmark = s3), e3.treeAdapter.detachNode(a2), e3.treeAdapter.appendChild(i2, a2), a2 = i2);
  3806. }
  3807. return a2;
  3808. }
  3809. function ke(e3, t2) {
  3810. const s2 = e3.treeAdapter.getNamespaceURI(t2.element), a2 = e3.treeAdapter.createElement(t2.token.tagName, s2, t2.token.attrs);
  3811. return e3.openElements.replace(t2.element, a2), t2.element = a2, a2;
  3812. }
  3813. function be(e3, t2, s2) {
  3814. const a2 = O(e3.treeAdapter.getTagName(t2));
  3815. if (e3._isElementCausesFosterParenting(a2)) e3._fosterParentElement(s2);
  3816. else {
  3817. const r2 = e3.treeAdapter.getNamespaceURI(t2);
  3818. a2 === S.TEMPLATE && r2 === u.HTML && (t2 = e3.treeAdapter.getTemplateContent(t2)), e3.treeAdapter.appendChild(t2, s2);
  3819. }
  3820. }
  3821. function Be(e3, t2, s2) {
  3822. const a2 = e3.treeAdapter.getNamespaceURI(s2.element), { token: r2 } = s2, n2 = e3.treeAdapter.createElement(r2.tagName, a2, r2.attrs);
  3823. e3._adoptNodes(t2, n2), e3.treeAdapter.appendChild(t2, n2), e3.activeFormattingElements.insertElementAfterBookmark(n2, r2), e3.activeFormattingElements.removeEntry(s2), e3.openElements.remove(s2.element), e3.openElements.insertAfter(t2, n2, r2.tagID);
  3824. }
  3825. function He(e3, t2) {
  3826. for (let s2 = 0; s2 < Ce; s2++) {
  3827. const s3 = Me(e3, t2);
  3828. if (!s3) break;
  3829. const a2 = ge(e3, s3);
  3830. if (!a2) break;
  3831. e3.activeFormattingElements.bookmark = s3;
  3832. const r2 = Pe(e3, a2, s3.element), n2 = e3.openElements.getCommonAncestor(s3.element);
  3833. e3.treeAdapter.detachNode(r2), n2 && be(e3, n2, r2), Be(e3, a2, s3);
  3834. }
  3835. }
  3836. function Fe(e3, t2) {
  3837. e3._appendCommentNode(t2, e3.openElements.currentTmplContentOrNode);
  3838. }
  3839. function Ue(e3, t2) {
  3840. if (e3.stopped = true, t2.location) {
  3841. const s2 = e3.fragmentContext ? 0 : 2;
  3842. for (let a2 = e3.openElements.stackTop; a2 >= s2; a2--) e3._setEndLocation(e3.openElements.items[a2], t2);
  3843. if (!e3.fragmentContext && e3.openElements.stackTop >= 0) {
  3844. const s3 = e3.openElements.items[0], a2 = e3.treeAdapter.getNodeSourceCodeLocation(s3);
  3845. if (a2 && !a2.endTag && (e3._setEndLocation(s3, t2), e3.openElements.stackTop >= 1)) {
  3846. const s4 = e3.openElements.items[1], a3 = e3.treeAdapter.getNodeSourceCodeLocation(s4);
  3847. a3 && !a3.endTag && e3._setEndLocation(s4, t2);
  3848. }
  3849. }
  3850. }
  3851. }
  3852. function ye(e3, t2) {
  3853. e3._err(t2, T.missingDoctype, true), e3.treeAdapter.setDocumentMode(e3.document, I.QUIRKS), e3.insertionMode = De.BEFORE_HTML, e3._processToken(t2);
  3854. }
  3855. function Ge(e3, t2) {
  3856. e3._insertFakeRootElement(), e3.insertionMode = De.BEFORE_HEAD, e3._processToken(t2);
  3857. }
  3858. function we(e3, t2) {
  3859. e3._insertFakeElement(C.HEAD, S.HEAD), e3.headElement = e3.openElements.current, e3.insertionMode = De.IN_HEAD, e3._processToken(t2);
  3860. }
  3861. function xe(e3, t2) {
  3862. switch (t2.tagID) {
  3863. case S.HTML:
  3864. Ze(e3, t2);
  3865. break;
  3866. case S.BASE:
  3867. case S.BASEFONT:
  3868. case S.BGSOUND:
  3869. case S.LINK:
  3870. case S.META:
  3871. e3._appendElement(t2, u.HTML), t2.ackSelfClosing = true;
  3872. break;
  3873. case S.TITLE:
  3874. e3._switchToTextParsing(t2, k.RCDATA);
  3875. break;
  3876. case S.NOSCRIPT:
  3877. e3.options.scriptingEnabled ? e3._switchToTextParsing(t2, k.RAWTEXT) : (e3._insertElement(t2, u.HTML), e3.insertionMode = De.IN_HEAD_NO_SCRIPT);
  3878. break;
  3879. case S.NOFRAMES:
  3880. case S.STYLE:
  3881. e3._switchToTextParsing(t2, k.RAWTEXT);
  3882. break;
  3883. case S.SCRIPT:
  3884. e3._switchToTextParsing(t2, k.SCRIPT_DATA);
  3885. break;
  3886. case S.TEMPLATE:
  3887. e3._insertTemplate(t2), e3.activeFormattingElements.insertMarker(), e3.framesetOk = false, e3.insertionMode = De.IN_TEMPLATE, e3.tmplInsertionModeStack.unshift(De.IN_TEMPLATE);
  3888. break;
  3889. case S.HEAD:
  3890. e3._err(t2, T.misplacedStartTagForHeadElement);
  3891. break;
  3892. default:
  3893. ve(e3, t2);
  3894. }
  3895. }
  3896. function Ye(e3, t2) {
  3897. e3.openElements.tmplCount > 0 ? (e3.openElements.generateImpliedEndTagsThoroughly(), e3.openElements.currentTagId !== S.TEMPLATE && e3._err(t2, T.closingOfElementWithOpenChildElements), e3.openElements.popUntilTagNamePopped(S.TEMPLATE), e3.activeFormattingElements.clearToLastMarker(), e3.tmplInsertionModeStack.shift(), e3._resetInsertionMode()) : e3._err(t2, T.endTagWithoutMatchingOpenElement);
  3898. }
  3899. function ve(e3, t2) {
  3900. e3.openElements.pop(), e3.insertionMode = De.AFTER_HEAD, e3._processToken(t2);
  3901. }
  3902. function Qe(e3, t2) {
  3903. const s2 = t2.type === h.EOF ? T.openElementsLeftAfterEof : T.disallowedContentInNoscriptInHead;
  3904. e3._err(t2, s2), e3.openElements.pop(), e3.insertionMode = De.IN_HEAD, e3._processToken(t2);
  3905. }
  3906. function qe(e3, t2) {
  3907. e3._insertFakeElement(C.BODY, S.BODY), e3.insertionMode = De.IN_BODY, We(e3, t2);
  3908. }
  3909. function We(e3, t2) {
  3910. switch (t2.type) {
  3911. case h.CHARACTER:
  3912. Ke(e3, t2);
  3913. break;
  3914. case h.WHITESPACE_CHARACTER:
  3915. Xe(e3, t2);
  3916. break;
  3917. case h.COMMENT:
  3918. Fe(e3, t2);
  3919. break;
  3920. case h.START_TAG:
  3921. Ze(e3, t2);
  3922. break;
  3923. case h.END_TAG:
  3924. et(e3, t2);
  3925. break;
  3926. case h.EOF:
  3927. tt(e3, t2);
  3928. }
  3929. }
  3930. function Xe(e3, t2) {
  3931. e3._reconstructActiveFormattingElements(), e3._insertCharacters(t2);
  3932. }
  3933. function Ke(e3, t2) {
  3934. e3._reconstructActiveFormattingElements(), e3._insertCharacters(t2), e3.framesetOk = false;
  3935. }
  3936. function Ve(e3, t2) {
  3937. e3._reconstructActiveFormattingElements(), e3._appendElement(t2, u.HTML), e3.framesetOk = false, t2.ackSelfClosing = true;
  3938. }
  3939. function ze(e3) {
  3940. const t2 = A(e3, N.TYPE);
  3941. return null != t2 && t2.toLowerCase() === Ie;
  3942. }
  3943. function je(e3, t2) {
  3944. e3._switchToTextParsing(t2, k.RAWTEXT);
  3945. }
  3946. function Je(e3, t2) {
  3947. e3._reconstructActiveFormattingElements(), e3._insertElement(t2, u.HTML);
  3948. }
  3949. function Ze(e3, t2) {
  3950. switch (t2.tagID) {
  3951. case S.I:
  3952. case S.S:
  3953. case S.B:
  3954. case S.U:
  3955. case S.EM:
  3956. case S.TT:
  3957. case S.BIG:
  3958. case S.CODE:
  3959. case S.FONT:
  3960. case S.SMALL:
  3961. case S.STRIKE:
  3962. case S.STRONG:
  3963. !function(e4, t3) {
  3964. e4._reconstructActiveFormattingElements(), e4._insertElement(t3, u.HTML), e4.activeFormattingElements.pushElement(e4.openElements.current, t3);
  3965. }(e3, t2);
  3966. break;
  3967. case S.A:
  3968. !function(e4, t3) {
  3969. const s2 = e4.activeFormattingElements.getElementEntryInScopeWithTagName(C.A);
  3970. s2 && (He(e4, t3), e4.openElements.remove(s2.element), e4.activeFormattingElements.removeEntry(s2)), e4._reconstructActiveFormattingElements(), e4._insertElement(t3, u.HTML), e4.activeFormattingElements.pushElement(e4.openElements.current, t3);
  3971. }(e3, t2);
  3972. break;
  3973. case S.H1:
  3974. case S.H2:
  3975. case S.H3:
  3976. case S.H4:
  3977. case S.H5:
  3978. case S.H6:
  3979. !function(e4, t3) {
  3980. e4.openElements.hasInButtonScope(S.P) && e4._closePElement(), M(e4.openElements.currentTagId) && e4.openElements.pop(), e4._insertElement(t3, u.HTML);
  3981. }(e3, t2);
  3982. break;
  3983. case S.P:
  3984. case S.DL:
  3985. case S.OL:
  3986. case S.UL:
  3987. case S.DIV:
  3988. case S.DIR:
  3989. case S.NAV:
  3990. case S.MAIN:
  3991. case S.MENU:
  3992. case S.ASIDE:
  3993. case S.CENTER:
  3994. case S.FIGURE:
  3995. case S.FOOTER:
  3996. case S.HEADER:
  3997. case S.HGROUP:
  3998. case S.DIALOG:
  3999. case S.DETAILS:
  4000. case S.ADDRESS:
  4001. case S.ARTICLE:
  4002. case S.SECTION:
  4003. case S.SUMMARY:
  4004. case S.FIELDSET:
  4005. case S.BLOCKQUOTE:
  4006. case S.FIGCAPTION:
  4007. !function(e4, t3) {
  4008. e4.openElements.hasInButtonScope(S.P) && e4._closePElement(), e4._insertElement(t3, u.HTML);
  4009. }(e3, t2);
  4010. break;
  4011. case S.LI:
  4012. case S.DD:
  4013. case S.DT:
  4014. !function(e4, t3) {
  4015. e4.framesetOk = false;
  4016. const s2 = t3.tagID;
  4017. for (let t4 = e4.openElements.stackTop; t4 >= 0; t4--) {
  4018. const a2 = e4.openElements.tagIDs[t4];
  4019. if (s2 === S.LI && a2 === S.LI || (s2 === S.DD || s2 === S.DT) && (a2 === S.DD || a2 === S.DT)) {
  4020. e4.openElements.generateImpliedEndTagsWithExclusion(a2), e4.openElements.popUntilTagNamePopped(a2);
  4021. break;
  4022. }
  4023. if (a2 !== S.ADDRESS && a2 !== S.DIV && a2 !== S.P && e4._isSpecialElement(e4.openElements.items[t4], a2)) break;
  4024. }
  4025. e4.openElements.hasInButtonScope(S.P) && e4._closePElement(), e4._insertElement(t3, u.HTML);
  4026. }(e3, t2);
  4027. break;
  4028. case S.BR:
  4029. case S.IMG:
  4030. case S.WBR:
  4031. case S.AREA:
  4032. case S.EMBED:
  4033. case S.KEYGEN:
  4034. Ve(e3, t2);
  4035. break;
  4036. case S.HR:
  4037. !function(e4, t3) {
  4038. e4.openElements.hasInButtonScope(S.P) && e4._closePElement(), e4._appendElement(t3, u.HTML), e4.framesetOk = false, t3.ackSelfClosing = true;
  4039. }(e3, t2);
  4040. break;
  4041. case S.RB:
  4042. case S.RTC:
  4043. !function(e4, t3) {
  4044. e4.openElements.hasInScope(S.RUBY) && e4.openElements.generateImpliedEndTags(), e4._insertElement(t3, u.HTML);
  4045. }(e3, t2);
  4046. break;
  4047. case S.RT:
  4048. case S.RP:
  4049. !function(e4, t3) {
  4050. e4.openElements.hasInScope(S.RUBY) && e4.openElements.generateImpliedEndTagsWithExclusion(S.RTC), e4._insertElement(t3, u.HTML);
  4051. }(e3, t2);
  4052. break;
  4053. case S.PRE:
  4054. case S.LISTING:
  4055. !function(e4, t3) {
  4056. e4.openElements.hasInButtonScope(S.P) && e4._closePElement(), e4._insertElement(t3, u.HTML), e4.skipNextNewLine = true, e4.framesetOk = false;
  4057. }(e3, t2);
  4058. break;
  4059. case S.XMP:
  4060. !function(e4, t3) {
  4061. e4.openElements.hasInButtonScope(S.P) && e4._closePElement(), e4._reconstructActiveFormattingElements(), e4.framesetOk = false, e4._switchToTextParsing(t3, k.RAWTEXT);
  4062. }(e3, t2);
  4063. break;
  4064. case S.SVG:
  4065. !function(e4, t3) {
  4066. e4._reconstructActiveFormattingElements(), ue(t3), Ne(t3), t3.selfClosing ? e4._appendElement(t3, u.SVG) : e4._insertElement(t3, u.SVG), t3.ackSelfClosing = true;
  4067. }(e3, t2);
  4068. break;
  4069. case S.HTML:
  4070. !function(e4, t3) {
  4071. 0 === e4.openElements.tmplCount && e4.treeAdapter.adoptAttributes(e4.openElements.items[0], t3.attrs);
  4072. }(e3, t2);
  4073. break;
  4074. case S.BASE:
  4075. case S.LINK:
  4076. case S.META:
  4077. case S.STYLE:
  4078. case S.TITLE:
  4079. case S.SCRIPT:
  4080. case S.BGSOUND:
  4081. case S.BASEFONT:
  4082. case S.TEMPLATE:
  4083. xe(e3, t2);
  4084. break;
  4085. case S.BODY:
  4086. !function(e4, t3) {
  4087. const s2 = e4.openElements.tryPeekProperlyNestedBodyElement();
  4088. s2 && 0 === e4.openElements.tmplCount && (e4.framesetOk = false, e4.treeAdapter.adoptAttributes(s2, t3.attrs));
  4089. }(e3, t2);
  4090. break;
  4091. case S.FORM:
  4092. !function(e4, t3) {
  4093. const s2 = e4.openElements.tmplCount > 0;
  4094. e4.formElement && !s2 || (e4.openElements.hasInButtonScope(S.P) && e4._closePElement(), e4._insertElement(t3, u.HTML), s2 || (e4.formElement = e4.openElements.current));
  4095. }(e3, t2);
  4096. break;
  4097. case S.NOBR:
  4098. !function(e4, t3) {
  4099. e4._reconstructActiveFormattingElements(), e4.openElements.hasInScope(S.NOBR) && (He(e4, t3), e4._reconstructActiveFormattingElements()), e4._insertElement(t3, u.HTML), e4.activeFormattingElements.pushElement(e4.openElements.current, t3);
  4100. }(e3, t2);
  4101. break;
  4102. case S.MATH:
  4103. !function(e4, t3) {
  4104. e4._reconstructActiveFormattingElements(), pe(t3), Ne(t3), t3.selfClosing ? e4._appendElement(t3, u.MATHML) : e4._insertElement(t3, u.MATHML), t3.ackSelfClosing = true;
  4105. }(e3, t2);
  4106. break;
  4107. case S.TABLE:
  4108. !function(e4, t3) {
  4109. e4.treeAdapter.getDocumentMode(e4.document) !== I.QUIRKS && e4.openElements.hasInButtonScope(S.P) && e4._closePElement(), e4._insertElement(t3, u.HTML), e4.framesetOk = false, e4.insertionMode = De.IN_TABLE;
  4110. }(e3, t2);
  4111. break;
  4112. case S.INPUT:
  4113. !function(e4, t3) {
  4114. e4._reconstructActiveFormattingElements(), e4._appendElement(t3, u.HTML), ze(t3) || (e4.framesetOk = false), t3.ackSelfClosing = true;
  4115. }(e3, t2);
  4116. break;
  4117. case S.PARAM:
  4118. case S.TRACK:
  4119. case S.SOURCE:
  4120. !function(e4, t3) {
  4121. e4._appendElement(t3, u.HTML), t3.ackSelfClosing = true;
  4122. }(e3, t2);
  4123. break;
  4124. case S.IMAGE:
  4125. !function(e4, t3) {
  4126. t3.tagName = C.IMG, t3.tagID = S.IMG, Ve(e4, t3);
  4127. }(e3, t2);
  4128. break;
  4129. case S.BUTTON:
  4130. !function(e4, t3) {
  4131. e4.openElements.hasInScope(S.BUTTON) && (e4.openElements.generateImpliedEndTags(), e4.openElements.popUntilTagNamePopped(S.BUTTON)), e4._reconstructActiveFormattingElements(), e4._insertElement(t3, u.HTML), e4.framesetOk = false;
  4132. }(e3, t2);
  4133. break;
  4134. case S.APPLET:
  4135. case S.OBJECT:
  4136. case S.MARQUEE:
  4137. !function(e4, t3) {
  4138. e4._reconstructActiveFormattingElements(), e4._insertElement(t3, u.HTML), e4.activeFormattingElements.insertMarker(), e4.framesetOk = false;
  4139. }(e3, t2);
  4140. break;
  4141. case S.IFRAME:
  4142. !function(e4, t3) {
  4143. e4.framesetOk = false, e4._switchToTextParsing(t3, k.RAWTEXT);
  4144. }(e3, t2);
  4145. break;
  4146. case S.SELECT:
  4147. !function(e4, t3) {
  4148. e4._reconstructActiveFormattingElements(), e4._insertElement(t3, u.HTML), e4.framesetOk = false, e4.insertionMode = e4.insertionMode === De.IN_TABLE || e4.insertionMode === De.IN_CAPTION || e4.insertionMode === De.IN_TABLE_BODY || e4.insertionMode === De.IN_ROW || e4.insertionMode === De.IN_CELL ? De.IN_SELECT_IN_TABLE : De.IN_SELECT;
  4149. }(e3, t2);
  4150. break;
  4151. case S.OPTION:
  4152. case S.OPTGROUP:
  4153. !function(e4, t3) {
  4154. e4.openElements.currentTagId === S.OPTION && e4.openElements.pop(), e4._reconstructActiveFormattingElements(), e4._insertElement(t3, u.HTML);
  4155. }(e3, t2);
  4156. break;
  4157. case S.NOEMBED:
  4158. je(e3, t2);
  4159. break;
  4160. case S.FRAMESET:
  4161. !function(e4, t3) {
  4162. const s2 = e4.openElements.tryPeekProperlyNestedBodyElement();
  4163. e4.framesetOk && s2 && (e4.treeAdapter.detachNode(s2), e4.openElements.popAllUpToHtmlElement(), e4._insertElement(t3, u.HTML), e4.insertionMode = De.IN_FRAMESET);
  4164. }(e3, t2);
  4165. break;
  4166. case S.TEXTAREA:
  4167. !function(e4, t3) {
  4168. e4._insertElement(t3, u.HTML), e4.skipNextNewLine = true, e4.tokenizer.state = k.RCDATA, e4.originalInsertionMode = e4.insertionMode, e4.framesetOk = false, e4.insertionMode = De.TEXT;
  4169. }(e3, t2);
  4170. break;
  4171. case S.NOSCRIPT:
  4172. e3.options.scriptingEnabled ? je(e3, t2) : Je(e3, t2);
  4173. break;
  4174. case S.PLAINTEXT:
  4175. !function(e4, t3) {
  4176. e4.openElements.hasInButtonScope(S.P) && e4._closePElement(), e4._insertElement(t3, u.HTML), e4.tokenizer.state = k.PLAINTEXT;
  4177. }(e3, t2);
  4178. break;
  4179. case S.COL:
  4180. case S.TH:
  4181. case S.TD:
  4182. case S.TR:
  4183. case S.HEAD:
  4184. case S.FRAME:
  4185. case S.TBODY:
  4186. case S.TFOOT:
  4187. case S.THEAD:
  4188. case S.CAPTION:
  4189. case S.COLGROUP:
  4190. break;
  4191. default:
  4192. Je(e3, t2);
  4193. }
  4194. }
  4195. function $e(e3, t2) {
  4196. const s2 = t2.tagName, a2 = t2.tagID;
  4197. for (let t3 = e3.openElements.stackTop; t3 > 0; t3--) {
  4198. const r2 = e3.openElements.items[t3], n2 = e3.openElements.tagIDs[t3];
  4199. if (a2 === n2 && (a2 !== S.UNKNOWN || e3.treeAdapter.getTagName(r2) === s2)) {
  4200. e3.openElements.generateImpliedEndTagsWithExclusion(a2), e3.openElements.stackTop >= t3 && e3.openElements.shortenToLength(t3);
  4201. break;
  4202. }
  4203. if (e3._isSpecialElement(r2, n2)) break;
  4204. }
  4205. }
  4206. function et(e3, t2) {
  4207. switch (t2.tagID) {
  4208. case S.A:
  4209. case S.B:
  4210. case S.I:
  4211. case S.S:
  4212. case S.U:
  4213. case S.EM:
  4214. case S.TT:
  4215. case S.BIG:
  4216. case S.CODE:
  4217. case S.FONT:
  4218. case S.NOBR:
  4219. case S.SMALL:
  4220. case S.STRIKE:
  4221. case S.STRONG:
  4222. He(e3, t2);
  4223. break;
  4224. case S.P:
  4225. !function(e4) {
  4226. e4.openElements.hasInButtonScope(S.P) || e4._insertFakeElement(C.P, S.P), e4._closePElement();
  4227. }(e3);
  4228. break;
  4229. case S.DL:
  4230. case S.UL:
  4231. case S.OL:
  4232. case S.DIR:
  4233. case S.DIV:
  4234. case S.NAV:
  4235. case S.PRE:
  4236. case S.MAIN:
  4237. case S.MENU:
  4238. case S.ASIDE:
  4239. case S.BUTTON:
  4240. case S.CENTER:
  4241. case S.FIGURE:
  4242. case S.FOOTER:
  4243. case S.HEADER:
  4244. case S.HGROUP:
  4245. case S.DIALOG:
  4246. case S.ADDRESS:
  4247. case S.ARTICLE:
  4248. case S.DETAILS:
  4249. case S.SECTION:
  4250. case S.SUMMARY:
  4251. case S.LISTING:
  4252. case S.FIELDSET:
  4253. case S.BLOCKQUOTE:
  4254. case S.FIGCAPTION:
  4255. !function(e4, t3) {
  4256. const s2 = t3.tagID;
  4257. e4.openElements.hasInScope(s2) && (e4.openElements.generateImpliedEndTags(), e4.openElements.popUntilTagNamePopped(s2));
  4258. }(e3, t2);
  4259. break;
  4260. case S.LI:
  4261. !function(e4) {
  4262. e4.openElements.hasInListItemScope(S.LI) && (e4.openElements.generateImpliedEndTagsWithExclusion(S.LI), e4.openElements.popUntilTagNamePopped(S.LI));
  4263. }(e3);
  4264. break;
  4265. case S.DD:
  4266. case S.DT:
  4267. !function(e4, t3) {
  4268. const s2 = t3.tagID;
  4269. e4.openElements.hasInScope(s2) && (e4.openElements.generateImpliedEndTagsWithExclusion(s2), e4.openElements.popUntilTagNamePopped(s2));
  4270. }(e3, t2);
  4271. break;
  4272. case S.H1:
  4273. case S.H2:
  4274. case S.H3:
  4275. case S.H4:
  4276. case S.H5:
  4277. case S.H6:
  4278. !function(e4) {
  4279. e4.openElements.hasNumberedHeaderInScope() && (e4.openElements.generateImpliedEndTags(), e4.openElements.popUntilNumberedHeaderPopped());
  4280. }(e3);
  4281. break;
  4282. case S.BR:
  4283. !function(e4) {
  4284. e4._reconstructActiveFormattingElements(), e4._insertFakeElement(C.BR, S.BR), e4.openElements.pop(), e4.framesetOk = false;
  4285. }(e3);
  4286. break;
  4287. case S.BODY:
  4288. !function(e4, t3) {
  4289. if (e4.openElements.hasInScope(S.BODY) && (e4.insertionMode = De.AFTER_BODY, e4.options.sourceCodeLocationInfo)) {
  4290. const s2 = e4.openElements.tryPeekProperlyNestedBodyElement();
  4291. s2 && e4._setEndLocation(s2, t3);
  4292. }
  4293. }(e3, t2);
  4294. break;
  4295. case S.HTML:
  4296. !function(e4, t3) {
  4297. e4.openElements.hasInScope(S.BODY) && (e4.insertionMode = De.AFTER_BODY, Nt(e4, t3));
  4298. }(e3, t2);
  4299. break;
  4300. case S.FORM:
  4301. !function(e4) {
  4302. const t3 = e4.openElements.tmplCount > 0, { formElement: s2 } = e4;
  4303. t3 || (e4.formElement = null), (s2 || t3) && e4.openElements.hasInScope(S.FORM) && (e4.openElements.generateImpliedEndTags(), t3 ? e4.openElements.popUntilTagNamePopped(S.FORM) : s2 && e4.openElements.remove(s2));
  4304. }(e3);
  4305. break;
  4306. case S.APPLET:
  4307. case S.OBJECT:
  4308. case S.MARQUEE:
  4309. !function(e4, t3) {
  4310. const s2 = t3.tagID;
  4311. e4.openElements.hasInScope(s2) && (e4.openElements.generateImpliedEndTags(), e4.openElements.popUntilTagNamePopped(s2), e4.activeFormattingElements.clearToLastMarker());
  4312. }(e3, t2);
  4313. break;
  4314. case S.TEMPLATE:
  4315. Ye(e3, t2);
  4316. break;
  4317. default:
  4318. $e(e3, t2);
  4319. }
  4320. }
  4321. function tt(e3, t2) {
  4322. e3.tmplInsertionModeStack.length > 0 ? ut(e3, t2) : Ue(e3, t2);
  4323. }
  4324. function st(e3, t2) {
  4325. if (Oe.has(e3.openElements.currentTagId)) switch (e3.pendingCharacterTokens.length = 0, e3.hasNonWhitespacePendingCharacterToken = false, e3.originalInsertionMode = e3.insertionMode, e3.insertionMode = De.IN_TABLE_TEXT, t2.type) {
  4326. case h.CHARACTER:
  4327. ot(e3, t2);
  4328. break;
  4329. case h.WHITESPACE_CHARACTER:
  4330. it(e3, t2);
  4331. }
  4332. else nt(e3, t2);
  4333. }
  4334. function at(e3, t2) {
  4335. switch (t2.tagID) {
  4336. case S.TD:
  4337. case S.TH:
  4338. case S.TR:
  4339. !function(e4, t3) {
  4340. e4.openElements.clearBackToTableContext(), e4._insertFakeElement(C.TBODY, S.TBODY), e4.insertionMode = De.IN_TABLE_BODY, _t(e4, t3);
  4341. }(e3, t2);
  4342. break;
  4343. case S.STYLE:
  4344. case S.SCRIPT:
  4345. case S.TEMPLATE:
  4346. xe(e3, t2);
  4347. break;
  4348. case S.COL:
  4349. !function(e4, t3) {
  4350. e4.openElements.clearBackToTableContext(), e4._insertFakeElement(C.COLGROUP, S.COLGROUP), e4.insertionMode = De.IN_COLUMN_GROUP, Tt(e4, t3);
  4351. }(e3, t2);
  4352. break;
  4353. case S.FORM:
  4354. !function(e4, t3) {
  4355. e4.formElement || 0 !== e4.openElements.tmplCount || (e4._insertElement(t3, u.HTML), e4.formElement = e4.openElements.current, e4.openElements.pop());
  4356. }(e3, t2);
  4357. break;
  4358. case S.TABLE:
  4359. !function(e4, t3) {
  4360. e4.openElements.hasInTableScope(S.TABLE) && (e4.openElements.popUntilTagNamePopped(S.TABLE), e4._resetInsertionMode(), e4._processStartTag(t3));
  4361. }(e3, t2);
  4362. break;
  4363. case S.TBODY:
  4364. case S.TFOOT:
  4365. case S.THEAD:
  4366. !function(e4, t3) {
  4367. e4.openElements.clearBackToTableContext(), e4._insertElement(t3, u.HTML), e4.insertionMode = De.IN_TABLE_BODY;
  4368. }(e3, t2);
  4369. break;
  4370. case S.INPUT:
  4371. !function(e4, t3) {
  4372. ze(t3) ? e4._appendElement(t3, u.HTML) : nt(e4, t3), t3.ackSelfClosing = true;
  4373. }(e3, t2);
  4374. break;
  4375. case S.CAPTION:
  4376. !function(e4, t3) {
  4377. e4.openElements.clearBackToTableContext(), e4.activeFormattingElements.insertMarker(), e4._insertElement(t3, u.HTML), e4.insertionMode = De.IN_CAPTION;
  4378. }(e3, t2);
  4379. break;
  4380. case S.COLGROUP:
  4381. !function(e4, t3) {
  4382. e4.openElements.clearBackToTableContext(), e4._insertElement(t3, u.HTML), e4.insertionMode = De.IN_COLUMN_GROUP;
  4383. }(e3, t2);
  4384. break;
  4385. default:
  4386. nt(e3, t2);
  4387. }
  4388. }
  4389. function rt(e3, t2) {
  4390. switch (t2.tagID) {
  4391. case S.TABLE:
  4392. e3.openElements.hasInTableScope(S.TABLE) && (e3.openElements.popUntilTagNamePopped(S.TABLE), e3._resetInsertionMode());
  4393. break;
  4394. case S.TEMPLATE:
  4395. Ye(e3, t2);
  4396. break;
  4397. case S.BODY:
  4398. case S.CAPTION:
  4399. case S.COL:
  4400. case S.COLGROUP:
  4401. case S.HTML:
  4402. case S.TBODY:
  4403. case S.TD:
  4404. case S.TFOOT:
  4405. case S.TH:
  4406. case S.THEAD:
  4407. case S.TR:
  4408. break;
  4409. default:
  4410. nt(e3, t2);
  4411. }
  4412. }
  4413. function nt(e3, t2) {
  4414. const s2 = e3.fosterParentingEnabled;
  4415. e3.fosterParentingEnabled = true, We(e3, t2), e3.fosterParentingEnabled = s2;
  4416. }
  4417. function it(e3, t2) {
  4418. e3.pendingCharacterTokens.push(t2);
  4419. }
  4420. function ot(e3, t2) {
  4421. e3.pendingCharacterTokens.push(t2), e3.hasNonWhitespacePendingCharacterToken = true;
  4422. }
  4423. function ct(e3, t2) {
  4424. let s2 = 0;
  4425. if (e3.hasNonWhitespacePendingCharacterToken) for (; s2 < e3.pendingCharacterTokens.length; s2++) nt(e3, e3.pendingCharacterTokens[s2]);
  4426. else for (; s2 < e3.pendingCharacterTokens.length; s2++) e3._insertCharacters(e3.pendingCharacterTokens[s2]);
  4427. e3.insertionMode = e3.originalInsertionMode, e3._processToken(t2);
  4428. }
  4429. const Et = /* @__PURE__ */ new Set([S.CAPTION, S.COL, S.COLGROUP, S.TBODY, S.TD, S.TFOOT, S.TH, S.THEAD, S.TR]);
  4430. function Tt(e3, t2) {
  4431. switch (t2.tagID) {
  4432. case S.HTML:
  4433. Ze(e3, t2);
  4434. break;
  4435. case S.COL:
  4436. e3._appendElement(t2, u.HTML), t2.ackSelfClosing = true;
  4437. break;
  4438. case S.TEMPLATE:
  4439. xe(e3, t2);
  4440. break;
  4441. default:
  4442. ht(e3, t2);
  4443. }
  4444. }
  4445. function ht(e3, t2) {
  4446. e3.openElements.currentTagId === S.COLGROUP && (e3.openElements.pop(), e3.insertionMode = De.IN_TABLE, e3._processToken(t2));
  4447. }
  4448. function _t(e3, t2) {
  4449. switch (t2.tagID) {
  4450. case S.TR:
  4451. e3.openElements.clearBackToTableBodyContext(), e3._insertElement(t2, u.HTML), e3.insertionMode = De.IN_ROW;
  4452. break;
  4453. case S.TH:
  4454. case S.TD:
  4455. e3.openElements.clearBackToTableBodyContext(), e3._insertFakeElement(C.TR, S.TR), e3.insertionMode = De.IN_ROW, lt(e3, t2);
  4456. break;
  4457. case S.CAPTION:
  4458. case S.COL:
  4459. case S.COLGROUP:
  4460. case S.TBODY:
  4461. case S.TFOOT:
  4462. case S.THEAD:
  4463. e3.openElements.hasTableBodyContextInTableScope() && (e3.openElements.clearBackToTableBodyContext(), e3.openElements.pop(), e3.insertionMode = De.IN_TABLE, at(e3, t2));
  4464. break;
  4465. default:
  4466. at(e3, t2);
  4467. }
  4468. }
  4469. function At(e3, t2) {
  4470. const s2 = t2.tagID;
  4471. switch (t2.tagID) {
  4472. case S.TBODY:
  4473. case S.TFOOT:
  4474. case S.THEAD:
  4475. e3.openElements.hasInTableScope(s2) && (e3.openElements.clearBackToTableBodyContext(), e3.openElements.pop(), e3.insertionMode = De.IN_TABLE);
  4476. break;
  4477. case S.TABLE:
  4478. e3.openElements.hasTableBodyContextInTableScope() && (e3.openElements.clearBackToTableBodyContext(), e3.openElements.pop(), e3.insertionMode = De.IN_TABLE, rt(e3, t2));
  4479. break;
  4480. case S.BODY:
  4481. case S.CAPTION:
  4482. case S.COL:
  4483. case S.COLGROUP:
  4484. case S.HTML:
  4485. case S.TD:
  4486. case S.TH:
  4487. case S.TR:
  4488. break;
  4489. default:
  4490. rt(e3, t2);
  4491. }
  4492. }
  4493. function lt(e3, t2) {
  4494. switch (t2.tagID) {
  4495. case S.TH:
  4496. case S.TD:
  4497. e3.openElements.clearBackToTableRowContext(), e3._insertElement(t2, u.HTML), e3.insertionMode = De.IN_CELL, e3.activeFormattingElements.insertMarker();
  4498. break;
  4499. case S.CAPTION:
  4500. case S.COL:
  4501. case S.COLGROUP:
  4502. case S.TBODY:
  4503. case S.TFOOT:
  4504. case S.THEAD:
  4505. case S.TR:
  4506. e3.openElements.hasInTableScope(S.TR) && (e3.openElements.clearBackToTableRowContext(), e3.openElements.pop(), e3.insertionMode = De.IN_TABLE_BODY, _t(e3, t2));
  4507. break;
  4508. default:
  4509. at(e3, t2);
  4510. }
  4511. }
  4512. function mt(e3, t2) {
  4513. switch (t2.tagID) {
  4514. case S.TR:
  4515. e3.openElements.hasInTableScope(S.TR) && (e3.openElements.clearBackToTableRowContext(), e3.openElements.pop(), e3.insertionMode = De.IN_TABLE_BODY);
  4516. break;
  4517. case S.TABLE:
  4518. e3.openElements.hasInTableScope(S.TR) && (e3.openElements.clearBackToTableRowContext(), e3.openElements.pop(), e3.insertionMode = De.IN_TABLE_BODY, At(e3, t2));
  4519. break;
  4520. case S.TBODY:
  4521. case S.TFOOT:
  4522. case S.THEAD:
  4523. (e3.openElements.hasInTableScope(t2.tagID) || e3.openElements.hasInTableScope(S.TR)) && (e3.openElements.clearBackToTableRowContext(), e3.openElements.pop(), e3.insertionMode = De.IN_TABLE_BODY, At(e3, t2));
  4524. break;
  4525. case S.BODY:
  4526. case S.CAPTION:
  4527. case S.COL:
  4528. case S.COLGROUP:
  4529. case S.HTML:
  4530. case S.TD:
  4531. case S.TH:
  4532. break;
  4533. default:
  4534. rt(e3, t2);
  4535. }
  4536. }
  4537. function dt(e3, t2) {
  4538. switch (t2.tagID) {
  4539. case S.HTML:
  4540. Ze(e3, t2);
  4541. break;
  4542. case S.OPTION:
  4543. e3.openElements.currentTagId === S.OPTION && e3.openElements.pop(), e3._insertElement(t2, u.HTML);
  4544. break;
  4545. case S.OPTGROUP:
  4546. e3.openElements.currentTagId === S.OPTION && e3.openElements.pop(), e3.openElements.currentTagId === S.OPTGROUP && e3.openElements.pop(), e3._insertElement(t2, u.HTML);
  4547. break;
  4548. case S.INPUT:
  4549. case S.KEYGEN:
  4550. case S.TEXTAREA:
  4551. case S.SELECT:
  4552. e3.openElements.hasInSelectScope(S.SELECT) && (e3.openElements.popUntilTagNamePopped(S.SELECT), e3._resetInsertionMode(), t2.tagID !== S.SELECT && e3._processStartTag(t2));
  4553. break;
  4554. case S.SCRIPT:
  4555. case S.TEMPLATE:
  4556. xe(e3, t2);
  4557. }
  4558. }
  4559. function pt(e3, t2) {
  4560. switch (t2.tagID) {
  4561. case S.OPTGROUP:
  4562. e3.openElements.stackTop > 0 && e3.openElements.currentTagId === S.OPTION && e3.openElements.tagIDs[e3.openElements.stackTop - 1] === S.OPTGROUP && e3.openElements.pop(), e3.openElements.currentTagId === S.OPTGROUP && e3.openElements.pop();
  4563. break;
  4564. case S.OPTION:
  4565. e3.openElements.currentTagId === S.OPTION && e3.openElements.pop();
  4566. break;
  4567. case S.SELECT:
  4568. e3.openElements.hasInSelectScope(S.SELECT) && (e3.openElements.popUntilTagNamePopped(S.SELECT), e3._resetInsertionMode());
  4569. break;
  4570. case S.TEMPLATE:
  4571. Ye(e3, t2);
  4572. }
  4573. }
  4574. function ut(e3, t2) {
  4575. e3.openElements.tmplCount > 0 ? (e3.openElements.popUntilTagNamePopped(S.TEMPLATE), e3.activeFormattingElements.clearToLastMarker(), e3.tmplInsertionModeStack.shift(), e3._resetInsertionMode(), e3.onEof(t2)) : Ue(e3, t2);
  4576. }
  4577. function Nt(e3, t2) {
  4578. var s2;
  4579. if (t2.tagID === S.HTML) {
  4580. if (e3.fragmentContext || (e3.insertionMode = De.AFTER_AFTER_BODY), e3.options.sourceCodeLocationInfo && e3.openElements.tagIDs[0] === S.HTML) {
  4581. e3._setEndLocation(e3.openElements.items[0], t2);
  4582. const a2 = e3.openElements.items[1];
  4583. a2 && !(null === (s2 = e3.treeAdapter.getNodeSourceCodeLocation(a2)) || void 0 === s2 ? void 0 : s2.endTag) && e3._setEndLocation(a2, t2);
  4584. }
  4585. } else It(e3, t2);
  4586. }
  4587. function It(e3, t2) {
  4588. e3.insertionMode = De.IN_BODY, We(e3, t2);
  4589. }
  4590. function Ct(e3, t2) {
  4591. e3.insertionMode = De.IN_BODY, We(e3, t2);
  4592. }
  4593. function St(e3) {
  4594. for (; e3.treeAdapter.getNamespaceURI(e3.openElements.current) !== u.HTML && !e3._isIntegrationPoint(e3.openElements.currentTagId, e3.openElements.current); ) e3.openElements.pop();
  4595. }
  4596. return /* @__PURE__ */ new Set([C.AREA, C.BASE, C.BASEFONT, C.BGSOUND, C.BR, C.COL, C.EMBED, C.FRAME, C.HR, C.IMG, C.INPUT, C.KEYGEN, C.LINK, C.META, C.PARAM, C.SOURCE, C.TRACK, C.WBR]), e2.parse = function(e3, t2) {
  4597. return Le.parse(e3, t2);
  4598. }, e2.parseFragment = function(e3, t2, s2) {
  4599. "string" == typeof e3 && (s2 = t2, t2 = e3, e3 = null);
  4600. const a2 = Le.getFragmentParser(e3, s2);
  4601. return a2.tokenizer.write(t2, true), a2.getFragment();
  4602. }, Object.defineProperty(e2, "__esModule", { value: true }), e2;
  4603. }({});
  4604. var parse = e.parse;
  4605. var parseFragment = e.parseFragment;
  4606. // src/mock-doc/parse-util.ts
  4607. var docParser = /* @__PURE__ */ new WeakMap();
  4608. function parseDocumentUtil(ownerDocument, html) {
  4609. const doc = parse(html.trim(), getParser(ownerDocument));
  4610. doc.documentElement = doc.firstElementChild;
  4611. doc.head = doc.documentElement.firstElementChild;
  4612. doc.body = doc.head.nextElementSibling;
  4613. return doc;
  4614. }
  4615. function parseFragmentUtil(ownerDocument, html) {
  4616. if (typeof html === "string") {
  4617. html = html.trim();
  4618. } else {
  4619. html = "";
  4620. }
  4621. const frag = parseFragment(html, getParser(ownerDocument));
  4622. return frag;
  4623. }
  4624. function getParser(ownerDocument) {
  4625. let parseOptions = docParser.get(ownerDocument);
  4626. if (parseOptions != null) {
  4627. return parseOptions;
  4628. }
  4629. const treeAdapter = {
  4630. createDocument() {
  4631. const doc = ownerDocument.createElement("#document" /* DOCUMENT_NODE */);
  4632. doc["x-mode"] = "no-quirks";
  4633. return doc;
  4634. },
  4635. setNodeSourceCodeLocation(node, location2) {
  4636. node.sourceCodeLocation = location2;
  4637. },
  4638. getNodeSourceCodeLocation(node) {
  4639. return node.sourceCodeLocation;
  4640. },
  4641. createDocumentFragment() {
  4642. return ownerDocument.createDocumentFragment();
  4643. },
  4644. createElement(tagName, namespaceURI, attrs) {
  4645. const elm = ownerDocument.createElementNS(namespaceURI, tagName);
  4646. for (let i = 0; i < attrs.length; i++) {
  4647. const attr = attrs[i];
  4648. if (attr.namespace == null || attr.namespace === "http://www.w3.org/1999/xhtml") {
  4649. elm.setAttribute(attr.name, attr.value);
  4650. } else {
  4651. elm.setAttributeNS(attr.namespace, attr.name, attr.value);
  4652. }
  4653. }
  4654. return elm;
  4655. },
  4656. createCommentNode(data) {
  4657. return ownerDocument.createComment(data);
  4658. },
  4659. appendChild(parentNode, newNode) {
  4660. parentNode.appendChild(newNode);
  4661. },
  4662. insertBefore(parentNode, newNode, referenceNode) {
  4663. parentNode.insertBefore(newNode, referenceNode);
  4664. },
  4665. setTemplateContent(templateElement, contentElement) {
  4666. templateElement.content = contentElement;
  4667. },
  4668. getTemplateContent(templateElement) {
  4669. return templateElement.content;
  4670. },
  4671. setDocumentType(doc, name, publicId, systemId) {
  4672. let doctypeNode = doc.childNodes.find((n) => n.nodeType === 10 /* DOCUMENT_TYPE_NODE */);
  4673. if (doctypeNode == null) {
  4674. doctypeNode = ownerDocument.createDocumentTypeNode();
  4675. doc.insertBefore(doctypeNode, doc.firstChild);
  4676. }
  4677. doctypeNode.nodeValue = "!DOCTYPE";
  4678. doctypeNode["x-name"] = name;
  4679. doctypeNode["x-publicId"] = publicId;
  4680. doctypeNode["x-systemId"] = systemId;
  4681. },
  4682. setDocumentMode(doc, mode) {
  4683. doc["x-mode"] = mode;
  4684. },
  4685. getDocumentMode(doc) {
  4686. return doc["x-mode"];
  4687. },
  4688. detachNode(node) {
  4689. node.remove();
  4690. },
  4691. insertText(parentNode, text) {
  4692. const lastChild = parentNode.lastChild;
  4693. if (lastChild != null && lastChild.nodeType === 3 /* TEXT_NODE */) {
  4694. lastChild.nodeValue += text;
  4695. } else {
  4696. parentNode.appendChild(ownerDocument.createTextNode(text));
  4697. }
  4698. },
  4699. insertTextBefore(parentNode, text, referenceNode) {
  4700. const prevNode = parentNode.childNodes[parentNode.childNodes.indexOf(referenceNode) - 1];
  4701. if (prevNode != null && prevNode.nodeType === 3 /* TEXT_NODE */) {
  4702. prevNode.nodeValue += text;
  4703. } else {
  4704. parentNode.insertBefore(ownerDocument.createTextNode(text), referenceNode);
  4705. }
  4706. },
  4707. adoptAttributes(recipient, attrs) {
  4708. for (let i = 0; i < attrs.length; i++) {
  4709. const attr = attrs[i];
  4710. if (recipient.hasAttributeNS(attr.namespace, attr.name) === false) {
  4711. recipient.setAttributeNS(attr.namespace, attr.name, attr.value);
  4712. }
  4713. }
  4714. },
  4715. getFirstChild(node) {
  4716. return node.childNodes[0];
  4717. },
  4718. getChildNodes(node) {
  4719. return node.childNodes;
  4720. },
  4721. getParentNode(node) {
  4722. return node.parentNode;
  4723. },
  4724. getAttrList(element) {
  4725. const attrs = element.attributes.__items.map((attr) => {
  4726. return {
  4727. name: attr.name,
  4728. value: attr.value,
  4729. namespace: attr.namespaceURI,
  4730. prefix: null
  4731. };
  4732. });
  4733. return attrs;
  4734. },
  4735. getTagName(element) {
  4736. if (element.namespaceURI === "http://www.w3.org/1999/xhtml") {
  4737. return element.nodeName.toLowerCase();
  4738. } else {
  4739. return element.nodeName;
  4740. }
  4741. },
  4742. getNamespaceURI(element) {
  4743. return element.namespaceURI;
  4744. },
  4745. getTextNodeContent(textNode) {
  4746. return textNode.nodeValue;
  4747. },
  4748. getCommentNodeContent(commentNode) {
  4749. return commentNode.nodeValue;
  4750. },
  4751. getDocumentTypeNodeName(doctypeNode) {
  4752. return doctypeNode["x-name"];
  4753. },
  4754. getDocumentTypeNodePublicId(doctypeNode) {
  4755. return doctypeNode["x-publicId"];
  4756. },
  4757. getDocumentTypeNodeSystemId(doctypeNode) {
  4758. return doctypeNode["x-systemId"];
  4759. },
  4760. // @ts-ignore - a `MockNode` will never be assignable to a `TreeAdapterTypeMap['text']`. As a result, we cannot
  4761. // complete this function signature
  4762. isTextNode(node) {
  4763. return node.nodeType === 3 /* TEXT_NODE */;
  4764. },
  4765. // @ts-ignore - a `MockNode` will never be assignable to a `TreeAdapterTypeMap['comment']`. As a result, we cannot
  4766. // complete this function signature (which requires its return type to be a type predicate)
  4767. isCommentNode(node) {
  4768. return node.nodeType === 8 /* COMMENT_NODE */;
  4769. },
  4770. // @ts-ignore - a `MockNode` will never be assignable to a `TreeAdapterTypeMap['document']`. As a result, we cannot
  4771. // complete this function signature (which requires its return type to be a type predicate)
  4772. isDocumentTypeNode(node) {
  4773. return node.nodeType === 10 /* DOCUMENT_TYPE_NODE */;
  4774. },
  4775. // @ts-ignore - a `MockNode` will never be assignable to a `TreeAdapterTypeMap['element']`. As a result, we cannot
  4776. // complete this function signature (which requires its return type to be a type predicate)
  4777. isElementNode(node) {
  4778. return node.nodeType === 1 /* ELEMENT_NODE */;
  4779. }
  4780. };
  4781. parseOptions = {
  4782. treeAdapter
  4783. };
  4784. docParser.set(ownerDocument, parseOptions);
  4785. return parseOptions;
  4786. }
  4787. // src/mock-doc/third-party/jquery.ts
  4788. var jquery_default = (
  4789. /*!
  4790. * jQuery JavaScript Library v4.0.0-pre+9352011a7.dirty +selector
  4791. * https://jquery.com/
  4792. *
  4793. * Copyright OpenJS Foundation and other contributors
  4794. * Released under the MIT license
  4795. * https://jquery.org/license
  4796. *
  4797. * Date: 2023-12-11T17:55Z
  4798. */
  4799. function(global2, factory) {
  4800. "use strict";
  4801. if (true) {
  4802. return factory(global2, true);
  4803. } else {
  4804. factory(global2);
  4805. }
  4806. }({
  4807. document: {
  4808. createElement() {
  4809. return {};
  4810. },
  4811. nodeType: 9,
  4812. documentElement: {
  4813. nodeType: 1,
  4814. nodeName: "HTML"
  4815. }
  4816. }
  4817. }, function(window2, noGlobal) {
  4818. "use strict";
  4819. if (!window2.document) {
  4820. throw new Error("jQuery requires a window with a document");
  4821. }
  4822. var arr = [];
  4823. var getProto = Object.getPrototypeOf;
  4824. var slice = arr.slice;
  4825. var flat = arr.flat ? function(array) {
  4826. return arr.flat.call(array);
  4827. } : function(array) {
  4828. return arr.concat.apply([], array);
  4829. };
  4830. var push = arr.push;
  4831. var indexOf = arr.indexOf;
  4832. var class2type = {};
  4833. var toString = class2type.toString;
  4834. var hasOwn = class2type.hasOwnProperty;
  4835. var fnToString = hasOwn.toString;
  4836. var ObjectFunctionString = fnToString.call(Object);
  4837. var support = {};
  4838. function toType(obj) {
  4839. if (obj == null) {
  4840. return obj + "";
  4841. }
  4842. return typeof obj === "object" ? class2type[toString.call(obj)] || "object" : typeof obj;
  4843. }
  4844. function isWindow(obj) {
  4845. return obj != null && obj === obj.window;
  4846. }
  4847. function isArrayLike(obj) {
  4848. var length = !!obj && obj.length, type = toType(obj);
  4849. if (typeof obj === "function" || isWindow(obj)) {
  4850. return false;
  4851. }
  4852. return type === "array" || length === 0 || typeof length === "number" && length > 0 && length - 1 in obj;
  4853. }
  4854. var document = window2.document;
  4855. var preservedScriptAttributes = {
  4856. type: true,
  4857. src: true,
  4858. nonce: true,
  4859. noModule: true
  4860. };
  4861. function DOMEval(code, node, doc) {
  4862. doc = doc || document;
  4863. var i2, script = doc.createElement("script");
  4864. script.text = code;
  4865. if (node) {
  4866. for (i2 in preservedScriptAttributes) {
  4867. if (node[i2]) {
  4868. script[i2] = node[i2];
  4869. }
  4870. }
  4871. }
  4872. doc.head.appendChild(script).parentNode.removeChild(script);
  4873. }
  4874. const jQuery = {};
  4875. var version = "4.0.0-pre+9352011a7.dirty +selector", rhtmlSuffix = /HTML$/i, jQueryOrig = function(selector, context) {
  4876. return new jQuery.fn.init(selector, context);
  4877. };
  4878. jQuery.fn = jQuery.prototype = {
  4879. // The current version of jQuery being used
  4880. jquery: version,
  4881. constructor: jQuery,
  4882. // The default length of a jQuery object is 0
  4883. length: 0,
  4884. toArray: function() {
  4885. return slice.call(this);
  4886. },
  4887. // Get the Nth element in the matched element set OR
  4888. // Get the whole matched element set as a clean array
  4889. get: function(num) {
  4890. if (num == null) {
  4891. return slice.call(this);
  4892. }
  4893. return num < 0 ? this[num + this.length] : this[num];
  4894. },
  4895. // Take an array of elements and push it onto the stack
  4896. // (returning the new matched element set)
  4897. pushStack: function(elems) {
  4898. var ret = jQuery.merge(this.constructor(), elems);
  4899. ret.prevObject = this;
  4900. return ret;
  4901. },
  4902. // Execute a callback for every element in the matched set.
  4903. each: function(callback) {
  4904. return jQuery.each(this, callback);
  4905. },
  4906. map: function(callback) {
  4907. return this.pushStack(jQuery.map(this, function(elem, i2) {
  4908. return callback.call(elem, i2, elem);
  4909. }));
  4910. },
  4911. slice: function() {
  4912. return this.pushStack(slice.apply(this, arguments));
  4913. },
  4914. first: function() {
  4915. return this.eq(0);
  4916. },
  4917. last: function() {
  4918. return this.eq(-1);
  4919. },
  4920. even: function() {
  4921. return this.pushStack(jQuery.grep(this, function(_elem, i2) {
  4922. return (i2 + 1) % 2;
  4923. }));
  4924. },
  4925. odd: function() {
  4926. return this.pushStack(jQuery.grep(this, function(_elem, i2) {
  4927. return i2 % 2;
  4928. }));
  4929. },
  4930. eq: function(i2) {
  4931. var len = this.length, j = +i2 + (i2 < 0 ? len : 0);
  4932. return this.pushStack(j >= 0 && j < len ? [this[j]] : []);
  4933. },
  4934. end: function() {
  4935. return this.prevObject || this.constructor();
  4936. }
  4937. };
  4938. jQuery.extend = jQuery.fn.extend = function() {
  4939. var options, name, src, copy, copyIsArray, clone, target = arguments[0] || {}, i2 = 1, length = arguments.length, deep = false;
  4940. if (typeof target === "boolean") {
  4941. deep = target;
  4942. target = arguments[i2] || {};
  4943. i2++;
  4944. }
  4945. if (typeof target !== "object" && typeof target !== "function") {
  4946. target = {};
  4947. }
  4948. if (i2 === length) {
  4949. target = this;
  4950. i2--;
  4951. }
  4952. for (; i2 < length; i2++) {
  4953. if ((options = arguments[i2]) != null) {
  4954. for (name in options) {
  4955. copy = options[name];
  4956. if (name === "__proto__" || target === copy) {
  4957. continue;
  4958. }
  4959. if (deep && copy && (jQuery.isPlainObject(copy) || (copyIsArray = Array.isArray(copy)))) {
  4960. src = target[name];
  4961. if (copyIsArray && !Array.isArray(src)) {
  4962. clone = [];
  4963. } else if (!copyIsArray && !jQuery.isPlainObject(src)) {
  4964. clone = {};
  4965. } else {
  4966. clone = src;
  4967. }
  4968. copyIsArray = false;
  4969. target[name] = jQuery.extend(deep, clone, copy);
  4970. } else if (copy !== void 0) {
  4971. target[name] = copy;
  4972. }
  4973. }
  4974. }
  4975. }
  4976. return target;
  4977. };
  4978. jQuery.extend({
  4979. // Unique for each copy of jQuery on the page
  4980. expando: "jQuery" + (version + Math.random()).replace(/\D/g, ""),
  4981. // Assume jQuery is ready without the ready module
  4982. isReady: true,
  4983. error: function(msg) {
  4984. throw new Error(msg);
  4985. },
  4986. noop: function() {
  4987. },
  4988. isPlainObject: function(obj) {
  4989. var proto, Ctor;
  4990. if (!obj || toString.call(obj) !== "[object Object]") {
  4991. return false;
  4992. }
  4993. proto = getProto(obj);
  4994. if (!proto) {
  4995. return true;
  4996. }
  4997. Ctor = hasOwn.call(proto, "constructor") && proto.constructor;
  4998. return typeof Ctor === "function" && fnToString.call(Ctor) === ObjectFunctionString;
  4999. },
  5000. isEmptyObject: function(obj) {
  5001. var name;
  5002. for (name in obj) {
  5003. return false;
  5004. }
  5005. return true;
  5006. },
  5007. // Evaluates a script in a provided context; falls back to the global one
  5008. // if not specified.
  5009. globalEval: function(code, options, doc) {
  5010. DOMEval(code, { nonce: options && options.nonce }, doc);
  5011. },
  5012. each: function(obj, callback) {
  5013. var length, i2 = 0;
  5014. if (isArrayLike(obj)) {
  5015. length = obj.length;
  5016. for (; i2 < length; i2++) {
  5017. if (callback.call(obj[i2], i2, obj[i2]) === false) {
  5018. break;
  5019. }
  5020. }
  5021. } else {
  5022. for (i2 in obj) {
  5023. if (callback.call(obj[i2], i2, obj[i2]) === false) {
  5024. break;
  5025. }
  5026. }
  5027. }
  5028. return obj;
  5029. },
  5030. // Retrieve the text value of an array of DOM nodes
  5031. text: function(elem) {
  5032. var node, ret = "", i2 = 0, nodeType = elem.nodeType;
  5033. if (!nodeType) {
  5034. while (node = elem[i2++]) {
  5035. ret += jQuery.text(node);
  5036. }
  5037. }
  5038. if (nodeType === 1 || nodeType === 11) {
  5039. return elem.textContent;
  5040. }
  5041. if (nodeType === 9) {
  5042. return elem.documentElement.textContent;
  5043. }
  5044. if (nodeType === 3 || nodeType === 4) {
  5045. return elem.nodeValue;
  5046. }
  5047. return ret;
  5048. },
  5049. // results is for internal usage only
  5050. makeArray: function(arr2, results) {
  5051. var ret = results || [];
  5052. if (arr2 != null) {
  5053. if (isArrayLike(Object(arr2))) {
  5054. jQuery.merge(
  5055. ret,
  5056. typeof arr2 === "string" ? [arr2] : arr2
  5057. );
  5058. } else {
  5059. push.call(ret, arr2);
  5060. }
  5061. }
  5062. return ret;
  5063. },
  5064. inArray: function(elem, arr2, i2) {
  5065. return arr2 == null ? -1 : indexOf.call(arr2, elem, i2);
  5066. },
  5067. isXMLDoc: function(elem) {
  5068. var namespace = elem && elem.namespaceURI, docElem = elem && (elem.ownerDocument || elem).documentElement;
  5069. return !rhtmlSuffix.test(namespace || docElem && docElem.nodeName || "HTML");
  5070. },
  5071. // Note: an element does not contain itself
  5072. contains: function(a, b) {
  5073. var bup = b && b.parentNode;
  5074. return a === bup || !!(bup && bup.nodeType === 1 && // Support: IE 9 - 11+
  5075. // IE doesn't have `contains` on SVG.
  5076. (a.contains ? a.contains(bup) : a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16));
  5077. },
  5078. merge: function(first, second) {
  5079. var len = +second.length, j = 0, i2 = first.length;
  5080. for (; j < len; j++) {
  5081. first[i2++] = second[j];
  5082. }
  5083. first.length = i2;
  5084. return first;
  5085. },
  5086. grep: function(elems, callback, invert) {
  5087. var callbackInverse, matches3 = [], i2 = 0, length = elems.length, callbackExpect = !invert;
  5088. for (; i2 < length; i2++) {
  5089. callbackInverse = !callback(elems[i2], i2);
  5090. if (callbackInverse !== callbackExpect) {
  5091. matches3.push(elems[i2]);
  5092. }
  5093. }
  5094. return matches3;
  5095. },
  5096. // arg is for internal usage only
  5097. map: function(elems, callback, arg) {
  5098. var length, value, i2 = 0, ret = [];
  5099. if (isArrayLike(elems)) {
  5100. length = elems.length;
  5101. for (; i2 < length; i2++) {
  5102. value = callback(elems[i2], i2, arg);
  5103. if (value != null) {
  5104. ret.push(value);
  5105. }
  5106. }
  5107. } else {
  5108. for (i2 in elems) {
  5109. value = callback(elems[i2], i2, arg);
  5110. if (value != null) {
  5111. ret.push(value);
  5112. }
  5113. }
  5114. }
  5115. return flat(ret);
  5116. },
  5117. // A global GUID counter for objects
  5118. guid: 1,
  5119. // jQuery.support is not used in Core but other projects attach their
  5120. // properties to it so it needs to exist.
  5121. support
  5122. });
  5123. if (typeof Symbol === "function") {
  5124. jQuery.fn[Symbol.iterator] = arr[Symbol.iterator];
  5125. }
  5126. jQuery.each(
  5127. "Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),
  5128. function(_i, name) {
  5129. class2type["[object " + name + "]"] = name.toLowerCase();
  5130. }
  5131. );
  5132. function nodeName(elem, name) {
  5133. return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
  5134. }
  5135. var pop = arr.pop;
  5136. var whitespace = "[\\x20\\t\\r\\n\\f]";
  5137. var isIE = document.documentMode;
  5138. try {
  5139. document.querySelector(":has(*,:jqfake)");
  5140. support.cssHas = false;
  5141. } catch (e2) {
  5142. support.cssHas = true;
  5143. }
  5144. var rbuggyQSA = [];
  5145. if (isIE) {
  5146. rbuggyQSA.push(
  5147. // Support: IE 9 - 11+
  5148. // IE's :disabled selector does not pick up the children of disabled fieldsets
  5149. ":enabled",
  5150. ":disabled",
  5151. // Support: IE 11+
  5152. // IE 11 doesn't find elements on a `[name='']` query in some cases.
  5153. // Adding a temporary attribute to the document before the selection works
  5154. // around the issue.
  5155. "\\[" + whitespace + "*name" + whitespace + "*=" + whitespace + `*(?:''|"")`
  5156. );
  5157. }
  5158. if (!support.cssHas) {
  5159. rbuggyQSA.push(":has");
  5160. }
  5161. rbuggyQSA = rbuggyQSA.length && new RegExp(rbuggyQSA.join("|"));
  5162. var rtrimCSS = new RegExp(
  5163. "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$",
  5164. "g"
  5165. );
  5166. var identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+";
  5167. var booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped";
  5168. var rleadingCombinator = new RegExp("^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*");
  5169. var rdescend = new RegExp(whitespace + "|>");
  5170. var rsibling = /[+~]/;
  5171. var documentElement = document.documentElement;
  5172. var matches2 = documentElement.matches || documentElement.msMatchesSelector;
  5173. function createCache() {
  5174. var keys = [];
  5175. function cache(key, value) {
  5176. if (keys.push(key + " ") > jQuery.expr.cacheLength) {
  5177. delete cache[keys.shift()];
  5178. }
  5179. return cache[key + " "] = value;
  5180. }
  5181. return cache;
  5182. }
  5183. function testContext(context) {
  5184. return context && typeof context.getElementsByTagName !== "undefined" && context;
  5185. }
  5186. var attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + // Operator (capture 2)
  5187. "*([*^$|!~]?=)" + whitespace + // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
  5188. `*(?:'((?:\\\\.|[^\\\\'])*)'|"((?:\\\\.|[^\\\\"])*)"|(` + identifier + "))|)" + whitespace + "*\\]";
  5189. var pseudos = ":(" + identifier + `)(?:\\((('((?:\\\\.|[^\\\\'])*)'|"((?:\\\\.|[^\\\\"])*)")|((?:\\\\.|[^\\\\()[\\]]|` + attributes + ")*)|.*)\\)|)";
  5190. var filterMatchExpr = {
  5191. ID: new RegExp("^#(" + identifier + ")"),
  5192. CLASS: new RegExp("^\\.(" + identifier + ")"),
  5193. TAG: new RegExp("^(" + identifier + "|[*])"),
  5194. ATTR: new RegExp("^" + attributes),
  5195. PSEUDO: new RegExp("^" + pseudos),
  5196. CHILD: new RegExp(
  5197. "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)",
  5198. "i"
  5199. )
  5200. };
  5201. var rpseudo = new RegExp(pseudos);
  5202. var runescape = new RegExp("\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g"), funescape = function(escape, nonHex) {
  5203. var high = "0x" + escape.slice(1) - 65536;
  5204. if (nonHex) {
  5205. return nonHex;
  5206. }
  5207. return high < 0 ? String.fromCharCode(high + 65536) : String.fromCharCode(high >> 10 | 55296, high & 1023 | 56320);
  5208. };
  5209. function unescapeSelector(sel) {
  5210. return sel.replace(runescape, funescape);
  5211. }
  5212. function selectorError(msg) {
  5213. jQuery.error("Syntax error, unrecognized expression: " + msg);
  5214. }
  5215. var rcomma = new RegExp("^" + whitespace + "*," + whitespace + "*");
  5216. var tokenCache = createCache();
  5217. function tokenize(selector, parseOnly) {
  5218. var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[selector + " "];
  5219. if (cached) {
  5220. return parseOnly ? 0 : cached.slice(0);
  5221. }
  5222. soFar = selector;
  5223. groups = [];
  5224. preFilters = jQuery.expr.preFilter;
  5225. while (soFar) {
  5226. if (!matched || (match = rcomma.exec(soFar))) {
  5227. if (match) {
  5228. soFar = soFar.slice(match[0].length) || soFar;
  5229. }
  5230. groups.push(tokens = []);
  5231. }
  5232. matched = false;
  5233. if (match = rleadingCombinator.exec(soFar)) {
  5234. matched = match.shift();
  5235. tokens.push({
  5236. value: matched,
  5237. // Cast descendant combinators to space
  5238. type: match[0].replace(rtrimCSS, " ")
  5239. });
  5240. soFar = soFar.slice(matched.length);
  5241. }
  5242. for (type in filterMatchExpr) {
  5243. if ((match = jQuery.expr.match[type].exec(soFar)) && (!preFilters[type] || (match = preFilters[type](match)))) {
  5244. matched = match.shift();
  5245. tokens.push({
  5246. value: matched,
  5247. type,
  5248. matches: match
  5249. });
  5250. soFar = soFar.slice(matched.length);
  5251. }
  5252. }
  5253. if (!matched) {
  5254. break;
  5255. }
  5256. }
  5257. if (parseOnly) {
  5258. return soFar.length;
  5259. }
  5260. return soFar ? selectorError(selector) : (
  5261. // Cache the tokens
  5262. tokenCache(selector, groups).slice(0)
  5263. );
  5264. }
  5265. var preFilter = {
  5266. ATTR: function(match) {
  5267. match[1] = unescapeSelector(match[1]);
  5268. match[3] = unescapeSelector(match[3] || match[4] || match[5] || "");
  5269. if (match[2] === "~=") {
  5270. match[3] = " " + match[3] + " ";
  5271. }
  5272. return match.slice(0, 4);
  5273. },
  5274. CHILD: function(match) {
  5275. match[1] = match[1].toLowerCase();
  5276. if (match[1].slice(0, 3) === "nth") {
  5277. if (!match[3]) {
  5278. selectorError(match[0]);
  5279. }
  5280. match[4] = +(match[4] ? match[5] + (match[6] || 1) : 2 * (match[3] === "even" || match[3] === "odd"));
  5281. match[5] = +(match[7] + match[8] || match[3] === "odd");
  5282. } else if (match[3]) {
  5283. selectorError(match[0]);
  5284. }
  5285. return match;
  5286. },
  5287. PSEUDO: function(match) {
  5288. var excess, unquoted = !match[6] && match[2];
  5289. if (filterMatchExpr.CHILD.test(match[0])) {
  5290. return null;
  5291. }
  5292. if (match[3]) {
  5293. match[2] = match[4] || match[5] || "";
  5294. } else if (unquoted && rpseudo.test(unquoted) && // Get excess from tokenize (recursively)
  5295. (excess = tokenize(unquoted, true)) && // advance to the next closing parenthesis
  5296. (excess = unquoted.indexOf(")", unquoted.length - excess) - unquoted.length)) {
  5297. match[0] = match[0].slice(0, excess);
  5298. match[2] = unquoted.slice(0, excess);
  5299. }
  5300. return match.slice(0, 3);
  5301. }
  5302. };
  5303. function toSelector(tokens) {
  5304. var i2 = 0, len = tokens.length, selector = "";
  5305. for (; i2 < len; i2++) {
  5306. selector += tokens[i2].value;
  5307. }
  5308. return selector;
  5309. }
  5310. var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;
  5311. function fcssescape(ch, asCodePoint) {
  5312. if (asCodePoint) {
  5313. if (ch === "\0") {
  5314. return "\uFFFD";
  5315. }
  5316. return ch.slice(0, -1) + "\\" + ch.charCodeAt(ch.length - 1).toString(16) + " ";
  5317. }
  5318. return "\\" + ch;
  5319. }
  5320. jQuery.escapeSelector = function(sel) {
  5321. return (sel + "").replace(rcssescape, fcssescape);
  5322. };
  5323. var sort = arr.sort;
  5324. var splice = arr.splice;
  5325. var hasDuplicate;
  5326. function sortOrder(a, b) {
  5327. if (a === b) {
  5328. hasDuplicate = true;
  5329. return 0;
  5330. }
  5331. var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
  5332. if (compare) {
  5333. return compare;
  5334. }
  5335. compare = (a.ownerDocument || a) == (b.ownerDocument || b) ? a.compareDocumentPosition(b) : (
  5336. // Otherwise we know they are disconnected
  5337. 1
  5338. );
  5339. if (compare & 1) {
  5340. if (a == document || a.ownerDocument == document && jQuery.contains(document, a)) {
  5341. return -1;
  5342. }
  5343. if (b == document || b.ownerDocument == document && jQuery.contains(document, b)) {
  5344. return 1;
  5345. }
  5346. return 0;
  5347. }
  5348. return compare & 4 ? -1 : 1;
  5349. }
  5350. jQuery.uniqueSort = function(results) {
  5351. var elem, duplicates = [], j = 0, i2 = 0;
  5352. hasDuplicate = false;
  5353. sort.call(results, sortOrder);
  5354. if (hasDuplicate) {
  5355. while (elem = results[i2++]) {
  5356. if (elem === results[i2]) {
  5357. j = duplicates.push(i2);
  5358. }
  5359. }
  5360. while (j--) {
  5361. splice.call(results, duplicates[j], 1);
  5362. }
  5363. }
  5364. return results;
  5365. };
  5366. jQuery.fn.uniqueSort = function() {
  5367. return this.pushStack(jQuery.uniqueSort(slice.apply(this)));
  5368. };
  5369. var i, outermostContext, document$1, documentElement$1, documentIsHTML, dirruns = 0, done = 0, classCache = createCache(), compilerCache = createCache(), nonnativeSelectorCache = createCache(), rwhitespace = new RegExp(whitespace + "+", "g"), ridentifier = new RegExp("^" + identifier + "$"), matchExpr = jQuery.extend({
  5370. bool: new RegExp("^(?:" + booleans + ")$", "i"),
  5371. // For use in libraries implementing .is()
  5372. // We use this for POS matching in `select`
  5373. needsContext: new RegExp("^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i")
  5374. }, filterMatchExpr), rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, unloadHandler = function() {
  5375. setDocument();
  5376. }, inDisabledFieldset = addCombinator(
  5377. function(elem) {
  5378. return elem.disabled === true && nodeName(elem, "fieldset");
  5379. },
  5380. { dir: "parentNode", next: "legend" }
  5381. );
  5382. function find(selector, context, results, seed) {
  5383. var m, i2, elem, nid, match, groups, newSelector, newContext = context && context.ownerDocument, nodeType = context ? context.nodeType : 9;
  5384. results = results || [];
  5385. if (typeof selector !== "string" || !selector || nodeType !== 1 && nodeType !== 9 && nodeType !== 11) {
  5386. return results;
  5387. }
  5388. if (false) {
  5389. setDocument(context);
  5390. context = context || document$1;
  5391. if (documentIsHTML) {
  5392. if (nodeType !== 11 && (match = rquickExpr.exec(selector))) {
  5393. if (m = match[1]) {
  5394. if (nodeType === 9) {
  5395. if (elem = context.getElementById(m)) {
  5396. push.call(results, elem);
  5397. }
  5398. return results;
  5399. } else {
  5400. if (newContext && (elem = newContext.getElementById(m)) && jQuery.contains(context, elem)) {
  5401. push.call(results, elem);
  5402. return results;
  5403. }
  5404. }
  5405. } else if (match[2]) {
  5406. push.apply(results, context.getElementsByTagName(selector));
  5407. return results;
  5408. } else if ((m = match[3]) && context.getElementsByClassName) {
  5409. push.apply(results, context.getElementsByClassName(m));
  5410. return results;
  5411. }
  5412. }
  5413. if (!nonnativeSelectorCache[selector + " "] && (!rbuggyQSA || !rbuggyQSA.test(selector))) {
  5414. newSelector = selector;
  5415. newContext = context;
  5416. if (nodeType === 1 && (rdescend.test(selector) || rleadingCombinator.test(selector))) {
  5417. newContext = rsibling.test(selector) && testContext(context.parentNode) || context;
  5418. if (newContext != context || isIE) {
  5419. if (nid = context.getAttribute("id")) {
  5420. nid = jQuery.escapeSelector(nid);
  5421. } else {
  5422. context.setAttribute("id", nid = jQuery.expando);
  5423. }
  5424. }
  5425. groups = tokenize(selector);
  5426. i2 = groups.length;
  5427. while (i2--) {
  5428. groups[i2] = (nid ? "#" + nid : ":scope") + " " + toSelector(groups[i2]);
  5429. }
  5430. newSelector = groups.join(",");
  5431. }
  5432. try {
  5433. push.apply(
  5434. results,
  5435. newContext.querySelectorAll(newSelector)
  5436. );
  5437. return results;
  5438. } catch (qsaError) {
  5439. nonnativeSelectorCache(selector, true);
  5440. } finally {
  5441. if (nid === jQuery.expando) {
  5442. context.removeAttribute("id");
  5443. }
  5444. }
  5445. }
  5446. }
  5447. }
  5448. return select(selector.replace(rtrimCSS, "$1"), context, results, seed);
  5449. }
  5450. function markFunction(fn) {
  5451. fn[jQuery.expando] = true;
  5452. return fn;
  5453. }
  5454. function createInputPseudo(type) {
  5455. return function(elem) {
  5456. return nodeName(elem, "input") && elem.type === type;
  5457. };
  5458. }
  5459. function createButtonPseudo(type) {
  5460. return function(elem) {
  5461. return (nodeName(elem, "input") || nodeName(elem, "button")) && elem.type === type;
  5462. };
  5463. }
  5464. function createDisabledPseudo(disabled) {
  5465. return function(elem) {
  5466. if ("form" in elem) {
  5467. if (elem.parentNode && elem.disabled === false) {
  5468. if ("label" in elem) {
  5469. if ("label" in elem.parentNode) {
  5470. return elem.parentNode.disabled === disabled;
  5471. } else {
  5472. return elem.disabled === disabled;
  5473. }
  5474. }
  5475. return elem.isDisabled === disabled || // Where there is no isDisabled, check manually
  5476. elem.isDisabled !== !disabled && inDisabledFieldset(elem) === disabled;
  5477. }
  5478. return elem.disabled === disabled;
  5479. } else if ("label" in elem) {
  5480. return elem.disabled === disabled;
  5481. }
  5482. return false;
  5483. };
  5484. }
  5485. function createPositionalPseudo(fn) {
  5486. return markFunction(function(argument) {
  5487. argument = +argument;
  5488. return markFunction(function(seed, matches3) {
  5489. var j, matchIndexes = fn([], seed.length, argument), i2 = matchIndexes.length;
  5490. while (i2--) {
  5491. if (seed[j = matchIndexes[i2]]) {
  5492. seed[j] = !(matches3[j] = seed[j]);
  5493. }
  5494. }
  5495. });
  5496. });
  5497. }
  5498. function setDocument(node) {
  5499. var subWindow, doc = node ? node.ownerDocument || node : document;
  5500. if (doc == document$1 || doc.nodeType !== 9) {
  5501. return;
  5502. }
  5503. document$1 = doc;
  5504. documentElement$1 = document$1.documentElement;
  5505. documentIsHTML = !jQuery.isXMLDoc(document$1);
  5506. if (isIE && document != document$1 && (subWindow = document$1.defaultView) && subWindow.top !== subWindow) {
  5507. subWindow.addEventListener("unload", unloadHandler);
  5508. }
  5509. }
  5510. find.matches = function(expr, elements) {
  5511. return find(expr, null, null, elements);
  5512. };
  5513. find.matchesSelector = function(elem, expr) {
  5514. setDocument(elem);
  5515. if (documentIsHTML && !nonnativeSelectorCache[expr + " "] && (!rbuggyQSA || !rbuggyQSA.test(expr))) {
  5516. try {
  5517. return matches2.call(elem, expr);
  5518. } catch (e2) {
  5519. nonnativeSelectorCache(expr, true);
  5520. }
  5521. }
  5522. return find(expr, document$1, null, [elem]).length > 0;
  5523. };
  5524. jQuery.expr = {
  5525. // Can be adjusted by the user
  5526. cacheLength: 50,
  5527. createPseudo: markFunction,
  5528. match: matchExpr,
  5529. find: {
  5530. ID: function(id, context) {
  5531. if (typeof context.getElementById !== "undefined" && documentIsHTML) {
  5532. var elem = context.getElementById(id);
  5533. return elem ? [elem] : [];
  5534. }
  5535. },
  5536. TAG: function(tag, context) {
  5537. if (typeof context.getElementsByTagName !== "undefined") {
  5538. return context.getElementsByTagName(tag);
  5539. } else {
  5540. return context.querySelectorAll(tag);
  5541. }
  5542. },
  5543. CLASS: function(className, context) {
  5544. if (typeof context.getElementsByClassName !== "undefined" && documentIsHTML) {
  5545. return context.getElementsByClassName(className);
  5546. }
  5547. }
  5548. },
  5549. relative: {
  5550. ">": { dir: "parentNode", first: true },
  5551. " ": { dir: "parentNode" },
  5552. "+": { dir: "previousSibling", first: true },
  5553. "~": { dir: "previousSibling" }
  5554. },
  5555. preFilter,
  5556. filter: {
  5557. ID: function(id) {
  5558. var attrId = unescapeSelector(id);
  5559. return function(elem) {
  5560. return elem.getAttribute("id") === attrId;
  5561. };
  5562. },
  5563. TAG: function(nodeNameSelector) {
  5564. var expectedNodeName = unescapeSelector(nodeNameSelector).toLowerCase();
  5565. return nodeNameSelector === "*" ? function() {
  5566. return true;
  5567. } : function(elem) {
  5568. return nodeName(elem, expectedNodeName);
  5569. };
  5570. },
  5571. CLASS: function(className) {
  5572. var pattern = classCache[className + " "];
  5573. return pattern || (pattern = new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)")) && classCache(className, function(elem) {
  5574. return pattern.test(
  5575. typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || ""
  5576. );
  5577. });
  5578. },
  5579. ATTR: function(name, operator, check) {
  5580. return function(elem) {
  5581. var result = elem.getAttribute(name);
  5582. if (result == null) {
  5583. return operator === "!=";
  5584. }
  5585. if (!operator) {
  5586. return true;
  5587. }
  5588. result += "";
  5589. if (operator === "=") {
  5590. return result === check;
  5591. }
  5592. if (operator === "!=") {
  5593. return result !== check;
  5594. }
  5595. if (operator === "^=") {
  5596. return check && result.indexOf(check) === 0;
  5597. }
  5598. if (operator === "*=") {
  5599. return check && result.indexOf(check) > -1;
  5600. }
  5601. if (operator === "$=") {
  5602. return check && result.slice(-check.length) === check;
  5603. }
  5604. if (operator === "~=") {
  5605. return (" " + result.replace(rwhitespace, " ") + " ").indexOf(check) > -1;
  5606. }
  5607. if (operator === "|=") {
  5608. return result === check || result.slice(0, check.length + 1) === check + "-";
  5609. }
  5610. return false;
  5611. };
  5612. },
  5613. CHILD: function(type, what, _argument, first, last) {
  5614. var simple = type.slice(0, 3) !== "nth", forward = type.slice(-4) !== "last", ofType = what === "of-type";
  5615. return first === 1 && last === 0 ? (
  5616. // Shortcut for :nth-*(n)
  5617. function(elem) {
  5618. return !!elem.parentNode;
  5619. }
  5620. ) : function(elem, _context, xml) {
  5621. var cache, outerCache, node, nodeIndex, start, dir = simple !== forward ? "nextSibling" : "previousSibling", parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), useCache = !xml && !ofType, diff = false;
  5622. if (parent) {
  5623. if (simple) {
  5624. while (dir) {
  5625. node = elem;
  5626. while (node = node[dir]) {
  5627. if (ofType ? nodeName(node, name) : node.nodeType === 1) {
  5628. return false;
  5629. }
  5630. }
  5631. start = dir = type === "only" && !start && "nextSibling";
  5632. }
  5633. return true;
  5634. }
  5635. start = [forward ? parent.firstChild : parent.lastChild];
  5636. if (forward && useCache) {
  5637. outerCache = parent[jQuery.expando] || (parent[jQuery.expando] = {});
  5638. cache = outerCache[type] || [];
  5639. nodeIndex = cache[0] === dirruns && cache[1];
  5640. diff = nodeIndex && cache[2];
  5641. node = nodeIndex && parent.childNodes[nodeIndex];
  5642. while (node = ++nodeIndex && node && node[dir] || // Fallback to seeking `elem` from the start
  5643. (diff = nodeIndex = 0) || start.pop()) {
  5644. if (node.nodeType === 1 && ++diff && node === elem) {
  5645. outerCache[type] = [dirruns, nodeIndex, diff];
  5646. break;
  5647. }
  5648. }
  5649. } else {
  5650. if (useCache) {
  5651. outerCache = elem[jQuery.expando] || (elem[jQuery.expando] = {});
  5652. cache = outerCache[type] || [];
  5653. nodeIndex = cache[0] === dirruns && cache[1];
  5654. diff = nodeIndex;
  5655. }
  5656. if (diff === false) {
  5657. while (node = ++nodeIndex && node && node[dir] || (diff = nodeIndex = 0) || start.pop()) {
  5658. if ((ofType ? nodeName(node, name) : node.nodeType === 1) && ++diff) {
  5659. if (useCache) {
  5660. outerCache = node[jQuery.expando] || (node[jQuery.expando] = {});
  5661. outerCache[type] = [dirruns, diff];
  5662. }
  5663. if (node === elem) {
  5664. break;
  5665. }
  5666. }
  5667. }
  5668. }
  5669. }
  5670. diff -= last;
  5671. return diff === first || diff % first === 0 && diff / first >= 0;
  5672. }
  5673. };
  5674. },
  5675. PSEUDO: function(pseudo, argument) {
  5676. var fn = jQuery.expr.pseudos[pseudo] || jQuery.expr.setFilters[pseudo.toLowerCase()] || selectorError("unsupported pseudo: " + pseudo);
  5677. if (fn[jQuery.expando]) {
  5678. return fn(argument);
  5679. }
  5680. return fn;
  5681. }
  5682. },
  5683. pseudos: {
  5684. // Potentially complex pseudos
  5685. not: markFunction(function(selector) {
  5686. var input = [], results = [], matcher = compile(selector.replace(rtrimCSS, "$1"));
  5687. return matcher[jQuery.expando] ? markFunction(function(seed, matches3, _context, xml) {
  5688. var elem, unmatched = matcher(seed, null, xml, []), i2 = seed.length;
  5689. while (i2--) {
  5690. if (elem = unmatched[i2]) {
  5691. seed[i2] = !(matches3[i2] = elem);
  5692. }
  5693. }
  5694. }) : function(elem, _context, xml) {
  5695. input[0] = elem;
  5696. matcher(input, null, xml, results);
  5697. input[0] = null;
  5698. return !results.pop();
  5699. };
  5700. }),
  5701. has: markFunction(function(selector) {
  5702. return function(elem) {
  5703. return find(selector, elem).length > 0;
  5704. };
  5705. }),
  5706. contains: markFunction(function(text) {
  5707. text = unescapeSelector(text);
  5708. return function(elem) {
  5709. return (elem.textContent || jQuery.text(elem)).indexOf(text) > -1;
  5710. };
  5711. }),
  5712. // "Whether an element is represented by a :lang() selector
  5713. // is based solely on the element's language value
  5714. // being equal to the identifier C,
  5715. // or beginning with the identifier C immediately followed by "-".
  5716. // The matching of C against the element's language value is performed case-insensitively.
  5717. // The identifier C does not have to be a valid language name."
  5718. // https://www.w3.org/TR/selectors/#lang-pseudo
  5719. lang: markFunction(function(lang) {
  5720. if (!ridentifier.test(lang || "")) {
  5721. selectorError("unsupported lang: " + lang);
  5722. }
  5723. lang = unescapeSelector(lang).toLowerCase();
  5724. return function(elem) {
  5725. var elemLang;
  5726. do {
  5727. if (elemLang = documentIsHTML ? elem.lang : elem.getAttribute("xml:lang") || elem.getAttribute("lang")) {
  5728. elemLang = elemLang.toLowerCase();
  5729. return elemLang === lang || elemLang.indexOf(lang + "-") === 0;
  5730. }
  5731. } while ((elem = elem.parentNode) && elem.nodeType === 1);
  5732. return false;
  5733. };
  5734. }),
  5735. // Miscellaneous
  5736. target: function(elem) {
  5737. var hash = window2.location && window2.location.hash;
  5738. return hash && hash.slice(1) === elem.id;
  5739. },
  5740. root: function(elem) {
  5741. return elem === documentElement$1;
  5742. },
  5743. focus: function(elem) {
  5744. return elem === document$1.activeElement && document$1.hasFocus() && !!(elem.type || elem.href || ~elem.tabIndex);
  5745. },
  5746. // Boolean properties
  5747. enabled: createDisabledPseudo(false),
  5748. disabled: createDisabledPseudo(true),
  5749. checked: function(elem) {
  5750. return nodeName(elem, "input") && !!elem.checked || nodeName(elem, "option") && !!elem.selected;
  5751. },
  5752. selected: function(elem) {
  5753. if (isIE && elem.parentNode) {
  5754. elem.parentNode.selectedIndex;
  5755. }
  5756. return elem.selected === true;
  5757. },
  5758. // Contents
  5759. empty: function(elem) {
  5760. for (elem = elem.firstChild; elem; elem = elem.nextSibling) {
  5761. if (elem.nodeType < 6) {
  5762. return false;
  5763. }
  5764. }
  5765. return true;
  5766. },
  5767. parent: function(elem) {
  5768. return !jQuery.expr.pseudos.empty(elem);
  5769. },
  5770. // Element/input types
  5771. header: function(elem) {
  5772. return rheader.test(elem.nodeName);
  5773. },
  5774. input: function(elem) {
  5775. return rinputs.test(elem.nodeName);
  5776. },
  5777. button: function(elem) {
  5778. return nodeName(elem, "input") && elem.type === "button" || nodeName(elem, "button");
  5779. },
  5780. text: function(elem) {
  5781. return nodeName(elem, "input") && elem.type === "text";
  5782. },
  5783. // Position-in-collection
  5784. first: createPositionalPseudo(function() {
  5785. return [0];
  5786. }),
  5787. last: createPositionalPseudo(function(_matchIndexes, length) {
  5788. return [length - 1];
  5789. }),
  5790. eq: createPositionalPseudo(function(_matchIndexes, length, argument) {
  5791. return [argument < 0 ? argument + length : argument];
  5792. }),
  5793. even: createPositionalPseudo(function(matchIndexes, length) {
  5794. var i2 = 0;
  5795. for (; i2 < length; i2 += 2) {
  5796. matchIndexes.push(i2);
  5797. }
  5798. return matchIndexes;
  5799. }),
  5800. odd: createPositionalPseudo(function(matchIndexes, length) {
  5801. var i2 = 1;
  5802. for (; i2 < length; i2 += 2) {
  5803. matchIndexes.push(i2);
  5804. }
  5805. return matchIndexes;
  5806. }),
  5807. lt: createPositionalPseudo(function(matchIndexes, length, argument) {
  5808. var i2;
  5809. if (argument < 0) {
  5810. i2 = argument + length;
  5811. } else if (argument > length) {
  5812. i2 = length;
  5813. } else {
  5814. i2 = argument;
  5815. }
  5816. for (; --i2 >= 0; ) {
  5817. matchIndexes.push(i2);
  5818. }
  5819. return matchIndexes;
  5820. }),
  5821. gt: createPositionalPseudo(function(matchIndexes, length, argument) {
  5822. var i2 = argument < 0 ? argument + length : argument;
  5823. for (; ++i2 < length; ) {
  5824. matchIndexes.push(i2);
  5825. }
  5826. return matchIndexes;
  5827. })
  5828. }
  5829. };
  5830. jQuery.expr.pseudos.nth = jQuery.expr.pseudos.eq;
  5831. for (i in { radio: true, checkbox: true, file: true, password: true, image: true }) {
  5832. jQuery.expr.pseudos[i] = createInputPseudo(i);
  5833. }
  5834. for (i in { submit: true, reset: true }) {
  5835. jQuery.expr.pseudos[i] = createButtonPseudo(i);
  5836. }
  5837. function setFilters() {
  5838. }
  5839. setFilters.prototype = jQuery.expr.filters = jQuery.expr.pseudos;
  5840. jQuery.expr.setFilters = new setFilters();
  5841. function addCombinator(matcher, combinator, base) {
  5842. var dir = combinator.dir, skip = combinator.next, key = skip || dir, checkNonElements = base && key === "parentNode", doneName = done++;
  5843. return combinator.first ? (
  5844. // Check against closest ancestor/preceding element
  5845. function(elem, context, xml) {
  5846. while (elem = elem[dir]) {
  5847. if (elem.nodeType === 1 || checkNonElements) {
  5848. return matcher(elem, context, xml);
  5849. }
  5850. }
  5851. return false;
  5852. }
  5853. ) : (
  5854. // Check against all ancestor/preceding elements
  5855. function(elem, context, xml) {
  5856. var oldCache, outerCache, newCache = [dirruns, doneName];
  5857. if (xml) {
  5858. while (elem = elem[dir]) {
  5859. if (elem.nodeType === 1 || checkNonElements) {
  5860. if (matcher(elem, context, xml)) {
  5861. return true;
  5862. }
  5863. }
  5864. }
  5865. } else {
  5866. while (elem = elem[dir]) {
  5867. if (elem.nodeType === 1 || checkNonElements) {
  5868. outerCache = elem[jQuery.expando] || (elem[jQuery.expando] = {});
  5869. if (skip && nodeName(elem, skip)) {
  5870. elem = elem[dir] || elem;
  5871. } else if ((oldCache = outerCache[key]) && oldCache[0] === dirruns && oldCache[1] === doneName) {
  5872. return newCache[2] = oldCache[2];
  5873. } else {
  5874. outerCache[key] = newCache;
  5875. if (newCache[2] = matcher(elem, context, xml)) {
  5876. return true;
  5877. }
  5878. }
  5879. }
  5880. }
  5881. }
  5882. return false;
  5883. }
  5884. );
  5885. }
  5886. function elementMatcher(matchers) {
  5887. return matchers.length > 1 ? function(elem, context, xml) {
  5888. var i2 = matchers.length;
  5889. while (i2--) {
  5890. if (!matchers[i2](elem, context, xml)) {
  5891. return false;
  5892. }
  5893. }
  5894. return true;
  5895. } : matchers[0];
  5896. }
  5897. function multipleContexts(selector, contexts, results) {
  5898. var i2 = 0, len = contexts.length;
  5899. for (; i2 < len; i2++) {
  5900. find(selector, contexts[i2], results);
  5901. }
  5902. return results;
  5903. }
  5904. function condense(unmatched, map, filter, context, xml) {
  5905. var elem, newUnmatched = [], i2 = 0, len = unmatched.length, mapped = map != null;
  5906. for (; i2 < len; i2++) {
  5907. if (elem = unmatched[i2]) {
  5908. if (!filter || filter(elem, context, xml)) {
  5909. newUnmatched.push(elem);
  5910. if (mapped) {
  5911. map.push(i2);
  5912. }
  5913. }
  5914. }
  5915. }
  5916. return newUnmatched;
  5917. }
  5918. function setMatcher(preFilter2, selector, matcher, postFilter, postFinder, postSelector) {
  5919. if (postFilter && !postFilter[jQuery.expando]) {
  5920. postFilter = setMatcher(postFilter);
  5921. }
  5922. if (postFinder && !postFinder[jQuery.expando]) {
  5923. postFinder = setMatcher(postFinder, postSelector);
  5924. }
  5925. return markFunction(function(seed, results, context, xml) {
  5926. var temp, i2, elem, matcherOut, preMap = [], postMap = [], preexisting = results.length, elems = seed || multipleContexts(
  5927. selector || "*",
  5928. context.nodeType ? [context] : context,
  5929. []
  5930. ), matcherIn = preFilter2 && (seed || !selector) ? condense(elems, preMap, preFilter2, context, xml) : elems;
  5931. if (matcher) {
  5932. matcherOut = postFinder || (seed ? preFilter2 : preexisting || postFilter) ? (
  5933. // ...intermediate processing is necessary
  5934. []
  5935. ) : (
  5936. // ...otherwise use results directly
  5937. results
  5938. );
  5939. matcher(matcherIn, matcherOut, context, xml);
  5940. } else {
  5941. matcherOut = matcherIn;
  5942. }
  5943. if (postFilter) {
  5944. temp = condense(matcherOut, postMap);
  5945. postFilter(temp, [], context, xml);
  5946. i2 = temp.length;
  5947. while (i2--) {
  5948. if (elem = temp[i2]) {
  5949. matcherOut[postMap[i2]] = !(matcherIn[postMap[i2]] = elem);
  5950. }
  5951. }
  5952. }
  5953. if (seed) {
  5954. if (postFinder || preFilter2) {
  5955. if (postFinder) {
  5956. temp = [];
  5957. i2 = matcherOut.length;
  5958. while (i2--) {
  5959. if (elem = matcherOut[i2]) {
  5960. temp.push(matcherIn[i2] = elem);
  5961. }
  5962. }
  5963. postFinder(null, matcherOut = [], temp, xml);
  5964. }
  5965. i2 = matcherOut.length;
  5966. while (i2--) {
  5967. if ((elem = matcherOut[i2]) && (temp = postFinder ? indexOf.call(seed, elem) : preMap[i2]) > -1) {
  5968. seed[temp] = !(results[temp] = elem);
  5969. }
  5970. }
  5971. }
  5972. } else {
  5973. matcherOut = condense(
  5974. matcherOut === results ? matcherOut.splice(preexisting, matcherOut.length) : matcherOut
  5975. );
  5976. if (postFinder) {
  5977. postFinder(null, results, matcherOut, xml);
  5978. } else {
  5979. push.apply(results, matcherOut);
  5980. }
  5981. }
  5982. });
  5983. }
  5984. function matcherFromTokens(tokens) {
  5985. var checkContext, matcher, j, len = tokens.length, leadingRelative = jQuery.expr.relative[tokens[0].type], implicitRelative = leadingRelative || jQuery.expr.relative[" "], i2 = leadingRelative ? 1 : 0, matchContext = addCombinator(function(elem) {
  5986. return elem === checkContext;
  5987. }, implicitRelative, true), matchAnyContext = addCombinator(function(elem) {
  5988. return indexOf.call(checkContext, elem) > -1;
  5989. }, implicitRelative, true), matchers = [function(elem, context, xml) {
  5990. var ret = !leadingRelative && (xml || context != outermostContext) || ((checkContext = context).nodeType ? matchContext(elem, context, xml) : matchAnyContext(elem, context, xml));
  5991. checkContext = null;
  5992. return ret;
  5993. }];
  5994. for (; i2 < len; i2++) {
  5995. if (matcher = jQuery.expr.relative[tokens[i2].type]) {
  5996. matchers = [addCombinator(elementMatcher(matchers), matcher)];
  5997. } else {
  5998. matcher = jQuery.expr.filter[tokens[i2].type].apply(null, tokens[i2].matches);
  5999. if (matcher[jQuery.expando]) {
  6000. j = ++i2;
  6001. for (; j < len; j++) {
  6002. if (jQuery.expr.relative[tokens[j].type]) {
  6003. break;
  6004. }
  6005. }
  6006. return setMatcher(
  6007. i2 > 1 && elementMatcher(matchers),
  6008. i2 > 1 && toSelector(
  6009. // If the preceding token was a descendant combinator, insert an implicit any-element `*`
  6010. tokens.slice(0, i2 - 1).concat({ value: tokens[i2 - 2].type === " " ? "*" : "" })
  6011. ).replace(rtrimCSS, "$1"),
  6012. matcher,
  6013. i2 < j && matcherFromTokens(tokens.slice(i2, j)),
  6014. j < len && matcherFromTokens(tokens = tokens.slice(j)),
  6015. j < len && toSelector(tokens)
  6016. );
  6017. }
  6018. matchers.push(matcher);
  6019. }
  6020. }
  6021. return elementMatcher(matchers);
  6022. }
  6023. function matcherFromGroupMatchers(elementMatchers, setMatchers) {
  6024. var bySet = setMatchers.length > 0, byElement = elementMatchers.length > 0, superMatcher = function(seed, context, xml, results, outermost) {
  6025. var elem, j, matcher, matchedCount = 0, i2 = "0", unmatched = seed && [], setMatched = [], contextBackup = outermostContext, elems = seed || byElement && jQuery.expr.find.TAG("*", outermost), dirrunsUnique = dirruns += contextBackup == null ? 1 : Math.random() || 0.1;
  6026. if (outermost) {
  6027. outermostContext = context == document$1 || context || outermost;
  6028. }
  6029. for (; (elem = elems[i2]) != null; i2++) {
  6030. if (byElement && elem) {
  6031. j = 0;
  6032. if (!context && elem.ownerDocument != document$1) {
  6033. setDocument(elem);
  6034. xml = !documentIsHTML;
  6035. }
  6036. while (matcher = elementMatchers[j++]) {
  6037. if (matcher(elem, context || document$1, xml)) {
  6038. push.call(results, elem);
  6039. break;
  6040. }
  6041. }
  6042. if (outermost) {
  6043. dirruns = dirrunsUnique;
  6044. }
  6045. }
  6046. if (bySet) {
  6047. if (elem = !matcher && elem) {
  6048. matchedCount--;
  6049. }
  6050. if (seed) {
  6051. unmatched.push(elem);
  6052. }
  6053. }
  6054. }
  6055. matchedCount += i2;
  6056. if (bySet && i2 !== matchedCount) {
  6057. j = 0;
  6058. while (matcher = setMatchers[j++]) {
  6059. matcher(unmatched, setMatched, context, xml);
  6060. }
  6061. if (seed) {
  6062. if (matchedCount > 0) {
  6063. while (i2--) {
  6064. if (!(unmatched[i2] || setMatched[i2])) {
  6065. setMatched[i2] = pop.call(results);
  6066. }
  6067. }
  6068. }
  6069. setMatched = condense(setMatched);
  6070. }
  6071. push.apply(results, setMatched);
  6072. if (outermost && !seed && setMatched.length > 0 && matchedCount + setMatchers.length > 1) {
  6073. jQuery.uniqueSort(results);
  6074. }
  6075. }
  6076. if (outermost) {
  6077. dirruns = dirrunsUnique;
  6078. outermostContext = contextBackup;
  6079. }
  6080. return unmatched;
  6081. };
  6082. return bySet ? markFunction(superMatcher) : superMatcher;
  6083. }
  6084. function compile(selector, match) {
  6085. var i2, setMatchers = [], elementMatchers = [], cached = compilerCache[selector + " "];
  6086. if (!cached) {
  6087. if (!match) {
  6088. match = tokenize(selector);
  6089. }
  6090. i2 = match.length;
  6091. while (i2--) {
  6092. cached = matcherFromTokens(match[i2]);
  6093. if (cached[jQuery.expando]) {
  6094. setMatchers.push(cached);
  6095. } else {
  6096. elementMatchers.push(cached);
  6097. }
  6098. }
  6099. cached = compilerCache(
  6100. selector,
  6101. matcherFromGroupMatchers(elementMatchers, setMatchers)
  6102. );
  6103. cached.selector = selector;
  6104. }
  6105. return cached;
  6106. }
  6107. function select(selector, context, results, seed) {
  6108. var i2, tokens, token, type, find2, compiled = typeof selector === "function" && selector, match = !seed && tokenize(selector = compiled.selector || selector);
  6109. results = results || [];
  6110. if (match.length === 1) {
  6111. tokens = match[0] = match[0].slice(0);
  6112. if (tokens.length > 2 && (token = tokens[0]).type === "ID" && context.nodeType === 9 && documentIsHTML && jQuery.expr.relative[tokens[1].type]) {
  6113. context = (jQuery.expr.find.ID(
  6114. unescapeSelector(token.matches[0]),
  6115. context
  6116. ) || [])[0];
  6117. if (!context) {
  6118. return results;
  6119. } else if (compiled) {
  6120. context = context.parentNode;
  6121. }
  6122. selector = selector.slice(tokens.shift().value.length);
  6123. }
  6124. i2 = matchExpr.needsContext.test(selector) ? 0 : tokens.length;
  6125. while (i2--) {
  6126. token = tokens[i2];
  6127. if (jQuery.expr.relative[type = token.type]) {
  6128. break;
  6129. }
  6130. if (find2 = jQuery.expr.find[type]) {
  6131. if (seed = find2(
  6132. unescapeSelector(token.matches[0]),
  6133. rsibling.test(tokens[0].type) && testContext(context.parentNode) || context
  6134. )) {
  6135. tokens.splice(i2, 1);
  6136. selector = seed.length && toSelector(tokens);
  6137. if (!selector) {
  6138. push.apply(results, seed);
  6139. return results;
  6140. }
  6141. break;
  6142. }
  6143. }
  6144. }
  6145. }
  6146. (compiled || compile(selector, match))(
  6147. seed,
  6148. context,
  6149. !documentIsHTML,
  6150. results,
  6151. !context || rsibling.test(selector) && testContext(context.parentNode) || context
  6152. );
  6153. return results;
  6154. }
  6155. setDocument();
  6156. jQuery.find = find;
  6157. find.compile = compile;
  6158. find.select = select;
  6159. find.setDocument = setDocument;
  6160. find.tokenize = tokenize;
  6161. return jQuery;
  6162. })
  6163. );
  6164. // src/mock-doc/selector.ts
  6165. function matches(selector, elm) {
  6166. try {
  6167. const r = jquery_default.find(selector, void 0, void 0, [elm]);
  6168. return r.length > 0;
  6169. } catch (e2) {
  6170. updateSelectorError(selector, e2);
  6171. throw e2;
  6172. }
  6173. }
  6174. function selectOne(selector, elm) {
  6175. try {
  6176. const r = jquery_default.find(selector, elm, void 0, void 0);
  6177. return r[0] || null;
  6178. } catch (e2) {
  6179. updateSelectorError(selector, e2);
  6180. throw e2;
  6181. }
  6182. }
  6183. function selectAll(selector, elm) {
  6184. try {
  6185. return jquery_default.find(selector, elm, void 0, void 0);
  6186. } catch (e2) {
  6187. updateSelectorError(selector, e2);
  6188. throw e2;
  6189. }
  6190. }
  6191. var PROBLEMATIC_SELECTORS = [":scope", ":where", ":is"];
  6192. function updateSelectorError(selector, e2) {
  6193. const selectorsPresent = PROBLEMATIC_SELECTORS.filter((s) => selector.includes(s));
  6194. if (selectorsPresent.length > 0 && e2.message) {
  6195. e2.message = `At present jQuery does not support the ${humanReadableList(selectorsPresent)} ${selectorsPresent.length === 1 ? "selector" : "selectors"}.
  6196. If you need this in your test, consider writing an end-to-end test instead.
  6197. ` + e2.message;
  6198. }
  6199. }
  6200. function humanReadableList(items) {
  6201. if (items.length <= 1) {
  6202. return items.join("");
  6203. }
  6204. return `${items.slice(0, items.length - 1).join(", ")} and ${items[items.length - 1]}`;
  6205. }
  6206. // src/mock-doc/serialize-node.ts
  6207. function normalizeSerializationOptions(opts = {}) {
  6208. return {
  6209. ...opts,
  6210. outerHtml: typeof opts.outerHtml !== "boolean" ? false : opts.outerHtml,
  6211. ...opts.prettyHtml ? {
  6212. indentSpaces: typeof opts.indentSpaces !== "number" ? 2 : opts.indentSpaces,
  6213. newLines: typeof opts.newLines !== "boolean" ? true : opts.newLines
  6214. } : {
  6215. prettyHtml: false,
  6216. indentSpaces: typeof opts.indentSpaces !== "number" ? 0 : opts.indentSpaces,
  6217. newLines: typeof opts.newLines !== "boolean" ? false : opts.newLines
  6218. },
  6219. approximateLineWidth: typeof opts.approximateLineWidth !== "number" ? -1 : opts.approximateLineWidth,
  6220. removeEmptyAttributes: typeof opts.removeEmptyAttributes !== "boolean" ? true : opts.removeEmptyAttributes,
  6221. removeAttributeQuotes: typeof opts.removeAttributeQuotes !== "boolean" ? false : opts.removeAttributeQuotes,
  6222. removeBooleanAttributeQuotes: typeof opts.removeBooleanAttributeQuotes !== "boolean" ? false : opts.removeBooleanAttributeQuotes,
  6223. removeHtmlComments: typeof opts.removeHtmlComments !== "boolean" ? false : opts.removeHtmlComments,
  6224. serializeShadowRoot: typeof opts.serializeShadowRoot !== "boolean" ? true : opts.serializeShadowRoot,
  6225. fullDocument: typeof opts.fullDocument !== "boolean" ? true : opts.fullDocument
  6226. };
  6227. }
  6228. function serializeNodeToHtml(elm, serializationOptions = {}) {
  6229. const opts = normalizeSerializationOptions(serializationOptions);
  6230. const output = {
  6231. currentLineWidth: 0,
  6232. indent: 0,
  6233. isWithinBody: false,
  6234. text: []
  6235. };
  6236. let renderedNode = "";
  6237. const children = !opts.fullDocument && elm.body ? Array.from(elm.body.childNodes) : opts.outerHtml ? [elm] : Array.from(elm.childNodes);
  6238. for (let i = 0, ii = children.length; i < ii; i++) {
  6239. const child = children[i];
  6240. const chunks = Array.from(streamToHtml(child, opts, output));
  6241. renderedNode += chunks.join("");
  6242. }
  6243. return renderedNode.trim();
  6244. }
  6245. var shadowRootTag = "mock:shadow-root";
  6246. function* streamToHtml(node, opts, output) {
  6247. var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
  6248. const isShadowRoot = node.nodeType === 11 /* DOCUMENT_FRAGMENT_NODE */;
  6249. if (node.nodeType === 1 /* ELEMENT_NODE */ || isShadowRoot) {
  6250. const tagName = isShadowRoot ? shadowRootTag : getTagName(node);
  6251. if (tagName === "body") {
  6252. output.isWithinBody = true;
  6253. }
  6254. const ignoreTag = opts.excludeTags != null && opts.excludeTags.includes(tagName);
  6255. if (ignoreTag === false) {
  6256. const isWithinWhitespaceSensitiveNode = opts.newLines || ((_a = opts.indentSpaces) != null ? _a : 0) > 0 ? isWithinWhitespaceSensitive(node) : false;
  6257. if (opts.newLines && !isWithinWhitespaceSensitiveNode) {
  6258. yield "\n";
  6259. output.currentLineWidth = 0;
  6260. }
  6261. if (((_b = opts.indentSpaces) != null ? _b : 0) > 0 && !isWithinWhitespaceSensitiveNode) {
  6262. for (let i = 0; i < output.indent; i++) {
  6263. yield " ";
  6264. }
  6265. output.currentLineWidth += output.indent;
  6266. }
  6267. const tag = tagName === shadowRootTag ? "template" : tagName;
  6268. yield "<" + tag;
  6269. output.currentLineWidth += tag.length + 1;
  6270. if (tag === "template") {
  6271. const mode = ` shadowrootmode="open"`;
  6272. yield mode;
  6273. output.currentLineWidth += mode.length;
  6274. }
  6275. const attrsLength = node.attributes.length;
  6276. const attributes = opts.prettyHtml && attrsLength > 1 ? cloneAttributes(node.attributes, true) : node.attributes;
  6277. for (let i = 0; i < attrsLength; i++) {
  6278. const attr = attributes.item(i);
  6279. const attrName = attr.name;
  6280. if (attrName === "style") {
  6281. continue;
  6282. }
  6283. let attrValue = attr.value;
  6284. if (opts.removeEmptyAttributes && attrValue === "" && REMOVE_EMPTY_ATTR.has(attrName)) {
  6285. continue;
  6286. }
  6287. const attrNamespaceURI = attr.namespaceURI;
  6288. if (attrNamespaceURI == null) {
  6289. output.currentLineWidth += attrName.length + 1;
  6290. if (opts.approximateLineWidth && opts.approximateLineWidth > 0 && output.currentLineWidth > opts.approximateLineWidth) {
  6291. yield "\n" + attrName;
  6292. output.currentLineWidth = 0;
  6293. } else {
  6294. yield " " + attrName;
  6295. }
  6296. } else if (attrNamespaceURI === "http://www.w3.org/XML/1998/namespace") {
  6297. yield " xml:" + attrName;
  6298. output.currentLineWidth += attrName.length + 5;
  6299. } else if (attrNamespaceURI === "http://www.w3.org/2000/xmlns/") {
  6300. if (attrName !== "xmlns") {
  6301. yield " xmlns:" + attrName;
  6302. output.currentLineWidth += attrName.length + 7;
  6303. } else {
  6304. yield " " + attrName;
  6305. output.currentLineWidth += attrName.length + 1;
  6306. }
  6307. } else if (attrNamespaceURI === XLINK_NS) {
  6308. yield " xlink:" + attrName;
  6309. output.currentLineWidth += attrName.length + 7;
  6310. } else {
  6311. yield " " + attrNamespaceURI + ":" + attrName;
  6312. output.currentLineWidth += attrNamespaceURI.length + attrName.length + 2;
  6313. }
  6314. if (opts.prettyHtml && attrName === "class") {
  6315. attrValue = attr.value = attrValue.split(" ").filter((t) => t !== "").sort().join(" ").trim();
  6316. }
  6317. if (attrValue === "") {
  6318. if (opts.removeBooleanAttributeQuotes && BOOLEAN_ATTR.has(attrName)) {
  6319. continue;
  6320. }
  6321. if (opts.removeEmptyAttributes && attrName.startsWith("data-")) {
  6322. continue;
  6323. }
  6324. }
  6325. if (opts.removeAttributeQuotes && CAN_REMOVE_ATTR_QUOTES.test(attrValue)) {
  6326. yield "=" + escapeString(attrValue, true);
  6327. output.currentLineWidth += attrValue.length + 1;
  6328. } else {
  6329. yield '="' + escapeString(attrValue, true) + '"';
  6330. output.currentLineWidth += attrValue.length + 3;
  6331. }
  6332. }
  6333. if (node.hasAttribute("style")) {
  6334. const cssText = node.style.cssText;
  6335. if (opts.approximateLineWidth && opts.approximateLineWidth > 0 && output.currentLineWidth + cssText.length + 10 > opts.approximateLineWidth) {
  6336. yield `
  6337. style="${cssText}">`;
  6338. output.currentLineWidth = 0;
  6339. } else {
  6340. yield ` style="${cssText}">`;
  6341. output.currentLineWidth += cssText.length + 10;
  6342. }
  6343. } else {
  6344. yield ">";
  6345. output.currentLineWidth += 1;
  6346. }
  6347. }
  6348. if (EMPTY_ELEMENTS.has(tagName) === false) {
  6349. const shadowRoot = node.shadowRoot;
  6350. if (shadowRoot != null && opts.serializeShadowRoot) {
  6351. output.indent = output.indent + ((_c = opts.indentSpaces) != null ? _c : 0);
  6352. yield* streamToHtml(shadowRoot, opts, output);
  6353. output.indent = output.indent - ((_d = opts.indentSpaces) != null ? _d : 0);
  6354. if (opts.newLines && (node.childNodes.length === 0 || node.childNodes.length === 1 && node.childNodes[0].nodeType === 3 /* TEXT_NODE */ && ((_e = node.childNodes[0].nodeValue) == null ? void 0 : _e.trim()) === "")) {
  6355. yield "\n";
  6356. output.currentLineWidth = 0;
  6357. for (let i = 0; i < output.indent; i++) {
  6358. yield " ";
  6359. }
  6360. output.currentLineWidth += output.indent;
  6361. }
  6362. }
  6363. if (opts.excludeTagContent == null || opts.excludeTagContent.includes(tagName) === false) {
  6364. const tag = tagName === shadowRootTag ? "template" : tagName;
  6365. const childNodes = tagName === "template" ? node.content.childNodes : node.childNodes;
  6366. const childNodeLength = childNodes.length;
  6367. if (childNodeLength > 0) {
  6368. if (childNodeLength === 1 && childNodes[0].nodeType === 3 /* TEXT_NODE */ && (typeof childNodes[0].nodeValue !== "string" || childNodes[0].nodeValue.trim() === "")) {
  6369. } else {
  6370. const isWithinWhitespaceSensitiveNode = opts.newLines || ((_f = opts.indentSpaces) != null ? _f : 0) > 0 ? isWithinWhitespaceSensitive(node) : false;
  6371. if (!isWithinWhitespaceSensitiveNode && ((_g = opts.indentSpaces) != null ? _g : 0) > 0 && ignoreTag === false) {
  6372. output.indent = output.indent + ((_h = opts.indentSpaces) != null ? _h : 0);
  6373. }
  6374. for (let i = 0; i < childNodeLength; i++) {
  6375. yield* streamToHtml(childNodes[i], opts, output);
  6376. }
  6377. if (ignoreTag === false) {
  6378. if (opts.newLines && !isWithinWhitespaceSensitiveNode) {
  6379. yield "\n";
  6380. output.currentLineWidth = 0;
  6381. }
  6382. if (((_i = opts.indentSpaces) != null ? _i : 0) > 0 && !isWithinWhitespaceSensitiveNode) {
  6383. output.indent = output.indent - ((_j = opts.indentSpaces) != null ? _j : 0);
  6384. for (let i = 0; i < output.indent; i++) {
  6385. yield " ";
  6386. }
  6387. output.currentLineWidth += output.indent;
  6388. }
  6389. }
  6390. }
  6391. }
  6392. if (ignoreTag === false) {
  6393. yield "</" + tag + ">";
  6394. output.currentLineWidth += tag.length + 3;
  6395. }
  6396. }
  6397. }
  6398. if (((_k = opts.approximateLineWidth) != null ? _k : 0) > 0 && STRUCTURE_ELEMENTS.has(tagName)) {
  6399. yield "\n";
  6400. output.currentLineWidth = 0;
  6401. }
  6402. if (tagName === "body") {
  6403. output.isWithinBody = false;
  6404. }
  6405. } else if (node.nodeType === 3 /* TEXT_NODE */) {
  6406. let textContent = node.nodeValue;
  6407. if (typeof textContent === "string") {
  6408. const trimmedTextContent = textContent.trim();
  6409. if (trimmedTextContent === "") {
  6410. if (isWithinWhitespaceSensitive(node)) {
  6411. yield textContent;
  6412. output.currentLineWidth += textContent.length;
  6413. } else if (((_l = opts.approximateLineWidth) != null ? _l : 0) > 0 && !output.isWithinBody) {
  6414. } else if (!opts.prettyHtml) {
  6415. output.currentLineWidth += 1;
  6416. if (opts.approximateLineWidth && opts.approximateLineWidth > 0 && output.currentLineWidth > opts.approximateLineWidth) {
  6417. yield "\n";
  6418. output.currentLineWidth = 0;
  6419. } else {
  6420. yield " ";
  6421. }
  6422. }
  6423. } else {
  6424. const isWithinWhitespaceSensitiveNode = opts.newLines || ((_m = opts.indentSpaces) != null ? _m : 0) > 0 || opts.prettyHtml ? isWithinWhitespaceSensitive(node) : false;
  6425. if (opts.newLines && !isWithinWhitespaceSensitiveNode) {
  6426. yield "\n";
  6427. output.currentLineWidth = 0;
  6428. }
  6429. if (((_n = opts.indentSpaces) != null ? _n : 0) > 0 && !isWithinWhitespaceSensitiveNode) {
  6430. for (let i = 0; i < output.indent; i++) {
  6431. yield " ";
  6432. }
  6433. output.currentLineWidth += output.indent;
  6434. }
  6435. let textContentLength = textContent.length;
  6436. if (textContentLength > 0) {
  6437. const parentTagName = node.parentNode != null && node.parentNode.nodeType === 1 /* ELEMENT_NODE */ ? node.parentNode.nodeName : null;
  6438. if (typeof parentTagName === "string" && NON_ESCAPABLE_CONTENT.has(parentTagName)) {
  6439. if (isWithinWhitespaceSensitive(node)) {
  6440. yield textContent;
  6441. } else {
  6442. yield trimmedTextContent;
  6443. textContentLength = trimmedTextContent.length;
  6444. }
  6445. output.currentLineWidth += textContentLength;
  6446. } else {
  6447. if (opts.prettyHtml && !isWithinWhitespaceSensitiveNode) {
  6448. yield escapeString(textContent.replace(/\s\s+/g, " ").trim(), false);
  6449. output.currentLineWidth += textContentLength;
  6450. } else {
  6451. if (isWithinWhitespaceSensitive(node)) {
  6452. output.currentLineWidth += textContentLength;
  6453. } else {
  6454. if (/\s/.test(textContent.charAt(0))) {
  6455. textContent = " " + textContent.trimLeft();
  6456. }
  6457. textContentLength = textContent.length;
  6458. if (textContentLength > 1) {
  6459. if (/\s/.test(textContent.charAt(textContentLength - 1))) {
  6460. if (opts.approximateLineWidth && opts.approximateLineWidth > 0 && output.currentLineWidth + textContentLength > opts.approximateLineWidth) {
  6461. textContent = textContent.trimRight() + "\n";
  6462. output.currentLineWidth = 0;
  6463. } else {
  6464. textContent = textContent.trimRight() + " ";
  6465. }
  6466. }
  6467. }
  6468. output.currentLineWidth += textContentLength;
  6469. }
  6470. yield escapeString(textContent, false);
  6471. }
  6472. }
  6473. }
  6474. }
  6475. }
  6476. } else if (node.nodeType === 8 /* COMMENT_NODE */) {
  6477. const nodeValue = node.nodeValue;
  6478. const isHydrateAnnotation = (nodeValue == null ? void 0 : nodeValue.startsWith(CONTENT_REF_ID + ".")) || (nodeValue == null ? void 0 : nodeValue.startsWith(ORG_LOCATION_ID + ".")) || (nodeValue == null ? void 0 : nodeValue.startsWith(SLOT_NODE_ID + ".")) || (nodeValue == null ? void 0 : nodeValue.startsWith(TEXT_NODE_ID + "."));
  6479. if (opts.removeHtmlComments && !isHydrateAnnotation) {
  6480. return;
  6481. }
  6482. const isWithinWhitespaceSensitiveNode = opts.newLines || ((_o = opts.indentSpaces) != null ? _o : 0) > 0 ? isWithinWhitespaceSensitive(node) : false;
  6483. if (opts.newLines && !isWithinWhitespaceSensitiveNode) {
  6484. yield "\n";
  6485. output.currentLineWidth = 0;
  6486. }
  6487. if (((_p = opts.indentSpaces) != null ? _p : 0) > 0 && !isWithinWhitespaceSensitiveNode) {
  6488. for (let i = 0; i < output.indent; i++) {
  6489. yield " ";
  6490. }
  6491. output.currentLineWidth += output.indent;
  6492. }
  6493. yield "<!--" + nodeValue + "-->";
  6494. if (nodeValue) {
  6495. output.currentLineWidth += nodeValue.length + 7;
  6496. }
  6497. } else if (node.nodeType === 10 /* DOCUMENT_TYPE_NODE */) {
  6498. yield "<!doctype html>";
  6499. }
  6500. }
  6501. var AMP_REGEX = /&/g;
  6502. var NBSP_REGEX = /\u00a0/g;
  6503. var DOUBLE_QUOTE_REGEX = /"/g;
  6504. var LT_REGEX = /</g;
  6505. var GT_REGEX = />/g;
  6506. var CAN_REMOVE_ATTR_QUOTES = /^[^ \t\n\f\r"'`=<>\/\\-]+$/;
  6507. function getTagName(element) {
  6508. if (element.namespaceURI === "http://www.w3.org/1999/xhtml") {
  6509. return element.nodeName.toLowerCase();
  6510. } else {
  6511. return element.nodeName;
  6512. }
  6513. }
  6514. function escapeString(str, attrMode) {
  6515. str = str.replace(AMP_REGEX, "&amp;").replace(NBSP_REGEX, "&nbsp;");
  6516. if (attrMode) {
  6517. return str.replace(DOUBLE_QUOTE_REGEX, "&quot;");
  6518. }
  6519. return str.replace(LT_REGEX, "&lt;").replace(GT_REGEX, "&gt;");
  6520. }
  6521. function isWithinWhitespaceSensitive(node) {
  6522. let _node = node;
  6523. while (_node == null ? void 0 : _node.nodeName) {
  6524. if (WHITESPACE_SENSITIVE.has(_node.nodeName)) {
  6525. return true;
  6526. }
  6527. _node = _node.parentNode;
  6528. }
  6529. return false;
  6530. }
  6531. var NON_ESCAPABLE_CONTENT = /* @__PURE__ */ new Set([
  6532. "STYLE",
  6533. "SCRIPT",
  6534. "IFRAME",
  6535. "NOSCRIPT",
  6536. "XMP",
  6537. "NOEMBED",
  6538. "NOFRAMES",
  6539. "PLAINTEXT"
  6540. ]);
  6541. var WHITESPACE_SENSITIVE = /* @__PURE__ */ new Set([
  6542. "CODE",
  6543. "OUTPUT",
  6544. "PLAINTEXT",
  6545. "PRE",
  6546. "SCRIPT",
  6547. "TEMPLATE",
  6548. "TEXTAREA"
  6549. ]);
  6550. var EMPTY_ELEMENTS = /* @__PURE__ */ new Set([
  6551. "area",
  6552. "base",
  6553. "basefont",
  6554. "bgsound",
  6555. "br",
  6556. "col",
  6557. "embed",
  6558. "frame",
  6559. "hr",
  6560. "img",
  6561. "input",
  6562. "keygen",
  6563. "link",
  6564. "meta",
  6565. "param",
  6566. "source",
  6567. "trace",
  6568. "track",
  6569. "wbr"
  6570. ]);
  6571. var REMOVE_EMPTY_ATTR = /* @__PURE__ */ new Set(["class", "dir", "id", "lang", "name", "title"]);
  6572. var BOOLEAN_ATTR = /* @__PURE__ */ new Set([
  6573. "allowfullscreen",
  6574. "async",
  6575. "autofocus",
  6576. "autoplay",
  6577. "checked",
  6578. "compact",
  6579. "controls",
  6580. "declare",
  6581. "default",
  6582. "defaultchecked",
  6583. "defaultmuted",
  6584. "defaultselected",
  6585. "defer",
  6586. "disabled",
  6587. "enabled",
  6588. "formnovalidate",
  6589. "hidden",
  6590. "indeterminate",
  6591. "inert",
  6592. "ismap",
  6593. "itemscope",
  6594. "loop",
  6595. "multiple",
  6596. "muted",
  6597. "nohref",
  6598. "nomodule",
  6599. "noresize",
  6600. "noshade",
  6601. "novalidate",
  6602. "nowrap",
  6603. "open",
  6604. "pauseonexit",
  6605. "readonly",
  6606. "required",
  6607. "reversed",
  6608. "scoped",
  6609. "seamless",
  6610. "selected",
  6611. "sortable",
  6612. "truespeed",
  6613. "typemustmatch",
  6614. "visible"
  6615. ]);
  6616. var STRUCTURE_ELEMENTS = /* @__PURE__ */ new Set([
  6617. "html",
  6618. "body",
  6619. "head",
  6620. "iframe",
  6621. "meta",
  6622. "link",
  6623. "base",
  6624. "title",
  6625. "script",
  6626. "style"
  6627. ]);
  6628. // src/mock-doc/node.ts
  6629. var MockNode2 = class {
  6630. constructor(ownerDocument, nodeType, nodeName, nodeValue) {
  6631. this.ownerDocument = ownerDocument;
  6632. this.nodeType = nodeType;
  6633. this.nodeName = nodeName;
  6634. this._nodeValue = nodeValue;
  6635. this.parentNode = null;
  6636. this.childNodes = [];
  6637. }
  6638. appendChild(newNode) {
  6639. if (newNode.nodeType === 11 /* DOCUMENT_FRAGMENT_NODE */) {
  6640. const nodes = newNode.childNodes.slice();
  6641. for (const child of nodes) {
  6642. this.appendChild(child);
  6643. }
  6644. } else {
  6645. newNode.remove();
  6646. newNode.parentNode = this;
  6647. this.childNodes.push(newNode);
  6648. connectNode(this.ownerDocument, newNode);
  6649. }
  6650. return newNode;
  6651. }
  6652. append(...items) {
  6653. items.forEach((item) => {
  6654. const isNode = typeof item === "object" && item !== null && "nodeType" in item;
  6655. this.appendChild(isNode ? item : this.ownerDocument.createTextNode(String(item)));
  6656. });
  6657. }
  6658. prepend(...items) {
  6659. const firstChild = this.firstChild;
  6660. items.forEach((item) => {
  6661. const isNode = typeof item === "object" && item !== null && "nodeType" in item;
  6662. if (firstChild) {
  6663. this.insertBefore(isNode ? item : this.ownerDocument.createTextNode(String(item)), firstChild);
  6664. }
  6665. });
  6666. }
  6667. cloneNode(deep) {
  6668. throw new Error(`invalid node type to clone: ${this.nodeType}, deep: ${deep}`);
  6669. }
  6670. compareDocumentPosition(_other) {
  6671. return -1;
  6672. }
  6673. get firstChild() {
  6674. return this.childNodes[0] || null;
  6675. }
  6676. insertBefore(newNode, referenceNode) {
  6677. if (newNode.nodeType === 11 /* DOCUMENT_FRAGMENT_NODE */) {
  6678. for (let i = 0, ii = newNode.childNodes.length; i < ii; i++) {
  6679. insertBefore(this, newNode.childNodes[i], referenceNode);
  6680. }
  6681. } else {
  6682. insertBefore(this, newNode, referenceNode);
  6683. }
  6684. return newNode;
  6685. }
  6686. get isConnected() {
  6687. let node = this;
  6688. while (node != null) {
  6689. if (node.nodeType === 9 /* DOCUMENT_NODE */) {
  6690. return true;
  6691. }
  6692. node = node.parentNode;
  6693. if (node != null && node.nodeType === 11 /* DOCUMENT_FRAGMENT_NODE */) {
  6694. node = node.host;
  6695. }
  6696. }
  6697. return false;
  6698. }
  6699. isSameNode(node) {
  6700. return this === node;
  6701. }
  6702. get lastChild() {
  6703. return this.childNodes[this.childNodes.length - 1] || null;
  6704. }
  6705. get nextSibling() {
  6706. if (this.parentNode != null) {
  6707. const index = this.parentNode.childNodes.indexOf(this) + 1;
  6708. return this.parentNode.childNodes[index] || null;
  6709. }
  6710. return null;
  6711. }
  6712. get nodeValue() {
  6713. var _a;
  6714. return (_a = this._nodeValue) != null ? _a : "";
  6715. }
  6716. set nodeValue(value) {
  6717. this._nodeValue = value;
  6718. }
  6719. get parentElement() {
  6720. return this.parentNode || null;
  6721. }
  6722. set parentElement(value) {
  6723. this.parentNode = value;
  6724. }
  6725. get previousSibling() {
  6726. if (this.parentNode != null) {
  6727. const index = this.parentNode.childNodes.indexOf(this) - 1;
  6728. return this.parentNode.childNodes[index] || null;
  6729. }
  6730. return null;
  6731. }
  6732. contains(otherNode) {
  6733. if (otherNode === this) {
  6734. return true;
  6735. }
  6736. const childNodes = Array.from(this.childNodes);
  6737. if (childNodes.includes(otherNode)) {
  6738. return true;
  6739. }
  6740. return childNodes.some((node) => this.contains.bind(node)(otherNode));
  6741. }
  6742. removeChild(childNode) {
  6743. const index = this.childNodes.indexOf(childNode);
  6744. if (index > -1) {
  6745. this.childNodes.splice(index, 1);
  6746. if (this.nodeType === 1 /* ELEMENT_NODE */) {
  6747. const wasConnected = this.isConnected;
  6748. childNode.parentNode = null;
  6749. if (wasConnected === true) {
  6750. disconnectNode(childNode);
  6751. }
  6752. } else {
  6753. childNode.parentNode = null;
  6754. }
  6755. } else {
  6756. throw new Error(`node not found within childNodes during removeChild`);
  6757. }
  6758. return childNode;
  6759. }
  6760. remove() {
  6761. if (this.parentNode != null) {
  6762. this.parentNode.removeChild(this);
  6763. }
  6764. }
  6765. replaceChild(newChild, oldChild) {
  6766. if (oldChild.parentNode === this) {
  6767. this.insertBefore(newChild, oldChild);
  6768. oldChild.remove();
  6769. return newChild;
  6770. }
  6771. return null;
  6772. }
  6773. get textContent() {
  6774. var _a;
  6775. return (_a = this._nodeValue) != null ? _a : "";
  6776. }
  6777. set textContent(value) {
  6778. this._nodeValue = String(value);
  6779. }
  6780. };
  6781. MockNode2.ELEMENT_NODE = 1;
  6782. MockNode2.TEXT_NODE = 3;
  6783. MockNode2.PROCESSING_INSTRUCTION_NODE = 7;
  6784. MockNode2.COMMENT_NODE = 8;
  6785. MockNode2.DOCUMENT_NODE = 9;
  6786. MockNode2.DOCUMENT_TYPE_NODE = 10;
  6787. MockNode2.DOCUMENT_FRAGMENT_NODE = 11;
  6788. var MockNodeList = class {
  6789. constructor(ownerDocument, childNodes, length) {
  6790. this.ownerDocument = ownerDocument;
  6791. this.childNodes = childNodes;
  6792. this.length = length;
  6793. }
  6794. };
  6795. var MockElement = class extends MockNode2 {
  6796. attachInternals() {
  6797. return new Proxy({}, {
  6798. get: function(_target, prop, _receiver) {
  6799. console.error(
  6800. `NOTE: Property ${String(prop)} was accessed on ElementInternals, but this property is not implemented.
  6801. Testing components with ElementInternals is fully supported in e2e tests.`
  6802. );
  6803. }
  6804. });
  6805. }
  6806. constructor(ownerDocument, nodeName, namespaceURI = null) {
  6807. super(ownerDocument, 1 /* ELEMENT_NODE */, typeof nodeName === "string" ? nodeName : null, null);
  6808. this.__namespaceURI = namespaceURI;
  6809. this.__shadowRoot = null;
  6810. this.__attributeMap = null;
  6811. }
  6812. addEventListener(type, handler) {
  6813. addEventListener(this, type, handler);
  6814. }
  6815. attachShadow(_opts) {
  6816. const shadowRoot = this.ownerDocument.createDocumentFragment();
  6817. this.shadowRoot = shadowRoot;
  6818. return shadowRoot;
  6819. }
  6820. blur() {
  6821. dispatchEvent(
  6822. this,
  6823. new MockFocusEvent("blur", { relatedTarget: null, bubbles: true, cancelable: true, composed: true })
  6824. );
  6825. }
  6826. get localName() {
  6827. if (!this.nodeName) {
  6828. throw new Error(`Can't compute elements localName without nodeName`);
  6829. }
  6830. return this.nodeName.toLocaleLowerCase();
  6831. }
  6832. get namespaceURI() {
  6833. return this.__namespaceURI;
  6834. }
  6835. get shadowRoot() {
  6836. return this.__shadowRoot || null;
  6837. }
  6838. /**
  6839. * Set shadow root for element
  6840. * @param shadowRoot - ShadowRoot to set
  6841. */
  6842. set shadowRoot(shadowRoot) {
  6843. if (shadowRoot != null) {
  6844. shadowRoot.host = this;
  6845. this.__shadowRoot = shadowRoot;
  6846. } else {
  6847. delete this.__shadowRoot;
  6848. }
  6849. }
  6850. get attributes() {
  6851. if (this.__attributeMap == null) {
  6852. const attrMap = createAttributeProxy(false);
  6853. this.__attributeMap = attrMap;
  6854. return attrMap;
  6855. }
  6856. return this.__attributeMap;
  6857. }
  6858. set attributes(attrs) {
  6859. this.__attributeMap = attrs;
  6860. }
  6861. get children() {
  6862. return this.childNodes.filter((n) => n.nodeType === 1 /* ELEMENT_NODE */);
  6863. }
  6864. get childElementCount() {
  6865. return this.childNodes.filter((n) => n.nodeType === 1 /* ELEMENT_NODE */).length;
  6866. }
  6867. get className() {
  6868. return this.getAttributeNS(null, "class") || "";
  6869. }
  6870. set className(value) {
  6871. this.setAttributeNS(null, "class", value);
  6872. }
  6873. get classList() {
  6874. return new MockClassList(this);
  6875. }
  6876. click() {
  6877. dispatchEvent(this, new MockEvent("click", { bubbles: true, cancelable: true, composed: true }));
  6878. }
  6879. cloneNode(_deep) {
  6880. return null;
  6881. }
  6882. closest(selector) {
  6883. let elm = this;
  6884. while (elm != null) {
  6885. if (elm.matches(selector)) {
  6886. return elm;
  6887. }
  6888. elm = elm.parentNode;
  6889. }
  6890. return null;
  6891. }
  6892. get dataset() {
  6893. return dataset(this);
  6894. }
  6895. get dir() {
  6896. return this.getAttributeNS(null, "dir") || "";
  6897. }
  6898. set dir(value) {
  6899. this.setAttributeNS(null, "dir", value);
  6900. }
  6901. dispatchEvent(ev) {
  6902. return dispatchEvent(this, ev);
  6903. }
  6904. get firstElementChild() {
  6905. return this.children[0] || null;
  6906. }
  6907. focus(_options) {
  6908. dispatchEvent(
  6909. this,
  6910. new MockFocusEvent("focus", { relatedTarget: null, bubbles: true, cancelable: true, composed: true })
  6911. );
  6912. }
  6913. getAttribute(attrName) {
  6914. if (attrName === "style") {
  6915. if (this.__style != null && this.__style.length > 0) {
  6916. return this.style.cssText;
  6917. }
  6918. return null;
  6919. }
  6920. const attr = this.attributes.getNamedItem(attrName);
  6921. if (attr != null) {
  6922. return attr.value;
  6923. }
  6924. return null;
  6925. }
  6926. getAttributeNS(namespaceURI, attrName) {
  6927. const attr = this.attributes.getNamedItemNS(namespaceURI, attrName);
  6928. if (attr != null) {
  6929. return attr.value;
  6930. }
  6931. return null;
  6932. }
  6933. getAttributeNode(attrName) {
  6934. if (!this.hasAttribute(attrName)) {
  6935. return null;
  6936. }
  6937. return new MockAttr(attrName, this.getAttribute(attrName));
  6938. }
  6939. getBoundingClientRect() {
  6940. return { bottom: 0, height: 0, left: 0, right: 0, top: 0, width: 0, x: 0, y: 0 };
  6941. }
  6942. getRootNode(opts) {
  6943. const isComposed = opts != null && opts.composed === true;
  6944. let node = this;
  6945. while (node.parentNode != null) {
  6946. node = node.parentNode;
  6947. if (isComposed === true && node.parentNode == null && node.host != null) {
  6948. node = node.host;
  6949. }
  6950. }
  6951. return node;
  6952. }
  6953. get draggable() {
  6954. return this.getAttributeNS(null, "draggable") === "true";
  6955. }
  6956. set draggable(value) {
  6957. this.setAttributeNS(null, "draggable", value);
  6958. }
  6959. hasChildNodes() {
  6960. return this.childNodes.length > 0;
  6961. }
  6962. get id() {
  6963. return this.getAttributeNS(null, "id") || "";
  6964. }
  6965. set id(value) {
  6966. this.setAttributeNS(null, "id", value);
  6967. }
  6968. get innerHTML() {
  6969. if (this.childNodes.length === 0) {
  6970. return "";
  6971. }
  6972. return serializeNodeToHtml(this, {
  6973. newLines: false,
  6974. indentSpaces: 0
  6975. });
  6976. }
  6977. set innerHTML(html) {
  6978. var _a;
  6979. if (NON_ESCAPABLE_CONTENT.has((_a = this.nodeName) != null ? _a : "") === true) {
  6980. setTextContent(this, html);
  6981. } else {
  6982. for (let i = this.childNodes.length - 1; i >= 0; i--) {
  6983. this.removeChild(this.childNodes[i]);
  6984. }
  6985. if (typeof html === "string") {
  6986. const frag = parseFragmentUtil(this.ownerDocument, html);
  6987. while (frag.childNodes.length > 0) {
  6988. this.appendChild(frag.childNodes[0]);
  6989. }
  6990. }
  6991. }
  6992. }
  6993. get innerText() {
  6994. const text = [];
  6995. getTextContent(this.childNodes, text);
  6996. return text.join("");
  6997. }
  6998. set innerText(value) {
  6999. setTextContent(this, value);
  7000. }
  7001. insertAdjacentElement(position, elm) {
  7002. if (position === "beforebegin" && this.parentNode) {
  7003. insertBefore(this.parentNode, elm, this);
  7004. } else if (position === "afterbegin") {
  7005. this.prepend(elm);
  7006. } else if (position === "beforeend") {
  7007. this.appendChild(elm);
  7008. } else if (position === "afterend" && this.parentNode) {
  7009. insertBefore(this.parentNode, elm, this.nextSibling);
  7010. }
  7011. return elm;
  7012. }
  7013. insertAdjacentHTML(position, html) {
  7014. const frag = parseFragmentUtil(this.ownerDocument, html);
  7015. if (position === "beforebegin") {
  7016. while (frag.childNodes.length > 0) {
  7017. if (this.parentNode) {
  7018. insertBefore(this.parentNode, frag.childNodes[0], this);
  7019. }
  7020. }
  7021. } else if (position === "afterbegin") {
  7022. while (frag.childNodes.length > 0) {
  7023. this.prepend(frag.childNodes[frag.childNodes.length - 1]);
  7024. }
  7025. } else if (position === "beforeend") {
  7026. while (frag.childNodes.length > 0) {
  7027. this.appendChild(frag.childNodes[0]);
  7028. }
  7029. } else if (position === "afterend") {
  7030. while (frag.childNodes.length > 0) {
  7031. if (this.parentNode) {
  7032. insertBefore(this.parentNode, frag.childNodes[frag.childNodes.length - 1], this.nextSibling);
  7033. }
  7034. }
  7035. }
  7036. }
  7037. insertAdjacentText(position, text) {
  7038. const elm = this.ownerDocument.createTextNode(text);
  7039. if (position === "beforebegin" && this.parentNode) {
  7040. insertBefore(this.parentNode, elm, this);
  7041. } else if (position === "afterbegin") {
  7042. this.prepend(elm);
  7043. } else if (position === "beforeend") {
  7044. this.appendChild(elm);
  7045. } else if (position === "afterend" && this.parentNode) {
  7046. insertBefore(this.parentNode, elm, this.nextSibling);
  7047. }
  7048. }
  7049. hasAttribute(attrName) {
  7050. if (attrName === "style") {
  7051. return this.__style != null && this.__style.length > 0;
  7052. }
  7053. return this.getAttribute(attrName) !== null;
  7054. }
  7055. hasAttributeNS(namespaceURI, name) {
  7056. return this.getAttributeNS(namespaceURI, name) !== null;
  7057. }
  7058. get hidden() {
  7059. return this.hasAttributeNS(null, "hidden");
  7060. }
  7061. set hidden(isHidden) {
  7062. if (isHidden === true) {
  7063. this.setAttributeNS(null, "hidden", "");
  7064. } else {
  7065. this.removeAttributeNS(null, "hidden");
  7066. }
  7067. }
  7068. get lang() {
  7069. return this.getAttributeNS(null, "lang") || "";
  7070. }
  7071. set lang(value) {
  7072. this.setAttributeNS(null, "lang", value);
  7073. }
  7074. get lastElementChild() {
  7075. const children = this.children;
  7076. return children[children.length - 1] || null;
  7077. }
  7078. matches(selector) {
  7079. return matches(selector, this);
  7080. }
  7081. get nextElementSibling() {
  7082. const parentElement = this.parentElement;
  7083. if (parentElement != null && (parentElement.nodeType === 1 /* ELEMENT_NODE */ || parentElement.nodeType === 11 /* DOCUMENT_FRAGMENT_NODE */ || parentElement.nodeType === 9 /* DOCUMENT_NODE */)) {
  7084. const children = parentElement.children;
  7085. const index = children.indexOf(this) + 1;
  7086. return parentElement.children[index] || null;
  7087. }
  7088. return null;
  7089. }
  7090. get outerHTML() {
  7091. return serializeNodeToHtml(this, {
  7092. newLines: false,
  7093. outerHtml: true,
  7094. indentSpaces: 0
  7095. });
  7096. }
  7097. get previousElementSibling() {
  7098. const parentElement = this.parentElement;
  7099. if (parentElement != null && (parentElement.nodeType === 1 /* ELEMENT_NODE */ || parentElement.nodeType === 11 /* DOCUMENT_FRAGMENT_NODE */ || parentElement.nodeType === 9 /* DOCUMENT_NODE */)) {
  7100. const children = parentElement.children;
  7101. const index = children.indexOf(this) - 1;
  7102. return parentElement.children[index] || null;
  7103. }
  7104. return null;
  7105. }
  7106. getElementsByClassName(classNames) {
  7107. const classes = classNames.trim().split(" ").filter((c) => c.length > 0);
  7108. const results = [];
  7109. getElementsByClassName(this, classes, results);
  7110. return results;
  7111. }
  7112. getElementsByTagName(tagName) {
  7113. const results = [];
  7114. getElementsByTagName(this, tagName.toLowerCase(), results);
  7115. return results;
  7116. }
  7117. querySelector(selector) {
  7118. return selectOne(selector, this);
  7119. }
  7120. querySelectorAll(selector) {
  7121. return selectAll(selector, this);
  7122. }
  7123. removeAttribute(attrName) {
  7124. if (attrName === "style") {
  7125. delete this.__style;
  7126. } else {
  7127. const attr = this.attributes.getNamedItem(attrName);
  7128. if (attr != null) {
  7129. this.attributes.removeNamedItemNS(attr);
  7130. if (checkAttributeChanged(this) === true) {
  7131. attributeChanged(this, attrName, attr.value, null);
  7132. }
  7133. }
  7134. }
  7135. }
  7136. removeAttributeNS(namespaceURI, attrName) {
  7137. const attr = this.attributes.getNamedItemNS(namespaceURI, attrName);
  7138. if (attr != null) {
  7139. this.attributes.removeNamedItemNS(attr);
  7140. if (checkAttributeChanged(this) === true) {
  7141. attributeChanged(this, attrName, attr.value, null);
  7142. }
  7143. }
  7144. }
  7145. removeEventListener(type, handler) {
  7146. removeEventListener(this, type, handler);
  7147. }
  7148. setAttribute(attrName, value) {
  7149. if (attrName === "style") {
  7150. this.style = value;
  7151. } else {
  7152. const attributes = this.attributes;
  7153. let attr = attributes.getNamedItem(attrName);
  7154. const checkAttrChanged = checkAttributeChanged(this);
  7155. if (attr != null) {
  7156. if (checkAttrChanged === true) {
  7157. const oldValue = attr.value;
  7158. attr.value = value;
  7159. if (oldValue !== attr.value) {
  7160. attributeChanged(this, attr.name, oldValue, attr.value);
  7161. }
  7162. } else {
  7163. attr.value = value;
  7164. }
  7165. } else {
  7166. if (attributes.caseInsensitive) {
  7167. attrName = attrName.toLowerCase();
  7168. }
  7169. attr = new MockAttr(attrName, value);
  7170. attributes.__items.push(attr);
  7171. if (checkAttrChanged === true) {
  7172. attributeChanged(this, attrName, null, attr.value);
  7173. }
  7174. }
  7175. }
  7176. }
  7177. setAttributeNS(namespaceURI, attrName, value) {
  7178. const attributes = this.attributes;
  7179. let attr = attributes.getNamedItemNS(namespaceURI, attrName);
  7180. const checkAttrChanged = checkAttributeChanged(this);
  7181. if (attr != null) {
  7182. if (checkAttrChanged === true) {
  7183. const oldValue = attr.value;
  7184. attr.value = value;
  7185. if (oldValue !== attr.value) {
  7186. attributeChanged(this, attr.name, oldValue, attr.value);
  7187. }
  7188. } else {
  7189. attr.value = value;
  7190. }
  7191. } else {
  7192. attr = new MockAttr(attrName, value, namespaceURI);
  7193. attributes.__items.push(attr);
  7194. if (checkAttrChanged === true) {
  7195. attributeChanged(this, attrName, null, attr.value);
  7196. }
  7197. }
  7198. }
  7199. get style() {
  7200. if (this.__style == null) {
  7201. this.__style = createCSSStyleDeclaration();
  7202. }
  7203. return this.__style;
  7204. }
  7205. set style(val) {
  7206. if (typeof val === "string") {
  7207. if (this.__style == null) {
  7208. this.__style = createCSSStyleDeclaration();
  7209. }
  7210. this.__style.cssText = val;
  7211. } else {
  7212. this.__style = val;
  7213. }
  7214. }
  7215. get tabIndex() {
  7216. return parseInt(this.getAttributeNS(null, "tabindex") || "-1", 10);
  7217. }
  7218. set tabIndex(value) {
  7219. this.setAttributeNS(null, "tabindex", value);
  7220. }
  7221. get tagName() {
  7222. var _a;
  7223. return (_a = this.nodeName) != null ? _a : "";
  7224. }
  7225. set tagName(value) {
  7226. this.nodeName = value;
  7227. }
  7228. get textContent() {
  7229. const text = [];
  7230. getTextContent(this.childNodes, text);
  7231. return text.join("");
  7232. }
  7233. set textContent(value) {
  7234. setTextContent(this, value);
  7235. }
  7236. get title() {
  7237. return this.getAttributeNS(null, "title") || "";
  7238. }
  7239. set title(value) {
  7240. this.setAttributeNS(null, "title", value);
  7241. }
  7242. animate() {
  7243. }
  7244. onanimationstart() {
  7245. }
  7246. onanimationend() {
  7247. }
  7248. onanimationiteration() {
  7249. }
  7250. onabort() {
  7251. }
  7252. onauxclick() {
  7253. }
  7254. onbeforecopy() {
  7255. }
  7256. onbeforecut() {
  7257. }
  7258. onbeforepaste() {
  7259. }
  7260. onblur() {
  7261. }
  7262. oncancel() {
  7263. }
  7264. oncanplay() {
  7265. }
  7266. oncanplaythrough() {
  7267. }
  7268. onchange() {
  7269. }
  7270. onclick() {
  7271. }
  7272. onclose() {
  7273. }
  7274. oncontextmenu() {
  7275. }
  7276. oncopy() {
  7277. }
  7278. oncuechange() {
  7279. }
  7280. oncut() {
  7281. }
  7282. ondblclick() {
  7283. }
  7284. ondrag() {
  7285. }
  7286. ondragend() {
  7287. }
  7288. ondragenter() {
  7289. }
  7290. ondragleave() {
  7291. }
  7292. ondragover() {
  7293. }
  7294. ondragstart() {
  7295. }
  7296. ondrop() {
  7297. }
  7298. ondurationchange() {
  7299. }
  7300. onemptied() {
  7301. }
  7302. onended() {
  7303. }
  7304. onerror() {
  7305. }
  7306. onfocus() {
  7307. }
  7308. onfocusin() {
  7309. }
  7310. onfocusout() {
  7311. }
  7312. onformdata() {
  7313. }
  7314. onfullscreenchange() {
  7315. }
  7316. onfullscreenerror() {
  7317. }
  7318. ongotpointercapture() {
  7319. }
  7320. oninput() {
  7321. }
  7322. oninvalid() {
  7323. }
  7324. onkeydown() {
  7325. }
  7326. onkeypress() {
  7327. }
  7328. onkeyup() {
  7329. }
  7330. onload() {
  7331. }
  7332. onloadeddata() {
  7333. }
  7334. onloadedmetadata() {
  7335. }
  7336. onloadstart() {
  7337. }
  7338. onlostpointercapture() {
  7339. }
  7340. onmousedown() {
  7341. }
  7342. onmouseenter() {
  7343. }
  7344. onmouseleave() {
  7345. }
  7346. onmousemove() {
  7347. }
  7348. onmouseout() {
  7349. }
  7350. onmouseover() {
  7351. }
  7352. onmouseup() {
  7353. }
  7354. onmousewheel() {
  7355. }
  7356. onpaste() {
  7357. }
  7358. onpause() {
  7359. }
  7360. onplay() {
  7361. }
  7362. onplaying() {
  7363. }
  7364. onpointercancel() {
  7365. }
  7366. onpointerdown() {
  7367. }
  7368. onpointerenter() {
  7369. }
  7370. onpointerleave() {
  7371. }
  7372. onpointermove() {
  7373. }
  7374. onpointerout() {
  7375. }
  7376. onpointerover() {
  7377. }
  7378. onpointerup() {
  7379. }
  7380. onprogress() {
  7381. }
  7382. onratechange() {
  7383. }
  7384. onreset() {
  7385. }
  7386. onresize() {
  7387. }
  7388. onscroll() {
  7389. }
  7390. onsearch() {
  7391. }
  7392. onseeked() {
  7393. }
  7394. onseeking() {
  7395. }
  7396. onselect() {
  7397. }
  7398. onselectstart() {
  7399. }
  7400. onstalled() {
  7401. }
  7402. onsubmit() {
  7403. }
  7404. onsuspend() {
  7405. }
  7406. ontimeupdate() {
  7407. }
  7408. ontoggle() {
  7409. }
  7410. onvolumechange() {
  7411. }
  7412. onwaiting() {
  7413. }
  7414. onwebkitfullscreenchange() {
  7415. }
  7416. onwebkitfullscreenerror() {
  7417. }
  7418. onwheel() {
  7419. }
  7420. requestFullscreen() {
  7421. }
  7422. scrollBy() {
  7423. }
  7424. scrollTo() {
  7425. }
  7426. scrollIntoView() {
  7427. }
  7428. toString(opts) {
  7429. return serializeNodeToHtml(this, opts);
  7430. }
  7431. };
  7432. function getElementsByClassName(elm, classNames, foundElms) {
  7433. const children = elm.children;
  7434. for (let i = 0, ii = children.length; i < ii; i++) {
  7435. const childElm = children[i];
  7436. for (let j = 0, jj = classNames.length; j < jj; j++) {
  7437. if (childElm.classList.contains(classNames[j])) {
  7438. foundElms.push(childElm);
  7439. }
  7440. }
  7441. getElementsByClassName(childElm, classNames, foundElms);
  7442. }
  7443. }
  7444. function getElementsByTagName(elm, tagName, foundElms) {
  7445. var _a;
  7446. const children = elm.children;
  7447. for (let i = 0, ii = children.length; i < ii; i++) {
  7448. const childElm = children[i];
  7449. if (tagName === "*" || ((_a = childElm.nodeName) != null ? _a : "").toLowerCase() === tagName) {
  7450. foundElms.push(childElm);
  7451. }
  7452. getElementsByTagName(childElm, tagName, foundElms);
  7453. }
  7454. }
  7455. function resetElement(elm) {
  7456. resetEventListeners(elm);
  7457. delete elm.__attributeMap;
  7458. delete elm.__shadowRoot;
  7459. delete elm.__style;
  7460. }
  7461. function insertBefore(parentNode, newNode, referenceNode) {
  7462. if (newNode !== referenceNode) {
  7463. newNode.remove();
  7464. newNode.parentNode = parentNode;
  7465. newNode.ownerDocument = parentNode.ownerDocument;
  7466. if (referenceNode != null) {
  7467. const index = parentNode.childNodes.indexOf(referenceNode);
  7468. if (index > -1) {
  7469. parentNode.childNodes.splice(index, 0, newNode);
  7470. } else {
  7471. throw new Error(`referenceNode not found in parentNode.childNodes`);
  7472. }
  7473. } else {
  7474. parentNode.childNodes.push(newNode);
  7475. }
  7476. connectNode(parentNode.ownerDocument, newNode);
  7477. }
  7478. return newNode;
  7479. }
  7480. var MockHTMLElement = class extends MockElement {
  7481. constructor(ownerDocument, nodeName) {
  7482. super(ownerDocument, typeof nodeName === "string" ? nodeName.toUpperCase() : null);
  7483. this.__namespaceURI = "http://www.w3.org/1999/xhtml";
  7484. }
  7485. get tagName() {
  7486. var _a;
  7487. return (_a = this.nodeName) != null ? _a : "";
  7488. }
  7489. set tagName(value) {
  7490. this.nodeName = value;
  7491. }
  7492. /**
  7493. * A node’s parent of type Element is known as its parent element.
  7494. * If the node has a parent of a different type, its parent element
  7495. * is null.
  7496. * @returns MockElement
  7497. */
  7498. get parentElement() {
  7499. if (this.nodeName === "HTML") {
  7500. return null;
  7501. }
  7502. return super.parentElement;
  7503. }
  7504. get attributes() {
  7505. if (this.__attributeMap == null) {
  7506. const attrMap = createAttributeProxy(true);
  7507. this.__attributeMap = attrMap;
  7508. return attrMap;
  7509. }
  7510. return this.__attributeMap;
  7511. }
  7512. set attributes(attrs) {
  7513. this.__attributeMap = attrs;
  7514. }
  7515. };
  7516. var MockTextNode = class _MockTextNode extends MockNode2 {
  7517. constructor(ownerDocument, text) {
  7518. super(ownerDocument, 3 /* TEXT_NODE */, "#text" /* TEXT_NODE */, text);
  7519. }
  7520. cloneNode(_deep) {
  7521. return new _MockTextNode(null, this.nodeValue);
  7522. }
  7523. get textContent() {
  7524. return this.nodeValue;
  7525. }
  7526. set textContent(text) {
  7527. this.nodeValue = text;
  7528. }
  7529. get data() {
  7530. return this.nodeValue;
  7531. }
  7532. set data(text) {
  7533. this.nodeValue = text;
  7534. }
  7535. get wholeText() {
  7536. if (this.parentNode != null) {
  7537. const text = [];
  7538. for (let i = 0, ii = this.parentNode.childNodes.length; i < ii; i++) {
  7539. const childNode = this.parentNode.childNodes[i];
  7540. if (childNode.nodeType === 3 /* TEXT_NODE */) {
  7541. text.push(childNode.nodeValue);
  7542. }
  7543. }
  7544. return text.join("");
  7545. }
  7546. return this.nodeValue;
  7547. }
  7548. };
  7549. function getTextContent(childNodes, text) {
  7550. for (let i = 0, ii = childNodes.length; i < ii; i++) {
  7551. const childNode = childNodes[i];
  7552. if (childNode.nodeType === 3 /* TEXT_NODE */) {
  7553. text.push(childNode.nodeValue);
  7554. } else if (childNode.nodeType === 1 /* ELEMENT_NODE */) {
  7555. getTextContent(childNode.childNodes, text);
  7556. }
  7557. }
  7558. }
  7559. function setTextContent(elm, text) {
  7560. for (let i = elm.childNodes.length - 1; i >= 0; i--) {
  7561. elm.removeChild(elm.childNodes[i]);
  7562. }
  7563. const textNode = new MockTextNode(elm.ownerDocument, text);
  7564. elm.appendChild(textNode);
  7565. }
  7566. // src/mock-doc/comment-node.ts
  7567. var MockComment = class _MockComment extends MockNode2 {
  7568. constructor(ownerDocument, data) {
  7569. super(ownerDocument, 8 /* COMMENT_NODE */, "#comment" /* COMMENT_NODE */, data);
  7570. }
  7571. cloneNode(_deep) {
  7572. return new _MockComment(null, this.nodeValue);
  7573. }
  7574. get textContent() {
  7575. return this.nodeValue;
  7576. }
  7577. set textContent(text) {
  7578. this.nodeValue = text;
  7579. }
  7580. };
  7581. // src/mock-doc/document-fragment.ts
  7582. var MockDocumentFragment = class _MockDocumentFragment extends MockHTMLElement {
  7583. constructor(ownerDocument) {
  7584. super(ownerDocument, null);
  7585. this.nodeName = "#document-fragment" /* DOCUMENT_FRAGMENT_NODE */;
  7586. this.nodeType = 11 /* DOCUMENT_FRAGMENT_NODE */;
  7587. }
  7588. getElementById(id) {
  7589. return getElementById(this, id);
  7590. }
  7591. cloneNode(deep) {
  7592. const cloned = new _MockDocumentFragment(null);
  7593. if (deep) {
  7594. for (let i = 0, ii = this.childNodes.length; i < ii; i++) {
  7595. const childNode = this.childNodes[i];
  7596. if (childNode.nodeType === 1 /* ELEMENT_NODE */ || childNode.nodeType === 3 /* TEXT_NODE */ || childNode.nodeType === 8 /* COMMENT_NODE */) {
  7597. const clonedChildNode = this.childNodes[i].cloneNode(true);
  7598. cloned.appendChild(clonedChildNode);
  7599. }
  7600. }
  7601. }
  7602. return cloned;
  7603. }
  7604. };
  7605. // src/mock-doc/document-type-node.ts
  7606. var MockDocumentTypeNode = class extends MockHTMLElement {
  7607. constructor(ownerDocument) {
  7608. super(ownerDocument, "!DOCTYPE");
  7609. this.nodeType = 10 /* DOCUMENT_TYPE_NODE */;
  7610. this.setAttribute("html", "");
  7611. }
  7612. };
  7613. // src/mock-doc/css-style-sheet.ts
  7614. var MockCSSRule = class {
  7615. constructor(parentStyleSheet) {
  7616. this.parentStyleSheet = parentStyleSheet;
  7617. this.cssText = "";
  7618. this.type = 0;
  7619. }
  7620. };
  7621. var MockCSSStyleSheet = class {
  7622. constructor(ownerNode) {
  7623. this.type = "text/css";
  7624. this.parentStyleSheet = null;
  7625. this.cssRules = [];
  7626. this.ownerNode = ownerNode;
  7627. }
  7628. get rules() {
  7629. return this.cssRules;
  7630. }
  7631. set rules(rules) {
  7632. this.cssRules = rules;
  7633. }
  7634. deleteRule(index) {
  7635. if (index >= 0 && index < this.cssRules.length) {
  7636. this.cssRules.splice(index, 1);
  7637. updateStyleTextNode(this.ownerNode);
  7638. }
  7639. }
  7640. insertRule(rule, index = 0) {
  7641. if (typeof index !== "number") {
  7642. index = 0;
  7643. }
  7644. if (index < 0) {
  7645. index = 0;
  7646. }
  7647. if (index > this.cssRules.length) {
  7648. index = this.cssRules.length;
  7649. }
  7650. const cssRule = new MockCSSRule(this);
  7651. cssRule.cssText = rule;
  7652. this.cssRules.splice(index, 0, cssRule);
  7653. updateStyleTextNode(this.ownerNode);
  7654. return index;
  7655. }
  7656. };
  7657. function getStyleElementText(styleElm) {
  7658. const output = [];
  7659. for (let i = 0; i < styleElm.childNodes.length; i++) {
  7660. output.push(styleElm.childNodes[i].nodeValue);
  7661. }
  7662. return output.join("");
  7663. }
  7664. function setStyleElementText(styleElm, text) {
  7665. const sheet = styleElm.sheet;
  7666. sheet.cssRules.length = 0;
  7667. sheet.insertRule(text);
  7668. updateStyleTextNode(styleElm);
  7669. }
  7670. function updateStyleTextNode(styleElm) {
  7671. const childNodeLen = styleElm.childNodes.length;
  7672. if (childNodeLen > 1) {
  7673. for (let i = childNodeLen - 1; i >= 1; i--) {
  7674. styleElm.removeChild(styleElm.childNodes[i]);
  7675. }
  7676. } else if (childNodeLen < 1) {
  7677. styleElm.appendChild(styleElm.ownerDocument.createTextNode(""));
  7678. }
  7679. const textNode = styleElm.childNodes[0];
  7680. textNode.nodeValue = styleElm.sheet.cssRules.map((r) => r.cssText).join("\n");
  7681. }
  7682. // src/mock-doc/element.ts
  7683. function createElement(ownerDocument, tagName) {
  7684. if (typeof tagName !== "string" || tagName === "" || !/^[a-z0-9-_:]+$/i.test(tagName)) {
  7685. throw new Error(`The tag name provided (${tagName}) is not a valid name.`);
  7686. }
  7687. tagName = tagName.toLowerCase();
  7688. switch (tagName) {
  7689. case "a":
  7690. return new MockAnchorElement(ownerDocument);
  7691. case "base":
  7692. return new MockBaseElement(ownerDocument);
  7693. case "button":
  7694. return new MockButtonElement(ownerDocument);
  7695. case "canvas":
  7696. return new MockCanvasElement(ownerDocument);
  7697. case "form":
  7698. return new MockFormElement(ownerDocument);
  7699. case "img":
  7700. return new MockImageElement(ownerDocument);
  7701. case "input":
  7702. return new MockInputElement(ownerDocument);
  7703. case "link":
  7704. return new MockLinkElement(ownerDocument);
  7705. case "meta":
  7706. return new MockMetaElement(ownerDocument);
  7707. case "script":
  7708. return new MockScriptElement(ownerDocument);
  7709. case "style":
  7710. return new MockStyleElement(ownerDocument);
  7711. case "template":
  7712. return new MockTemplateElement(ownerDocument);
  7713. case "title":
  7714. return new MockTitleElement(ownerDocument);
  7715. case "ul":
  7716. return new MockUListElement(ownerDocument);
  7717. }
  7718. if (ownerDocument != null && tagName.includes("-")) {
  7719. const win = ownerDocument.defaultView;
  7720. if (win != null && win.customElements != null) {
  7721. return createCustomElement(win.customElements, ownerDocument, tagName);
  7722. }
  7723. }
  7724. return new MockHTMLElement(ownerDocument, tagName);
  7725. }
  7726. function createElementNS(ownerDocument, namespaceURI, tagName) {
  7727. if (namespaceURI === "http://www.w3.org/1999/xhtml") {
  7728. return createElement(ownerDocument, tagName);
  7729. } else if (namespaceURI === "http://www.w3.org/2000/svg") {
  7730. switch (tagName.toLowerCase()) {
  7731. case "text":
  7732. case "tspan":
  7733. case "tref":
  7734. case "altglyph":
  7735. case "textpath":
  7736. return new MockSVGTextContentElement(ownerDocument, tagName);
  7737. case "circle":
  7738. case "ellipse":
  7739. case "image":
  7740. case "line":
  7741. case "path":
  7742. case "polygon":
  7743. case "polyline":
  7744. case "rect":
  7745. case "use":
  7746. return new MockSVGGraphicsElement(ownerDocument, tagName);
  7747. case "svg":
  7748. return new MockSVGSVGElement(ownerDocument, tagName);
  7749. default:
  7750. return new MockSVGElement(ownerDocument, tagName);
  7751. }
  7752. } else {
  7753. return new MockElement(ownerDocument, tagName, namespaceURI);
  7754. }
  7755. }
  7756. var MockAnchorElement = class extends MockHTMLElement {
  7757. constructor(ownerDocument) {
  7758. super(ownerDocument, "a");
  7759. }
  7760. get href() {
  7761. return fullUrl(this, "href");
  7762. }
  7763. set href(value) {
  7764. this.setAttribute("href", value);
  7765. }
  7766. get pathname() {
  7767. return new URL(this.href).pathname;
  7768. }
  7769. };
  7770. var MockButtonElement = class extends MockHTMLElement {
  7771. constructor(ownerDocument) {
  7772. super(ownerDocument, "button");
  7773. }
  7774. };
  7775. patchPropAttributes(
  7776. MockButtonElement.prototype,
  7777. {
  7778. type: String
  7779. },
  7780. {
  7781. type: "submit"
  7782. }
  7783. );
  7784. var MockImageElement = class extends MockHTMLElement {
  7785. constructor(ownerDocument) {
  7786. super(ownerDocument, "img");
  7787. }
  7788. get draggable() {
  7789. return this.getAttributeNS(null, "draggable") !== "false";
  7790. }
  7791. set draggable(value) {
  7792. this.setAttributeNS(null, "draggable", value);
  7793. }
  7794. get src() {
  7795. return fullUrl(this, "src");
  7796. }
  7797. set src(value) {
  7798. this.setAttribute("src", value);
  7799. }
  7800. };
  7801. patchPropAttributes(MockImageElement.prototype, {
  7802. height: Number,
  7803. width: Number
  7804. });
  7805. var MockInputElement = class extends MockHTMLElement {
  7806. constructor(ownerDocument) {
  7807. super(ownerDocument, "input");
  7808. }
  7809. get list() {
  7810. const listId = this.getAttribute("list");
  7811. if (listId) {
  7812. return this.ownerDocument.getElementById(listId);
  7813. }
  7814. return null;
  7815. }
  7816. };
  7817. patchPropAttributes(
  7818. MockInputElement.prototype,
  7819. {
  7820. accept: String,
  7821. autocomplete: String,
  7822. autofocus: Boolean,
  7823. capture: String,
  7824. checked: Boolean,
  7825. disabled: Boolean,
  7826. form: String,
  7827. formaction: String,
  7828. formenctype: String,
  7829. formmethod: String,
  7830. formnovalidate: String,
  7831. formtarget: String,
  7832. height: Number,
  7833. inputmode: String,
  7834. max: String,
  7835. maxLength: Number,
  7836. min: String,
  7837. minLength: Number,
  7838. multiple: Boolean,
  7839. name: String,
  7840. pattern: String,
  7841. placeholder: String,
  7842. required: Boolean,
  7843. readOnly: Boolean,
  7844. size: Number,
  7845. spellCheck: Boolean,
  7846. src: String,
  7847. step: String,
  7848. type: String,
  7849. value: String,
  7850. width: Number
  7851. },
  7852. {
  7853. type: "text"
  7854. }
  7855. );
  7856. var MockFormElement = class extends MockHTMLElement {
  7857. constructor(ownerDocument) {
  7858. super(ownerDocument, "form");
  7859. }
  7860. };
  7861. patchPropAttributes(MockFormElement.prototype, {
  7862. name: String
  7863. });
  7864. var MockLinkElement = class extends MockHTMLElement {
  7865. constructor(ownerDocument) {
  7866. super(ownerDocument, "link");
  7867. }
  7868. get href() {
  7869. return fullUrl(this, "href");
  7870. }
  7871. set href(value) {
  7872. this.setAttribute("href", value);
  7873. }
  7874. };
  7875. patchPropAttributes(MockLinkElement.prototype, {
  7876. crossorigin: String,
  7877. media: String,
  7878. rel: String,
  7879. type: String
  7880. });
  7881. var MockMetaElement = class extends MockHTMLElement {
  7882. constructor(ownerDocument) {
  7883. super(ownerDocument, "meta");
  7884. }
  7885. };
  7886. patchPropAttributes(MockMetaElement.prototype, {
  7887. charset: String,
  7888. content: String,
  7889. name: String
  7890. });
  7891. var MockScriptElement = class extends MockHTMLElement {
  7892. constructor(ownerDocument) {
  7893. super(ownerDocument, "script");
  7894. }
  7895. get src() {
  7896. return fullUrl(this, "src");
  7897. }
  7898. set src(value) {
  7899. this.setAttribute("src", value);
  7900. }
  7901. };
  7902. patchPropAttributes(MockScriptElement.prototype, {
  7903. type: String
  7904. });
  7905. var MockDOMMatrix = class _MockDOMMatrix {
  7906. constructor() {
  7907. this.a = 1;
  7908. this.b = 0;
  7909. this.c = 0;
  7910. this.d = 1;
  7911. this.e = 0;
  7912. this.f = 0;
  7913. this.m11 = 1;
  7914. this.m12 = 0;
  7915. this.m13 = 0;
  7916. this.m14 = 0;
  7917. this.m21 = 0;
  7918. this.m22 = 1;
  7919. this.m23 = 0;
  7920. this.m24 = 0;
  7921. this.m31 = 0;
  7922. this.m32 = 0;
  7923. this.m33 = 1;
  7924. this.m34 = 0;
  7925. this.m41 = 0;
  7926. this.m42 = 0;
  7927. this.m43 = 0;
  7928. this.m44 = 1;
  7929. this.is2D = true;
  7930. this.isIdentity = true;
  7931. }
  7932. static fromMatrix() {
  7933. return new _MockDOMMatrix();
  7934. }
  7935. inverse() {
  7936. return new _MockDOMMatrix();
  7937. }
  7938. flipX() {
  7939. return new _MockDOMMatrix();
  7940. }
  7941. flipY() {
  7942. return new _MockDOMMatrix();
  7943. }
  7944. multiply() {
  7945. return new _MockDOMMatrix();
  7946. }
  7947. rotate() {
  7948. return new _MockDOMMatrix();
  7949. }
  7950. rotateAxisAngle() {
  7951. return new _MockDOMMatrix();
  7952. }
  7953. rotateFromVector() {
  7954. return new _MockDOMMatrix();
  7955. }
  7956. scale() {
  7957. return new _MockDOMMatrix();
  7958. }
  7959. scaleNonUniform() {
  7960. return new _MockDOMMatrix();
  7961. }
  7962. skewX() {
  7963. return new _MockDOMMatrix();
  7964. }
  7965. skewY() {
  7966. return new _MockDOMMatrix();
  7967. }
  7968. toJSON() {
  7969. }
  7970. toString() {
  7971. }
  7972. transformPoint() {
  7973. return new MockDOMPoint();
  7974. }
  7975. translate() {
  7976. return new _MockDOMMatrix();
  7977. }
  7978. };
  7979. var MockDOMPoint = class {
  7980. constructor() {
  7981. this.w = 1;
  7982. this.x = 0;
  7983. this.y = 0;
  7984. this.z = 0;
  7985. }
  7986. toJSON() {
  7987. }
  7988. matrixTransform() {
  7989. return new MockDOMMatrix();
  7990. }
  7991. };
  7992. var MockSVGRect = class {
  7993. constructor() {
  7994. this.height = 10;
  7995. this.width = 10;
  7996. this.x = 0;
  7997. this.y = 0;
  7998. }
  7999. };
  8000. var MockStyleElement = class extends MockHTMLElement {
  8001. constructor(ownerDocument) {
  8002. super(ownerDocument, "style");
  8003. this.sheet = new MockCSSStyleSheet(this);
  8004. }
  8005. get innerHTML() {
  8006. return getStyleElementText(this);
  8007. }
  8008. set innerHTML(value) {
  8009. setStyleElementText(this, value);
  8010. }
  8011. get innerText() {
  8012. return getStyleElementText(this);
  8013. }
  8014. set innerText(value) {
  8015. setStyleElementText(this, value);
  8016. }
  8017. get textContent() {
  8018. return getStyleElementText(this);
  8019. }
  8020. set textContent(value) {
  8021. setStyleElementText(this, value);
  8022. }
  8023. };
  8024. var MockSVGElement = class extends MockElement {
  8025. constructor() {
  8026. super(...arguments);
  8027. this.__namespaceURI = "http://www.w3.org/2000/svg";
  8028. }
  8029. // SVGElement properties and methods
  8030. get ownerSVGElement() {
  8031. return null;
  8032. }
  8033. get viewportElement() {
  8034. return null;
  8035. }
  8036. onunload() {
  8037. }
  8038. // SVGGeometryElement properties and methods
  8039. get pathLength() {
  8040. return 0;
  8041. }
  8042. isPointInFill(_pt) {
  8043. return false;
  8044. }
  8045. isPointInStroke(_pt) {
  8046. return false;
  8047. }
  8048. getTotalLength() {
  8049. return 0;
  8050. }
  8051. };
  8052. var MockSVGGraphicsElement = class extends MockSVGElement {
  8053. getBBox(_options) {
  8054. return new MockSVGRect();
  8055. }
  8056. getCTM() {
  8057. return new MockDOMMatrix();
  8058. }
  8059. getScreenCTM() {
  8060. return new MockDOMMatrix();
  8061. }
  8062. };
  8063. var MockSVGSVGElement = class extends MockSVGGraphicsElement {
  8064. createSVGPoint() {
  8065. return new MockDOMPoint();
  8066. }
  8067. };
  8068. var MockSVGTextContentElement = class extends MockSVGGraphicsElement {
  8069. getComputedTextLength() {
  8070. return 0;
  8071. }
  8072. };
  8073. var MockBaseElement = class extends MockHTMLElement {
  8074. constructor(ownerDocument) {
  8075. super(ownerDocument, "base");
  8076. }
  8077. get href() {
  8078. return fullUrl(this, "href");
  8079. }
  8080. set href(value) {
  8081. this.setAttribute("href", value);
  8082. }
  8083. };
  8084. var MockTemplateElement = class _MockTemplateElement extends MockHTMLElement {
  8085. constructor(ownerDocument) {
  8086. super(ownerDocument, "template");
  8087. this.content = new MockDocumentFragment(ownerDocument);
  8088. }
  8089. get innerHTML() {
  8090. return this.content.innerHTML;
  8091. }
  8092. set innerHTML(html) {
  8093. this.content.innerHTML = html;
  8094. }
  8095. cloneNode(deep) {
  8096. const cloned = new _MockTemplateElement(null);
  8097. cloned.attributes = cloneAttributes(this.attributes);
  8098. const styleCssText = this.getAttribute("style");
  8099. if (styleCssText != null && styleCssText.length > 0) {
  8100. cloned.setAttribute("style", styleCssText);
  8101. }
  8102. cloned.content = this.content.cloneNode(deep);
  8103. if (deep) {
  8104. for (let i = 0, ii = this.childNodes.length; i < ii; i++) {
  8105. const clonedChildNode = this.childNodes[i].cloneNode(true);
  8106. cloned.appendChild(clonedChildNode);
  8107. }
  8108. }
  8109. return cloned;
  8110. }
  8111. };
  8112. var MockTitleElement = class extends MockHTMLElement {
  8113. constructor(ownerDocument) {
  8114. super(ownerDocument, "title");
  8115. }
  8116. get text() {
  8117. return this.textContent;
  8118. }
  8119. set text(value) {
  8120. this.textContent = value;
  8121. }
  8122. };
  8123. var MockUListElement = class extends MockHTMLElement {
  8124. constructor(ownerDocument) {
  8125. super(ownerDocument, "ul");
  8126. }
  8127. };
  8128. var CanvasRenderingContext = class {
  8129. constructor(context, contextAttributes) {
  8130. this.context = context;
  8131. this.contextAttributes = contextAttributes;
  8132. }
  8133. fillRect() {
  8134. return;
  8135. }
  8136. clearRect() {
  8137. }
  8138. getImageData(_, __, w, h) {
  8139. return {
  8140. data: new Array(w * h * 4)
  8141. };
  8142. }
  8143. toDataURL() {
  8144. return "data:,";
  8145. }
  8146. putImageData() {
  8147. }
  8148. createImageData() {
  8149. return {};
  8150. }
  8151. setTransform() {
  8152. }
  8153. drawImage() {
  8154. }
  8155. save() {
  8156. }
  8157. fillText() {
  8158. }
  8159. restore() {
  8160. }
  8161. beginPath() {
  8162. }
  8163. moveTo() {
  8164. }
  8165. lineTo() {
  8166. }
  8167. closePath() {
  8168. }
  8169. stroke() {
  8170. }
  8171. translate() {
  8172. }
  8173. scale() {
  8174. }
  8175. rotate() {
  8176. }
  8177. arc() {
  8178. }
  8179. fill() {
  8180. }
  8181. measureText() {
  8182. return { width: 0 };
  8183. }
  8184. transform() {
  8185. }
  8186. rect() {
  8187. }
  8188. clip() {
  8189. }
  8190. };
  8191. var MockCanvasElement = class extends MockHTMLElement {
  8192. constructor(ownerDocument) {
  8193. super(ownerDocument, "canvas");
  8194. }
  8195. getContext(context, contextAttributes) {
  8196. return new CanvasRenderingContext(context, contextAttributes);
  8197. }
  8198. };
  8199. function fullUrl(elm, attrName) {
  8200. const val = elm.getAttribute(attrName) || "";
  8201. if (elm.ownerDocument != null) {
  8202. const win = elm.ownerDocument.defaultView;
  8203. if (win != null) {
  8204. const loc = win.location;
  8205. if (loc != null) {
  8206. try {
  8207. const url = new URL(val, loc.href);
  8208. return url.href;
  8209. } catch (e2) {
  8210. }
  8211. }
  8212. }
  8213. }
  8214. return val.replace(/\'|\"/g, "").trim();
  8215. }
  8216. function patchPropAttributes(prototype, attrs, defaults = {}) {
  8217. Object.keys(attrs).forEach((propName) => {
  8218. const attr = attrs[propName];
  8219. const defaultValue = defaults[propName];
  8220. if (attr === Boolean) {
  8221. Object.defineProperty(prototype, propName, {
  8222. get() {
  8223. return this.hasAttribute(propName);
  8224. },
  8225. set(value) {
  8226. if (value) {
  8227. this.setAttribute(propName, "");
  8228. } else {
  8229. this.removeAttribute(propName);
  8230. }
  8231. }
  8232. });
  8233. } else if (attr === Number) {
  8234. Object.defineProperty(prototype, propName, {
  8235. get() {
  8236. const value = this.getAttribute(propName);
  8237. return value ? parseInt(value, 10) : defaultValue === void 0 ? 0 : defaultValue;
  8238. },
  8239. set(value) {
  8240. this.setAttribute(propName, value);
  8241. }
  8242. });
  8243. } else {
  8244. Object.defineProperty(prototype, propName, {
  8245. get() {
  8246. return this.hasAttribute(propName) ? this.getAttribute(propName) : defaultValue || "";
  8247. },
  8248. set(value) {
  8249. this.setAttribute(propName, value);
  8250. }
  8251. });
  8252. }
  8253. });
  8254. }
  8255. MockElement.prototype.cloneNode = function(deep) {
  8256. const cloned = createElement(this.ownerDocument, this.nodeName);
  8257. cloned.attributes = cloneAttributes(this.attributes);
  8258. const styleCssText = this.getAttribute("style");
  8259. if (styleCssText != null && styleCssText.length > 0) {
  8260. cloned.setAttribute("style", styleCssText);
  8261. }
  8262. if (deep) {
  8263. for (let i = 0, ii = this.childNodes.length; i < ii; i++) {
  8264. const clonedChildNode = this.childNodes[i].cloneNode(true);
  8265. cloned.appendChild(clonedChildNode);
  8266. }
  8267. }
  8268. return cloned;
  8269. };
  8270. // src/mock-doc/parse-html.ts
  8271. var sharedDocument;
  8272. function parseHtmlToDocument(html, ownerDocument = null) {
  8273. if (ownerDocument == null) {
  8274. if (sharedDocument == null) {
  8275. sharedDocument = new MockDocument();
  8276. }
  8277. ownerDocument = sharedDocument;
  8278. }
  8279. return parseDocumentUtil(ownerDocument, html);
  8280. }
  8281. function parseHtmlToFragment(html, ownerDocument = null) {
  8282. if (ownerDocument == null) {
  8283. if (sharedDocument == null) {
  8284. sharedDocument = new MockDocument();
  8285. }
  8286. ownerDocument = sharedDocument;
  8287. }
  8288. return parseFragmentUtil(ownerDocument, html);
  8289. }
  8290. // src/mock-doc/console.ts
  8291. var consoleNoop = () => {
  8292. };
  8293. function createConsole() {
  8294. return {
  8295. debug: consoleNoop,
  8296. error: consoleNoop,
  8297. info: consoleNoop,
  8298. log: consoleNoop,
  8299. warn: consoleNoop,
  8300. dir: consoleNoop,
  8301. dirxml: consoleNoop,
  8302. table: consoleNoop,
  8303. trace: consoleNoop,
  8304. group: consoleNoop,
  8305. groupCollapsed: consoleNoop,
  8306. groupEnd: consoleNoop,
  8307. clear: consoleNoop,
  8308. count: consoleNoop,
  8309. countReset: consoleNoop,
  8310. assert: consoleNoop,
  8311. profile: consoleNoop,
  8312. profileEnd: consoleNoop,
  8313. time: consoleNoop,
  8314. timeLog: consoleNoop,
  8315. timeEnd: consoleNoop,
  8316. timeStamp: consoleNoop,
  8317. context: consoleNoop,
  8318. memory: consoleNoop
  8319. };
  8320. }
  8321. // src/mock-doc/headers.ts
  8322. var MockHeaders = class {
  8323. constructor(init) {
  8324. this._values = [];
  8325. if (typeof init === "object") {
  8326. if (typeof init[Symbol.iterator] === "function") {
  8327. const kvs = [];
  8328. for (const kv of init) {
  8329. if (typeof kv[Symbol.iterator] === "function") {
  8330. kvs.push([...kv]);
  8331. }
  8332. }
  8333. for (const kv of kvs) {
  8334. this.append(kv[0], kv[1]);
  8335. }
  8336. } else {
  8337. for (const key in init) {
  8338. this.append(key, init[key]);
  8339. }
  8340. }
  8341. }
  8342. }
  8343. append(key, value) {
  8344. this._values.push([key, value + ""]);
  8345. }
  8346. delete(key) {
  8347. key = key.toLowerCase();
  8348. for (let i = this._values.length - 1; i >= 0; i--) {
  8349. if (this._values[i][0].toLowerCase() === key) {
  8350. this._values.splice(i, 1);
  8351. }
  8352. }
  8353. }
  8354. entries() {
  8355. const entries = [];
  8356. for (const kv of this.keys()) {
  8357. entries.push([kv, this.get(kv)]);
  8358. }
  8359. let index = -1;
  8360. return {
  8361. next() {
  8362. index++;
  8363. return {
  8364. value: entries[index],
  8365. done: !entries[index]
  8366. };
  8367. },
  8368. [Symbol.iterator]() {
  8369. return this;
  8370. }
  8371. };
  8372. }
  8373. forEach(cb) {
  8374. for (const kv of this.entries()) {
  8375. cb(kv[1], kv[0]);
  8376. }
  8377. }
  8378. get(key) {
  8379. const rtn = [];
  8380. key = key.toLowerCase();
  8381. for (const kv of this._values) {
  8382. if (kv[0].toLowerCase() === key) {
  8383. rtn.push(kv[1]);
  8384. }
  8385. }
  8386. return rtn.length > 0 ? rtn.join(", ") : null;
  8387. }
  8388. has(key) {
  8389. key = key.toLowerCase();
  8390. for (const kv of this._values) {
  8391. if (kv[0].toLowerCase() === key) {
  8392. return true;
  8393. }
  8394. }
  8395. return false;
  8396. }
  8397. keys() {
  8398. const keys = [];
  8399. for (const kv of this._values) {
  8400. const key = kv[0].toLowerCase();
  8401. if (!keys.includes(key)) {
  8402. keys.push(key);
  8403. }
  8404. }
  8405. let index = -1;
  8406. return {
  8407. next() {
  8408. index++;
  8409. return {
  8410. value: keys[index],
  8411. done: !keys[index]
  8412. };
  8413. },
  8414. [Symbol.iterator]() {
  8415. return this;
  8416. }
  8417. };
  8418. }
  8419. set(key, value) {
  8420. for (const kv of this._values) {
  8421. if (kv[0].toLowerCase() === key.toLowerCase()) {
  8422. kv[1] = value + "";
  8423. return;
  8424. }
  8425. }
  8426. this.append(key, value);
  8427. }
  8428. values() {
  8429. const values = this._values;
  8430. let index = -1;
  8431. return {
  8432. next() {
  8433. index++;
  8434. const done = !values[index];
  8435. return {
  8436. value: done ? void 0 : values[index][1],
  8437. done
  8438. };
  8439. },
  8440. [Symbol.iterator]() {
  8441. return this;
  8442. }
  8443. };
  8444. }
  8445. [Symbol.iterator]() {
  8446. return this.entries();
  8447. }
  8448. };
  8449. // src/mock-doc/parser.ts
  8450. var MockDOMParser = class {
  8451. parseFromString(htmlToParse, mimeType) {
  8452. if (mimeType !== "text/html") {
  8453. console.error("XML parsing not implemented yet, continuing as html");
  8454. }
  8455. return parseHtmlToDocument(htmlToParse);
  8456. }
  8457. };
  8458. // src/mock-doc/request-response.ts
  8459. var MockRequest = class _MockRequest {
  8460. constructor(input, init = {}) {
  8461. this._method = "GET";
  8462. this._url = "/";
  8463. this.bodyUsed = false;
  8464. this.cache = "default";
  8465. this.credentials = "same-origin";
  8466. this.integrity = "";
  8467. this.keepalive = false;
  8468. this.mode = "cors";
  8469. this.redirect = "follow";
  8470. this.referrer = "about:client";
  8471. this.referrerPolicy = "";
  8472. if (typeof input === "string") {
  8473. this.url = input;
  8474. } else if (input) {
  8475. Object.assign(this, input);
  8476. this.headers = new MockHeaders(input.headers);
  8477. }
  8478. Object.assign(this, init);
  8479. if (init.headers) {
  8480. this.headers = new MockHeaders(init.headers);
  8481. }
  8482. if (!this.headers) {
  8483. this.headers = new MockHeaders();
  8484. }
  8485. }
  8486. get url() {
  8487. if (typeof this._url === "string") {
  8488. return new URL(this._url, location.href).href;
  8489. }
  8490. return new URL("/", location.href).href;
  8491. }
  8492. set url(value) {
  8493. this._url = value;
  8494. }
  8495. get method() {
  8496. if (typeof this._method === "string") {
  8497. return this._method.toUpperCase();
  8498. }
  8499. return "GET";
  8500. }
  8501. set method(value) {
  8502. this._method = value;
  8503. }
  8504. clone() {
  8505. const clone = { ...this };
  8506. clone.headers = new MockHeaders(this.headers);
  8507. return new _MockRequest(clone);
  8508. }
  8509. };
  8510. var MockResponse = class _MockResponse {
  8511. constructor(body, init = {}) {
  8512. this.ok = true;
  8513. this.status = 200;
  8514. this.statusText = "";
  8515. this.type = "default";
  8516. this.url = "";
  8517. this._body = body;
  8518. if (init) {
  8519. Object.assign(this, init);
  8520. }
  8521. this.headers = new MockHeaders(init.headers);
  8522. }
  8523. async json() {
  8524. return JSON.parse(this._body);
  8525. }
  8526. async text() {
  8527. return this._body;
  8528. }
  8529. clone() {
  8530. const initClone = { ...this };
  8531. initClone.headers = new MockHeaders(this.headers);
  8532. return new _MockResponse(this._body, initClone);
  8533. }
  8534. };
  8535. // src/mock-doc/global.ts
  8536. function setupGlobal(gbl) {
  8537. if (gbl.window == null) {
  8538. const win = gbl.window = new MockWindow();
  8539. WINDOW_FUNCTIONS.forEach((fnName) => {
  8540. if (!(fnName in gbl)) {
  8541. gbl[fnName] = win[fnName].bind(win);
  8542. }
  8543. });
  8544. WINDOW_PROPS.forEach((propName) => {
  8545. if (!(propName in gbl)) {
  8546. Object.defineProperty(gbl, propName, {
  8547. get() {
  8548. return win[propName];
  8549. },
  8550. set(val) {
  8551. win[propName] = val;
  8552. },
  8553. configurable: true,
  8554. enumerable: true
  8555. });
  8556. }
  8557. });
  8558. GLOBAL_CONSTRUCTORS.forEach(([cstrName]) => {
  8559. gbl[cstrName] = win[cstrName];
  8560. });
  8561. }
  8562. return gbl.window;
  8563. }
  8564. function teardownGlobal(gbl) {
  8565. const win = gbl.window;
  8566. if (win && typeof win.close === "function") {
  8567. win.close();
  8568. }
  8569. }
  8570. function patchWindow(winToBePatched) {
  8571. const mockWin = new MockWindow(false);
  8572. WINDOW_FUNCTIONS.forEach((fnName) => {
  8573. if (typeof winToBePatched[fnName] !== "function") {
  8574. winToBePatched[fnName] = mockWin[fnName].bind(mockWin);
  8575. }
  8576. });
  8577. WINDOW_PROPS.forEach((propName) => {
  8578. if (winToBePatched === void 0) {
  8579. Object.defineProperty(winToBePatched, propName, {
  8580. get() {
  8581. return mockWin[propName];
  8582. },
  8583. set(val) {
  8584. mockWin[propName] = val;
  8585. },
  8586. configurable: true,
  8587. enumerable: true
  8588. });
  8589. }
  8590. });
  8591. }
  8592. function addGlobalsToWindowPrototype(mockWinPrototype) {
  8593. GLOBAL_CONSTRUCTORS.forEach(([cstrName, Cstr]) => {
  8594. Object.defineProperty(mockWinPrototype, cstrName, {
  8595. get() {
  8596. return this["__" + cstrName] || Cstr;
  8597. },
  8598. set(cstr) {
  8599. this["__" + cstrName] = cstr;
  8600. },
  8601. configurable: true,
  8602. enumerable: true
  8603. });
  8604. });
  8605. }
  8606. var WINDOW_FUNCTIONS = [
  8607. "addEventListener",
  8608. "alert",
  8609. "blur",
  8610. "cancelAnimationFrame",
  8611. "cancelIdleCallback",
  8612. "clearInterval",
  8613. "clearTimeout",
  8614. "close",
  8615. "confirm",
  8616. "dispatchEvent",
  8617. "focus",
  8618. "getComputedStyle",
  8619. "matchMedia",
  8620. "open",
  8621. "prompt",
  8622. "removeEventListener",
  8623. "requestAnimationFrame",
  8624. "requestIdleCallback",
  8625. "URL"
  8626. ];
  8627. var WINDOW_PROPS = [
  8628. "customElements",
  8629. "devicePixelRatio",
  8630. "document",
  8631. "history",
  8632. "innerHeight",
  8633. "innerWidth",
  8634. "localStorage",
  8635. "location",
  8636. "navigator",
  8637. "pageXOffset",
  8638. "pageYOffset",
  8639. "performance",
  8640. "screenLeft",
  8641. "screenTop",
  8642. "screenX",
  8643. "screenY",
  8644. "scrollX",
  8645. "scrollY",
  8646. "sessionStorage",
  8647. "CSS",
  8648. "CustomEvent",
  8649. "Event",
  8650. "Element",
  8651. "HTMLElement",
  8652. "Node",
  8653. "NodeList",
  8654. "FocusEvent",
  8655. "KeyboardEvent",
  8656. "MouseEvent"
  8657. ];
  8658. var GLOBAL_CONSTRUCTORS = [
  8659. ["CustomEvent", MockCustomEvent],
  8660. ["DocumentFragment", MockDocumentFragment],
  8661. ["DOMParser", MockDOMParser],
  8662. ["Event", MockEvent],
  8663. ["FocusEvent", MockFocusEvent],
  8664. ["Headers", MockHeaders],
  8665. ["KeyboardEvent", MockKeyboardEvent],
  8666. ["MouseEvent", MockMouseEvent],
  8667. ["Request", MockRequest],
  8668. ["Response", MockResponse],
  8669. ["ShadowRoot", MockDocumentFragment],
  8670. ["HTMLAnchorElement", MockAnchorElement],
  8671. ["HTMLBaseElement", MockBaseElement],
  8672. ["HTMLButtonElement", MockButtonElement],
  8673. ["HTMLCanvasElement", MockCanvasElement],
  8674. ["HTMLFormElement", MockFormElement],
  8675. ["HTMLImageElement", MockImageElement],
  8676. ["HTMLInputElement", MockInputElement],
  8677. ["HTMLLinkElement", MockLinkElement],
  8678. ["HTMLMetaElement", MockMetaElement],
  8679. ["HTMLScriptElement", MockScriptElement],
  8680. ["HTMLStyleElement", MockStyleElement],
  8681. ["HTMLTemplateElement", MockTemplateElement],
  8682. ["HTMLTitleElement", MockTitleElement],
  8683. ["HTMLUListElement", MockUListElement]
  8684. ];
  8685. // src/mock-doc/history.ts
  8686. var MockHistory = class {
  8687. constructor() {
  8688. this.items = [];
  8689. }
  8690. get length() {
  8691. return this.items.length;
  8692. }
  8693. back() {
  8694. this.go(-1);
  8695. }
  8696. forward() {
  8697. this.go(1);
  8698. }
  8699. go(_value) {
  8700. }
  8701. pushState(_state, _title, _url) {
  8702. }
  8703. replaceState(_state, _title, _url) {
  8704. }
  8705. };
  8706. // src/mock-doc/intersection-observer.ts
  8707. var MockIntersectionObserver = class {
  8708. constructor() {
  8709. }
  8710. disconnect() {
  8711. }
  8712. observe() {
  8713. }
  8714. takeRecords() {
  8715. return [];
  8716. }
  8717. unobserve() {
  8718. }
  8719. };
  8720. // src/mock-doc/location.ts
  8721. var MockLocation = class {
  8722. constructor() {
  8723. this.ancestorOrigins = null;
  8724. this.protocol = "";
  8725. this.host = "";
  8726. this.hostname = "";
  8727. this.port = "";
  8728. this.pathname = "";
  8729. this.search = "";
  8730. this.hash = "";
  8731. this.username = "";
  8732. this.password = "";
  8733. this.origin = "";
  8734. this._href = "";
  8735. }
  8736. get href() {
  8737. return this._href;
  8738. }
  8739. set href(value) {
  8740. const url = new URL(value, "http://mockdoc.stenciljs.com");
  8741. this._href = url.href;
  8742. this.protocol = url.protocol;
  8743. this.host = url.host;
  8744. this.hostname = url.hostname;
  8745. this.port = url.port;
  8746. this.pathname = url.pathname;
  8747. this.search = url.search;
  8748. this.hash = url.hash;
  8749. this.username = url.username;
  8750. this.password = url.password;
  8751. this.origin = url.origin;
  8752. }
  8753. assign(_url) {
  8754. }
  8755. reload(_forcedReload) {
  8756. }
  8757. replace(_url) {
  8758. }
  8759. toString() {
  8760. return this.href;
  8761. }
  8762. };
  8763. // src/mock-doc/navigator.ts
  8764. var MockNavigator = class {
  8765. constructor() {
  8766. this.appCodeName = "MockNavigator";
  8767. this.appName = "MockNavigator";
  8768. this.appVersion = "MockNavigator";
  8769. this.platform = "MockNavigator";
  8770. this.userAgent = "MockNavigator";
  8771. }
  8772. };
  8773. // src/mock-doc/performance.ts
  8774. var MockPerformance = class {
  8775. constructor() {
  8776. this.timeOrigin = Date.now();
  8777. this.eventCounts = /* @__PURE__ */ new Map();
  8778. }
  8779. addEventListener() {
  8780. }
  8781. clearMarks() {
  8782. }
  8783. clearMeasures() {
  8784. }
  8785. clearResourceTimings() {
  8786. }
  8787. dispatchEvent() {
  8788. return true;
  8789. }
  8790. getEntries() {
  8791. return [];
  8792. }
  8793. getEntriesByName() {
  8794. return [];
  8795. }
  8796. getEntriesByType() {
  8797. return [];
  8798. }
  8799. // Stencil's implementation of `mark` is non-compliant with the `Performance` interface. Because Stencil will
  8800. // instantiate an instance of this class and may attempt to assign it to a variable of type `Performance`, the return
  8801. // type must match the `Performance` interface (rather than typing this function as returning `void` and ignoring the
  8802. // associated errors returned by the type checker)
  8803. // @ts-ignore
  8804. mark() {
  8805. }
  8806. // Stencil's implementation of `measure` is non-compliant with the `Performance` interface. Because Stencil will
  8807. // instantiate an instance of this class and may attempt to assign it to a variable of type `Performance`, the return
  8808. // type must match the `Performance` interface (rather than typing this function as returning `void` and ignoring the
  8809. // associated errors returned by the type checker)
  8810. // @ts-ignore
  8811. measure() {
  8812. }
  8813. get navigation() {
  8814. return {};
  8815. }
  8816. now() {
  8817. return Date.now() - this.timeOrigin;
  8818. }
  8819. get onresourcetimingbufferfull() {
  8820. return null;
  8821. }
  8822. removeEventListener() {
  8823. }
  8824. setResourceTimingBufferSize() {
  8825. }
  8826. get timing() {
  8827. return {};
  8828. }
  8829. toJSON() {
  8830. }
  8831. };
  8832. function resetPerformance(perf) {
  8833. if (perf != null) {
  8834. try {
  8835. perf.timeOrigin = Date.now();
  8836. } catch (e2) {
  8837. }
  8838. }
  8839. }
  8840. // src/mock-doc/storage.ts
  8841. var MockStorage = class {
  8842. constructor() {
  8843. this.items = /* @__PURE__ */ new Map();
  8844. }
  8845. key(_value) {
  8846. }
  8847. getItem(key) {
  8848. key = String(key);
  8849. if (this.items.has(key)) {
  8850. return this.items.get(key);
  8851. }
  8852. return null;
  8853. }
  8854. setItem(key, value) {
  8855. if (value == null) {
  8856. value = "null";
  8857. }
  8858. this.items.set(String(key), String(value));
  8859. }
  8860. removeItem(key) {
  8861. this.items.delete(String(key));
  8862. }
  8863. clear() {
  8864. this.items.clear();
  8865. }
  8866. };
  8867. // src/mock-doc/window.ts
  8868. var nativeClearInterval = clearInterval;
  8869. var nativeClearTimeout = clearTimeout;
  8870. var nativeSetInterval = setInterval;
  8871. var nativeSetTimeout = setTimeout;
  8872. var nativeURL = URL;
  8873. var nativeWindow = globalThis.window;
  8874. var MockWindow = class {
  8875. constructor(html = null) {
  8876. if (html !== false) {
  8877. this.document = new MockDocument(html, this);
  8878. } else {
  8879. this.document = null;
  8880. }
  8881. this.performance = new MockPerformance();
  8882. this.customElements = new MockCustomElementRegistry(this);
  8883. this.console = createConsole();
  8884. resetWindowDefaults(this);
  8885. resetWindowDimensions(this);
  8886. }
  8887. addEventListener(type, handler) {
  8888. addEventListener(this, type, handler);
  8889. }
  8890. alert(msg) {
  8891. if (this.console) {
  8892. this.console.debug(msg);
  8893. } else {
  8894. console.debug(msg);
  8895. }
  8896. }
  8897. blur() {
  8898. }
  8899. cancelAnimationFrame(id) {
  8900. this.__clearTimeout.call(nativeWindow || this, id);
  8901. }
  8902. cancelIdleCallback(id) {
  8903. this.__clearTimeout.call(nativeWindow || this, id);
  8904. }
  8905. get CharacterData() {
  8906. if (this.__charDataCstr == null) {
  8907. const ownerDocument = this.document;
  8908. this.__charDataCstr = class extends MockNode2 {
  8909. constructor() {
  8910. super(ownerDocument, 0, "test", "");
  8911. throw new Error("Illegal constructor: cannot construct CharacterData");
  8912. }
  8913. };
  8914. }
  8915. return this.__charDataCstr;
  8916. }
  8917. set CharacterData(charDataCstr) {
  8918. this.__charDataCstr = charDataCstr;
  8919. }
  8920. clearInterval(id) {
  8921. this.__clearInterval.call(nativeWindow || this, id);
  8922. }
  8923. clearTimeout(id) {
  8924. this.__clearTimeout.call(nativeWindow || this, id);
  8925. }
  8926. close() {
  8927. resetWindow(this);
  8928. }
  8929. confirm() {
  8930. return false;
  8931. }
  8932. get CSS() {
  8933. return {
  8934. supports: () => true
  8935. };
  8936. }
  8937. get Document() {
  8938. if (this.__docCstr == null) {
  8939. const win = this;
  8940. this.__docCstr = class extends MockDocument {
  8941. constructor() {
  8942. super(false, win);
  8943. throw new Error("Illegal constructor: cannot construct Document");
  8944. }
  8945. };
  8946. }
  8947. return this.__docCstr;
  8948. }
  8949. set Document(docCstr) {
  8950. this.__docCstr = docCstr;
  8951. }
  8952. get DocumentFragment() {
  8953. if (this.__docFragCstr == null) {
  8954. const ownerDocument = this.document;
  8955. this.__docFragCstr = class extends MockDocumentFragment {
  8956. constructor() {
  8957. super(ownerDocument);
  8958. throw new Error("Illegal constructor: cannot construct DocumentFragment");
  8959. }
  8960. };
  8961. }
  8962. return this.__docFragCstr;
  8963. }
  8964. set DocumentFragment(docFragCstr) {
  8965. this.__docFragCstr = docFragCstr;
  8966. }
  8967. get DocumentType() {
  8968. if (this.__docTypeCstr == null) {
  8969. const ownerDocument = this.document;
  8970. this.__docTypeCstr = class extends MockNode2 {
  8971. constructor() {
  8972. super(ownerDocument, 0, "test", "");
  8973. throw new Error("Illegal constructor: cannot construct DocumentType");
  8974. }
  8975. };
  8976. }
  8977. return this.__docTypeCstr;
  8978. }
  8979. set DocumentType(docTypeCstr) {
  8980. this.__docTypeCstr = docTypeCstr;
  8981. }
  8982. get DOMTokenList() {
  8983. if (this.__domTokenListCstr == null) {
  8984. this.__domTokenListCstr = class MockDOMTokenList {
  8985. };
  8986. }
  8987. return this.__domTokenListCstr;
  8988. }
  8989. set DOMTokenList(domTokenListCstr) {
  8990. this.__domTokenListCstr = domTokenListCstr;
  8991. }
  8992. dispatchEvent(ev) {
  8993. return dispatchEvent(this, ev);
  8994. }
  8995. get Element() {
  8996. if (this.__elementCstr == null) {
  8997. const ownerDocument = this.document;
  8998. this.__elementCstr = class extends MockElement {
  8999. constructor() {
  9000. super(ownerDocument, "");
  9001. throw new Error("Illegal constructor: cannot construct Element");
  9002. }
  9003. };
  9004. }
  9005. return this.__elementCstr;
  9006. }
  9007. fetch(input, init) {
  9008. if (typeof fetch === "function") {
  9009. return fetch(input, init);
  9010. }
  9011. throw new Error(`fetch() not implemented`);
  9012. }
  9013. focus() {
  9014. }
  9015. getComputedStyle(_) {
  9016. return {
  9017. cssText: "",
  9018. length: 0,
  9019. parentRule: null,
  9020. getPropertyPriority() {
  9021. return null;
  9022. },
  9023. getPropertyValue() {
  9024. return "";
  9025. },
  9026. item() {
  9027. return null;
  9028. },
  9029. removeProperty() {
  9030. return null;
  9031. },
  9032. setProperty() {
  9033. return null;
  9034. }
  9035. };
  9036. }
  9037. get globalThis() {
  9038. return this;
  9039. }
  9040. get history() {
  9041. if (this.__history == null) {
  9042. this.__history = new MockHistory();
  9043. }
  9044. return this.__history;
  9045. }
  9046. set history(hsty) {
  9047. this.__history = hsty;
  9048. }
  9049. get JSON() {
  9050. return JSON;
  9051. }
  9052. get HTMLElement() {
  9053. if (this.__htmlElementCstr == null) {
  9054. const ownerDocument = this.document;
  9055. this.__htmlElementCstr = class extends MockHTMLElement {
  9056. constructor() {
  9057. super(ownerDocument, "");
  9058. const observedAttributes = this.constructor.observedAttributes;
  9059. if (Array.isArray(observedAttributes) && typeof this.attributeChangedCallback === "function") {
  9060. observedAttributes.forEach((attrName) => {
  9061. const attrValue = this.getAttribute(attrName);
  9062. if (attrValue != null) {
  9063. this.attributeChangedCallback(attrName, null, attrValue);
  9064. }
  9065. });
  9066. }
  9067. }
  9068. };
  9069. }
  9070. return this.__htmlElementCstr;
  9071. }
  9072. set HTMLElement(htmlElementCstr) {
  9073. this.__htmlElementCstr = htmlElementCstr;
  9074. }
  9075. get IntersectionObserver() {
  9076. return MockIntersectionObserver;
  9077. }
  9078. get localStorage() {
  9079. if (this.__localStorage == null) {
  9080. this.__localStorage = new MockStorage();
  9081. }
  9082. return this.__localStorage;
  9083. }
  9084. set localStorage(locStorage) {
  9085. this.__localStorage = locStorage;
  9086. }
  9087. get location() {
  9088. if (this.__location == null) {
  9089. this.__location = new MockLocation();
  9090. }
  9091. return this.__location;
  9092. }
  9093. set location(val) {
  9094. if (typeof val === "string") {
  9095. if (this.__location == null) {
  9096. this.__location = new MockLocation();
  9097. }
  9098. this.__location.href = val;
  9099. } else {
  9100. this.__location = val;
  9101. }
  9102. }
  9103. matchMedia(media) {
  9104. return {
  9105. media,
  9106. matches: false,
  9107. addListener: (_handler) => {
  9108. },
  9109. removeListener: (_handler) => {
  9110. },
  9111. addEventListener: (_type, _handler) => {
  9112. },
  9113. removeEventListener: (_type, _handler) => {
  9114. },
  9115. dispatchEvent: (_ev) => {
  9116. },
  9117. onchange: null
  9118. };
  9119. }
  9120. get Node() {
  9121. if (this.__nodeCstr == null) {
  9122. const ownerDocument = this.document;
  9123. this.__nodeCstr = class extends MockNode2 {
  9124. constructor() {
  9125. super(ownerDocument, 0, "test", "");
  9126. throw new Error("Illegal constructor: cannot construct Node");
  9127. }
  9128. };
  9129. }
  9130. return this.__nodeCstr;
  9131. }
  9132. get NodeList() {
  9133. if (this.__nodeListCstr == null) {
  9134. const ownerDocument = this.document;
  9135. this.__nodeListCstr = class extends MockNodeList {
  9136. constructor() {
  9137. super(ownerDocument, [], 0);
  9138. throw new Error("Illegal constructor: cannot construct NodeList");
  9139. }
  9140. };
  9141. }
  9142. return this.__nodeListCstr;
  9143. }
  9144. get navigator() {
  9145. if (this.__navigator == null) {
  9146. this.__navigator = new MockNavigator();
  9147. }
  9148. return this.__navigator;
  9149. }
  9150. set navigator(nav) {
  9151. this.__navigator = nav;
  9152. }
  9153. get parent() {
  9154. return null;
  9155. }
  9156. prompt() {
  9157. return "";
  9158. }
  9159. open() {
  9160. return null;
  9161. }
  9162. get origin() {
  9163. return this.location.origin;
  9164. }
  9165. removeEventListener(type, handler) {
  9166. removeEventListener(this, type, handler);
  9167. }
  9168. requestAnimationFrame(callback) {
  9169. return this.setTimeout(() => {
  9170. callback(Date.now());
  9171. }, 0);
  9172. }
  9173. requestIdleCallback(callback) {
  9174. return this.setTimeout(() => {
  9175. callback({
  9176. didTimeout: false,
  9177. timeRemaining: () => 0
  9178. });
  9179. }, 0);
  9180. }
  9181. scroll(_x, _y) {
  9182. }
  9183. scrollBy(_x, _y) {
  9184. }
  9185. scrollTo(_x, _y) {
  9186. }
  9187. get self() {
  9188. return this;
  9189. }
  9190. get sessionStorage() {
  9191. if (this.__sessionStorage == null) {
  9192. this.__sessionStorage = new MockStorage();
  9193. }
  9194. return this.__sessionStorage;
  9195. }
  9196. set sessionStorage(locStorage) {
  9197. this.__sessionStorage = locStorage;
  9198. }
  9199. setInterval(callback, ms, ...args) {
  9200. if (this.__timeouts == null) {
  9201. this.__timeouts = /* @__PURE__ */ new Set();
  9202. }
  9203. ms = Math.min(ms, this.__maxTimeout);
  9204. if (this.__allowInterval) {
  9205. const intervalId = this.__setInterval(() => {
  9206. if (this.__timeouts) {
  9207. this.__timeouts.delete(intervalId);
  9208. try {
  9209. callback(...args);
  9210. } catch (e2) {
  9211. if (this.console) {
  9212. this.console.error(e2);
  9213. } else {
  9214. console.error(e2);
  9215. }
  9216. }
  9217. }
  9218. }, ms);
  9219. if (this.__timeouts) {
  9220. this.__timeouts.add(intervalId);
  9221. }
  9222. return intervalId;
  9223. }
  9224. const timeoutId = this.__setTimeout.call(
  9225. nativeWindow || this,
  9226. () => {
  9227. if (this.__timeouts) {
  9228. this.__timeouts.delete(timeoutId);
  9229. try {
  9230. callback(...args);
  9231. } catch (e2) {
  9232. if (this.console) {
  9233. this.console.error(e2);
  9234. } else {
  9235. console.error(e2);
  9236. }
  9237. }
  9238. }
  9239. },
  9240. ms
  9241. );
  9242. if (this.__timeouts) {
  9243. this.__timeouts.add(timeoutId);
  9244. }
  9245. return timeoutId;
  9246. }
  9247. setTimeout(callback, ms, ...args) {
  9248. if (this.__timeouts == null) {
  9249. this.__timeouts = /* @__PURE__ */ new Set();
  9250. }
  9251. ms = Math.min(ms, this.__maxTimeout);
  9252. const timeoutId = this.__setTimeout.call(
  9253. nativeWindow || this,
  9254. () => {
  9255. if (this.__timeouts) {
  9256. this.__timeouts.delete(timeoutId);
  9257. try {
  9258. callback(...args);
  9259. } catch (e2) {
  9260. if (this.console) {
  9261. this.console.error(e2);
  9262. } else {
  9263. console.error(e2);
  9264. }
  9265. }
  9266. }
  9267. },
  9268. ms
  9269. );
  9270. if (this.__timeouts) {
  9271. this.__timeouts.add(timeoutId);
  9272. }
  9273. return timeoutId;
  9274. }
  9275. get top() {
  9276. return this;
  9277. }
  9278. get window() {
  9279. return this;
  9280. }
  9281. onanimationstart() {
  9282. }
  9283. onanimationend() {
  9284. }
  9285. onanimationiteration() {
  9286. }
  9287. onabort() {
  9288. }
  9289. onauxclick() {
  9290. }
  9291. onbeforecopy() {
  9292. }
  9293. onbeforecut() {
  9294. }
  9295. onbeforepaste() {
  9296. }
  9297. onblur() {
  9298. }
  9299. oncancel() {
  9300. }
  9301. oncanplay() {
  9302. }
  9303. oncanplaythrough() {
  9304. }
  9305. onchange() {
  9306. }
  9307. onclick() {
  9308. }
  9309. onclose() {
  9310. }
  9311. oncontextmenu() {
  9312. }
  9313. oncopy() {
  9314. }
  9315. oncuechange() {
  9316. }
  9317. oncut() {
  9318. }
  9319. ondblclick() {
  9320. }
  9321. ondrag() {
  9322. }
  9323. ondragend() {
  9324. }
  9325. ondragenter() {
  9326. }
  9327. ondragleave() {
  9328. }
  9329. ondragover() {
  9330. }
  9331. ondragstart() {
  9332. }
  9333. ondrop() {
  9334. }
  9335. ondurationchange() {
  9336. }
  9337. onemptied() {
  9338. }
  9339. onended() {
  9340. }
  9341. onerror() {
  9342. }
  9343. onfocus() {
  9344. }
  9345. onfocusin() {
  9346. }
  9347. onfocusout() {
  9348. }
  9349. onformdata() {
  9350. }
  9351. onfullscreenchange() {
  9352. }
  9353. onfullscreenerror() {
  9354. }
  9355. ongotpointercapture() {
  9356. }
  9357. oninput() {
  9358. }
  9359. oninvalid() {
  9360. }
  9361. onkeydown() {
  9362. }
  9363. onkeypress() {
  9364. }
  9365. onkeyup() {
  9366. }
  9367. onload() {
  9368. }
  9369. onloadeddata() {
  9370. }
  9371. onloadedmetadata() {
  9372. }
  9373. onloadstart() {
  9374. }
  9375. onlostpointercapture() {
  9376. }
  9377. onmousedown() {
  9378. }
  9379. onmouseenter() {
  9380. }
  9381. onmouseleave() {
  9382. }
  9383. onmousemove() {
  9384. }
  9385. onmouseout() {
  9386. }
  9387. onmouseover() {
  9388. }
  9389. onmouseup() {
  9390. }
  9391. onmousewheel() {
  9392. }
  9393. onpaste() {
  9394. }
  9395. onpause() {
  9396. }
  9397. onplay() {
  9398. }
  9399. onplaying() {
  9400. }
  9401. onpointercancel() {
  9402. }
  9403. onpointerdown() {
  9404. }
  9405. onpointerenter() {
  9406. }
  9407. onpointerleave() {
  9408. }
  9409. onpointermove() {
  9410. }
  9411. onpointerout() {
  9412. }
  9413. onpointerover() {
  9414. }
  9415. onpointerup() {
  9416. }
  9417. onprogress() {
  9418. }
  9419. onratechange() {
  9420. }
  9421. onreset() {
  9422. }
  9423. onresize() {
  9424. }
  9425. onscroll() {
  9426. }
  9427. onsearch() {
  9428. }
  9429. onseeked() {
  9430. }
  9431. onseeking() {
  9432. }
  9433. onselect() {
  9434. }
  9435. onselectstart() {
  9436. }
  9437. onstalled() {
  9438. }
  9439. onsubmit() {
  9440. }
  9441. onsuspend() {
  9442. }
  9443. ontimeupdate() {
  9444. }
  9445. ontoggle() {
  9446. }
  9447. onvolumechange() {
  9448. }
  9449. onwaiting() {
  9450. }
  9451. onwebkitfullscreenchange() {
  9452. }
  9453. onwebkitfullscreenerror() {
  9454. }
  9455. onwheel() {
  9456. }
  9457. };
  9458. addGlobalsToWindowPrototype(MockWindow.prototype);
  9459. function resetWindowDefaults(win) {
  9460. win.__clearInterval = nativeClearInterval;
  9461. win.__clearTimeout = nativeClearTimeout;
  9462. win.__setInterval = nativeSetInterval;
  9463. win.__setTimeout = nativeSetTimeout;
  9464. win.__maxTimeout = 3e4;
  9465. win.__allowInterval = true;
  9466. win.URL = nativeURL;
  9467. }
  9468. function cloneWindow(srcWin, opts = {}) {
  9469. if (srcWin == null) {
  9470. return null;
  9471. }
  9472. const clonedWin = new MockWindow(false);
  9473. if (!opts.customElementProxy) {
  9474. srcWin.customElements = null;
  9475. }
  9476. if (srcWin.document != null) {
  9477. const clonedDoc = new MockDocument(false, clonedWin);
  9478. clonedWin.document = clonedDoc;
  9479. clonedDoc.documentElement = srcWin.document.documentElement.cloneNode(true);
  9480. } else {
  9481. clonedWin.document = new MockDocument(null, clonedWin);
  9482. }
  9483. return clonedWin;
  9484. }
  9485. function cloneDocument(srcDoc) {
  9486. if (srcDoc == null || !srcDoc.defaultView) {
  9487. return null;
  9488. }
  9489. const dstWin = cloneWindow(srcDoc.defaultView);
  9490. return (dstWin == null ? void 0 : dstWin.document) || null;
  9491. }
  9492. function constrainTimeouts(win) {
  9493. win.__allowInterval = false;
  9494. win.__maxTimeout = 0;
  9495. }
  9496. function resetWindow(win) {
  9497. if (win != null) {
  9498. if (win.__timeouts) {
  9499. win.__timeouts.forEach((timeoutId) => {
  9500. nativeClearInterval(timeoutId);
  9501. nativeClearTimeout(timeoutId);
  9502. });
  9503. win.__timeouts.clear();
  9504. }
  9505. if (win.customElements && win.customElements.clear) {
  9506. win.customElements.clear();
  9507. }
  9508. resetDocument(win.document);
  9509. resetPerformance(win.performance);
  9510. for (const key in win) {
  9511. if (win.hasOwnProperty(key) && key !== "document" && key !== "performance" && key !== "customElements") {
  9512. delete win[key];
  9513. }
  9514. }
  9515. resetWindowDefaults(win);
  9516. resetWindowDimensions(win);
  9517. resetEventListeners(win);
  9518. if (win.document != null) {
  9519. try {
  9520. win.document.defaultView = win;
  9521. } catch (e2) {
  9522. }
  9523. }
  9524. win.fetch = null;
  9525. win.Headers = null;
  9526. win.Request = null;
  9527. win.Response = null;
  9528. win.FetchError = null;
  9529. }
  9530. }
  9531. function resetWindowDimensions(win) {
  9532. try {
  9533. win.devicePixelRatio = 1;
  9534. win.innerHeight = 768;
  9535. win.innerWidth = 1366;
  9536. win.pageXOffset = 0;
  9537. win.pageYOffset = 0;
  9538. win.screenLeft = 0;
  9539. win.screenTop = 0;
  9540. win.screenX = 0;
  9541. win.screenY = 0;
  9542. win.scrollX = 0;
  9543. win.scrollY = 0;
  9544. win.screen = {
  9545. availHeight: win.innerHeight,
  9546. availLeft: 0,
  9547. availTop: 0,
  9548. availWidth: win.innerWidth,
  9549. colorDepth: 24,
  9550. height: win.innerHeight,
  9551. keepAwake: false,
  9552. orientation: {
  9553. angle: 0,
  9554. type: "portrait-primary"
  9555. },
  9556. pixelDepth: 24,
  9557. width: win.innerWidth
  9558. };
  9559. } catch (e2) {
  9560. }
  9561. }
  9562. // src/mock-doc/document.ts
  9563. var MockDocument = class _MockDocument extends MockHTMLElement {
  9564. constructor(html = null, win = null) {
  9565. super(null, null);
  9566. this.nodeName = "#document" /* DOCUMENT_NODE */;
  9567. this.nodeType = 9 /* DOCUMENT_NODE */;
  9568. this.defaultView = win;
  9569. this.cookie = "";
  9570. this.referrer = "";
  9571. this.appendChild(this.createDocumentTypeNode());
  9572. if (typeof html === "string") {
  9573. const parsedDoc = parseDocumentUtil(this, html);
  9574. const documentElement = parsedDoc.children.find((elm) => elm.nodeName === "HTML");
  9575. if (documentElement != null) {
  9576. this.appendChild(documentElement);
  9577. setOwnerDocument(documentElement, this);
  9578. }
  9579. } else if (html !== false) {
  9580. const documentElement = new MockHTMLElement(this, "html");
  9581. this.appendChild(documentElement);
  9582. documentElement.appendChild(new MockHTMLElement(this, "head"));
  9583. documentElement.appendChild(new MockHTMLElement(this, "body"));
  9584. }
  9585. }
  9586. get dir() {
  9587. return this.documentElement.dir;
  9588. }
  9589. set dir(value) {
  9590. this.documentElement.dir = value;
  9591. }
  9592. get localName() {
  9593. throw new Error("Unimplemented");
  9594. }
  9595. get location() {
  9596. if (this.defaultView != null) {
  9597. return this.defaultView.location;
  9598. }
  9599. return null;
  9600. }
  9601. set location(val) {
  9602. if (this.defaultView != null) {
  9603. this.defaultView.location = val;
  9604. }
  9605. }
  9606. get baseURI() {
  9607. const baseNode = this.head.childNodes.find((node) => node.nodeName === "BASE");
  9608. if (baseNode) {
  9609. return baseNode.href;
  9610. }
  9611. return this.URL;
  9612. }
  9613. get URL() {
  9614. return this.location.href;
  9615. }
  9616. get styleSheets() {
  9617. return this.querySelectorAll("style");
  9618. }
  9619. get scripts() {
  9620. return this.querySelectorAll("script");
  9621. }
  9622. get forms() {
  9623. return this.querySelectorAll("form");
  9624. }
  9625. get images() {
  9626. return this.querySelectorAll("img");
  9627. }
  9628. get scrollingElement() {
  9629. return this.documentElement;
  9630. }
  9631. get documentElement() {
  9632. for (let i = this.childNodes.length - 1; i >= 0; i--) {
  9633. if (this.childNodes[i].nodeName === "HTML") {
  9634. return this.childNodes[i];
  9635. }
  9636. }
  9637. const documentElement = new MockHTMLElement(this, "html");
  9638. this.appendChild(documentElement);
  9639. return documentElement;
  9640. }
  9641. set documentElement(documentElement) {
  9642. for (let i = this.childNodes.length - 1; i >= 0; i--) {
  9643. if (this.childNodes[i].nodeType !== 10 /* DOCUMENT_TYPE_NODE */) {
  9644. this.childNodes[i].remove();
  9645. }
  9646. }
  9647. if (documentElement != null) {
  9648. this.appendChild(documentElement);
  9649. setOwnerDocument(documentElement, this);
  9650. }
  9651. }
  9652. get head() {
  9653. const documentElement = this.documentElement;
  9654. for (let i = 0; i < documentElement.childNodes.length; i++) {
  9655. if (documentElement.childNodes[i].nodeName === "HEAD") {
  9656. return documentElement.childNodes[i];
  9657. }
  9658. }
  9659. const head = new MockHTMLElement(this, "head");
  9660. documentElement.insertBefore(head, documentElement.firstChild);
  9661. return head;
  9662. }
  9663. set head(head) {
  9664. const documentElement = this.documentElement;
  9665. for (let i = documentElement.childNodes.length - 1; i >= 0; i--) {
  9666. if (documentElement.childNodes[i].nodeName === "HEAD") {
  9667. documentElement.childNodes[i].remove();
  9668. }
  9669. }
  9670. if (head != null) {
  9671. documentElement.insertBefore(head, documentElement.firstChild);
  9672. setOwnerDocument(head, this);
  9673. }
  9674. }
  9675. get body() {
  9676. const documentElement = this.documentElement;
  9677. for (let i = documentElement.childNodes.length - 1; i >= 0; i--) {
  9678. if (documentElement.childNodes[i].nodeName === "BODY") {
  9679. return documentElement.childNodes[i];
  9680. }
  9681. }
  9682. const body = new MockHTMLElement(this, "body");
  9683. documentElement.appendChild(body);
  9684. return body;
  9685. }
  9686. set body(body) {
  9687. const documentElement = this.documentElement;
  9688. for (let i = documentElement.childNodes.length - 1; i >= 0; i--) {
  9689. if (documentElement.childNodes[i].nodeName === "BODY") {
  9690. documentElement.childNodes[i].remove();
  9691. }
  9692. }
  9693. if (body != null) {
  9694. documentElement.appendChild(body);
  9695. setOwnerDocument(body, this);
  9696. }
  9697. }
  9698. appendChild(newNode) {
  9699. newNode.remove();
  9700. newNode.parentNode = this;
  9701. this.childNodes.push(newNode);
  9702. return newNode;
  9703. }
  9704. createComment(data) {
  9705. return new MockComment(this, data);
  9706. }
  9707. createAttribute(attrName) {
  9708. return new MockAttr(attrName.toLowerCase(), "");
  9709. }
  9710. createAttributeNS(namespaceURI, attrName) {
  9711. return new MockAttr(attrName, "", namespaceURI);
  9712. }
  9713. createElement(tagName) {
  9714. if (tagName === "#document" /* DOCUMENT_NODE */) {
  9715. const doc = new _MockDocument(false);
  9716. doc.nodeName = tagName;
  9717. doc.parentNode = null;
  9718. return doc;
  9719. }
  9720. return createElement(this, tagName);
  9721. }
  9722. createElementNS(namespaceURI, tagName) {
  9723. const elmNs = createElementNS(this, namespaceURI, tagName);
  9724. return elmNs;
  9725. }
  9726. createTextNode(text) {
  9727. return new MockTextNode(this, text);
  9728. }
  9729. createDocumentFragment() {
  9730. return new MockDocumentFragment(this);
  9731. }
  9732. createDocumentTypeNode() {
  9733. return new MockDocumentTypeNode(this);
  9734. }
  9735. getElementById(id) {
  9736. return getElementById(this, id);
  9737. }
  9738. getElementsByName(elmName) {
  9739. return getElementsByName(this, elmName.toLowerCase());
  9740. }
  9741. get title() {
  9742. const title = this.head.childNodes.find((elm) => elm.nodeName === "TITLE");
  9743. if (title != null && typeof title.textContent === "string") {
  9744. return title.textContent.trim();
  9745. }
  9746. return "";
  9747. }
  9748. set title(value) {
  9749. const head = this.head;
  9750. let title = head.childNodes.find((elm) => elm.nodeName === "TITLE");
  9751. if (title == null) {
  9752. title = this.createElement("title");
  9753. head.appendChild(title);
  9754. }
  9755. title.textContent = value;
  9756. }
  9757. };
  9758. function createDocument(html = null) {
  9759. return new MockWindow(html).document;
  9760. }
  9761. function createFragment(html) {
  9762. return parseHtmlToFragment(html, null);
  9763. }
  9764. function resetDocument(doc) {
  9765. if (doc != null) {
  9766. resetEventListeners(doc);
  9767. const documentElement = doc.documentElement;
  9768. if (documentElement != null) {
  9769. resetElement(documentElement);
  9770. for (let i = 0, ii = documentElement.childNodes.length; i < ii; i++) {
  9771. const childNode = documentElement.childNodes[i];
  9772. resetElement(childNode);
  9773. childNode.childNodes.length = 0;
  9774. }
  9775. }
  9776. for (const key in doc) {
  9777. if (doc.hasOwnProperty(key) && !DOC_KEY_KEEPERS.has(key)) {
  9778. delete doc[key];
  9779. }
  9780. }
  9781. try {
  9782. doc.nodeName = "#document" /* DOCUMENT_NODE */;
  9783. } catch (e2) {
  9784. }
  9785. try {
  9786. doc.nodeType = 9 /* DOCUMENT_NODE */;
  9787. } catch (e2) {
  9788. }
  9789. try {
  9790. doc.cookie = "";
  9791. } catch (e2) {
  9792. }
  9793. try {
  9794. doc.referrer = "";
  9795. } catch (e2) {
  9796. }
  9797. }
  9798. }
  9799. var DOC_KEY_KEEPERS = /* @__PURE__ */ new Set([
  9800. "nodeName",
  9801. "nodeType",
  9802. "nodeValue",
  9803. "ownerDocument",
  9804. "parentNode",
  9805. "childNodes",
  9806. "_shadowRoot"
  9807. ]);
  9808. function getElementById(elm, id) {
  9809. const children = elm.children;
  9810. for (let i = 0, ii = children.length; i < ii; i++) {
  9811. const childElm = children[i];
  9812. if (childElm.id === id) {
  9813. return childElm;
  9814. }
  9815. const childElmFound = getElementById(childElm, id);
  9816. if (childElmFound != null) {
  9817. return childElmFound;
  9818. }
  9819. }
  9820. return null;
  9821. }
  9822. function getElementsByName(elm, elmName, foundElms = []) {
  9823. const children = elm.children;
  9824. for (let i = 0, ii = children.length; i < ii; i++) {
  9825. const childElm = children[i];
  9826. if (childElm.name && childElm.name.toLowerCase() === elmName) {
  9827. foundElms.push(childElm);
  9828. }
  9829. getElementsByName(childElm, elmName, foundElms);
  9830. }
  9831. return foundElms;
  9832. }
  9833. function setOwnerDocument(elm, ownerDocument) {
  9834. for (let i = 0, ii = elm.childNodes.length; i < ii; i++) {
  9835. elm.childNodes[i].ownerDocument = ownerDocument;
  9836. if (elm.childNodes[i].nodeType === 1 /* ELEMENT_NODE */) {
  9837. setOwnerDocument(elm.childNodes[i], ownerDocument);
  9838. }
  9839. }
  9840. }
  9841. export {
  9842. MockAttr,
  9843. MockAttributeMap,
  9844. MockComment,
  9845. MockCustomEvent,
  9846. MockDocument,
  9847. MockElement,
  9848. MockHTMLElement,
  9849. MockHeaders,
  9850. MockKeyboardEvent,
  9851. MockMouseEvent,
  9852. MockNode2 as MockNode,
  9853. MockRequest,
  9854. MockResponse,
  9855. MockTextNode,
  9856. MockWindow,
  9857. NODE_TYPES,
  9858. cloneAttributes,
  9859. cloneDocument,
  9860. cloneWindow,
  9861. constrainTimeouts,
  9862. createDocument,
  9863. createFragment,
  9864. parseHtmlToDocument,
  9865. parseHtmlToFragment,
  9866. patchWindow,
  9867. resetDocument,
  9868. serializeNodeToHtml,
  9869. setupGlobal,
  9870. teardownGlobal
  9871. };